/* ==========================================================
   Design system — modern, minimal, hand-drawn SVG icons only
   (no icon CDN dependency). Font is Geist (Google Fonts) loaded
   via <link> in index.html/angebot.php/packliste.php, with the
   original system-font stack kept as a fallback in --font below.
   ========================================================== */

:root {
  --color-bg: #f5f6fb;
  --color-bg-alt: #edeef7;
  --color-surface: #ffffff;
  --color-surface-2: #fbfbfe;
  --color-border: #e6e8f2;
  --color-border-strong: #d7d9e8;
  --color-text: #14152b;
  --color-text-muted: #676b84;
  --color-text-faint: #9598ae;

  --color-accent: #0071e3;
  --color-accent-hover: #0058b9;
  --color-accent-strong: #004c9e;
  --color-accent-soft: #e8f2fd;
  --color-accent-2: #06b6d4;

  --color-success: #16a34a;
  --color-success-soft: #e6f8ed;
  --color-warning: #d97706;
  --color-warning-soft: #fef3e0;
  --color-danger: #dc2626;
  --color-danger-soft: #fdeaea;
  /* Zwei Einzelfälle, die vorher direkt als Hex-Wert im jeweiligen Selektor
     standen (.stat-icon.tone-violet / .btn-danger:hover) - als Variable
     ausgelagert, damit der Dark-Mode-Block weiter unten sie mit überschreiben
     kann, statt jeden hartkodierten Fund einzeln suchen zu müssen. */
  --color-violet-soft: #dcf7fb;
  --color-danger-soft-strong: #fbd9d9;

  --sidebar-bg: linear-gradient(180deg, #0d1420 0%, #111d33 100%);
  --sidebar-text: #a3b0c9;
  --sidebar-text-active: #ffffff;
  --sidebar-border: rgba(255, 255, 255, 0.07);
  --sidebar-hover: rgba(255, 255, 255, 0.06);
  --sidebar-active: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-2) 130%);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 1px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 10px 28px -6px rgba(15, 23, 42, 0.10), 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 24px 48px -12px rgba(15, 23, 42, 0.18);
  --shadow-glow: 0 0 0 3px var(--color-accent-soft);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-8: 48px;

  --sidebar-width: 252px;
  /* Geist (Google Fonts, siehe <link> in index.html) - Vercels Hausschrift,
     sehr clean/neutral/scharf. Fällt sauber auf die System-Font-Stack
     zurück, falls Google Fonts mal nicht lädt. */
  --font: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
}

/* ==========================================================
   Dark Mode — überschreibt nur die Farb-Tokens von oben, nichts sonst
   (Radien/Spacing/Font bleiben gleich). Wird per data-theme="dark" auf
   <html> aktiviert (siehe js/theme.js + der Inline-Script in index.html,
   das das schon vor dem ersten Render setzt, um ein Aufblitzen im falschen
   Modus zu vermeiden). Die Sidebar bleibt bewusst unverändert - die war
   schon vorher dunkel gestaltet (--sidebar-* oben), unabhängig vom Modus
   des restlichen Contents.
   ========================================================== */
html[data-theme="dark"] {
  --color-bg: #12141c;
  --color-bg-alt: #191c26;
  --color-surface: #1c1f2a;
  --color-surface-2: #20232f;
  --color-border: #2a2e3d;
  --color-border-strong: #363b4f;
  --color-text: #edeef5;
  --color-text-muted: #9297ab;
  --color-text-faint: #6b7086;

  --color-accent: #3b9dff;
  --color-accent-hover: #62b1ff;
  --color-accent-strong: #8cc8ff;
  --color-accent-soft: #1c3a5c;
  --color-accent-2: #22d3ee;

  --color-success: #34d399;
  --color-success-soft: #163829;
  --color-warning: #fbbf24;
  --color-warning-soft: #3a2d12;
  --color-danger: #f87171;
  --color-danger-soft: #3a1f22;
  --color-violet-soft: #163a42;
  --color-danger-soft-strong: #4a2529;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35), 0 1px 1px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 10px 28px -6px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }

/* Safety net: every hand-authored icon SVG (icons.js) has no width/height of
   its own, so without this any icon in a spot that doesn't set an explicit
   size (e.g. inside .btn-ghost) falls back to the browser's default replaced-
   element size and renders oversized/clipped. More specific rules further
   down (.btn svg, .nav-link svg, etc.) still win over this. */
svg { width: 1em; height: 1em; flex-shrink: 0; }

/* Icons are always wrapped as h('span', { html: icon(...) }) - a plain inline
   span. Inline elements reserve baseline/line-height whitespace around their
   content, which visually pushes the icon a few pixels above true center
   inside flex-centered circles/buttons (set-status icons, stat icons,
   avatars, etc.). inline-flex removes that whitespace so every icon centers
   exactly, everywhere, without needing a per-component fix. */
span:has(> svg) { display: inline-flex; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--color-accent-soft); color: var(--color-accent-strong); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-border-strong); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-text-faint); }

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.015em; }
h1 { font-size: 23px; }
h2 { font-size: 16px; }
h3 { font-size: 13.5px; }
p { margin: 0; }

a { color: inherit; text-decoration: none; }

button {
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: none;
  color: inherit;
  margin: 0;
}

/* ---------- App shell ---------- */

#app { min-height: 100%; }

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--sidebar-bg);
  padding: var(--space-5) var(--space-3);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 50;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  color: var(--sidebar-text-active);
  padding: 0 var(--space-2) var(--space-6);
  letter-spacing: -0.01em;
}

.sidebar-brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--sidebar-active);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 14px -2px rgba(0, 113, 227, 0.4);
}
.sidebar-brand-mark svg { width: 17px; height: 17px; color: #fff; }

.sidebar-brand span.dim { color: var(--sidebar-text); font-weight: 500; }

.sidebar-search-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  margin-bottom: var(--space-5);
  background: var(--sidebar-hover);
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}
.sidebar-search-trigger:hover { background: var(--sidebar-active); color: #fff; }
.sidebar-search-trigger svg { width: 14px; height: 14px; flex-shrink: 0; }
.sidebar-search-label { flex: 1; text-align: left; }
.sidebar-search-kbd {
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
}

.nav-group { margin-bottom: var(--space-5); }

.nav-group-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(163, 176, 201, 0.55);
  padding: 0 var(--space-3);
  margin-bottom: var(--space-2);
  font-weight: 700;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 2px;
  transition: background 0.14s ease, color 0.14s ease;
}

.nav-link:hover { background: var(--sidebar-hover); color: var(--sidebar-text-active); }

.nav-link.active {
  background: var(--sidebar-active);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 16px -4px rgba(0, 113, 227, 0.38);
}

.nav-link svg { width: 16px; height: 16px; flex-shrink: 0; }

.sidebar-footer {
  margin-top: auto;
  padding-top: var(--space-3);
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--sidebar-active);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12.5px;
  flex-shrink: 0;
}

.sidebar-user-block { flex: 1; min-width: 0; }
.sidebar-user {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--sidebar-text-active);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: 11px;
  color: var(--sidebar-text);
}

.btn-logout {
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px;
  color: var(--sidebar-text);
  flex-shrink: 0;
  display: flex;
}
.btn-logout:hover { background: var(--sidebar-hover); color: #fff; }
.btn-logout svg { width: 16px; height: 16px; }

.topbar {
  display: none;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar-toggle {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
}
.topbar-toggle svg { width: 18px; height: 18px; }
.sidebar-backdrop { display: none; }

.main {
  padding: var(--space-6) var(--space-8);
  width: 100%;
}

/* Stretches the fixed-viewBox SVG to fill its card (see lineChart() in
   chart.js for why this is a CSS stretch rather than a JS-measured exact
   width: a ResizeObserver-based "build at the real container width"
   approach was tried and ended up silently rendering blank in production,
   for reasons that weren't reproducible enough to track down - this plain
   CSS stretch is what reliably worked before and still does). The
   "chunky on wide screens" look this stretch used to cause is mitigated
   in chart.js instead: a much wider design baseline keeps the stretch
   factor closer to 1x on realistic card widths, and vector-effect=
   "non-scaling-stroke" keeps stroke thickness constant regardless of
   scale. display:block avoids the usual inline-element baseline gap. */
svg.line-chart { width: 100%; height: auto; display: block; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.page-header p { color: var(--color-text-muted); margin-top: 4px; }

/* Wraps multi-button action groups in the header (e.g. "Kalender-Feed" +
   "Neue Buchung") - without this, the actions container was a plain block
   div with no flex/gap, so its buttons rendered flush against each other. */
.page-header-actions { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }

/* Uniform vertical rhythm between top-level page sections (page-header,
   stat grids, cards, card grids, tables, ...). Every page mounts a flat
   list of section elements directly into <main class="main">, so a single
   sibling rule keeps spacing consistent everywhere instead of relying on
   ad hoc inline margins scattered across individual pages. */
.main > * + * { margin-top: var(--space-5); }

@media (max-width: 900px) {
  /* iOS Safari zoomt die GESAMTE Seite automatisch hinein, sobald ein Feld
     mit einer Schriftgröße unter 16px fokussiert wird (eigene Eingabehilfe,
     damit man den getippten Text noch lesen kann) - genau das war die
     Ursache für "manche Seiten werden mobil zu groß eingezoomt": jedes
     Antippen von Suchfeldern/Dropdowns/Textfeldern (.field input, die
     Tabellen-Suche, das Suchfeld in searchSelect-Dropdowns, ...) liegt mit
     13-13.5px deutlich darunter. Der Zoom bleibt dann oft auch nach dem
     Verlassen des Feldes bestehen, wirkt also wie ein allgemeines Layout-
     Problem, obwohl er nur durch das Antippen EINES Feldes ausgelöst wurde.
     !important, weil das hier gezielt und pauschal ALLE Eingabefelder auf
     Mobilgeräten übersteuern soll, unabhängig davon, wie spezifisch deren
     eigene font-size-Regel ist - das visuelle Erscheinungsbild am Desktop
     bleibt davon komplett unberührt (nur diese max-width:900px-Regel ändert
     sich, sonst nichts an den betroffenen Selektoren). */
  input, select, textarea { font-size: 16px !important; }

  /* .main prefix bumps specificity above the unconditional .grid-3/.grid-4
     rule further down the file - without it, that later same-specificity
     rule would win the cascade tie regardless of viewport width and this
     override would silently do nothing. */
  .main .grid-3, .main .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(var(--sidebar-width), 84vw);
    transform: translateX(-100%);
    transition: transform 0.22s ease;
  }
  body.sidebar-open { overflow: hidden; }
  body.sidebar-open .sidebar { transform: translateX(0); box-shadow: var(--shadow-lg); }
  body.sidebar-open .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 15, 35, 0.45);
    z-index: 45;
  }
  .topbar { display: flex; }
  .main { padding: var(--space-4) var(--space-4) var(--space-8); }
}

