/* ═══════════════════════════════════════════════════════════════════════════
   reports/reports.css — Berichte-Modul Stylesheet
   Welle 6 — Modul: reports

   Nutzt cal-* CSS-Variablen für konsistentes Styling mit dem übrigen System.
   Scope: .rp-root — kein globaler Namespace-Leak.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── ROOT & VARIABLEN ──────────────────────────────────────────────────────
   Sprint C: Tokens werden zentral in modules/_tokens.css verwaltet.
   Hier deklarieren wir nur die Reports-spezifischen Geometrie/Sizing-Tokens
   und Layout-Defaults. Farb-Tokens (--rp-surface, --rp-primary, etc.)
   kommen aus _tokens.css und folgen dem Theme automatisch.
   ────────────────────────────────────────────────────────────────────────── */
:root {
  --rp-sidebar-w: 252px;
  --rp-radius: 8px;
  --rp-radius-lg: 12px;
  /* Legacy-Aliase für ältere Selektoren — schauen auf das neue Token-System */
  --rp-ok:    var(--success, #16a34a);
  --rp-warn:  var(--warning, #f59e0b);
}

/* ── SCOPE ───────────────────────────────────────────────────────────────── */
.rp-root {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: var(--rp-surface);
  color: var(--rp-text);
  font-size: 0.875rem;
  overflow: hidden;
}

/* Fund 4 Fix: Mobile-Basis-Schriftgröße auf 1rem (16px) anheben.
   0.875rem als Basis erzeugt effektive 9-11px bei relativen Label-Größen —
   für Außeneinsatz (Sonne, Handschuhe) kaum lesbar. */
@media (max-width: 768px) {
  .rp-root { font-size: 1rem; }
}

/* ── TOOLBAR ────────────────────────────────────────────────────────────────── */
.rp-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rp-border);
  background: var(--rp-surface);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.rp-toolbar-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--rp-primary);
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}
.rp-toolbar-title i { font-size: 0.95rem; }
.rp-toolbar-spacer { flex: 1; }
.rp-toolbar-search {
  position: relative;
  flex: 1;
  min-width: 160px;
  max-width: 320px;
}
.rp-toolbar-search input {
  width: 100%;
  padding: 6px 10px 6px 32px;
  border: 1px solid var(--rp-border);
  border-radius: 20px;
  background: var(--rp-surface-2);
  color: var(--rp-text);
  font-size: 0.82rem;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.rp-toolbar-search input:focus {
  border-color: var(--rp-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb,var(--blue,#1B7599) 10%,transparent);
  background: var(--rp-surface);
}
.rp-toolbar-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--rp-muted);
  font-size: 0.75rem;
  pointer-events: none;
}
/* Sprint C: Buttons folgen dem Shell-System (.btn) — gleiches Look-and-feel
   wie Dashboard/Timetrack/Logbook. Hover/Active-States über brightness/scale,
   nicht hardcoded Hex-Werte → funktioniert in allen Themes (dark/pink/gray). */
.rp-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--rp-border);
  border-radius: 6px;
  background: var(--rp-surface);
  color: var(--rp-text);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .14s ease, border-color .14s ease, color .14s ease, transform .08s ease, box-shadow .14s ease;
  white-space: nowrap;
  flex-shrink: 0;
  /* Fund 1 Fix: Mindesthöhe unabhängig vom pointer-Typ — schützt Hybrid-Geräte
     (Chromebook, Surface in Laptop-Mode) wo pointer:coarse nicht feuert. */
  min-height: 44px;
}
.rp-btn:hover {
  background: var(--rp-surface-2);
  border-color: var(--rp-primary);
  color: var(--rp-primary);
}
.rp-btn:active { transform: scale(0.97); }
.rp-btn-primary {
  background: var(--rp-primary);
  border-color: var(--rp-primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.rp-btn-primary:hover {
  background: var(--rp-primary);
  border-color: var(--rp-primary);
  color: #fff;
  filter: brightness(1.08);
  box-shadow: 0 3px 10px color-mix(in srgb,var(--blue,#1B7599) 22%,transparent);
}
.rp-btn-icon {
  padding: 6px 8px;
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
}
.rp-btn-danger {
  color: var(--rp-danger);
  border-color: var(--rp-border);
}
.rp-btn-danger:hover {
  border-color: var(--rp-danger);
  background: var(--error-bg, rgba(239,68,68,.10));
  color: var(--rp-danger);
}
.rp-btn-success {
  color: var(--rp-success, var(--success, #16a34a));
  border-color: var(--rp-border);
}
.rp-btn-success:hover {
  border-color: var(--rp-success, var(--success, #16a34a));
  background: var(--success-bg, rgba(22,163,74,.10));
}

/* v97.270: Writer/Calc-Buttons in Top-Toolbar.
   Icons default-neutral (erben rp-text via inherit). Beim Hover subtle
   brand-Tint zur Identifikation, ohne Office-Original-Farben aufzudrängen. */
#rp-new-writer-btn i,
#rp-new-calc-btn i {
  color: inherit;
  font-size: 0.95rem;
  transition: color .15s ease, transform .12s ease;
}
#rp-new-writer-btn:hover i {
  color: #4f7cd1;
  transform: scale(1.08);
}
#rp-new-calc-btn:hover i {
  color: #2d9d6e;
  transform: scale(1.08);
}

/* Beta-Buttons: noch nicht voll implementiert. Klare Kennzeichnung
   via Badge + reduzierte Opazität, damit Nutzer wissen dass die Funktion
   in Entwicklung ist. */
.rp-btn-beta { position: relative; opacity: .72; }
.rp-btn-beta:hover { opacity: 1; }
.rp-beta-badge {
  position: absolute; top: -4px; right: -4px;
  font-size: .6rem; font-weight: 700; line-height: 1;
  padding: 2px 4px; border-radius: 4px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff; pointer-events: none;
  letter-spacing: .02em;
  box-shadow: 0 1px 2px rgba(0,0,0,.15);
}

/* ── SKELETON-LOADERS ───────────────────────────────────────────────────────
   Statt Spinner: shimmer-Placeholder, die das echte Layout vorzeichnen.
   Wirkt schneller, vermeidet Layout-Shift beim Tausch echter Daten. */
@keyframes rp-skel-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}
.rp-skel {
  background: linear-gradient(90deg,
    var(--rp-surface-2, #f0f3f2) 25%,
    rgba(0,0,0,.04) 50%,
    var(--rp-surface-2, #f0f3f2) 75%);
  background-size: 200% 100%;
  animation: rp-skel-shimmer 1.4s linear infinite;
  border-radius: 6px;
  display: block;
}
@media (prefers-reduced-motion: reduce) {
  .rp-skel { animation: none; }
}

/* Shell — initial mount */
.rp-skel-shell {
  display: flex; flex-direction: column; height: 100%;
  background: var(--rp-bg, #f4f6f8);
}
.rp-skel-topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--rp-border, #e0e8e5);
}
.rp-skel-logo { width: 140px; height: 22px; }
.rp-skel-search { flex: 1; max-width: 480px; height: 32px; }
.rp-skel-btn { width: 110px; height: 32px; }
.rp-skel-body { flex: 1; display: flex; min-height: 0; }
.rp-skel-sidebar {
  width: 240px; padding: 12px; display: flex; flex-direction: column; gap: 6px;
  border-right: 1px solid var(--rp-border, #e0e8e5);
}
.rp-skel-sb-item { height: 28px; width: 100%; }
.rp-skel-sb-item:nth-child(1) { width: 80%; }
.rp-skel-sb-item:nth-child(3) { width: 60%; }
.rp-skel-sb-item:nth-child(5) { width: 70%; }
.rp-skel-main { flex: 1; padding: 14px; overflow: hidden; }

/* Grid — Card-Skeletons */
.rp-skel-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.rp-skel-card {
  background: var(--rp-surface, #fff); border-radius: 10px;
  overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.rp-skel-cover { width: 100%; aspect-ratio: 4/3; border-radius: 0; }
.rp-skel-card-body { padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.rp-skel-line { height: 12px; }
.rp-skel-line.short { width: 60%; }

/* List */
.rp-skel-list { display: flex; flex-direction: column; gap: 6px; }
.rp-skel-row {
  display: grid; grid-template-columns: 32px 1fr 100px 80px;
  align-items: center; gap: 12px; padding: 10px 14px;
  background: var(--rp-surface, #fff); border-radius: 8px;
  border: 1px solid var(--rp-border, #edf1f3);
}
.rp-skel-icon { width: 28px; height: 28px; border-radius: 6px; }
.rp-skel-title { height: 14px; }
.rp-skel-meta { height: 10px; }
.rp-skel-meta.short { width: 60%; }

/* Home — Stats + Grid */
.rp-skel-home { display: flex; flex-direction: column; gap: 16px; }
.rp-skel-stats {
  display: grid; gap: 10px;
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 700px) { .rp-skel-stats { grid-template-columns: repeat(2, 1fr); } }
.rp-skel-stat { height: 78px; border-radius: 10px; }
.rp-beta-badge-inline {
  display: inline-block; margin-left: 4px;
  font-size: .58rem; font-weight: 700; line-height: 1;
  padding: 2px 4px; border-radius: 3px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff; vertical-align: middle;
}
.rp-tree-item.is-beta { opacity: .85; }
.rp-tree-item.is-beta:hover { opacity: 1; }

/* View-Toggle */
.rp-view-toggle {
  display: inline-flex;
  border: 1px solid var(--rp-border);
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}
.rp-view-btn {
  width: 30px; height: 30px;
  border: none;
  background: var(--rp-surface);
  color: var(--rp-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem;
  transition: background .12s, color .12s;
}
.rp-view-btn + .rp-view-btn { border-left: 1px solid var(--rp-border); }
.rp-view-btn:hover { color: var(--rp-primary); }
.rp-view-btn.active { background: var(--rp-primary); color: #fff; }
/* Icon nicht stauchen lassen — sonst sitzt es bei knappem Padding nicht mittig. */
.rp-view-btn i { flex-shrink: 0; line-height: 1; }

/* Status-Filter-Chips (Alle/Entwurf/Abgegeben/…) — hatten bisher KEINE eigene Regel und
   rendern als native graue Buttons. Jetzt als gebrandete Pills mit aktivem Zustand. */
.rp-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 5px 12px;
  border: 1px solid var(--rp-border);
  border-radius: 999px;
  background: var(--rp-surface);
  color: var(--rp-text, #1a2926);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.rp-status-chip i { font-size: 0.76rem; flex-shrink: 0; }
.rp-status-chip:hover { border-color: var(--rp-primary); color: var(--rp-primary); }
.rp-status-chip.active {
  background: var(--rp-primary);
  border-color: var(--rp-primary);
  color: #fff;
}
/* 2026-05-08: Aktive Hauptansicht-Buttons (Home/Kanban/Map) sichtbar markieren */
.rp-btn-icon.active {
  background: var(--rp-primary, #1a7599);
  color: #fff;
  border-color: var(--rp-primary, #1a7599);
}
.rp-btn-icon.active:hover { background: var(--rp-primary-dark, #155f7f); }

/* ── SPLIT-LAYOUT ───────────────────────────────────────────────────────────── */
/* Sprint 6.4 — Sidebar entfernt, Vollbild-Layout. .rp-content nimmt jetzt 100% width. */
.rp-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.rp-body > .rp-content {
  flex: 1;
  width: 100%;
  min-width: 0;
}

/* ── SIDEBAR ────────────────────────────────────────────────────────────────── */
.rp-sidebar {
  width: var(--rp-sidebar-w);
  min-width: 180px;
  max-width: 340px;
  border-right: 1px solid var(--rp-border);
  display: flex;
  flex-direction: column;
  background: var(--rp-surface-2);
  overflow: hidden;
  flex-shrink: 0;
  transition: width .2s;
}
.rp-sidebar.collapsed { width: 0; min-width: 0; border-right: none; }
.rp-sidebar-hdr {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--rp-border);
  flex-shrink: 0;
}
.rp-sidebar-hdr-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--rp-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex: 1;
}
.rp-sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 0 40px;
}
/* Sidebar-Sektionen */
.rp-sb-section {
  margin-bottom: 4px;
}
.rp-sb-section-hdr {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  font-size: 0.70rem;
  font-weight: 600;
  color: var(--rp-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  user-select: none;
}
.rp-sb-section-hdr:hover { color: var(--rp-text); }
/* Fund 3 Fix: Sidebar-Sektionsköpfe auf Touch auf ≥44px Mindesthöhe anheben.
   Verhindert Fehlklicks beim Kollabieren/Aufklappen von Sektionen. */
@media (pointer: coarse) {
  .rp-sb-section-hdr { min-height: 44px; padding: 10px 12px; }
}
.rp-sb-section-chev { margin-left: auto; font-size: 0.62rem; transition: transform .15s; }
.rp-sb-section-chev.open { transform: rotate(180deg); }
/* Tree-Item */
.rp-tree-item {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px 5px 0;
  cursor: pointer;
  border-radius: 5px;
  margin: 0 4px;
  transition: background .1s;
  position: relative;
  /* Fund 4 Fix: Direkt 44px statt nur über den coarse-Block — schützt Hybrid-
     Geräte (Android-Tablet mit Maus-Modus, Surface-Pro in Laptop-Mode) bei
     denen pointer:fine aktiv ist obwohl Touch genutzt wird. */
  min-height: 44px;
}
.rp-tree-item:hover { background: color-mix(in srgb,var(--blue,#1B7599) 7%,transparent); }
.rp-tree-item.active {
  background: color-mix(in srgb,var(--blue,#1B7599) 12%,transparent);
  color: var(--rp-primary);
  font-weight: 500;
}
.rp-tree-item.active .rp-tree-icon { color: var(--rp-primary); }
.rp-tree-indent { flex-shrink: 0; }
.rp-tree-expand {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--rp-muted);
  font-size: 0.7rem;
  border-radius: 4px;
  transition: background .1s, transform .15s;
}
/* Sprint F P4-09: Touch-Targets >=44px auf coarse-pointer */
@media (pointer:coarse) { .rp-tree-expand { width: 44px; height: 44px; font-size:.8rem; } }
/* 2026-07-21 (Dominic): "Importieren" + "Hochladen" in der mobilen Ansicht ausblenden. */
@media (max-width: 768px) { #rp-upload-btn, #rp-folder-import-btn { display: none !important; } }
.rp-tree-expand:hover { background: rgba(0,0,0,.07); }
.rp-tree-expand.open { transform: rotate(90deg); }
.rp-tree-icon { color: var(--rp-muted); font-size: 0.85rem; flex-shrink: 0; }
.rp-tree-label {
  flex: 1;
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rp-tree-count {
  font-size: 0.68rem;
  color: var(--rp-muted);
  background: var(--rp-border);
  border-radius: 10px;
  padding: 1px 6px;
  flex-shrink: 0;
}
.rp-tree-status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
/* Smart-Folder Eintrag */
.rp-smart-folder { opacity: 0.85; }
.rp-smart-folder .rp-tree-icon { color: var(--rp-primary); }

/* Sidebar Resize Handle */
.rp-resize-handle {
  position: absolute;
  right: -3px;
  top: 0; bottom: 0;
  /* Fund 5 Fix: 6px sind auf Desktop schwer zu treffen. Tatsächliche Hit-Area
     auf 12px erweitern; der optische Indikator bleibt per ::before 6px dünn. */
  width: 12px;
  cursor: col-resize;
  z-index: 10;
}
.rp-resize-handle::before {
  content: '';
  position: absolute;
  left: 50%; transform: translateX(-50%);
  top: 0; bottom: 0;
  width: 4px;
  background: transparent;
  transition: background .15s;
}
.rp-resize-handle:hover::before { background: var(--rp-primary, #1a7599); opacity: .35; }
/* Auf Mobile ist die Sidebar ein Fixed-Overlay — kein Resize nötig. */
@media (pointer: coarse) {
  .rp-resize-handle { display: none; }
}
.rp-sidebar-wrapper {
  position: relative;
  display: flex;
  flex-direction: row;
}

/* ── CONTENT-BEREICH ─────────────────────────────────────────────────────────── */
.rp-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

/* Breadcrumb */
.rp-breadcrumb {
  display: flex;
  align-items: center;
  /* 2026-07-09 Ordner-UX: bei tiefer Verschachtelung horizontal scrollen statt
     umbrechen — der Breadcrumb ist die einzige Hierarchie-Anzeige und blieb
     sonst bei langen Pfaden unleserlich. */
  flex-wrap: nowrap;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: thin;
  gap: 4px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--rp-border);
  background: var(--rp-surface);
  flex-shrink: 0;
  min-height: 38px;
}
.rp-crumb {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--rp-primary);
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 4px;
  transition: background .1s;
}
.rp-crumb:hover { background: var(--rp-primary-light); }
/* Fund 5 Fix: Breadcrumb-Tap-Target auf Touch auf ≥44px — verhindert
   versehentliches Navigieren auf falsche Ordnerebene. */
@media (pointer: coarse) {
  .rp-crumb { min-height: 44px; padding: 10px 10px; }
}
.rp-crumb.current { color: var(--rp-text); font-weight: 500; cursor: default; }
.rp-crumb.current:hover { background: transparent; }
.rp-crumb-sep { color: var(--rp-muted); font-size: 0.75rem; }

/* Content-Scroll */
.rp-content-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px;
  position: relative;
}

/* ── HOME-VIEW ──────────────────────────────────────────────────────────────── */
.rp-home-section { margin-bottom: 22px; }
.rp-home-section-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--rp-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.rp-home-section-title i { color: var(--rp-primary); }
/* Pending-Reports: Berichte die noch abgegeben werden müssen */
.rp-pending-list { display: flex; flex-direction: column; gap: 6px; }
.rp-pending-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--rp-surface-2);
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius);
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.rp-pending-item:hover { border-color: var(--rp-primary); background: var(--rp-primary-light); }
.rp-pending-item-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: color-mix(in srgb,var(--blue,#1B7599) 10%,transparent);
  color: var(--rp-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.rp-pending-item-body { flex: 1; min-width: 0; }
.rp-pending-item-title {
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rp-pending-item-meta { font-size: 0.75rem; color: var(--rp-muted); margin-top: 1px; }
.rp-pending-item-submit {
  flex-shrink: 0;
  /* Fund 6 Fix: Padding auf 10px vertikal erhöht — der "Einreichen"-Button
     war ~26px hoch (4px × 2 + Schrift). Jetzt fingertauglich auch ohne
     coarse-Override (schützt Hybridgeräte + verbessertes Desktop-Feeling). */
  padding: 10px 14px;
  border: 1px solid var(--rp-primary);
  border-radius: 20px;
  color: var(--rp-primary);
  font-size: 0.75rem;
  font-weight: 600;
  background: transparent;
  cursor: pointer;
  transition: background .12s, color .12s;
  font-family: inherit;
}
.rp-pending-item-submit:hover { background: var(--rp-primary); color: #fff; }

/* Stats-Ring (Wochen-Zusammenfassung) */
.rp-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}
.rp-stat-tile {
  background: var(--rp-surface-2);
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.rp-stat-tile-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.rp-stat-tile-val { font-size: 1.4rem; font-weight: 600; line-height: 1.1; }
.rp-stat-tile-label { font-size: 0.72rem; color: var(--rp-muted); margin-top: 1px; }

/* ── FOLDER/REPORT CARDS (Grid) ──────────────────────────────────────────────── */
/* 2026-07-10 User-Wunsch: dynamisch so viele Ordner/Karten nebeneinander wie passen
   (auto-fill, kleinere Mindestbreite = mehr Spalten) + klarer Zeilenabstand
   (row-gap > column-gap, damit die Reihen sichtbar getrennt sind). */
.rp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px 12px;
}
/* 2026-07-02 User-Wunsch: Datei-Anzeige-Größe umschaltbar (klein/mittel=Default/groß).
   Greift alle .rp-grid (Dateien/Ordner/Berichte + Recent/Starred) via html[data-rp-size]. */
html[data-rp-size="small"] .rp-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px 8px; }
html[data-rp-size="small"] .rp-card-cover { height: 72px; }
html[data-rp-size="small"] .rp-card-name { font-size: .76rem; }
/* 2026-07-10 User-Bug (nur Klein-Ansicht): Datei-Karten haben 6 Aktions-Buttons (Ansehen/Umbenennen/
   Verschieben/Bearbeiten/Download/Löschen). Bei 26px bildeten sie ein 2×3-Raster = 84px, das im nur
   72px hohen Klein-Cover unten abgeschnitten wurde (Download/Löschen "teilweise verdeckt"). Kleinere
   Buttons (22px) + engerer Gap -> 3 pro Reihe, 2 Reihen (46px) passen ganz ins Cover. */
html[data-rp-size="small"] .rp-card-actions { gap: 2px; }
html[data-rp-size="small"] .rp-card-actions .rp-card-action-btn { width: 22px; height: 22px; }
html[data-rp-size="small"] .rp-card-actions .rp-card-action-btn i { font-size: 0.68rem; }
html[data-rp-size="large"] .rp-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px 14px; }
html[data-rp-size="large"] .rp-card-cover { height: 150px; }
/* 2026-07-10 User-Wunsch: Home-Dashboard View-Modi (getrennt von der Ordner-Ansicht) als
   Grid-Varianten — gleiche Karten (.rp-grid-card), nur andere Dichte/Layout via CSS.
   grid-template-columns hier mit !important, weil sonst die responsiven .rp-grid-Regeln
   (@media 768/380/1024, teils !important) UND die [data-rp-size]-Regeln oben die
   Spaltenzahl des gewählten View-Modus überschreiben würden. Grid-Modus (.rp-grid ohne
   Zusatzklasse) bleibt völlig unberührt = bisheriges responsives + Größen-Verhalten. */
.rp-grid.rp-grid-gallery { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important; }
/* 2026-07-10 B1-Audit R17 (Finder B, FUND 3): Galerie = bild-betont → Cover konsistent gross,
   unabhaengig von der Kartengroesse (sonst 72px-Cover in 240px-Kachel = stark letterboxed bei size=small). */
.rp-grid.rp-grid-gallery .rp-card-cover { height: 150px; }
.rp-grid.rp-grid-list { grid-template-columns: 1fr !important; gap: 8px; }
/* .rp-grid-card ist per Default display:block (kein flex) → für die Zeilen-Ansicht explizit
   auf flex/row setzen, damit Cover links + Body rechts stehen (Karten-DOM bleibt gleich).
   2026-07-10 R17-Live-Nachschliff (Finder-B FUND 2): align-items:center + FIXE Cover-Groesse
   (104×64) → EINHEITLICHE Zeilenhoehen. Vorher aspekt-getrieben (height:auto) ruppig: Collage-
   Ordner hoch, Icon-Ordner flach. Live in Chrome verifiziert. */
.rp-grid.rp-grid-list .rp-grid-card { display: flex; flex-direction: row; align-items: center; }
.rp-grid.rp-grid-list .rp-card-label-bar { width: 4px; height: auto; align-self: stretch; flex-shrink: 0; }
.rp-grid.rp-grid-list .rp-card-cover { width: 104px; min-width: 104px; height: 64px; border-bottom: none; border-right: 1px solid var(--rp-border); }
.rp-grid.rp-grid-list .rp-card-cover img { object-fit: cover; }
.rp-grid.rp-grid-list .rp-card-cover-icon { height: 64px; }
.rp-grid.rp-grid-list .rp-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; padding-left: 10px; }
/* 2026-07-10 R17-Live-Nachschliff (Finder-B FUND 4): Action-Buttons (Merken/Label/Teilen/Loeschen)
   im schmalen 104px-Cover in EINER Reihe statt gedraengtem 2×2-Block (weniger Checkbox-Reserve
   right:4px, nowrap, 22px-Buttons). Live verifiziert. */
.rp-grid.rp-grid-list .rp-card-actions { right: 4px; top: 4px; gap: 3px; flex-wrap: nowrap; }
.rp-grid.rp-grid-list .rp-card-action-btn { width: 22px; height: 22px; }
.rp-grid-card {
  background: var(--rp-surface-2);
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: border-color .12s, transform .08s, box-shadow .12s;
  position: relative;
}
.rp-grid-card:hover {
  border-color: var(--rp-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px color-mix(in srgb,var(--blue,#1B7599) 12%,transparent);
}
/* Fund 14 Fix: visuelles Tap-Feedback als allgemeine Regel (nicht nur coarse) —
   Hybridgeräte mit Maus+Touch (Surface, Chromebook) würden ohne diese Regel
   kein Tap-Feedback erhalten, da pointer:coarse dort nicht feuert. */
.rp-grid-card:active { transform: scale(.97); }
.rp-grid-card.selected {
  border-color: var(--rp-primary);
  box-shadow: 0 0 0 2px color-mix(in srgb,var(--blue,#1B7599) 25%,transparent);
}

/* ─── 2026-05-08 Polish: Bericht-Karten visuell deutlich abgehoben ──────── */
.rp-card-report {
  border-left: 4px solid #185FA5;        /* prominente blaue Kante = "Dokument" */
  background: linear-gradient(135deg, #fafdff 0%, #f0f7fd 100%);
}
.rp-card-report:hover {
  border-color: #185FA5;
  box-shadow: 0 6px 18px rgba(24,95,165,.18);
}
/* Status-spezifische Akzent-Farbe links */
.rp-card-report.rp-card-report-success { border-left-color: #2e7d32; }   /* approved */
.rp-card-report.rp-card-report-warn    { border-left-color: #b07a10; }   /* draft / pending */
.rp-card-report.rp-card-report-danger  { border-left-color: #d32f2f; }   /* rejected */
.rp-card-report.rp-card-report-info    { border-left-color: #185FA5; }   /* submitted */

/* Bericht-Banner — kleines Ribbon oben das sofort signalisiert: das ist ein BERICHT */
.rp-card-report-banner {
  background: linear-gradient(90deg, #185FA5, #2c7bc4);
  color: #fff;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .08em;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  text-transform: uppercase;
}
.rp-card-report-banner i { font-size: .7rem; opacity: .9; }

/* Cover-Icon im "Berichts-Look": leichte Schraffur-Background damit klar
   "Dokument" statt "Foto-Galerie" */
.rp-card-cover-icon-report {
  background: repeating-linear-gradient(
    -45deg,
    rgba(24,95,165,.04) 0,
    rgba(24,95,165,.04) 4px,
    transparent 4px,
    transparent 8px
  );
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}
.rp-card-cover-icon-report i { font-size: 2rem; color: #185FA5; opacity: .85; }

/* "Weitermachen"-Shortcut auf der Startseite — gebrandeter, klar lesbarer Button
   (statt nacktem Play-Icon). Sekundär zum gefüllten "Abgeben". */
.rp-btn-continue{
  display:inline-flex; align-items:center; gap:7px;
  padding:8px 15px;
  background:linear-gradient(135deg,var(--blue,#1B7599),#155e7a);
  color:#fff; border:none; border-radius:10px;
  font-weight:600; font-size:13px; cursor:pointer; white-space:nowrap;
  box-shadow:0 3px 10px -3px color-mix(in srgb,var(--blue,#1B7599) 50%,transparent);
  transition:filter .15s, transform .12s;
}
.rp-btn-continue:hover{ filter:brightness(1.07); }
.rp-btn-continue:active{ transform:scale(.97); }
.rp-btn-continue i{ font-size:11px; }

/* List-View: Bericht-Zeilen leicht abgehoben */
.rp-list-row-report { background: linear-gradient(90deg, rgba(24,95,165,.04), transparent 40%); }
.rp-list-row-report:hover { background: rgba(24,95,165,.08); }
.rp-list-row-report .rp-list-icon { background: rgba(24,95,165,.06); }

/* ─── 2026-05-08: Folder-Info-Bar (Termin-Link + Team-Zugriff sichtbar) ──── */
.rp-fbar {
  background: linear-gradient(135deg, #f4faf8 0%, #ffffff 100%);
  border: 1px solid var(--rp-border, #e3e6ea);
  border-left: 4px solid var(--rp-accent,#488078);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.rp-fbar-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.rp-fbar-folder {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .95rem;
  font-weight: 600;
  color: var(--rp-text, #1a1a1a);
  flex-shrink: 0;
}
.rp-fbar-folder-name { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-fbar-section { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rp-fbar-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--rp-muted, #7b8c8a);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.rp-fbar-label.rp-fbar-empty { color: #b0b8b6; font-style: italic; font-weight: 500; text-transform: none; letter-spacing: 0; }
.rp-fbar-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.rp-fbar-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 14px;
  font-size: .76rem;
  background: #fff;
  border: 1px solid var(--rp-border, #e3e6ea);
  color: var(--rp-text, #1a1a1a);
}
.rp-fbar-pill-event {
  background: rgba(26,117,153,.08);
  border-color: rgba(26,117,153,.4);
  color: var(--blue,#1a7599);
}
.rp-fbar-pill-event[data-primary="1"] {
  background: linear-gradient(135deg, rgba(251,191,36,.16), rgba(26,117,153,.08));
  border-color: #fbbf24;
}
.rp-fbar-pill-event strong { font-weight: 700; }
.rp-fbar-primary-tag {
  background: #fbbf24;
  color: #7c2d12;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: .58rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-left: 2px;
}
.rp-fbar-pill-user {
  background: color-mix(in srgb,var(--rp-accent,#488078) 8%,transparent);
  border-color: color-mix(in srgb,var(--rp-accent,#488078) 40%,transparent);
  color: #2f5e57;
}
.rp-fbar-avatar {
  width: 18px; height: 18px;
  background: var(--rp-accent,#488078); color: #fff;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 9px;
}
.rp-fbar-event-hint {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(26,117,153,.08); color: var(--blue,#1a7599);
  padding: 4px 10px; border-radius: 14px; font-size: .76rem;
}
.rp-fbar-actions { margin-left: auto; flex-shrink: 0; display:flex; gap:14px; }
.rp-fbar-btn {
  background: var(--blue,#1a7599);
  color: #fff;
  border: 0;
  padding: 7px 14px;
  border-radius: 7px;
  cursor: pointer;
  font-size: .8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .12s;
}
.rp-fbar-btn:hover { background: #155f7f; }
@media (max-width: 700px) {
  .rp-fbar-row { gap: 10px; }
  .rp-fbar-folder-name { max-width: 160px; }
  .rp-fbar-actions { margin-left: 0; width: 100%; }
  .rp-fbar-btn { width: 100%; justify-content: center; }
}

/* Farb-Label-Streifen oben */
.rp-card-label-bar {
  height: 4px;
  width: 100%;
  flex-shrink: 0;
}
/* Cover-Foto */
.rp-card-cover {
  height: 100px;
  background: var(--rp-surface);
  border-bottom: 1px solid var(--rp-border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.rp-card-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.rp-card-cover-icon {
  font-size: 2rem;
  color: var(--rp-muted);
  opacity: 0.5;
}
/* 2026-07-10 User-Wunsch: Inhalts-Vorschau (Collage) + Leer-Markierung + dichteres Grid.
   Collage = bis zu 4 Thumbnails, füllt die Cover-Fläche randlos. */
.rp-card-collage {
  width: 100%; height: 100%;
  display: grid;
  gap: 1px;
  background: var(--rp-border);
}
.rp-collage-2 { grid-template-columns: 1fr 1fr; }
.rp-collage-3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.rp-collage-3 .rp-collage-cell:first-child { grid-row: span 2; }
.rp-collage-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.rp-collage-cell { overflow: hidden; position: relative; background: var(--rp-surface); }
.rp-collage-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rp-card-more-badge {
  position: absolute; right: 4px; bottom: 4px;
  background: rgba(0,0,0,.62); color: #fff;
  font-size: .64rem; font-weight: 700;
  padding: 1px 6px; border-radius: 10px;
  pointer-events: none;
}
/* Leerer Ordner: klar erkennbar (gestrichelt + gedämpft + Label). */
.rp-grid-card.rp-card-empty {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--rp-border) 80%, transparent);
  background: color-mix(in srgb, var(--rp-surface-2) 60%, transparent);
}
.rp-card-empty-cover {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; opacity: .55;
}
.rp-card-empty-label {
  font-size: .66rem; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--rp-muted); opacity: 1;
}
/* Status-Badge oben rechts in Cover */
.rp-card-status {
  position: absolute;
  top: 6px;
  right: 6px;
}
/* Karten-Body */
.rp-card-body { padding: 8px 10px 10px; }
.rp-card-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--rp-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 3px;
}
.rp-card-meta {
  font-size: 0.70rem;
  color: var(--rp-muted);
  display: flex;
  align-items: center;
  gap: 3px 5px;             /* Spaltenabstand 5px wie bisher; Zeilenabstand 3px greift nur bei Umbruch (Ordner) */
  min-width: 0;             /* erlaubt Schrumpfen im dichten Grid statt Ueberlauf */
}
/* 2026-07-10 B1-Audit R17 (Finder B, FUND 1): flex-wrap NUR auf Ordner-Karten. Deren Meta ist in
   nowrap-.rp-meta-item-Spans migriert (sauberer Datums-Umbruch). Bericht-/Datei-/Office-/Skizzen-
   Karten nutzen weiter rohes Inline-Markup ("<i> · Text") — dort erzeugte flex-wrap baumelnde "·"
   und uneben umbrechende Icons. Ohne Wrap bleiben sie einzeilig wie vor der Umstellung. */
.rp-card-meta.rp-card-meta-folder { flex-wrap: wrap; }
/* 2026-07-10 User-Bug: jede Angabe (Berichte/Fotos/Dateien/Datum) als geschlossene nowrap-Einheit,
   damit Icon+Zahl nie getrennt umbrechen und das Datum als Ganzes in die naechste Zeile rutscht. */
.rp-card-meta .rp-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}
.rp-card-meta .rp-meta-item i { font-size: 0.7rem; }
/* 2026-07-10 User-Wunsch: Ordner-Adresse gesondert unter dem Namen (Karte/Liste/Ordnerleiste).
   Dezent, aber klar vom Ordnernamen abgesetzt (kann bewusst abweichen). */
.rp-card-addr {
  font-size: 0.70rem;
  color: var(--rp-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.rp-card-addr > i { font-size: .66rem; color: var(--rp-accent, #488078); flex: 0 0 auto; }
.rp-list-addr {
  font-size: 0.72rem;
  color: var(--rp-muted);
  font-weight: 400;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: normal;
}
.rp-list-addr > i { font-size: .66rem; color: var(--rp-accent, #488078); flex: 0 0 auto; }
.rp-fbar-folder-addr {
  font-size: 0.74rem;
  color: var(--rp-muted);
  margin-left: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 260px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.rp-fbar-folder-addr > i { font-size: .68rem; color: var(--rp-accent, #488078); flex: 0 0 auto; }
@media (max-width: 640px) {
  .rp-fbar-folder-addr { max-width: 150px; }
}
/* Hover-Actions
   2026-05-08 EOD-fix3: right:40px reserviert die obere rechte Ecke für die
   Selection-Checkbox — bei Bilder-Cards mit 5-6 Action-Buttons hat sonst
   der letzte (Löschen) unter der Checkbox gelegen. flex-wrap erlaubt
   Buttons in eine zweite Reihe falls Card schmal. */
.rp-card-actions {
  position: absolute;
  top: 6px;
  left: 6px;
  right: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  opacity: 0;
  transition: opacity .15s;
}
.rp-grid-card:hover .rp-card-actions { opacity: 1; }
/* 2026-07-10 B1-Audit R4 Fund 10: Tastatur-Fokus (Karte oder Action-Button) zeigt die
   Hover-Actions — sonst waren sie per Tab unerreichbar unsichtbar. */
.rp-grid-card:focus-within .rp-card-actions { opacity: 1; pointer-events: auto; }
.rp-card-action-btn {
  width: 26px; height: 26px;
  border-radius: 5px;
  border: 1px solid rgba(255,255,255,.3);
  background: rgba(0,0,0,.45);
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.70rem;
  transition: background .1s;
}
.rp-card-action-btn:hover { background: rgba(0,0,0,.7); }
/* Checkbox bei Selection (Mehrfach-Auswahl für Bulk-Aktionen wie Verschieben/Löschen)
   2026-05-08 EOD Bug-Fix: Lag bisher in der gleichen Ecke wie die Hover-Action-Buttons
   (Merken/Label/Teilen) und überdeckte diese. Jetzt rechts oben — keine Kollision. */
.rp-card-checkbox {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px; height: 22px;
  border-radius: 4px;
  border: 2px solid rgba(255,255,255,.85);
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity .15s, background .15s, transform .12s;
  cursor: pointer;
  color: #fff;
  font-size: 0.78rem;
  z-index: 3;
}
.rp-card-checkbox:hover { transform: scale(1.1); background: rgba(0,0,0,.7); }
.rp-grid-card:hover .rp-card-checkbox,
.rp-grid-card.selected .rp-card-checkbox { opacity: 1; }
.rp-grid-card.selected .rp-card-checkbox { background: var(--rp-primary); border-color: var(--rp-primary); }
/* 2026-05-08 EOD-fix4: Auf Report-Karten kollidiert top-right mit dem Status-
   Badge ("Entwurf"/"Eingereicht"/etc.). Status bleibt an seinem Platz, Checkbox
   wandert auf Report-Karten in die untere rechte Ecke (Stern-Indikator gibt es
   bei Reports eh nicht, also frei). */
.rp-grid-card.rp-card-report .rp-card-checkbox {
  top: auto;
  bottom: 8px;
  right: 8px;
}

/* 2026-05-08 EOD-fix5: Folder-Cards brauchen keinen Mehrfach-Auswahl-Haken.
   User-Wunsch: "die ordnerübersicht braucht keine haken da man die ja nicht
   verschieben kann". Ordner werden via Klick geöffnet, Aktionen über Hover-
   Buttons (Merken/Label/Teilen/Löschen) oder Rechtsklick-Menü. Datei- und
   Bericht-Cards behalten den Haken für Bulk-Operationen. */
.rp-grid-card[data-item-type="folder"] .rp-card-checkbox { display: none !important; }

/* Stern */
.rp-card-star {
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-size: 0.8rem;
  color: #f59e0b;
  opacity: 0.9;
}

/* ── LISTEN-ANSICHT ──────────────────────────────────────────────────────────── */
.rp-list { width: 100%; }
.rp-list-row {
  display: grid;
  grid-template-columns: 24px 2fr 1fr 1fr 90px 80px;
  align-items: center;
  gap: 8px;
  padding: 7px 4px;
  border-radius: 5px;
  cursor: pointer;
  border-bottom: 1px solid var(--rp-border);
  transition: background .1s;
}
.rp-list-row:hover { background: var(--rp-primary-light); }
.rp-list-row.selected { background: color-mix(in srgb,var(--blue,#1B7599) 10%,transparent); }
.rp-list-row.header { cursor: default; font-size: 0.72rem; color: var(--rp-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 5px 4px; }
.rp-list-row.header:hover { background: transparent; }
.rp-list-icon { color: var(--rp-muted); font-size: 0.9rem; text-align: center; }
.rp-list-name { font-size: 0.83rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
/* 2026-07-10 User-Wunsch: Adresse bricht in der Listenzeile auf eine eigene Zeile unter den Namen. */
.rp-list-addr { flex: 0 0 100%; }
.rp-list-meta { font-size: 0.75rem; color: var(--rp-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-list-date { font-size: 0.75rem; color: var(--rp-muted); }
.rp-list-actions { display: flex; gap: 4px; opacity: 0; transition: opacity .1s; }
.rp-list-row:hover .rp-list-actions { opacity: 1; }
/* Fund 1 Fix: Listenansicht-Aktionen auf Touch dauerhaft sichtbar — analoge Regel
   zur Card-Ansicht (≤768px opacity:1). Verhindert unsichtbare Aktionen auf Smartphone. */
@media (pointer: coarse) { .rp-list-actions { opacity: 1; } }

/* ── GALERIE-ANSICHT ─────────────────────────────────────────────────────────── */
.rp-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px;
}
.rp-gallery-item {
  aspect-ratio: 1;
  border-radius: var(--rp-radius);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: var(--rp-surface-2);
  border: 1px solid var(--rp-border);
  transition: transform .1s;
}
.rp-gallery-item:hover { transform: scale(1.02); border-color: var(--rp-primary); }
.rp-gallery-item:focus-visible {
  outline: 3px solid var(--rp-primary, #488078);
  outline-offset: 2px;
  transform: scale(1.02);
  z-index: 1;
}
.rp-gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* R21 Fund 2: Auswahl-Highlight in der Galerie (Ctrl+A / Bulk) — Grid/Liste haben es via
   .selected, die Galerie hatte kein visuelles Feedback. */
.rp-gallery-item.selected {
  outline: 3px solid var(--rp-primary, #488078);
  outline-offset: -3px;
  box-shadow: 0 0 0 4px rgba(72, 128, 120, .25);
}
.rp-gallery-item-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 6px 8px;
  background: linear-gradient(transparent, rgba(0,0,0,.6));
  color: #fff;
  font-size: 0.68rem;
  opacity: 0;
  transition: opacity .15s;
}
.rp-gallery-item:hover .rp-gallery-item-overlay { opacity: 1; }
/* Fund 2 Fix: Galerie-Overlay auf Touch-Geräten dauerhaft einblenden —
   kein Hover-State auf Touch → Dateiname/Metadaten sonst unsichtbar. */
@media (pointer: coarse) { .rp-gallery-item-overlay { opacity: 1; } }

/* ── STATUS-BADGES ───────────────────────────────────────────────────────────── */
.rp-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.70rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border: 1px solid;
}
/* v95.43: Pills mit voll deckendem Hintergrund + weißer Text/dunklere Töne für bessere Sichtbarkeit */
.rp-badge-draft    { background: #475569; color: #fff; border-color: #334155; }
.rp-badge-submitted { background: var(--blue,#1B7599); color: #fff; border-color: #155b78; }
.rp-badge-reviewing { background: #d97706; color: #fff; border-color: #b8620a; }
.rp-badge-approved  { background: #2e7d32; color: #fff; border-color: #1b5e20; }
.rp-badge-rejected  { background: #c84848; color: #fff; border-color: #a93636; }

/* ── FARB-LABELS ─────────────────────────────────────────────────────────────── */
.rp-label-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,.12);
}
.rp-label-none    { background: var(--rp-border); }
.rp-label-red     { background: #e24b4a; }
.rp-label-orange  { background: #f59e0b; }
.rp-label-green   { background: #4caf50; }
.rp-label-blue    { background: #2196f3; }
.rp-label-purple  { background: #7c3aed; }
.rp-label-teal    { background: #0d9488; }
.rp-label-gray    { background: #9ca3af; }
.rp-label-pink    { background: #db2777; }

/* ── BULK-ACTION-BAR ─────────────────────────────────────────────────────────── */
.rp-bulk-bar {
  position: sticky;
  bottom: 0;
  left: 0; right: 0;
  background: var(--rp-primary);
  color: #fff;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: var(--rp-radius-lg) var(--rp-radius-lg) 0 0;
  box-shadow: 0 -4px 20px color-mix(in srgb,var(--blue,#1B7599) 30%,transparent);
  transition: transform .2s;
  z-index: 20;
  flex-wrap: wrap;
}
.rp-bulk-bar.hidden { transform: translateY(100%); }
.rp-bulk-count { font-weight: 600; font-size: 0.88rem; flex-shrink: 0; }
.rp-bulk-spacer { flex: 1; }
.rp-bulk-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 20px;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 0.78rem;
  cursor: pointer;
  font-family: inherit;
  transition: background .1s;
  white-space: nowrap;
}
.rp-bulk-btn:hover { background: rgba(255,255,255,.25); }
.rp-bulk-btn-danger { background: rgba(220,38,38,.32); border-color: rgba(255,180,180,.5); }
.rp-bulk-btn-danger:hover { background: rgba(220,38,38,.55); }
.rp-bulk-deselect { background: transparent; border-color: rgba(255,255,255,.2); }

/* Move-Picker */
.rp-move-list {
  display: flex; flex-direction: column; gap: 2px;
  max-height: 360px; overflow-y: auto;
  border: 1px solid var(--rp-border, #e0e8e5);
  border-radius: 8px; padding: 4px; background: var(--rp-surface, #fff);
}
.rp-move-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border: none; background: transparent;
  border-radius: 6px;
  cursor: pointer; font-family: inherit; font-size: .86rem;
  text-align: left; color: var(--rp-text, #1a2926);
  transition: background .1s;
  width: 100%;
}
.rp-move-item:hover { background: color-mix(in srgb,var(--rp-accent,#488078) 8%,transparent); }
.rp-move-item i { width: 16px; text-align: center; flex-shrink: 0; }

/* ── UPLOAD DROPZONE ─────────────────────────────────────────────────────────── */
.rp-dropzone-active::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 3px dashed var(--rp-primary);
  border-radius: var(--rp-radius-lg);
  background: color-mix(in srgb,var(--blue,#1B7599) 6%,transparent);
  pointer-events: none;
  z-index: 50;
  animation: rp-drop-pulse 1s ease-in-out infinite;
}
@keyframes rp-drop-pulse {
  0%,100% { opacity: 1; }
  50%      { opacity: .6; }
}
/* Upload-Manager Sidebar */
.rp-upload-mgr {
  position: fixed;
  bottom: 16px;
  right: 16px;
  width: 300px;
  max-height: 360px;
  background: var(--rp-surface);
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius-lg);
  box-shadow: 0 8px 30px rgba(0,0,0,.14);
  z-index: 1000;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s ease, opacity .2s ease;
}
/* 2026-07-16 (User-Bug, Folge zu ar_6e7b1bbb499e): solange das FAB-Plus-Menue offen ist,
   weicht das Upload-Fenster komplett aus (nach rechts raus + unantastbar) — die Menue-
   Punkte „Datei hochladen"/„Foto aufnehmen" liegen sonst genau in seinem Bereich. Damit
   kann man auch WAEHREND eines langsamen Uploads sofort weitere Fotos aufnehmen. Klasse
   wird in reports.js _toggleFab/_closeFab gesetzt/entfernt.
   #rpu-widget = das ECHTE Upload-Widget (reports-upload.js, z-index 9000 ueber der Masken-
   Overlay, komplett Inline-gestylt) → !important noetig, um die Inline-Styles zu schlagen.
   .rp-upload-mgr = nur der XHR-Fallback aus reports.js. */
.rp-upload-mgr.rp-fab-dodge,
#rpu-widget.rp-fab-dodge {
  transform: translateX(calc(100% + 24px)) !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.rp-upload-mgr-hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--rp-border);
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--rp-surface-2);
  flex-shrink: 0;
}
.rp-upload-mgr-body { flex: 1; overflow-y: auto; padding: 6px; }
.rp-upload-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  margin-bottom: 4px;
  background: var(--rp-surface-2);
}
.rp-upload-item-icon { font-size: 1.1rem; color: var(--rp-muted); flex-shrink: 0; }
.rp-upload-item-body { flex: 1; min-width: 0; }
.rp-upload-item-name { font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-upload-progress {
  height: 3px;
  background: var(--rp-border);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}
.rp-upload-progress-fill {
  height: 100%;
  background: var(--rp-primary);
  border-radius: 2px;
  transition: width .3s;
}
.rp-upload-item-status { font-size: 0.72rem; color: var(--rp-muted); flex-shrink: 0; }
.rp-upload-item.done .rp-upload-item-status { color: var(--rp-ok); }
.rp-upload-item.error .rp-upload-item-status { color: var(--rp-danger); }

/* ── MODALS ──────────────────────────────────────────────────────────────────── */
/* ── MODALS & OVERLAYS (Premium 2026) ─────────────────────────────────────── */
.rp-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(10,12,14,.65); backdrop-filter: blur(4px) saturate(1.2);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: rp-fade-in .18s ease;
}
@keyframes rp-fade-in { from{opacity:0} to{opacity:1} }

.rp-modal {
  background: var(--rp-surface);
  border-radius: 14px;
  box-shadow: 0 32px 80px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.08);
  width: 100%; max-width: 480px; max-height: 90vh;
  overflow: hidden; display: flex; flex-direction: column;
  animation: rp-modal-in .2s cubic-bezier(.34,1.4,.64,1);
}
.rp-modal-lg { max-width: 680px; }
@keyframes rp-modal-in { from{opacity:0;transform:scale(.93) translateY(8px)} to{opacity:1;transform:scale(1) translateY(0)} }

/* ── MOBILE: rpDialog rendert als Bottom-Sheet ───────────────────────────────
   Auf Phones (≤640px) wird die Modal-Karte zu einem Sheet, das von unten
   reinrutscht. Inhaltsstruktur bleibt 100% gleich — kein JS-Refactor nötig.
   Body bleibt scrollbar. Sichtbare „Grip-Bar" oben am Sheet als Affordance. */
@media (max-width: 640px) {
  .rp-overlay {
    align-items: flex-end;
    padding: 0;
    animation: rp-overlay-fade-in .22s ease;
  }
  @keyframes rp-overlay-fade-in { from{opacity:0} to{opacity:1} }
  .rp-modal,
  .rp-modal-lg {
    max-width: 100%;
    width: 100%;
    max-height: 92vh;
    border-radius: 18px 18px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    animation: rp-sheet-up .26s cubic-bezier(.34,1.4,.64,1);
    /* Fund 8 Fix: touch-action:pan-y erlaubt vertikales Wischen auf dem Modal.
       JS-Swipe-Down-Polyfills (falls vorhanden) erkennen das als Swipe-Down-Zone.
       Verhindert außerdem ungewolltes horizontales Scrollen beim Wischen. */
    touch-action: pan-y;
  }
  .rp-modal::before {
    content: '';
    position: absolute;
    top: 6px; left: 50%;
    transform: translateX(-50%);
    width: 40px; height: 4px;
    border-radius: 999px;
    background: var(--rp-border);
    pointer-events: none;
  }
  .rp-modal-hdr { padding-top: 18px; }
  @keyframes rp-sheet-up { from{transform:translateY(100%)} to{transform:translateY(0)} }
}

.rp-modal-hdr {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--rp-border);
  flex-shrink: 0;
}
.rp-modal-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; flex-shrink: 0;
}
.rp-modal-title { font-size: 1rem; font-weight: 700; flex: 1; color: var(--rp-text); }
/* Fund 3 Fix: 44×44px direkt in der Basisregel — Modal-Schließen-Button muss
   auf ALLEN Geräten fingertauglich sein, unabhängig vom pointer-Typ.
   WCAG 2.5.5 + iOS HIG: min. 44pt. */
.rp-modal-close {
  width: 44px; height: 44px; border: none; background: transparent;
  color: var(--rp-muted); cursor: pointer; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: .88rem; transition: background .1s, color .1s;
}
.rp-modal-close:hover { background: rgba(200,72,72,.1); color: #c84848; }
/* Screen-Reader-Only: Element ist sichtbar für Assistive Tech aber visuell versteckt.
   Standard-Pattern, kompatibel mit allen ATs. Nicht display:none weil das auch von ATs ignoriert würde. */
.rp-sr-only {
  position: absolute !important;
  width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Modal-Icon-Varianten — funktionieren mit oder ohne geladenes Dialog-Modul.
   Light-Tint-Background + dunklerer Text für Light-Mode.
   Im Dark-Mode (über CSS-Vars) automatisch konsistent. */
.rp-modal-icon-info    { background: color-mix(in srgb,var(--rp-accent,#488078) 15%,transparent);  color: var(--rp-primary, #488078); }
.rp-modal-icon-warn    { background: rgba(217,119,6,.15);   color: #d97706; }
.rp-modal-icon-danger  { background: rgba(220,38,38,.15);   color: #dc2626; }
.rp-modal-icon-success { background: rgba(22,163,74,.15);   color: #16a34a; }
.rp-modal-icon-violet  { background: rgba(124,58,237,.15);  color: #7c3aed; }

/* Suche-Highlight: <mark> um Treffer in Card-Namen, List-Rows. Tönung passt zu Light+Dark.
   Nicht den Browser-Default verwenden weil der gelb-grell ist. */
.rp-mark {
  background: rgba(245,158,11,.32);
  color: inherit;
  padding: 0 2px;
  border-radius: 3px;
  font-weight: 600;
}

/* Offline-Banner — bleibt sticky am unteren Rand bis Verbindung wieder da. */
.rp-offline-banner {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: #d97706;
  color: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 4000;
  box-shadow: 0 4px 16px rgba(217,119,6,.3);
  animation: rp-offline-in .25s ease;
}
@keyframes rp-offline-in { from { opacity:0; transform: translate(-50%, 8px); } to { opacity:1; transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) { .rp-offline-banner { animation: none; } }

/* ── PRINT-CSS ─────────────────────────────────────────────────────────────
   Beim Drucken (z.B. QR-Code-Modal, Berichts-Übersicht) verstecken wir
   alle UI-Chrome (Toolbar, Sidebar, Bulk-Bar, FAB, Modals, Buttons).
   Nur der eigentliche Inhalt wird gedruckt. Schwarze Schrift auf Weiß. */
@media print {
  /* Hintergrund + Farbe normalisieren — sparen Druckertinte */
  body, .rp-root, .rp-content, .rp-body {
    background: #fff !important; color: #000 !important;
  }

  /* Komplette Chrome ausblenden */
  .rp-toolbar,
  .rp-sidebar,
  .rp-resize-handle,
  .rp-content-extra-toolbar,
  .rp-bulk-bar,
  .rp-fab,
  .rp-fab-menu,
  .rp-upload-mgr,
  .rp-overlay,
  .rp-quicklook-overlay,
  .rp-ctx-menu,
  .rp-shortcuts-overlay,
  .rp-undo-toast-stack,
  .rp-card-actions,
  .rp-card-checkbox,
  .rp-modal-close,
  .rp-modal-actions,
  .rp-live-ticker,
  .rpa-header,
  .rpa-card-actions {
    display: none !important;
  }

  /* Modal-Inhalte beim Drucken vollformatig — kein Backdrop, keine Animation */
  .rp-overlay { position: static !important; background: transparent !important; padding: 0 !important; }
  .rp-modal {
    box-shadow: none !important; border: 1px solid #ccc !important;
    max-width: 100% !important; max-height: none !important;
    page-break-inside: avoid;
  }

  /* Cards beim Drucken: keine Schatten/Hover, klare Borders */
  .rp-grid-card, .rpa-card, .rp-list-row {
    box-shadow: none !important;
    border: 1px solid #d0d0d0 !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }
  .rp-card-cover img { max-height: 200px; object-fit: contain !important; }

  /* Skeletons im Druck nie sichtbar (laufende Animation würde Tinte verschwenden) */
  .rp-skel, .rp-skel-card, .rp-skel-row { display: none !important; }

  /* Links: URL hinter Linktext anzeigen (nur wenn nicht-trivial) */
  a[href]:not(.rp-no-print-url):after {
    content: " (" attr(href) ")";
    font-size: 80%;
    color: #555;
  }

  /* Editor / User-Maske: Top-Bar + Footer beim Druck weg, nur Dokument */
  .rpe2-top, .rpe2-fmt-bar, .rpe2-mob-bar,
  .rpum-hdr, .rpum-foot {
    display: none !important;
  }
  .rpe2-doc, .rpum-body {
    box-shadow: none !important;
    background: #fff !important;
  }

  /* Page-Breaks: jede Foto-Reihe auf einer Seite halten */
  .rpe2-row, .rpum-row { page-break-inside: avoid; break-inside: avoid; }
}
.rp-modal-body { flex: 1; overflow-y: auto; padding: 18px; }
.rp-modal-actions {
  display: flex; gap: 8px; padding: 14px 18px;
  border-top: 1px solid var(--rp-border);
  justify-content: flex-end; flex-shrink: 0;
  background: var(--rp-surface-2);
}

/* Form-Felder */
.rp-field { margin-bottom: 14px; }
.rp-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--rp-muted);
  margin-bottom: 4px;
}
.rp-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--rp-border);
  border-radius: 6px;
  background: var(--rp-surface);
  color: var(--rp-text);
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.rp-input:focus {
  border-color: var(--rp-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb,var(--blue,#1B7599) 10%,transparent);
}
.rp-textarea { min-height: 80px; resize: vertical; }
/* Fund 15 Fix: iOS Safari zoomt automatisch rein wenn ein Input-Feld < 16px hat.
   In Bottom-Sheets ist das besonders störend — das Sheet springt beim Fokus aus
   dem Bild. coarse-Override setzt 16px überall, unabhängig vom Viewport. */
@media (pointer: coarse) {
  .rp-input, .rp-textarea, .rp-select { font-size: 16px; }
}
.rp-select {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--rp-border);
  border-radius: 6px;
  background: var(--rp-surface);
  color: var(--rp-text);
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
}
.rp-select:focus { border-color: var(--rp-primary); box-shadow: 0 0 0 3px color-mix(in srgb,var(--blue,#1B7599) 10%,transparent); }

/* ── SUBMIT-FLOW ─────────────────────────────────────────────────────────────── */
/* Checklist im Submit-Modal */
.rp-checklist { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 12px; }
.rp-check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--rp-border);
  background: var(--rp-surface-2);
}
.rp-check-item.ok { border-color: rgba(76,175,80,.3); background: rgba(76,175,80,.06); }
.rp-check-item.warn { border-color: rgba(224,160,64,.35); background: rgba(224,160,64,.07); }
.rp-check-item.fail { border-color: rgba(200,72,72,.3); background: rgba(200,72,72,.06); }
.rp-check-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.rp-check-item.ok .rp-check-icon { color: var(--rp-ok); }
.rp-check-item.warn .rp-check-icon { color: var(--rp-warn); }
.rp-check-item.fail .rp-check-icon { color: var(--rp-danger); }
.rp-check-body { flex: 1; }
.rp-check-title { font-size: 0.85rem; font-weight: 500; }
.rp-check-sub { font-size: 0.75rem; color: var(--rp-muted); margin-top: 1px; }

/* Submit-Bestätigungs-Animation */
.rp-submit-success {
  text-align: center;
  padding: 30px 20px;
}
.rp-submit-checkmark {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: rgba(76,175,80,.12);
  border: 2px solid rgba(76,175,80,.3);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  font-size: 1.8rem;
  color: var(--rp-ok);
  animation: rp-pop-in .4s cubic-bezier(.34,1.56,.64,1);
}
@keyframes rp-pop-in { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.rp-submit-receipt {
  background: var(--rp-surface-2);
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius);
  padding: 10px 14px;
  text-align: left;
  margin: 12px 0;
  font-size: 0.82rem;
}
.rp-submit-receipt-row { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.rp-submit-receipt-key { color: var(--rp-muted); }
.rp-submit-receipt-val { font-weight: 500; font-family: ui-monospace, monospace; font-size: 0.78rem; }

/* Recall-Countdown */
.rp-recall-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(224,160,64,.1);
  border: 1px solid rgba(224,160,64,.3);
  border-radius: 6px;
  margin-top: 8px;
}
.rp-recall-timer {
  font-family: ui-monospace, monospace;
  font-size: 0.88rem;
  font-weight: 600;
  color: #b07a10;
  min-width: 42px;
}
.rp-recall-btn {
  margin-left: auto;
  padding: 3px 10px;
  border: 1px solid rgba(224,160,64,.5);
  border-radius: 20px;
  background: transparent;
  color: #b07a10;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .1s;
}
.rp-recall-btn:hover { background: rgba(224,160,64,.15); }
.rp-recall-btn:disabled { opacity: .4; cursor: default; }

/* ── STATUS-TRACKING für Techniker ──────────────────────────────────────────── */
.rp-status-track {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 8px 0;
}
.rp-status-track-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  position: relative;
}
.rp-status-track-step::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 32px;
  bottom: -8px;
  width: 2px;
  background: var(--rp-border);
}
.rp-status-track-step:last-child::before { display: none; }
.rp-track-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
  border: 2px solid var(--rp-border);
  background: var(--rp-surface);
  color: var(--rp-muted);
  z-index: 1;
}
.rp-track-dot.done { background: var(--rp-ok); border-color: var(--rp-ok); color: #fff; }
.rp-track-dot.active { background: var(--rp-primary); border-color: var(--rp-primary); color: #fff; animation: rp-dot-pulse 1.4s ease-in-out infinite; }
.rp-track-dot.rejected { background: var(--rp-danger); border-color: var(--rp-danger); color: #fff; }
@keyframes rp-dot-pulse {
  0%,100% { box-shadow: 0 0 0 0 color-mix(in srgb,var(--blue,#1B7599) 40%,transparent); }
  50% { box-shadow: 0 0 0 6px color-mix(in srgb,var(--blue,#1B7599) 0%,transparent); }
}
.rp-track-body { flex: 1; padding-top: 4px; }
.rp-track-title { font-size: 0.85rem; font-weight: 500; }
.rp-track-meta { font-size: 0.75rem; color: var(--rp-muted); margin-top: 1px; }

/* ── LABEL-PICKER ────────────────────────────────────────────────────────────── */
.rp-label-picker {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 4px 0;
}
.rp-label-swatch {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .1s, border-color .1s;
  flex-shrink: 0;
}
.rp-label-swatch:hover { transform: scale(1.15); }
.rp-label-swatch.selected { border-color: var(--rp-text); }
/* Fund 13 Fix: Farb-Swatch 24×24px zu klein für Finger-Selektion im Bottom-Sheet.
   36px + 4px margin auf coarse → deutlich bessere Trefferquote. */
@media (pointer: coarse) {
  .rp-label-swatch { width: 36px; height: 36px; margin: 4px; }
}
/* Großer Label-Swatch für Bulk-Picker */
.rp-label-swatch-big {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 8px; cursor: pointer;
  border: 2px solid transparent; transition: all .12s;
  font-size: .83rem; font-weight: 500; color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.rp-label-swatch-big:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0,0,0,.18); border-color: rgba(255,255,255,.4); }

/* ── CONTEXT MENU ────────────────────────────────────────────────────────────── */
.rp-ctx-menu {
  position: fixed;
  background: var(--rp-surface);
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius);
  box-shadow: 0 8px 30px rgba(0,0,0,.14);
  z-index: 3000;
  min-width: 180px;
  padding: 4px;
  animation: rp-fade-in .1s ease;
}
.rp-ctx-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--rp-text);
  transition: background .08s;
}
.rp-ctx-item:hover { background: var(--rp-primary-light); color: var(--rp-primary); }
.rp-ctx-item i { width: 14px; text-align: center; color: var(--rp-muted); flex-shrink: 0; }
.rp-ctx-item:hover i { color: var(--rp-primary); }
.rp-ctx-item.danger:hover { background: rgba(200,72,72,.08); color: var(--rp-danger); }
.rp-ctx-item.danger:hover i { color: var(--rp-danger); }
.rp-ctx-sep { height: 1px; background: var(--rp-border); margin: 3px 8px; }
/* Fund 2 Fix: Kontext-Menü-Items auf Touch-Geräten fingertauglich machen.
   ≥44px Mindesthöhe verhindert Fehlklicks bei Long-Press/Tap auf Mobile. */
@media (pointer: coarse) {
  .rp-ctx-item { min-height: 44px; padding: 12px 14px; }
}

/* ── KEYBOARD SHORTCUT OVERLAY ───────────────────────────────────────────────── */
.rp-shortcuts-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.rp-shortcuts-modal {
  background: var(--rp-surface);
  border-radius: var(--rp-radius-lg);
  padding: 20px 24px;
  max-width: 560px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.rp-shortcuts-title { font-size: 1rem; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.rp-shortcuts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; }
.rp-shortcut-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 0.82rem; }
.rp-shortcut-key { display: flex; gap: 3px; flex-shrink: 0; }
kbd {
  display: inline-block;
  padding: 2px 6px;
  background: var(--rp-surface-2);
  border: 1px solid var(--rp-border);
  border-bottom-width: 2px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-family: ui-monospace, monospace;
  color: var(--rp-text);
  min-width: 22px;
  text-align: center;
}
.rp-shortcut-desc { color: var(--rp-muted); }
/* Fund 6 Fix: Shortcut-Overlay auf ≤640px als Bottom-Sheet — gleiches Pattern
   wie .rp-overlay/.rp-modal. Overlay aligned nach unten, Modal rutscht hoch. */
@media (max-width: 640px) {
  .rp-shortcuts-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .rp-shortcuts-modal {
    max-width: 100%;
    width: 100%;
    max-height: 80vh;
    border-radius: 18px 18px 0 0;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    animation: rp-sheet-up .26s cubic-bezier(.34,1.4,.64,1);
  }
}

/* ── QUICK-LOOK / LIGHTBOX (Pinch+Zoom+Swipe+Keyboard) ───────────────────── */
/* Fund 11 Fix: iOS Safari ignoriert overflow:hidden auf body bei Touch-Events —
   die Hintergrundseite kann noch scrollen. touch-action:none auf body + Overlay
   blockiert Touch-Scroll zuverlässig. position:fixed (bereits gesetzt) fixiert
   außerdem den Scroll-Offset, damit beim Schließen die Position stimmt. */
body.rp-ql-open { overflow: hidden; touch-action: none; }
.rp-quicklook-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 3500;
  display: flex; align-items: center; justify-content: center;
  animation: rp-fade-in .15s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none; /* verhindert iOS-Scroll-Leak durch das Overlay */
}
.rp-ql-stage {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: zoom-in;
  overflow: hidden;
  touch-action: none; /* Pinch+Pan im JS */
}
.rp-quicklook-overlay.zoomed .rp-ql-stage { cursor: grab; }
.rp-quicklook-overlay.zoomed .rp-ql-stage:active { cursor: grabbing; }
.rp-ql-img {
  max-width: 96vw;
  max-height: 92vh;
  display: block;
  transform-origin: center center;
  will-change: transform;
  -webkit-user-drag: none;
  user-drag: none;
  transition: transform .22s cubic-bezier(.2,.8,.2,1);
}
.rp-ql-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  border: none; color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  z-index: 2;
  transition: background .1s, transform .1s;
}
.rp-ql-close:hover { background: rgba(255,255,255,.18); transform: scale(1.06); }
.rp-ql-nav {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(0,0,0,.55); border: none; color: #fff;
  cursor: pointer; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem;
  transition: background .12s, transform .12s, opacity .15s;
  opacity: .6;
}
.rp-ql-nav:hover { background: rgba(255,255,255,.18); opacity: 1; }
.rp-ql-prev { left: 14px; }
.rp-ql-next { right: 14px; }
.rp-quicklook-overlay.zoomed .rp-ql-nav { opacity: .15; pointer-events: none; }
.rp-ql-info {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 14px 22px;
  background: linear-gradient(transparent, rgba(0,0,0,.78));
  color: #fff; font-size: .85rem;
  display: flex; gap: 14px; align-items: center;
  pointer-events: none;
}
.rp-ql-info-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-ql-info-counter { font-variant-numeric: tabular-nums; opacity: .82; flex-shrink: 0; }
.rp-ql-tools {
  position: absolute;
  bottom: 60px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px;
  background: rgba(0,0,0,.5);
  border-radius: 999px; padding: 6px;
  z-index: 2;
  backdrop-filter: blur(8px);
}
/* Fund 12 Fix: Lightbox-Tool-Buttons direkt auf 44×44px — Lightbox ist primär
   ein Mobile-/Touch-Feature. 36px als Basis ist zu klein für Hybridgeräte
   die pointer:fine melden aber physisch per Touch bedient werden. */
.rp-ql-tool {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: transparent; border: none; color: #fff;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
  transition: background .12s;
}
.rp-ql-tool:hover { background: rgba(255,255,255,.18); }
@media (pointer: coarse) {
  /* coarse-Block bleibt für andere Overrides (nav/close); rp-ql-tool ist bereits 44px */
  .rp-ql-nav, .rp-ql-close { width: 48px; height: 48px; }
}
@media (max-width: 600px) {
  .rp-ql-tools { bottom: 80px; }
}
@media (prefers-reduced-motion: reduce) {
  .rp-ql-img { transition: none !important; }
}

/* ── LEER/LOADING STATES (Sprint C: angeglichen an Dashboard-Pattern) ───── */
.rp-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  text-align: center;
  color: var(--rp-muted);
}
.rp-empty-icon { font-size: 36px; opacity: .3; margin-bottom: 12px; }
.rp-empty-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; color: var(--rp-text); }
.rp-empty-sub { font-size: 12.5px; max-width: 320px; line-height: 1.45; }
.rp-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--rp-muted);
  gap: 8px;
  font-size: 13px;
}
.rp-loading i { color: var(--rp-primary); font-size: 14px; }

/* ── NOTIFICATION DOT ────────────────────────────────────────────────────────── */
.rp-notif-dot {
  position: absolute;
  top: -2px; right: -2px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--rp-danger);
  border: 2px solid var(--rp-surface);
}

/* ── LIVE-AKTIVITÄTS-TICKER ──────────────────────────────────────────────────── */
.rp-live-ticker {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: color-mix(in srgb,var(--blue,#1B7599) 7%,transparent);
  border-bottom: 1px solid color-mix(in srgb,var(--blue,#1B7599) 15%,transparent);
  font-size: 0.75rem;
  color: var(--rp-primary);
  min-height: 28px;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rp-live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--rp-primary);
  animation: rp-live-blink 1.4s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes rp-live-blink { 0%,100%{opacity:1;} 50%{opacity:.3;} }

/* ── RESPONSIVE TOOLBAR ─────────────────────────────────────────────────────── */
/* Auf schmalen Bildschirmen werden Buttons mit Text-Label kompakter dargestellt:
   <900px: Label wird ausgeblendet, nur Icon bleibt sichtbar (Tooltip aktiv).
   Reduziert die Toolbar-Last und verhindert flex-wrap-Chaos auf Tablets. */
@media (max-width: 900px) {
  .rp-toolbar .rp-btn-label,
  .rp-content-extra-toolbar .rp-btn-label { display: none; }
  .rp-toolbar .rp-btn,
  .rp-content-extra-toolbar .rp-btn {
    min-width: 40px;
    padding: 8px 10px;
  }
  .rp-toolbar .rp-btn i,
  .rp-content-extra-toolbar .rp-btn i { margin: 0; }
}

/* Touch-Target-Mindestgrößen (Apple 44pt / Material 48dp).
   Verhindert Fehlklicks auf kleinen Schaltflächen. */
@media (pointer: coarse) {
  .rp-btn-icon,
  .rp-modal-close,
  .rp-card-action-btn,
  .rpa-refresh-btn { min-width: 44px; min-height: 44px; }
}

/* ── MOBILE ──────────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .rp-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 500;
    box-shadow: 4px 0 20px rgba(0,0,0,.15);
    transform: translateX(0);
    transition: transform .22s;
    width: 280px !important;
  }
  .rp-sidebar.collapsed {
    transform: translateX(-100%);
    width: 280px !important;
    min-width: 280px !important;
  }
  .rp-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 499;
    display: none;
  }
  .rp-sidebar-backdrop.visible { display: block; }
  .rp-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .rp-list-row { grid-template-columns: 24px 1fr 70px 60px; }
  .rp-list-row > :nth-child(3),
  .rp-list-row > :nth-child(5) { display: none; }
  .rp-gallery { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .rp-upload-mgr {
    width: calc(100vw - 32px);
    /* Alpha-Report ar_6e7b1bbb499e (2026-07-16): Upload-Manager sitzt am Handy jetzt ueber dem FAB.
       Der veraltete Wert (160px) ging noch von FAB-bottom 88px aus — der FAB steht real bei 108px
       (Oberkante 108+56=164px). 180px = 164 + 16px Gap → kein Overlap mehr im Ruhezustand; das
       FAB-Menue (bottom 180px, z-index 1002) liegt bei Bedarf ohnehin darueber. */
    bottom: calc(180px + env(safe-area-inset-bottom, 0px));
  }
  .rp-shortcuts-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .rp-grid { grid-template-columns: repeat(2, 1fr); }
  .rp-gallery { grid-template-columns: repeat(3, 1fr); }
  .rp-stats-row { grid-template-columns: repeat(2, 1fr); }
}

/* ── 2026-05-07 A3+A4: Virtuelle Sub-Folder Cards (orig/LS) ────────────────── */
.rp-card-virtual {
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
  border: 2px dashed color-mix(in srgb,var(--rp-accent,#488078) 20%,transparent);
}
.rp-card-virtual:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,.12);
  border-color: color-mix(in srgb,var(--rp-accent,#488078) 50%,transparent);
}
.rp-card-virtual .rp-card-cover {
  display: flex; align-items: center; justify-content: center;
  min-height: 140px;
}
.rp-card-virtual .rp-card-cover-icon {
  font-size: 3.2rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.18));
}
.rp-card-virtual .rp-card-status {
  position: absolute; top: 10px; right: 10px;
}

/* ── Subfolder-Karte (parent_id != NULL) ───────────────────────────────────
   2026-05-08 EOD User-Wunsch: "die auch als solche markiert sein sollen".
   Optisch dezenter Indent + violetter Akzent + "Unterordner"-Badge oben links. */
.rp-grid-card.rp-card-subfolder {
  border-left: 4px solid #7c3aed;     /* violet-600 */
  background: linear-gradient(90deg, rgba(124,58,237,.04) 0%, transparent 60%);
}
.rp-grid-card.rp-card-subfolder:hover {
  border-left-color: #6d28d9;
}
.rp-card-subfolder-badge {
  /* 2026-05-08 EOD: bottom-left platziert damit es weder Hover-Actions
     (top-left) noch Selection-Checkbox (top-right) überdeckt. */
  position: absolute;
  bottom: 8px; left: 8px;
  background: #7c3aed;
  color: #fff;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  z-index: 2;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
}
.rp-card-subfolder-badge i { font-size: .7rem; }
.rp-grid-card.rp-card-subfolder .rp-card-cover-icon i {
  color: #7c3aed;
}
.rp-list-row.rp-list-row-subfolder {
  background: linear-gradient(90deg, rgba(124,58,237,.05) 0%, transparent 80%);
  border-left: 3px solid #7c3aed;
}

/* ── Drag & Drop (Files in Folders verschieben) ─────────────────────────── */
/* 2026-07-14 Alpha ar_3946a149a012 (Dominic, Android): touch-action:none ENTFERNT —
   es blockierte den Touch-Scroll auf JEDER Foto-Karte (in foto-vollen Ordnern war
   damit fast die ganze Flaeche scroll-tot). Der Fund-16-Kommentar nannte es als
   "Voraussetzung fuer Touch-Drag-Polyfills" — es ist aber NIE ein Polyfill geladen
   worden; HTML5-DnD laeuft auf Touch ohnehin nicht, Mobile verschiebt ueber das
   Langdruck-Menue. Desktop-Maus-DnD braucht kein touch-action. */
.rp-grid-card[draggable="true"] { cursor: grab; }
.rp-grid-card[draggable="true"]:active { cursor: grabbing; }
.rp-grid-card.rp-card-dragging {
  opacity: .45;
  transform: scale(.96);
  transition: opacity .15s, transform .15s;
}
.rp-grid-card.rp-drop-active {
  outline: 3px dashed var(--blue,#1B7599);
  outline-offset: 2px;
  background: linear-gradient(135deg, color-mix(in srgb,var(--blue,#1B7599) 8%,transparent), color-mix(in srgb,var(--blue,#1B7599) 2%,transparent));
  transform: scale(1.02);
  box-shadow: 0 8px 24px color-mix(in srgb,var(--blue,#1B7599) 25%,transparent);
  transition: all .14s;
}
.rp-grid-card.rp-drop-active::after {
  content: '\f0fe';  /* fa-square-plus */
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  color: var(--blue,#1B7599);
  pointer-events: none;
  background: rgba(255,255,255,.7);
  z-index: 5;
}

/* Move-Modal Folder-Liste Hover */
.rp-move-target {
  transition: background .12s;
}
.rp-move-target:hover {
  background: var(--rp-bg-soft, #f1f5f9) !important;
}
.rp-move-target.rp-move-out:hover {
  background: linear-gradient(90deg,#fde68a,#fbbf24) !important;
}

/* ── FAB (Mobile) ────────────────────────────────────────────────────────────── */
/* 2026-05-07 Bugfix v2: Mobile-Nav ist ~72px hoch + safe-area-inset-bottom.
   Der FAB muss DARUEBER liegen, sonst verdeckt die Bottom-Nav ihn.
   z-index 950 — knapp unter mobile-nav (1000) ist kein Problem da
   keine vertikale Ueberlappung. */
.rp-fab {
  position: fixed;
  /* Über der ~88px Mobile-Nav PLUS ~20px Luft, damit der FAB nicht an der Leiste klebt.
     !important, damit kein @media-Block diesen Wert mehr ueberschreibt. */
  bottom: calc(108px + env(safe-area-inset-bottom, 0px)) !important;
  right: 18px;
  width: 56px; height: 56px;
  /* Bewusst ANDERS als der runde, blaue Mobile-Nav-FAB (.mnav-fab): abgerundetes Quadrat
     (Squircle) + warmer Amber-Verlauf → die beiden Buttons sind nicht mehr verwechselbar. */
  border-radius: 18px;
  background: linear-gradient(150deg, #fbbf24 0%, #f59e0b 55%, #ea580c 100%);
  color: #fff;
  border: none;
  box-shadow:
    0 10px 22px -6px rgba(234,88,12,.5),
    0 4px 10px -3px rgba(15,23,42,.2),
    inset 0 1px 0 rgba(255,255,255,.35);
  font-size: 1.3rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  /* Alpha-Report ar_6e7b1bbb499e (2026-07-16): Der Upload-Manager (.rp-upload-mgr, z-index 1000)
     lag ueber dem FAB (vorher 950) + FAB-Menue (951) und blockierte am Handy den Klick / verdeckte
     das Pop-up. FAB + Menue jetzt ueber den Upload-Manager, aber unter Modals (2000)/Offline-Banner (4000). */
  z-index: 1001;
  transition: transform .15s, box-shadow .15s;
}
.rp-fab:active { transform: scale(0.94); }
/* Auf Desktop (kein Mobile-Nav) reicht knapper Abstand */
@media (min-width: 769px) { .rp-fab { bottom: 20px !important; } }
@media (max-width: 768px) { .rp-fab { display: flex; } }

/* FAB-Menu (steht ueber dem FAB — 108px FAB-bottom + 60 FAB-Hoehe + 12px gap = 180,
   damit der unterste Eintrag den FAB nicht mehr ueberdeckt). right auf FAB-Mitte ausgerichtet. */
.rp-fab-menu {
  position: fixed;
  bottom: calc(180px + env(safe-area-inset-bottom, 0px)) !important;
  right: 26px;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  /* ueber dem Upload-Manager (z-index 1000) — s. .rp-fab (Alpha-Report ar_6e7b1bbb499e) */
  z-index: 1002;
}
@media (min-width: 769px) { .rp-fab-menu { bottom: 88px !important; } }
.rp-fab-item {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}
.rp-fab-item-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--rp-surface);
  border: 1px solid var(--rp-border);
  color: var(--rp-primary);
  font-size: 1rem;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s, border-color .12s, transform .12s;
}
/* Hover: voll in Brand-Farbe gefuellt (vorher var(--rp-primary-light) = undefiniert → transparent). */
.rp-fab-item-btn:hover { background: var(--rp-primary); color: #fff; border-color: var(--rp-primary); }
.rp-fab-item-btn:active { transform: scale(.93); }
.rp-fab-item-label {
  background: rgba(0,0,0,.7);
  color: #fff;
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

/* ── SCROLLBAR ───────────────────────────────────────────────────────────────── */
.rp-sidebar-scroll::-webkit-scrollbar,
.rp-content-scroll::-webkit-scrollbar { width: 5px; }
.rp-sidebar-scroll::-webkit-scrollbar-thumb,
.rp-content-scroll::-webkit-scrollbar-thumb {
  background: var(--rp-border);
  border-radius: 3px;
}

/* ═══════════════════════════════════════════════════════════════════
   Sprint 6.4.3 — Mobile-First Patches
   ═══════════════════════════════════════════════════════════════════ */
@media (pointer: coarse) {
  /* Touch-Targets ≥ 44×44px für alle interaktiven Elemente */
  .rp-btn,
  .rp-btn-icon,
  .rp-tree-expand,
  .rp-card-action-btn,
  .rp-modal-close,
  .rpa-refresh-btn,
  .rp-view-btn {
    min-width: 44px;
    min-height: 44px;
    padding: 10px;
  }
  /* Größerer Tap-Bereich für Folder-Cards / Berichte-Cards */
  .rp-folder-card,
  .rp-report-card {
    min-height: 64px;
    padding: 14px;
  }
  /* Scroll-Performance auf Mobile: GPU-Layer */
  .rp-content,
  .rp-folder-grid,
  .rp-report-grid {
    transform: translateZ(0);
  }
  /* Fund 4 Fix (ergänzend): Suchfeld ≥16px auf allen coarse-Pointer-Geräten
     unabhängig vom Viewport — verhindert iOS-Zoom-on-Focus auf iPad Landscape
     und anderen Tablets mit Touch-Primär-Pointer. */
  .rp-toolbar-search input {
    font-size: 16px;
  }
}

/* Mobile-First Layout (Phone < 480px) */
@media (max-width: 480px) {
  .rp-toolbar {
    padding: 8px 12px;
    flex-wrap: wrap;
  }
  .rp-toolbar-title { font-size: 0.95rem; }
  .rp-btn-label { display: none; }   /* nur Icon auf Phone */
  /* 2026-07-16 (User-Feedback): mit verstecktem Label sass das Icon links statt
     mittig (.rp-btn hat default justify-content:flex-start + min-width 44px vom
     Touch-Target) → auf Phone alle rp-btn-Inhalte zentrieren. */
  .rp-btn { justify-content: center; }
  /* 2026-07-16 (User-Feedback Mobile-Toolbar): Suchfeld NICHT mehr als eigene volle
     Zeile (order 99 + flex-basis 100% = eine ganze Zeile verschwendet), sondern es
     teilt sich die letzte Zeile mit den hinteren Buttons (Writer/Calc) — order 98
     ans Zeilenende, flex-grow füllt den Rest der Zeile. (Hochladen/Importieren sind
     mobil komplett ausgeblendet, s. max-width:768px-Block.) */
  .rp-toolbar-search { flex: 1 1 150px; max-width: none; order: 98; margin-top: 6px; }
  /* 2026-07-16: die View-Leiste lief am Phone ~13px über (8 Buttons à 44px > 392px
     Viewport → Leiste ließ sich seitlich schieben). Der Kartengrößen-Button ist am
     Phone funktionslos (Grid fix 2-spaltig via !important) → raus; Rest passt exakt. */
  #rp-size-btn { display: none; }
  .rp-content-extra-toolbar { gap: 4px; }
  .rp-content { padding: 8px; }
  .rp-breadcrumb { font-size: 0.78rem; padding: 6px 12px; }
  /* Modals als Bottom-Sheet auf Phone */
  /* Fund 9 Fix: rp-sheet-slide-up (≤480px) und rp-sheet-up (≤640px) waren
     zwei identische @keyframes-Definitionen → doppelter Blink auf 480-640px-
     Geräten (ältere Androids). Jetzt einheitlich rp-sheet-up. */
  .rp-modal {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    border-radius: 16px 16px 0 0;
    max-width: 100%;
    width: 100%;
    max-height: 90vh;
    margin: 0;
    transform: translateY(0);
    animation: rp-sheet-up 0.22s cubic-bezier(.4,0,.2,1);
  }
}

/* ════════════════════════════════════════════════════════════════════════════
   Sprint 2026-05-06c — MOBILE-FIRST ULTRA-OVERHAUL (User-Direktive)
   "Berichte-Modul muss absolut ausgerichtet sein für mobile use am Smartphone
    und Tablet. Gesamtes UI/UX + Gestenunterstützung muss vollkommen für
    mobile ausgerichtet sein."
   ──────────────────────────────────────────────────────────────────────────── */

/* TOUCH-TARGETS überall ≥44×44px (iOS HIG, Material 48dp) */
@media (pointer:coarse) {
  .rp-btn,
  .rp-btn-icon,
  .rp-card-action-btn,
  .rp-bulk-btn,
  .rp-view-btn,
  .rp-fab,
  .rp-fab-item,
  .rp-tree-item,
  .rp-modal-close,
  .rp-card-checkbox,
  .rp-pending-item-submit { min-width:44px; min-height:44px; }
  .rp-card-action-btn { width:44px; height:44px; font-size:1rem; }
  .rp-card-checkbox { width:32px; height:32px; }  /* etwas kompakter da overlay */
}

/* MOBILE TOOLBAR — kompakt aber klar */
@media (max-width:768px) {
  .rp-toolbar {
    padding: 10px 12px;
    gap: 8px;
    background: var(--rp-surface);
    box-shadow: 0 1px 0 rgba(0,0,0,.06);
    position: sticky; top: 0; z-index: var(--z-toolbar, 100);
  }
  /* 2026-07-16 (User-Feedback): Hochladen- UND Folder-Import-Button mobil raus —
     Hochladen steckt im Plus-Menü (FAB „Datei hochladen"), ZIP-Import ist ein reiner
     Desktop-Admin-Workflow. Desktop behält beide. */
  #rp-upload-btn,
  #rp-folder-import-btn { display: none !important; }
  /* 2026-07-16 (User-Feedback): Status-Filter („Alle/Entwurf/Abgegeben/…") nahm
     gewrappt 2-3 Zeilen ein → EINE Zeile, seitlich wischbar, kompaktere Chips.
     !important nötig: flex-wrap:wrap kommt als Inline-Style aus reports.js. */
  .rp-status-filter-bar {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 4px 10px !important;
  }
  .rp-status-filter-bar::-webkit-scrollbar { display: none; }
  .rp-status-chip {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 4px 10px;
    font-size: .78rem;
  }
  .rp-toolbar-search input {
    padding: 10px 12px 10px 34px;
    font-size: 16px;  /* iOS: verhindert Zoom-on-Focus wenn ≥16px */
    min-height: 44px;
    border-radius: 12px;
  }
  .rp-toolbar-search-icon { font-size:.9rem; left:12px; }
  .rp-content-extra-toolbar {
    padding: 8px 10px !important;
    gap: 6px;
    overflow-x: auto;  /* horizontal-scroll falls zu viele Buttons */
    scrollbar-width: none;
  }
  .rp-content-extra-toolbar::-webkit-scrollbar { display: none; }
  .rp-view-toggle { display: flex; flex-shrink: 0; }
  .rp-view-btn { min-width:40px; padding:8px 10px; font-size:.92rem; }
}

/* GRID-CARDS mobile: feste 2-Spalten + Card-Actions immer sichtbar */
@media (max-width:768px) {
  .rp-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    padding: 10px !important;
  }
  .rp-grid-card {
    border-radius: 14px;
  }
  /* B (User-Wunsch 2026-06): Cover bleibt CLEAN — Inline-Aktionen liegen NICHT mehr
     dauerhaft über dem Vorschaubild. Auf Maus-Geräten kommen sie per Hover (Basis-Regel
     .rp-grid-card:hover), auf Touch per Long-Press-Aktionsmenü (scSwipe → _show*ContextMenu,
     reichhaltiger als die 4 Inline-Buttons). Das frühere opacity:1 !important ist raus. */
  .rp-card-actions {
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.55) 100%);
    padding: 6px 8px;
    border-radius: 0 0 14px 14px;
  }
  /* Aktionsbuttons fingertauglich (44×44) für den eingeblendeten Zustand (Hover/Reveal). */
  .rp-card-action-btn {
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,.92);
    color: #1a2926;
    box-shadow: 0 2px 6px rgba(0,0,0,.18);
  }
  .rp-card-action-btn:active {
    transform: scale(.92);
    background: var(--rp-primary, #488078);
    color: #fff;
  }
  /* Checkbox immer sichtbar wenn etwas ausgewählt ist */
  .rp-grid-card.selected .rp-card-checkbox,
  .rp-bulk-active .rp-card-checkbox { opacity: 1; }
  /* Card-Body kompakter auf Phone */
  .rp-card-body { padding: 8px 10px; }
  .rp-card-name { font-size:.84rem; line-height:1.2; }
  .rp-card-meta { font-size:.7rem; margin-top:3px; }
}

/* 2026-07-10 B1-Audit R2 Fund 10: "Cover clean" gilt auf ALLEN Touch-Geräten — die Regel war
   vorher im @media(max-width:768px)-Block verschachtelt und griff auf Touch-Tablets >768px
   nicht (dort standen Hover-Aktionen ohne Hover). Echte Touch-Geräte: Inline-Aktionen
   ausgeblendet + nicht antippbar (kein Hover); Aktionen kommen per Long-Press-Menü. */
@media (pointer:coarse) {
  .rp-card-actions { opacity: 0 !important; pointer-events: none !important; }
}

/* PHONE (sehr klein) — 1 Spalte für volle Übersicht */
@media (max-width:380px) {
  .rp-grid {
    grid-template-columns: 1fr !important;
  }
  .rp-grid-card { border-radius: 12px; }
}

/* TABLET — 3 Spalten optimal */
@media (min-width:768px) and (max-width:1024px) {
  .rp-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 14px !important;
    padding: 14px !important;
  }
  /* Fund 4 Fix: iPad Landscape (>768px) empfängt den ≤768px-Override nicht.
     font-size < 16px löst auf iOS Safari einen automatischen Zoom-on-Focus aus
     der das Layout verschiebt und den Nutzer desorientiert. Korrektur hier
     explizit für den Tablet-Breakpoint gesetzt. */
  .rp-toolbar-search input {
    font-size: 16px;
  }
}

/* FAB — prominenter auf Mobile (Groesse + Schatten — bottom NUR an EINER Stelle Z.1617) */
@media (max-width:768px) {
  .rp-fab {
    width: 60px;
    height: 60px;
    /* WICHTIG: bottom NICHT hier setzen — der echte Wert kommt aus der Basis-Regel oben
       (108px + safe-area), damit der FAB über der Mobile-Nav schwebt. */
    right: 18px;
    box-shadow:
      0 12px 24px -6px rgba(234,88,12,.5),
      0 4px 10px -3px rgba(15,23,42,.2),
      inset 0 1px 0 rgba(255,255,255,.35);
    z-index: 950;
  }
  .rp-fab i { font-size: 1.5rem; }
  .rp-fab:active { transform: scale(.92); }
}

/* BULK-BAR — floating ÜBER der Mobile-Nav (Dominic 2026-07-17: die Leiste wurde von
   Bottom-Nav + FAB überdeckt — Buttons unerreichbar). Die Mobile-Nav ist ~88px hoch
   (siehe .rp-fab-Kommentar) → Bar schwebt darüber; unten abgerundet (Floating-Look).
   Der orange FAB wird bei aktiver Auswahl zusätzlich per JS ausgeblendet (_updateBulkBar). */
@media (max-width:768px) {
  .rp-bulk-bar {
    position: fixed;
    bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    left: 8px; right: 8px;
    border-radius: 16px;
    padding-bottom: 10px !important;
    box-shadow: 0 8px 28px rgba(0,0,0,.28);
    overflow-x: auto;
    z-index: 951; /* über Mobile-Nav und FAB (950) */
  }
  .rp-bulk-bar::-webkit-scrollbar { display: none; }
  /* Fund 7 Fix: Bulk-Buttons am Daumen-Bereich müssen ≥44px hoch sein —
     5px v-Padding ergab ~24px. Bulk-Bar ist position:fixed unten, prime
     Touch-Bereich. */
  .rp-bulk-btn { flex-shrink: 0; min-height: 44px; padding: 10px 14px; }
}

/* CARDS Tap-Animation — feel-good */
@media (pointer:coarse) {
  .rp-grid-card {
    transition: transform .12s ease, box-shadow .12s ease;
  }
  .rp-grid-card:active {
    transform: scale(.97);
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
  }
}

/* SAFE-AREA-Aware Layout (iPhone-Notch + Home-Indicator) */
@supports (padding: env(safe-area-inset-top)) {
  .rp-toolbar {
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
  }
  .rp-content-scroll {
    scroll-padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}
/* Fund 10 Fix: scroll-padding-bottom ist KEIN Ersatz für echtes padding-bottom —
   es steuert nur Scroll-Snap-Ankerpunkte, nicht den Inhaltsfluss. Ohne tatsächliches
   padding-bottom verschwindet die letzte Card-Reihe unter FAB + Mobile-Nav auf iPhones
   mit Home-Indicator. 88px Mobile-Nav + safe-area + 16px Luft. */
@media (max-width: 768px) {
  @supports (padding: env(safe-area-inset-bottom)) {
    .rp-content-scroll {
      padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px) + 16px);
    }
  }
}

/* PULL-TO-REFRESH-Indikator (von scPullToRefresh injiziert) */
.sc-ptr-indicator {
  background: var(--rp-primary, #488078) !important;
  color: #fff !important;
}

/* Empty-State auf Mobile besser zentriert */
@media (max-width:768px) {
  .rp-empty {
    padding: 40px 20px !important;
  }
  .rp-empty-icon i { font-size: 2.5rem; }
  .rp-empty-title { font-size: 1rem; margin-top: 12px; }
  .rp-empty-sub { font-size: .82rem; margin-top: 6px; }
}

/* GALLERY-Mode: 3-Spalten Mobile, full-bleed */
@media (max-width:768px) {
  .rp-gallery {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 4px !important;
    padding: 4px !important;
  }
  .rp-gallery-item {
    aspect-ratio: 1/1;
    border-radius: 6px;
  }
}

/* LIST-Mode auf Mobile: Card-artig statt Tabelle */
@media (max-width:768px) {
  .rp-list { display: block !important; }
  .rp-list thead { display: none !important; }
  .rp-list-row {
    display: flex !important;
    flex-direction: column;
    background: var(--rp-surface);
    border: 1px solid var(--rp-border);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 8px;
  }
  .rp-list-row td {
    display: block !important;
    padding: 4px 0 !important;
    border: none !important;
  }
}

/* HORIZONTAL-Scroll-Indikator wenn Toolbar überläuft */
.rp-content-extra-toolbar {
  scroll-snap-type: x proximity;
}
.rp-content-extra-toolbar > * {
  scroll-snap-align: start;
}

/* Sprint 2026-05-06c — Lieferschein-Card-Markierung im Folder */
.rp-grid-card.is-delivery {
  border-color: color-mix(in srgb,var(--blue,#1B7599) 25%,transparent);
}
.rp-grid-card.is-delivery .rp-card-cover {
  background: linear-gradient(135deg, color-mix(in srgb,var(--blue,#1B7599) 5%,transparent), color-mix(in srgb,var(--blue,#1B7599) 2%,transparent));
}