@media (max-width: 640px) {
  .main .grid-2, .main .grid-3, .main .grid-4 { grid-template-columns: 1fr; }
  .main { padding: var(--space-3) var(--space-3) var(--space-8); }
  .main > * + * { margin-top: var(--space-4); }
  h1 { font-size: 20px; }
  .page-header .btn { width: 100%; justify-content: center; }
  .card { padding: var(--space-4); border-radius: var(--radius-md); }
  .field-row { flex-direction: column; gap: 0; }
  .field-row > .field { width: 100%; }
  .modal-backdrop { padding: var(--space-3); align-items: center; }
  .modal { padding: var(--space-4); max-height: 88vh; overflow-y: auto; }
  .year-pills { flex-wrap: wrap; }
  .login-form-side { padding: var(--space-4); }
}

/* ---------- Cards / layout ---------- */

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  gap: var(--space-3);
  flex-wrap: wrap;
}

.grid { display: grid; gap: var(--space-4); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-4) var(--space-4) var(--space-4);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: transparent;
  color: var(--color-accent);
  border: 1.5px solid var(--color-accent-soft);
}
.stat-icon svg { width: 16px; height: 16px; }
.stat-icon.tone-success { color: var(--color-success); border-color: var(--color-success-soft); }
.stat-icon.tone-warning { color: var(--color-warning); border-color: var(--color-warning-soft); }
.stat-icon.tone-danger { color: var(--color-danger); border-color: var(--color-danger-soft); }
.stat-icon.tone-violet { color: var(--color-accent-2); border-color: var(--color-violet-soft); }

.stat-body { min-width: 0; }
.stat-card .stat-value { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.stat-card .stat-label { color: var(--color-text-muted); font-size: 12.5px; margin-top: 3px; font-weight: 500; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 13px;
  transition: background 0.14s ease, box-shadow 0.14s ease, transform 0.05s ease;
}
.btn svg { width: 15px; height: 15px; }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-2) 130%);
  color: #fff;
  box-shadow: 0 6px 16px -4px rgba(0, 113, 227, 0.32);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--color-accent-hover) 0%, var(--color-accent-2) 130%); box-shadow: 0 8px 20px -4px rgba(0, 113, 227, 0.4); }

.btn-secondary { background: var(--color-surface); border-color: var(--color-border-strong); color: var(--color-text); }
.btn-secondary:hover { background: var(--color-bg); border-color: var(--color-text-faint); }

.btn-danger { background: var(--color-danger-soft); color: var(--color-danger); }
.btn-danger:hover { background: var(--color-danger-soft-strong); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--color-text-muted);
  padding: 7px;
  border-radius: var(--radius-sm);
}
.btn-ghost:hover { background: var(--color-bg-alt); color: var(--color-text); }
.btn-ghost svg { width: 15px; height: 15px; }

.btn-sm { padding: 6px 11px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Forms ---------- */

.field { margin-bottom: var(--space-3); }
.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.field input, .field select, .field textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-family: inherit;
  background: var(--color-surface-2);
  color: var(--color-text);
  transition: border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

/* Without this, browsers render <select> with native OS chrome that ignores
   the `background` above, so selects visibly differed from text inputs/
   textareas even though the CSS rule was identical. A custom chevron
   replaces the native arrow so it still reads clearly as a dropdown. */
.field select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239598ae' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 15px 15px;
}

.field input::placeholder, .field textarea::placeholder { color: var(--color-text-faint); opacity: 1; }

.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  background-color: var(--color-surface);
  box-shadow: var(--shadow-glow);
}

/* Einsatztage darf nie über den tatsächlichen Abholung-Rückgabe-Zeitraum
   hinausgehen (siehe openBookingForm() in bookings.js) - sowohl fürs obere
   Standardfeld als auch pro Artikel-Zeile. Bewusst nicht automatisch
   gekappt/überschrieben, während man tippt, nur visuell markiert, damit die
   Eingabe nicht mitten im Tippen unter der Hand wegspringt. */
input.is-invalid {
  border-color: var(--color-danger) !important;
  background: var(--color-danger-soft) !important;
}
.field-warning {
  display: block;
  margin-top: 5px;
  font-size: 11.5px;
  line-height: 1.3;
  color: var(--color-danger);
  font-weight: 500;
}
.booking-item-days-warning {
  font-size: 10.5px;
  line-height: 1.25;
  color: var(--color-danger);
  font-weight: 500;
  margin-top: 3px;
}

/* Browsers force a white/yellow background on autofilled fields via an
   internal box-shadow that plain `background` can't override - this was
   the cause of the "Nummer" field looking white while the rest of the form
   kept the intended off-white tone. */
.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--color-text);
  -webkit-box-shadow: 0 0 0px 1000px var(--color-surface-2) inset;
  box-shadow: 0 0 0px 1000px var(--color-surface-2) inset;
  transition: background-color 9999s ease-in-out 0s;
}
.field input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0px 1000px var(--color-surface) inset;
  box-shadow: 0 0 0px 1000px var(--color-surface) inset;
}

.field-row { display: flex; gap: var(--space-3); }
.field-row > .field { flex: 1; }

.checkbox-field { display: flex; align-items: center; gap: 8px; margin-bottom: var(--space-3); }
.checkbox-field input { width: auto; accent-color: var(--color-accent); }
.checkbox-field label { margin: 0; font-weight: 500; color: var(--color-text); }

/* ---------- Table ---------- */

table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-faint);
  font-weight: 700;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-border);
}
tbody td {
  padding: 12px var(--space-3);
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.1s ease; }
tbody tr:hover { background: var(--color-bg-alt); }

.table-actions { display: flex; gap: 2px; justify-content: flex-end; }

/* ---------- Data table toolbar / sortable headers / pagination ---------- */

.datatable-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.datatable-search {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}
.datatable-search svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--color-text-faint);
  pointer-events: none;
}
.datatable-search input {
  width: 100%;
  padding: 8px 11px 8px 34px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  background: var(--color-surface-2);
  color: var(--color-text);
  transition: border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}
.datatable-search input:focus {
  outline: none;
  border-color: var(--color-accent);
  background: var(--color-surface);
  box-shadow: var(--shadow-glow);
}

.datatable-count { font-size: 12px; color: var(--color-text-faint); white-space: nowrap; }

th.sortable { cursor: pointer; user-select: none; }
th.sortable .th-inner { display: inline-flex; align-items: center; gap: 4px; }
th.sortable:hover { color: var(--color-text-muted); }
th.sortable .sort-icon {
  display: inline-flex;
  width: 11px;
  height: 11px;
  opacity: 0.35;
  transition: opacity 0.12s ease, transform 0.12s ease;
}
th.sortable .sort-icon svg { width: 11px; height: 11px; }
th.sorted .sort-icon { opacity: 1; color: var(--color-accent); }
th.sorted.sort-desc .sort-icon { transform: rotate(180deg); }

.datatable-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}
.datatable-pagination .pagination-info { font-size: 12.5px; color: var(--color-text-muted); }

@media (max-width: 640px) {
  .datatable-search { max-width: none; }
}

/* ---------- Lead avatar ---------- */

.lead-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  flex-shrink: 0;
}
.lead-avatar.is-empty {
  background: var(--color-bg-alt);
  color: var(--color-text-faint);
  border: 1.5px dashed var(--color-border-strong);
}
.lead-avatar.is-empty svg { width: 15px; height: 15px; }
.lead-avatar.is-rental {
  background: var(--color-warning-soft);
  color: var(--color-warning);
  border: 1.5px solid var(--color-warning);
}
.lead-avatar.is-rental svg { width: 15px; height: 15px; }

/* ---------- Set-status stage icons ---------- */

.set-status { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; }
.set-status-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--color-border-strong);
  background: var(--color-surface);
  color: var(--color-text-faint);
  padding: 0;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease, transform 0.1s ease;
}
.set-status-icon svg { width: 12.5px; height: 12.5px; }
.set-status-icon.done { background: var(--color-accent-soft); border-color: transparent; color: var(--color-accent-strong); cursor: default; }
.set-status.is-finished .set-status-icon.done { background: var(--color-success-soft); color: var(--color-success); }
.set-status-icon.current {
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-2) 130%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 10px -2px rgba(0, 113, 227, 0.4);
  cursor: default;
}
.set-status-icon.pending:hover { border-color: var(--color-accent); color: var(--color-accent); transform: translateY(-1px); }

/* ---------- Donut chart legend (Job Type breakdown) ---------- */

.donut-chart { flex-shrink: 0; }
.donut-legend-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 7px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 12.5px;
}
.donut-legend-row:last-child { border-bottom: none; }

/* ---------- Startseite: Vermietungsblock (rentalBookingsCard) ---------- */

.rental-booking-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--color-border); }
.rental-booking-row:last-child { border-bottom: none; }
.rental-booking-title { font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rental-booking-sub { font-size: 11.5px; color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.rental-booking-dates { font-size: 11.5px; color: var(--color-text-muted); white-space: nowrap; flex-shrink: 0; }
.rental-hint { font-size: 11.5px; color: var(--color-text-muted); margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--color-border); }

/* ---------- Startseite: Tagesbriefing (briefingCard) ---------- */

/* margin-bottom gab es früher, als die Karte allein/direkt in .main stand -
   jetzt steckt sie in einem .grid-2 zusammen mit tomorrowBriefingCard(), der
   Abstand zur nächsten Sektion kommt also schon von der allgemeinen
   .main > * + *-Regel. */
.briefing-card { border-color: var(--color-warning); border-width: 1.5px; height: 100%; box-sizing: border-box; }
.briefing-card.is-upcoming { border-color: var(--color-accent); }
.briefing-card.is-clear { border-color: var(--color-success); border-width: 1.5px; padding: var(--space-4) var(--space-5); display: flex; align-items: center; }
.briefing-clear { display: flex; align-items: center; gap: 12px; }
.briefing-clear-icon { color: var(--color-success); flex-shrink: 0; display: flex; }
.briefing-clear-icon svg { width: 24px; height: 24px; }
.briefing-clear-title { font-weight: 700; font-size: 14px; }
.briefing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-5);
}
.briefing-section-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--color-warning);
  margin-bottom: 8px;
}
.briefing-section-label svg { width: 13px; height: 13px; flex-shrink: 0; }
.briefing-section-count {
  margin-left: auto;
  background: var(--color-warning-soft);
  color: var(--color-warning);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 10.5px;
}
.briefing-row { padding: 7px 8px; border-radius: var(--radius-sm); cursor: pointer; margin: 0 -8px; }
.briefing-row:hover { background: var(--color-bg-alt); }
.briefing-row-title { font-size: 12.5px; font-weight: 600; color: var(--color-text); }
.briefing-row-sub { font-size: 11px; color: var(--color-text-muted); margin-top: 1px; }

@media (max-width: 640px) {
  .briefing-grid { grid-template-columns: 1fr; gap: var(--space-4); }
}
.donut-legend-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.donut-legend-label { flex: 1; font-weight: 600; }
.donut-legend-value { color: var(--color-text-muted); white-space: nowrap; }

/* ---------- Konsolidierung / Backup-Empfehlung (Tapes page) ---------- */

.consolidation-card { margin-bottom: var(--space-4); border-color: var(--color-accent); border-width: 1.5px; }

.consolidation-list { display: flex; flex-direction: column; gap: var(--space-2); }

.consolidation-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px 12px;
  background: var(--color-bg-alt);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}
.consolidation-row-title { font-weight: 600; font-size: 13px; color: var(--color-text); }
.consolidation-row-sub { font-size: 11.5px; color: var(--color-text-muted); margin-top: 2px; }
.consolidation-row-rec {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-accent-strong);
  white-space: nowrap;
}
.consolidation-row-rec svg { width: 14px; height: 14px; }

/* ---------- LTO drive accordion (Tapes page) ---------- */

.drive-card-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  text-align: left;
  padding: 0 0 var(--space-3);
}
.drive-card-toggle-head { min-width: 0; }
.drive-card-toggle-head h2 { margin-bottom: 3px; }
.drive-card-toggle-head .text-muted { font-size: 12px; }
.drive-card-chevron {
  display: inline-flex;
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-alt);
  color: var(--color-text-muted);
  transition: transform 0.16s ease, background 0.14s ease, color 0.14s ease;
}
.drive-card-chevron svg { width: 13px; height: 13px; }
.drive-card-chevron.is-open { transform: rotate(180deg); background: var(--color-accent-soft); color: var(--color-accent-strong); }
.drive-card-toggle:hover .drive-card-chevron { color: var(--color-text); }

.drive-card-body {
  display: none;
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}
.drive-card-body.is-open { display: block; }

/* ---------- Chip button (e.g. copy production number) ---------- */

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--color-accent-soft);
  color: var(--color-accent-strong);
  font-weight: 700;
  font-size: 12px;
  transition: background 0.14s ease, color 0.14s ease;
}
.chip-btn:hover { background: var(--color-accent); color: #fff; }
.chip-btn svg { width: 12px; height: 12px; opacity: 0.7; }

/* Responsive tables: on narrow screens, rows become stacked "cards" with
   the column header shown as a small label above each value. Applied via
   the `.responsive-table` class on the <table> element; each <td> needs a
   matching `data-label` attribute (columns with no header, e.g. actions,
   can omit it). */
@media (max-width: 720px) {
  .card:has(table.responsive-table) { padding: var(--space-3); }
  table.responsive-table thead { display: none; }
  table.responsive-table, table.responsive-table tbody, table.responsive-table tr { display: block; width: 100%; }
  table.responsive-table tr {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-3);
    padding: var(--space-3);
  }
  table.responsive-table tbody tr:last-child { margin-bottom: 0; }
  table.responsive-table tbody tr:hover { background: var(--color-surface); }
  table.responsive-table td {
    display: block;
    border-bottom: 1px solid var(--color-border);
    padding: 9px 0;
  }
  table.responsive-table td:first-child { padding-top: 0; }
  table.responsive-table td:last-child { border-bottom: none; padding-bottom: 0; }
  table.responsive-table td.text-right { text-align: left; }
  table.responsive-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-faint);
    margin-bottom: 5px;
  }
}

/* ---------- Badges / progress ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
}
.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.badge-success { background: var(--color-success-soft); color: var(--color-success); }
.badge-warning { background: var(--color-warning-soft); color: var(--color-warning); }
.badge-danger { background: var(--color-danger-soft); color: var(--color-danger); }
.badge-accent { background: var(--color-accent-soft); color: var(--color-accent-strong); }
.badge-neutral { background: var(--color-bg-alt); color: var(--color-text-muted); }
.badge-rental { background: var(--color-warning-soft); color: var(--color-warning); border: 1px solid var(--color-warning); font-weight: 700; }

/* iOS-artiger An/Aus-Schalter (siehe clients.js statusSwitch()) - ein
   verstecktes Checkbox-Input treibt den Zustand, .switch-slider ist die
   sichtbare Pille. Grün fürs "an" ist hier bewusst kein Bruch mit der
   sonst grün-freien Kanban-/Kalender-Optik (siehe Nutzer-Feedback dort) -
   Status-"Aktiv" nutzt an anderer Stelle (Badges) schon dieselbe Farbe,
   ein Wechsel der Darstellungsform sollte die Bedeutung nicht ändern. */
.switch-row { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.switch { position: relative; display: inline-block; width: 36px; height: 21px; flex-shrink: 0; }
.switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.switch-slider {
  position: absolute;
  inset: 0;
  background: var(--color-border-strong);
  border-radius: 999px;
  transition: background 0.16s ease;
  pointer-events: none;
}
.switch-slider::before {
  content: '';
  position: absolute;
  width: 17px;
  height: 17px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.16s ease;
}
.switch input:checked + .switch-slider { background: var(--color-success); }
.switch input:checked + .switch-slider::before { transform: translateX(15px); }
.switch input:disabled + .switch-slider { opacity: 0.5; cursor: not-allowed; }
.switch-label { font-size: 12.5px; color: var(--color-text-muted); }

.progress-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: var(--color-bg-alt);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-2));
  border-radius: 999px;
  transition: width 0.2s ease;
}
.progress-fill.warning { background: var(--color-warning); }
.progress-fill.danger { background: var(--color-danger); }
.progress-fill.success { background: var(--color-success); }
.progress-fill.neutral { background: var(--color-text-faint); }

/* ---------- Status stepper (Productions) ---------- */

.status-cell { min-width: 180px; }
.status-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: 7px;
}
.status-percent { font-size: 11.5px; font-weight: 700; color: var(--color-text-faint); }

.status-stepper {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-top: 8px;
}
.status-stepper button {
  border: none;
  background: transparent;
  color: var(--color-text-faint);
  width: 22px;
  height: 22px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.12s ease, color 0.12s ease;
}
.status-stepper button:hover:not(:disabled) { background: var(--color-bg-alt); color: var(--color-text); }
.status-stepper button:disabled { opacity: 0.3; cursor: not-allowed; }
.status-stepper button svg { width: 11px; height: 11px; }
.status-stepper-divider { width: 1px; height: 12px; background: var(--color-border); }

/* ---------- Modal ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(14, 15, 30, 0.5);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: var(--space-8) var(--space-4);
  overflow-y: auto;
  z-index: 100;
  animation: fade-in 0.14s ease;
}

.modal {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  padding: var(--space-5);
  animation: modal-in 0.16s ease;
}
/* Wider variant for content that needs side-by-side columns (e.g. the
   Buchungen material catalog + added-items picker) - opt-in via
   openModal({ wide: true }) so every other modal keeps its compact width.
   Sized to fill the main content area (viewport minus the sidebar), not
   just "a bit wider" - the backdrop shifts its centering column over by
   --sidebar-width so the modal lines up with (and fills) the content area
   instead of also spanning under the sidebar. */
.modal-backdrop.is-wide {
  padding-top: var(--space-4);
  padding-bottom: var(--space-4);
  padding-right: var(--space-3);
  /* Exactly the sidebar's width, no extra gap - the modal starts right
     where the content area starts and fills every pixel out to the right
     edge of the viewport (minus the small breathing margin above). */
  padding-left: calc(var(--sidebar-width) + var(--space-3));
}
@media (max-width: 900px) {
  .modal-backdrop.is-wide { padding-left: var(--space-3); }
}
.modal.is-wide { max-width: none; width: 100%; margin: 0; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(0.99); } to { opacity: 1; transform: translateY(0) scale(1); } }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

/* ---------- Toast ---------- */

.toast-container {
  position: fixed;
  bottom: var(--space-5);
  right: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  z-index: 200;
}

.toast {
  background: var(--color-text);
  color: #fff;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.16s ease;
}
.toast.error { background: var(--color-danger); }
.toast.success { background: var(--color-success); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Login ---------- */

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  background: var(--color-surface);
}

.login-hero {
  background: var(--sidebar-bg);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--space-8);
  color: #fff;
  overflow: hidden;
}
.login-hero::before {
  content: '';
  position: absolute;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 113, 227, 0.35), transparent 70%);
  top: -160px;
  right: -160px;
}
.login-hero::after {
  content: '';
  position: absolute;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.25), transparent 70%);
  bottom: -140px;
  left: -100px;
}

.login-hero-brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.login-hero-quote {
  position: relative;
  z-index: 1;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.4;
  max-width: 420px;
}
.login-hero-quote span { color: #67e8f9; }
.login-hero-foot { position: relative; z-index: 1; font-size: 12.5px; color: var(--sidebar-text); }

.login-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
}

.login-card {
  width: 100%;
  max-width: 360px;
}

.login-card h1 { margin-bottom: 4px; }
.login-card p.subtitle { color: var(--color-text-muted); margin-bottom: var(--space-6); }

@media (max-width: 860px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-hero { display: none; }
}

.form-error {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-danger-soft);
  color: var(--color-danger);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12.5px;
  font-weight: 500;
  margin-bottom: var(--space-3);
}
.form-error svg { width: 15px; height: 15px; flex-shrink: 0; }

/* ---------- Misc ---------- */

.text-muted { color: var(--color-text-muted); }
.text-faint { color: var(--color-text-faint); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-nowrap { white-space: nowrap; }

/* ---------- Music / LTO status indicators (Productions table) ---------- */

.music-indicator, .lto-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-faint);
  cursor: help;
}
.music-indicator svg, .lto-indicator svg { width: 15px; height: 15px; }
.lto-indicator.is-on { color: var(--color-success); }

/* ---------- Kunde-Feedback indicators (Buchungen table) ---------- */

.feedback-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
}
.feedback-indicator svg { width: 15px; height: 15px; }
.feedback-indicator.is-confirmed { color: var(--color-success); }
.feedback-indicator.is-note { color: var(--color-accent); }

/* ---------- Custom hover tooltip (data-tooltip="...") -----------
   Native `title` tooltips are slow to appear and unstyled, so anywhere we
   want a reliable, on-brand tooltip (Music/LTO indicators, etc.) we use
   this instead: a small dark bubble with an arrow, positioned above the
   element and shown on hover or keyboard focus. */
[data-tooltip] { position: relative; }
[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-text);
  color: #fff;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.4;
  width: max-content;
  max-width: 240px;
  white-space: normal;
  text-align: left;
  box-shadow: var(--shadow-md);
  z-index: 60;
  pointer-events: none;
}
[data-tooltip]:hover::before,
[data-tooltip]:focus-visible::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--color-text);
  z-index: 60;
  pointer-events: none;
}
[data-tooltip]:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; border-radius: var(--radius-sm); }
.empty-state {
  text-align: center;
  padding: var(--space-8) var(--space-4);
  color: var(--color-text-muted);
}
.empty-state svg { width: 32px; height: 32px; color: var(--color-text-faint); margin-bottom: var(--space-3); }

.spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin: var(--space-6) auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spinner-sm { width: 16px; height: 16px; border-width: 2px; margin: var(--space-3) auto; }

/* ---------- Expandable table rows (dataTable expandable option) ---------- */
.expand-col { width: 32px; }
.expand-chevron { display: inline-flex; color: var(--color-text-faint); transition: transform 0.16s ease; }
.expand-chevron svg { width: 14px; height: 14px; }
.expand-chevron.is-open { transform: rotate(180deg); color: var(--color-accent); }

.is-expandable-row { cursor: pointer; }
.is-expandable-row:hover { background: var(--color-bg-alt); }
.is-expandable-row.is-expanded { background: var(--color-accent-soft); }

.datatable-expanded-row { background: var(--color-surface-2); }
.datatable-expanded-row:hover { background: var(--color-surface-2); }
.datatable-expanded-cell { padding: var(--space-5) var(--space-5) !important; border-top: 1px solid var(--color-border); }

.expand-panel { display: flex; flex-direction: column; gap: var(--space-5); }
.expand-panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-4);
}
.expand-panel-field { min-width: 0; }
.expand-panel-field-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-faint);
  margin-bottom: 3px;
}
.expand-panel-field-value { font-size: 13px; color: var(--color-text); overflow-wrap: break-word; }
.expand-panel-field-value.is-empty { color: var(--color-text-faint); }

.expand-panel-section h3 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: 6px;
}
.expand-panel-section h3 svg { width: 14px; height: 14px; color: var(--color-text-faint); }

.expand-documents-list { display: flex; flex-direction: column; gap: 6px; }
.expand-documents-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  cursor: pointer;
}
.expand-documents-row:hover { border-color: var(--color-accent); }
.expand-documents-row svg { width: 14px; height: 14px; color: var(--color-text-faint); flex-shrink: 0; }
.expand-documents-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.expand-documents-sub { font-size: 11px; color: var(--color-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.expand-todo-list { display: flex; flex-direction: column; gap: 6px; }
.expand-todo-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
}
.expand-todo-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.expand-todo-due { color: var(--color-text-muted); font-size: 11.5px; flex-shrink: 0; }
.expand-todo-due.is-overdue { color: var(--color-danger); font-weight: 600; }
.expand-todo-assignee {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-accent-soft);
  color: var(--color-accent-strong);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.expand-time-list { display: flex; flex-direction: column; gap: 6px; }
.expand-time-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
}
.expand-time-total { font-weight: 700; color: var(--color-text); }

/* Category groups for the read-only Packliste (see itemsSection() in
   bookings.js) - same top-level-category grouping as the editable booking
   form's groupedItemsPanel(), just without any drag/collapse controls here
   since this view is read-only. */
.expand-item-groups { display: flex; flex-direction: column; gap: 14px; }
.expand-item-group-header {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--color-text-faint);
  margin-bottom: 6px;
}
.expand-item-list { display: flex; flex-direction: column; gap: 6px; }
.expand-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
}
.expand-item-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.expand-item-name-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.expand-item-client-note {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 11.5px; font-style: italic;
  color: var(--color-text-muted); white-space: normal;
}
.expand-item-client-note svg { width: 12px; height: 12px; flex-shrink: 0; }
/* Erledigt-Kennzeichnung für Kundenanmerkungen (siehe
   migration_booking_client_notes_resolved.sql) - note text stays visible
   (never deleted), just visually de-emphasized once staff have dealt with
   it, on both the global note (.is-resolved-note on the summary field's
   span) and each per-item note. */
.is-resolved-note { color: var(--color-text-faint); text-decoration: line-through; text-decoration-color: var(--color-border-strong); }
.expand-panel-field-value span.is-empty { color: var(--color-text-faint); }
.expand-item-status { flex-shrink: 0; display: flex; gap: 6px; }

/* Read-only "Inhalt" list for a Physische-Kombination (kit) row here too -
   same content as itemRow()'s kitContents in the booking form, just
   visually attached under the item card instead of its own row. */
.expand-item-block:has(.expand-item-kit-contents) .expand-item-row {
  border-bottom: none;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.expand-item-kit-contents {
  padding: 6px 10px 8px;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-top: none;
  border-bottom-left-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--color-text-faint);
}
.expand-item-kit-contents-label { font-weight: 600; color: var(--color-text-muted); margin-bottom: 2px; }
.expand-item-kit-contents-list { margin: 0; padding-left: 16px; list-style: disc; }
.expand-item-kit-contents-list li { padding: 1px 0; }

.tabs { display: flex; gap: var(--space-2); border-bottom: 1px solid var(--color-border); margin-bottom: var(--space-4); }
.tab {
  padding: var(--space-2) var(--space-3);
  font-weight: 600;
  color: var(--color-text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.12s ease;
}
.tab.active { color: var(--color-accent); border-color: var(--color-accent); }

.year-pills { display: flex; gap: 6px; margin-bottom: var(--space-4); }
.year-pill {
  padding: 7px 15px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 12.5px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  color: var(--color-text-muted);
  transition: all 0.14s ease;
}
.year-pill:hover { border-color: var(--color-accent); color: var(--color-accent); }
.year-pill.active {
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-2) 130%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 14px -4px rgba(0, 113, 227, 0.38);
}

/* ---------- To-Do Kanban board ---------- */

/* Nutzt die verfügbare Bildschirmhöhe statt nur so hoch wie der Inhalt zu
   sein - auf großen Monitoren wirkte das Board davor sehr "abgeschnitten"
   mit viel Leerraum darunter. Der Offset ist eine Annäherung an Header +
   Main-Padding (kein exaktes Messen möglich ohne JS/ResizeObserver, siehe
   chart.js-Kommentar zu warum das hier bewusst vermieden wird); min-height
   statt height, damit der Bereich bei vielen Karten trotzdem mitwächst. */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  align-items: stretch;
  min-height: calc(100vh - 260px);
}
@media (max-width: 900px) {
  .main .kanban-board { grid-template-columns: 1fr; min-height: 0; }
}

.kanban-column {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--kanban-accent, var(--color-border-strong));
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}
.kanban-column-open { --kanban-accent: var(--color-text-faint); }
.kanban-column-progress { --kanban-accent: var(--color-accent); }
.kanban-column-done { --kanban-accent: var(--color-accent-2); }

.kanban-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-2) var(--space-3);
  font-weight: 700;
  font-size: 13.5px;
  color: var(--color-text);
}

.kanban-column-count {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border-strong);
  color: var(--color-text-muted);
  font-size: 11.5px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 999px;
}

/* flex: 1 lässt jede Spalte die volle Board-Höhe ausfüllen (statt am
   kürzesten Inhalt auszurichten) und scrollt bei vielen Karten intern,
   statt die ganze Seite in die Länge zu ziehen. */
.kanban-column-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1;
  min-height: 40px;
  overflow-y: auto;
  padding-right: 2px;
}

.kanban-column-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--color-text-faint);
  font-size: 12.5px;
  padding: var(--space-4) 0;
}

.kanban-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  box-shadow: var(--shadow-sm);
  cursor: grab;
  transition: box-shadow 0.14s ease, transform 0.14s ease, opacity 0.14s ease;
}
.kanban-card:hover { box-shadow: var(--shadow-md); border-color: var(--color-border-strong); }
.kanban-card.is-dragging { opacity: 0.4; }
/* OS-Datei-Drop direkt auf die Karte (siehe todos.js todoCard()) - bewusst
   ein eigener Zustand statt is-dragging wiederzuverwenden: is-dragging
   markiert die *Quelle* eines internen Reorder-Drags (halbtransparent),
   is-file-dragover das *Ziel* eines externen OS-Datei-Drags (Akzent-Rahmen). */
.kanban-card.is-file-dragover { border-color: var(--color-accent); box-shadow: 0 0 0 2px var(--color-accent-soft); }

.kanban-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.kanban-card-delete {
  background: none;
  border: none;
  color: var(--color-text-faint);
  cursor: pointer;
  padding: 2px;
  display: inline-flex;
  border-radius: var(--radius-sm);
  opacity: 0;
  transition: opacity 0.14s ease, color 0.14s ease;
}
.kanban-card:hover .kanban-card-delete { opacity: 1; }
.kanban-card-delete:hover { color: var(--color-danger); }
.kanban-card-delete svg { width: 14px; height: 14px; }

.kanban-card-title {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--color-text);
  margin-bottom: var(--space-2);
  line-height: 1.35;
}

.kanban-card-production {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}
.kanban-card-production svg { width: 12px; height: 12px; flex-shrink: 0; }

.todo-checklist-progress {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}
.todo-checklist-progress svg { width: 12px; height: 12px; }

.todo-checklist-items { display: flex; flex-direction: column; gap: 3px; margin-bottom: var(--space-2); }
.todo-checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 11.5px;
  color: var(--color-text-muted);
  cursor: pointer;
}
.todo-checklist-item input[type="checkbox"] { width: 13px; height: 13px; margin-top: 1px; flex-shrink: 0; accent-color: var(--color-accent); cursor: pointer; }
.todo-checklist-item .is-done { text-decoration: line-through; color: var(--color-text-faint); }

.kanban-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-1);
}

.kanban-card-bottom-left { display: flex; align-items: center; gap: 10px; }

.todo-due {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--color-text-faint);
}
.todo-due svg { width: 12px; height: 12px; }
.todo-due.is-overdue { color: var(--color-danger); font-weight: 600; }

.todo-files-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--color-text-faint);
}
.todo-files-badge svg { width: 12px; height: 12px; }

.todo-assignee {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-accent-soft);
  color: var(--color-accent-strong);
  font-size: 10.5px;
  font-weight: 700;
}

.todo-priority {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}
.todo-priority-dot { width: 6px; height: 6px; border-radius: 50%; }

/* Quick-complete Kreis (Board-Karte + Kalender-Chip) - bewusst dezent
   (leerer Kreis) bis man ihn hovert, damit er die Karte nicht dominiert. */
.kanban-card-check {
  background: none;
  border: 1.5px solid var(--color-border-strong);
  color: transparent;
  cursor: pointer;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  transition: border-color 0.14s ease, background 0.14s ease, color 0.14s ease;
}
.kanban-card-check svg { width: 11px; height: 11px; stroke-width: 3; }
.kanban-card-check:hover { border-color: var(--color-accent); background: var(--color-accent-soft); color: var(--color-accent); }

/* ---- Board/Kalender-Umschalter (Aufgaben) ------------------------- */
.view-toggle {
  display: inline-flex;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
}
.view-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: calc(var(--radius-md) - 3px);
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}
.view-toggle-btn svg { width: 14px; height: 14px; }
.view-toggle-btn:hover { color: var(--color-text); }
.view-toggle-btn.is-active { background: var(--color-surface); color: var(--color-accent-strong); box-shadow: var(--shadow-sm); }

/* ---- Kalenderansicht (Aufgaben) ------------------------------------ */
.cal-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.cal-mode-switch {
  display: inline-flex;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
}
.cal-mode-btn {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: calc(var(--radius-md) - 3px);
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}
.cal-mode-btn:hover { color: var(--color-text); }
.cal-mode-btn.is-active { background: var(--color-surface); color: var(--color-accent-strong); box-shadow: var(--shadow-sm); }

.cal-nav { display: flex; align-items: center; gap: var(--space-2); }
.cal-nav svg { width: 15px; height: 15px; }
.cal-range-label { font-weight: 700; font-size: 14px; color: var(--color-text); margin-left: 6px; min-width: 150px; }

/* Füllt die Höhe genau wie das Board (siehe .kanban-board) - Zellen wirkten
   vorher gedrungen, weil die Grid-Reihen sich nur am Inhalt orientierten. */
.cal-body { display: grid; grid-template-columns: 1fr 240px; gap: var(--space-4); align-items: stretch; min-height: calc(100vh - 340px); }
.cal-body-day { grid-template-columns: 1fr 280px; }

.cal-month, .cal-week, .cal-day-view {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.cal-weekday-row { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--color-border); flex: 0 0 auto; }
.cal-weekday { padding: 9px 0; text-align: center; font-size: 11px; font-weight: 700; color: var(--color-text-faint); text-transform: uppercase; letter-spacing: 0.03em; }

.cal-month-row { display: grid; grid-template-columns: repeat(7, 1fr); flex: 1; }
.cal-month-row + .cal-month-row { border-top: 1px solid var(--color-border); }

.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: 1fr; }

.cal-day {
  border-right: 1px solid var(--color-border);
  padding: 8px 7px;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: background 0.12s ease;
}
.cal-day:last-child { border-right: none; }
.cal-week .cal-day { min-height: 420px; padding: 12px 10px; gap: 6px; }
.cal-day.is-muted { background: var(--color-bg-alt); }
.cal-day.is-muted .cal-day-number { color: var(--color-text-faint); }
.cal-day.is-dragover { background: var(--color-accent-soft); }

.cal-day-head { display: flex; align-items: center; justify-content: space-between; flex: 0 0 auto; }
.cal-day-weekday { font-size: 10.5px; font-weight: 700; color: var(--color-text-faint); text-transform: uppercase; }
.cal-day-number { font-size: 13px; font-weight: 700; color: var(--color-text); }
.cal-day.is-today .cal-day-number {
  background: var(--color-accent);
  color: #fff;
  width: 21px; height: 21px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.cal-day-chips { display: flex; flex-direction: column; gap: 5px; flex: 1; overflow-y: auto; }
.cal-day-empty { color: var(--color-text-faint); font-size: 11px; }
.cal-day-more { font-size: 10.5px; color: var(--color-text-muted); font-weight: 600; padding: 1px 2px; }

/* Gleiche Sprache wie die Kanban-Karte: weiße Fläche, dezenter Rahmen,
   Farbe nur als Akzent (linker Rand) statt vollflächig eingefärbt - genau
   das Feedback ("zu grün, passt nicht zum restlichen Look"). */
.cal-chip {
  --chip-color: var(--color-accent);
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--chip-color);
  border-radius: 8px;
  padding: 10px 9px;
  min-height: 44px;
  box-sizing: border-box;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
  cursor: grab;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.14s ease, border-color 0.14s ease, opacity 0.14s ease;
}
.cal-chip:hover { box-shadow: var(--shadow-md); border-color: var(--color-border-strong); border-left-color: var(--chip-color); }
.cal-chip.is-dragging { opacity: 0.4; }

/* Monatsansicht: bewusst wieder kompakt (siehe Feedback) - hier geht es um
   die Übersicht über viele Tage, nicht ums präzise Greifen einzelner
   Chips wie in Wochen-/Tagesansicht oder der "Ohne Datum"-Ablage. */
.cal-chip.is-sm { gap: 5px; padding: 4px 6px; min-height: 0; border-left-width: 3px; font-size: 11px; }
.cal-chip.is-sm .cal-chip-check { width: 14px; height: 14px; }
.cal-chip.is-sm .cal-chip-check svg { width: 8px; height: 8px; }
.cal-chip-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.cal-chip-check {
  background: none;
  border: 1.5px solid var(--color-border-strong);
  color: transparent;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease, color 0.14s ease;
}
.cal-chip-check svg { width: 11px; height: 11px; stroke-width: 3.5; }
.cal-chip-check:hover { border-color: var(--color-accent); background: var(--color-accent-soft); color: var(--color-accent); }

.cal-day-view { padding: var(--space-4); flex: 1; }
.cal-day-list { display: flex; flex-direction: column; gap: var(--space-2); flex: 1; min-height: 120px; border-radius: var(--radius-md); transition: background 0.12s ease; }
.cal-day-list.is-dragover { background: var(--color-accent-soft); }
.cal-day-empty-state { text-align: center; color: var(--color-text-faint); font-size: 12.5px; padding: var(--space-6) 0; }

.cal-unscheduled {
  background: var(--color-bg-alt);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
}
.cal-unscheduled-header { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 13px; margin-bottom: 6px; flex: 0 0 auto; }
.cal-unscheduled-list { display: flex; flex-direction: column; gap: 6px; flex: 1; min-height: 60px; border-radius: var(--radius-md); transition: background 0.12s ease; overflow-y: auto; }
.cal-unscheduled-list.is-dragover { background: var(--color-accent-soft); }

@media (max-width: 900px) {
  .cal-body, .cal-body-day { grid-template-columns: 1fr; min-height: 0; }
  .cal-week { grid-template-columns: repeat(7, minmax(130px, 1fr)); overflow-x: auto; }
}

.todo-checklist-editor { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-2); }
.todo-checklist-row { display: flex; align-items: center; gap: var(--space-2); }
.todo-checklist-row input[type="text"] { flex: 1; }
.todo-checklist-row input[type="checkbox"] { width: 16px; height: 16px; flex-shrink: 0; accent-color: var(--color-accent); }

/* ---------- Arbeitszeit (time tracking) ---------- */

.timer-card.is-running { border-color: var(--color-accent); box-shadow: var(--shadow-glow), var(--shadow-sm); }
.timer-elapsed {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--color-accent-strong);
}
.field-checkbox input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--color-accent); }

/* ---------- Vermietung: Verfügbarkeitskalender ---------- */

.avail-months {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
}

.avail-month-title { font-weight: 700; font-size: 13px; margin-bottom: 8px; }

.avail-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin-bottom: 3px;
}
.avail-weekdays span { text-align: center; font-size: 10px; color: var(--color-text-faint); font-weight: 600; }

.avail-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-bottom: 3px; }

.avail-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 600;
  cursor: default;
}
.avail-day.is-empty { visibility: hidden; }

.avail-booking-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-3);
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 12px;
}
.avail-booking-row:last-child { border-bottom: none; }

/* ---------- Vermietung: Buchungspositionen (Packliste) ---------- */

.booking-items-list {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  max-height: 58vh;
  overflow-y: auto;
}
/* Fixed shared column template - header and every item row (saved or not)
   use this exact grid, emitting an empty cell where a column doesn't apply
   (e.g. Gepackt/Raus/Zurück for a not-yet-saved item), so all 9 columns
   always line up regardless of which cells a given row actually fills in. */
.booking-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 50px 40px 68px 76px 56px 50px 50px 30px;
  align-items: center;
  gap: var(--space-2);
  padding: 9px 12px;
  /* No border here anymore - see .booking-item-block below, which now owns
     it so the border sits correctly whether or not this row has a
     kit-contents block underneath it. */
}
.booking-item-row input[type="number"] { width: 100%; padding: 5px 6px; font-size: 12px; text-align: center; }
.booking-item-row input[type="checkbox"] { cursor: pointer; }
/* margin:0 auto on the checkbox alone wasn't reliably centering it under
   the "Gepackt" header - flex-centering the whole cell instead guarantees
   it regardless of the checkbox's own intrinsic/rendered size. */
.booking-item-packed-cell { display: flex; align-items: center; justify-content: center; }
.booking-item-name { display: flex; align-items: center; gap: 5px; min-width: 0; font-weight: 600; font-size: 12.5px; }
.booking-item-name-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.booking-item-group-price { text-align: right; font-size: 12px; font-weight: 600; }
.booking-item-row > div:last-child { text-align: center; }

/* Drag&Drop-Sortierung (Positionen innerhalb einer Gruppe, siehe
   groupedItemsPanel()/itemRow() in bookings.js). Border moves onto the
   wrapper block itself (owns both the row and any kit-contents beneath it)
   instead of living on the row/kit-contents individually, so it stays
   correct regardless of which of the two happens to be visually last. */
.booking-item-block {
  border-bottom: 1px solid var(--color-border);
  cursor: grab;
}
.booking-item-block:active { cursor: grabbing; }
.booking-item-block:last-child { border-bottom: none; }
.booking-item-block.is-dragging { opacity: 0.4; }
.booking-item-grip {
  flex-shrink: 0;
  display: inline-flex;
  color: var(--color-text-faint);
}
.booking-item-grip svg { width: 13px; height: 13px; }

.booking-item-row.is-header {
  background: var(--color-bg-alt);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-faint);
  padding: 7px 12px;
  text-align: center;
}
.booking-item-row.is-header > div:first-child { text-align: left; }
/* All other header cells (Menge/Tage/Preis/Stk/Gruppe/Gepackt/Raus/Zurück)
   stay centered above their column via the inherited text-align: center
   above - including "Gruppe", even though its data cells below are
   right-aligned (.booking-item-group-price) to line up with the €
   amounts. A dedicated right-align override used to sit here for that
   column, but it made the header visibly hug the right edge instead of
   sitting centered over the column like every other header label. */

/* Read-only "Inhalt" reference list for a Physische-Kombination (kit) line -
   see itemRow() in bookings.js. Sits directly under the kit's own row,
   inside the same .booking-item-block, which owns the border between
   consecutive lines (see above). */
.booking-item-kit-contents {
  padding: 0 12px 9px 12px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--color-text-faint);
}
.booking-item-kit-contents-label { font-weight: 600; color: var(--color-text-muted); margin-bottom: 2px; }
.booking-item-kit-contents-list { margin: 0; padding-left: 16px; list-style: disc; }
.booking-item-kit-contents-list li { padding: 1px 0; }

.booking-items-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-top: 2px solid var(--color-border-strong);
  background: var(--color-bg-alt);
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
}

/* Zwischensumme / Versicherung / Rabatt / Gesamtpreis stack beneath the
   line items - only the final Gesamtpreis row is emphasized like the old
   single-row .booking-items-total was. */
.booking-items-totals {
  display: flex;
  flex-direction: column;
  border-top: 2px solid var(--color-border-strong);
  background: var(--color-bg-alt);
}
.booking-items-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  font-size: 13px;
  color: var(--color-text-faint);
}
.booking-items-total-row.is-grand {
  font-weight: 700;
  color: var(--color-text);
  font-size: 14px;
  border-top: 1px solid var(--color-border);
  padding-top: 10px;
}
.booking-items-total-row.is-discount input {
  width: 56px;
  text-align: right;
  margin: 0 4px;
  display: inline-block;
}

/* Booking form's material picker: left = full catalog browsable by
   category, right = this booking's added items, same category grouping on
   both sides (see materialCatalogPanel()/groupedItemsPanel() in bookings.js). */
.booking-material-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
@media (max-width: 900px) {
  .booking-material-layout { grid-template-columns: 1fr; }
}

.material-panel { display: flex; flex-direction: column; min-width: 0; }
.material-panel h3 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.material-panel-count { color: var(--color-text-faint); font-weight: 500; }
.material-panel-collapse-links {
  margin-left: auto;
  display: flex;
  gap: 10px;
  font-size: 11px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
}
.material-panel-collapse-link { color: var(--color-text-faint); text-decoration: none; cursor: pointer; }
.material-panel-collapse-link:hover { color: var(--color-text); text-decoration: underline; }

.material-catalog {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  max-height: 58vh;
  overflow: hidden;
}
.material-catalog-search { position: relative; padding: 8px; border-bottom: 1px solid var(--color-border); flex-shrink: 0; }
.material-catalog-search svg {
  position: absolute; left: 20px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; color: var(--color-text-faint); pointer-events: none;
}
.material-catalog-search input {
  width: 100%;
  padding: 8px 10px 8px 32px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface-2);
  font-size: 13px;
  font-family: inherit;
  color: var(--color-text);
}
.material-catalog-list { flex: 1; overflow-y: auto; padding: 4px; }

.material-catalog-group summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 9px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
}
.material-catalog-group summary::-webkit-details-marker { display: none; }
.material-catalog-group summary:hover { background: var(--color-bg-alt); }
.material-catalog-count { font-weight: 600; color: var(--color-text-faint); text-transform: none; letter-spacing: normal; }

.material-catalog-items { padding-left: 6px; }
.material-catalog-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-family: inherit;
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
}
.material-catalog-item:hover { background: var(--color-accent-soft); color: var(--color-accent-strong); }
.material-catalog-item svg { width: 13px; height: 13px; flex-shrink: 0; color: var(--color-text-faint); }
.material-catalog-item:hover svg { color: var(--color-accent-strong); }

.booking-items-groups { display: flex; flex-direction: column; }
/* Drag&Drop-Sortierung ganzer Gruppen (siehe groupedItemsPanel() in
   bookings.js) - draggable lives on .booking-items-group itself (dragstart
   only actually starts if the gesture began inside the header, see there),
   dragged via the header's grip handle. */
.booking-items-group.is-dragging { opacity: 0.4; }
.booking-items-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
  cursor: grab;
}
.booking-items-group-header:active { cursor: grabbing; }
.booking-items-group-grip {
  display: inline-flex;
  vertical-align: middle;
  margin-right: 6px;
  color: var(--color-text-faint);
}
.booking-items-group-grip svg { width: 13px; height: 13px; }
.booking-items-group-meta { display: flex; align-items: center; gap: 10px; }
.booking-items-group-count { font-weight: 600; color: var(--color-text-faint); text-transform: none; letter-spacing: normal; }
.booking-items-group-subtotal { font-weight: 700; color: var(--color-text); text-transform: none; letter-spacing: normal; }

/* Auf-/zuklappbar (siehe groupedItemsPanel() in bookings.js) - the chevron
   rotates to point right while collapsed, .booking-items-group-body itself
   is simply hidden (still in the DOM, so drag&drop item-order reads via
   readDomOrder() keep working even for a currently-collapsed group). */
.booking-items-group-toggle {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-right: 4px;
  padding: 0;
  border: none;
  background: none;
  color: var(--color-text-faint);
  cursor: pointer;
}
.booking-items-group-toggle svg { width: 14px; height: 14px; transition: transform 0.15s; }
.booking-items-group-toggle:hover { color: var(--color-text); }
.booking-items-group.is-collapsed .booking-items-group-toggle svg { transform: rotate(-90deg); }
.booking-items-group.is-collapsed .booking-items-group-body { display: none; }

/* ---------- searchSelect: searchable dropdown (replaces plain <select> for
   long option lists - Kunden, Agenturen, Produktionen, Ausrüstung) ---------- */

.searchselect { position: relative; display: block; width: 100%; }

.searchselect-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface-2);
  color: var(--color-text);
  font-size: 13.5px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}
.searchselect-trigger:hover { border-color: var(--color-text-faint); }
.searchselect-trigger:focus-visible,
.searchselect.is-open .searchselect-trigger {
  outline: none;
  border-color: var(--color-accent);
  background-color: var(--color-surface);
  box-shadow: var(--shadow-glow);
}

.searchselect-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.searchselect-label.is-placeholder { color: var(--color-text-faint); }
.searchselect-chevron { flex-shrink: 0; color: var(--color-text-faint); display: inline-flex; }
.searchselect-chevron svg { width: 14px; height: 14px; }

.searchselect-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  /* Labels can now be longer than the trigger itself (e.g. "Nummer · Kunde ·
     Titel" - see productionOptionLabel() in todos.js/bookings.js/etc.) and
     wrap onto multiple lines instead of being cut off with an ellipsis, so
     the panel needs a floor wider than a cramped half-width field-row. */
  min-width: 280px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 150;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.searchselect-search {
  position: relative;
  padding: 8px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
.searchselect-search svg {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--color-text-faint);
  pointer-events: none;
}
/* The panel (and this input) can end up nested inside a .field wrapper
   wherever searchSelect() is used in a form - the generic ".field input"
   rules (incl. the :focus variant, which wins on specificity since it adds
   a pseudo-class) would otherwise leak their own border/background/box-shadow
   in here too. !important pins down exactly the look this component wants,
   deliberately and narrowly, not as a general habit. */
.searchselect-search input,
.searchselect-search input:focus {
  width: 100%;
  padding: 8px 10px 8px 32px !important;
  border: 1px solid var(--color-border-strong) !important;
  border-radius: var(--radius-sm) !important;
  background: var(--color-surface-2) !important;
  font-size: 13px;
  font-family: inherit;
  color: var(--color-text);
  outline: none !important;
  box-shadow: none !important;
  transition: border-color 0.14s ease, background 0.14s ease;
}
.searchselect-search input:focus {
  border-color: var(--color-accent) !important;
  background: var(--color-surface) !important;
}

.searchselect-list { max-height: 240px; overflow-y: auto; padding: 4px; }

.searchselect-group {
  padding: 6px 9px 3px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-faint);
}

.searchselect-option {
  padding: 8px 9px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.35;
  cursor: pointer;
  white-space: normal;
  overflow-wrap: break-word;
}
.searchselect-option:hover { background: var(--color-bg-alt); }
.searchselect-option.is-selected { background: var(--color-accent-soft); color: var(--color-accent-strong); font-weight: 600; }

.searchselect-empty { padding: var(--space-4); text-align: center; font-size: 12.5px; color: var(--color-text-faint); }

/* ---------- Multi-select (checkbox dropdown) ---------- */
/* Same trigger/panel shell as .searchselect, but sized to sit inline next to
   a button in a page-header row instead of stretching full-width, and with
   checkbox rows that stay open across multiple picks instead of closing
   after each selection like a single-value dropdown would. */
.multiselect { width: auto; min-width: 200px; }
.multiselect-trigger { min-width: 200px; }
.multiselect-panel { left: 0; right: auto; min-width: 230px; }

.multiselect-list { max-height: 260px; padding: 6px; }

.multiselect-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
}
.multiselect-option:hover { background: var(--color-bg-alt); }
.multiselect-option.is-selected { background: var(--color-accent-soft); color: var(--color-accent-strong); font-weight: 600; }
.multiselect-option input[type="checkbox"] {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--color-accent);
  cursor: pointer;
}
.multiselect-option span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.multiselect-clear {
  flex-shrink: 0;
  width: 100%;
  padding: 9px;
  border: none;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}
.multiselect-clear:hover { background: var(--color-bg-alt); color: var(--color-text); }
.multiselect-clear.is-hidden { display: none; }

/* ==========================================================
   Inventur (pages/inventory.js) - Kategorie-Auswahl/Verlauf auf der
   Landing-Seite, der Schritt-für-Schritt-Zählbildschirm mit der
   Swipe-Leiste, und der Abweichungs-Bericht am Ende.
   ========================================================== */

.inventory-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 6px 18px;
}
.inventory-category-grid .field-checkbox { white-space: nowrap; }
.inventory-category-all {
  grid-column: 1 / -1;
  font-weight: 700;
  padding-bottom: 8px;
  margin-bottom: 4px;
  border-bottom: 1px dashed var(--color-border);
}
.inventory-category-count { color: var(--color-text-faint); font-size: 11px; }

.inventory-session-list { display: flex; flex-direction: column; gap: 10px; }
.inventory-session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.inventory-session-info { min-width: 0; flex: 1; }
.inventory-session-cats { font-weight: 700; font-size: 13.5px; }
.inventory-session-meta { font-size: 12px; color: var(--color-text-muted); margin-top: 2px; }
.inventory-session-progress {
  height: 5px;
  background: var(--color-bg-alt);
  border-radius: 999px;
  margin-top: 8px;
  max-width: 240px;
  overflow: hidden;
}
.inventory-session-progress-bar {
  height: 100%;
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-2) 130%);
  border-radius: 999px;
}
.inventory-session-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* Zählbildschirm - bewusst schmal+zentriert (statt volle Breite), damit es
   sich auf dem Handy (Haupt-Einsatzort, siehe Kommentar in inventory.js)
   wie eine native Vollbild-Karte anfühlt und auf dem Desktop nicht sinnlos
   auseinandergezogen wird. */
.inventory-count-card {
  max-width: 440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.inventory-count-top { display: flex; align-items: center; justify-content: space-between; }
.inventory-count-progress-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-faint);
  font-variant-numeric: tabular-nums;
}
.inventory-count-progress-bar-track {
  height: 4px;
  background: var(--color-bg-alt);
  border-radius: 999px;
  overflow: hidden;
  margin-top: -8px;
}
.inventory-count-progress-bar-fill {
  height: 100%;
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-2) 130%);
  transition: width 0.25s ease;
}
.inventory-count-item-header { display: flex; align-items: center; gap: 8px; min-height: 22px; }
.inventory-count-mismatch { display: none; }
.inventory-count-item-name { font-size: 20px; line-height: 1.3; margin: 0; }
.inventory-count-soll { font-size: 12.5px; color: var(--color-text-muted); font-weight: 500; margin-top: -10px; }
.inventory-count-actions { display: flex; gap: 8px; margin-top: 4px; }
.inventory-count-actions .btn { flex: 1; justify-content: center; }
.inventory-count-next svg { width: 14px; height: 14px; }

/* Swipe-Leiste zum Zählen: großes Zahlendisplay, horizontale Skala mit
   Snap-Punkten (ein Tick pro Stück, jeder 5. beschriftet), fester
   Akzent-Strich in der Mitte als Zeiger. Touch/Trackpad nutzt natives
   Scrollen (kein JS-Handling nötig); auf dem Desktop kann zusätzlich mit
   der Maus gezogen werden (siehe quantitySlider() in inventory.js). */
.inventory-qty-slider { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 6px 0 2px; }
.inventory-qty-display { display: flex; align-items: baseline; gap: 6px; }
.inventory-qty-number {
  font-size: 50px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.inventory-qty-unit { font-size: 15px; color: var(--color-text-faint); font-weight: 600; }
.inventory-qty-track-wrap { position: relative; width: 100%; }
.inventory-qty-center-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-accent);
  border-radius: 2px;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 1;
}
.inventory-qty-track {
  display: flex;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  touch-action: pan-x;
  user-select: none;
  cursor: grab;
}
.inventory-qty-track::-webkit-scrollbar { display: none; }
.inventory-qty-track:active { cursor: grabbing; }
.inventory-qty-tick {
  flex-shrink: 0;
  width: 32px;
  height: 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  scroll-snap-align: center;
  cursor: pointer;
}
.inventory-qty-tick-mark { width: 2px; height: 12px; background: var(--color-border-strong); border-radius: 1px; }
.inventory-qty-tick.is-major .inventory-qty-tick-mark { height: 22px; background: var(--color-text-faint); }
.inventory-qty-tick-label {
  font-size: 10.5px;
  margin-top: 5px;
  color: var(--color-text-faint);
  font-variant-numeric: tabular-nums;
}
.inventory-qty-controls { display: flex; align-items: center; gap: 10px; }
.inventory-qty-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--color-text);
  line-height: 1;
}
.inventory-qty-btn:active { background: var(--color-bg-alt); }
.inventory-qty-input {
  width: 64px;
  text-align: center;
  padding: 8px 4px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Bericht */
.inventory-report-list { display: flex; flex-direction: column; }
.inventory-report-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
}
.inventory-report-row:last-child { border-bottom: none; }
.inventory-report-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; font-weight: 600; font-size: 13px; }
.inventory-report-cat { font-size: 11px; font-weight: 500; color: var(--color-text-faint); letter-spacing: 0.02em; }
.inventory-report-values {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.inventory-report-arrow { color: var(--color-text-faint); }
.inventory-report-diff { font-weight: 700; padding: 2px 7px; border-radius: 999px; font-size: 11.5px; }
.inventory-report-diff.is-plus { background: var(--color-success-soft); color: var(--color-success); }
.inventory-report-diff.is-minus { background: var(--color-danger-soft); color: var(--color-danger); }
.inventory-report-actions { display: flex; gap: 10px; flex-wrap: wrap; }

@media (max-width: 640px) {
  .inventory-report-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .inventory-report-actions .btn, .inventory-report-actions .btn-ghost { flex: 1; justify-content: center; }
  .inventory-count-item-name { font-size: 18px; }
  .inventory-qty-number { font-size: 44px; }
}

/* ---------- Globale Suche (Cmd/Strg+K, quicksearch.js) ---------- */

.quicksearch-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 18, 32, 0.5);
  backdrop-filter: blur(2px);
  z-index: 200;
  display: flex;
  justify-content: center;
  padding: 12vh var(--space-4) var(--space-4);
}
.quicksearch-palette {
  width: 100%;
  max-width: 620px;
  max-height: 70vh;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.quicksearch-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: var(--space-4);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-faint);
}
.quicksearch-input-row svg { width: 17px; height: 17px; flex-shrink: 0; }
.quicksearch-input {
  flex: 1;
  border: none;
  outline: none;
  background: none;
  font-size: 15px;
  color: var(--color-text);
}
.quicksearch-results { flex: 1; overflow-y: auto; padding: var(--space-2); }
.quicksearch-empty { padding: var(--space-5); text-align: center; color: var(--color-text-faint); font-size: 13px; }
.quicksearch-group { margin-bottom: 4px; }
.quicksearch-group-label {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--color-text-faint);
}
.quicksearch-group-label svg { width: 12px; height: 12px; }
.quicksearch-row {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.quicksearch-row.is-active { background: var(--color-accent-soft); }
.quicksearch-row-title { font-size: 13.5px; font-weight: 600; color: var(--color-text); }
.quicksearch-row-sub { font-size: 11.5px; color: var(--color-text-muted); margin-top: 1px; }
.quicksearch-hint {
  display: flex;
  gap: var(--space-4);
  padding: 9px var(--space-4);
  border-top: 1px solid var(--color-border);
  font-size: 11px;
  color: var(--color-text-faint);
}
.quicksearch-hint kbd {
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--color-bg-alt);
  margin-right: 3px;
}
body.quicksearch-open { overflow: hidden; }

@media (max-width: 640px) {
  .quicksearch-backdrop { padding-top: 8vh; }
  .quicksearch-hint span:not(:first-child) { display: none; }
}

/* ---------- Dokumente (documents.js) ---------- */

.documents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-4);
}
.documents-box {
  background: var(--color-surface);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.documents-box.is-dragover { border-color: var(--color-accent); background: var(--color-accent-soft); }
.documents-box.is-uploading { border-color: var(--color-accent); }
.documents-box-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: var(--space-3); }
.documents-box-number { font-size: 11px; font-weight: 700; color: var(--color-text-faint); letter-spacing: 0.02em; }
.documents-box-title { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.documents-box-client { font-size: 12px; color: var(--color-text-muted); margin-top: 1px; }
.documents-box-count {
  flex-shrink: 0;
  background: var(--color-bg-alt);
  color: var(--color-text-muted);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 700;
}
.documents-dropzone-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: var(--space-4) var(--space-3);
  margin-bottom: var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--color-bg-alt);
  color: var(--color-text-faint);
  font-size: 12px;
  text-align: center;
}
.documents-dropzone-hint svg { width: 14px; height: 14px; }
.documents-box.is-dragover .documents-dropzone-hint { color: var(--color-accent); }
.documents-uploading { display: flex; flex-direction: column; gap: 6px; }
.documents-uploading:not(:empty) { margin-bottom: 6px; }
.documents-uploading-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  background: var(--color-accent-soft);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
}
.documents-uploading-row svg { width: 14px; height: 14px; color: var(--color-accent); flex-shrink: 0; }
.documents-uploading-row .documents-row-name { margin-bottom: 4px; }
.documents-uploading-row .progress-track { height: 5px; }
.documents-uploading-percent { flex-shrink: 0; font-size: 11px; font-weight: 700; color: var(--color-accent-strong); font-variant-numeric: tabular-nums; }
.documents-list { display: flex; flex-direction: column; gap: 14px; }
.documents-empty { font-size: 12px; color: var(--color-text-faint); text-align: center; margin: 0; }

/* Gruppiert die Dokumente nach Herkunft (direkt hochgeladen / per File-
   Transfer geteilt / vom Kunden hochgeladen) - siehe groupKeyFor() in
   documents.js. Ein farbig abgesetztes Label statt schlichtem Grau, damit
   die Gruppen auf einen Blick auseinanderzuhalten sind, nicht nur durch den
   Text selbst. */
.documents-group { display: flex; flex-direction: column; gap: 6px; }
.documents-group-label {
  align-self: flex-start;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-accent-strong);
  background: var(--color-accent-soft);
  padding: 3px 9px;
  border-radius: 999px;
}
.documents-group-list { display: flex; flex-direction: column; gap: 6px; }
.documents-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  cursor: pointer;
}
.documents-row:hover { border-color: var(--color-accent); }
.documents-row svg { width: 14px; height: 14px; color: var(--color-text-faint); flex-shrink: 0; }
.documents-row-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.documents-row-sub { font-size: 11px; color: var(--color-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* File-Transfer (app/js/pages/filetransfer.js) - eine große, eigenständige
   Dropzone (nicht pro Produktion wie bei .documents-box), daher deutlich
   mehr Innenabstand und eine zentrierte Icon+Text-Anordnung statt der
   kompakten Kopfzeile dort. */
.filetransfer-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: var(--space-6) var(--space-4);
  margin-bottom: var(--space-3);
  border: 2px dashed var(--color-border-strong);
  border-radius: var(--radius-lg);
  background: var(--color-bg-alt);
  color: var(--color-text-muted);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.filetransfer-dropzone.is-dragover, .filetransfer-dropzone.is-uploading {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
  color: var(--color-accent);
}
.filetransfer-dropzone-icon { width: 34px; height: 34px; }
.filetransfer-dropzone-icon svg { width: 100%; height: 100%; }
.filetransfer-dropzone-text { font-size: 14px; font-weight: 600; }
.filetransfer-dropzone-hint { font-size: 11.5px; color: var(--color-text-faint); }
.filetransfer-link-box {
  margin-top: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--color-success-soft);
  border: 1px solid var(--color-success);
}
.filetransfer-link-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--color-success);
  margin-bottom: 8px;
}
.filetransfer-link-label svg { width: 14px; height: 14px; }
