/* Fuhrpark App – Layout & Design (nach Fuhrpark App.dc.html) */
:root {
  --accent: #5B93D3;
  --accent-soft: oklch(93% 0.03 230);
  --accent-strip: oklch(94% 0.035 230);
  --accent-strip-border: oklch(85% 0.05 230);
  --text: oklch(22% 0.005 250);
  --text-muted: oklch(48% 0.006 250);
  --border: oklch(90% 0.004 250);
  --border-soft: oklch(92% 0.004 250);
  --bg: oklch(97.5% 0.002 250);
  --bg-sidebar: oklch(96% 0.003 250);
  --bg-input: oklch(98% 0.002 250);
  /* Fahrzeug-Status (KFZ-166): geplant=Gelb, bestellt=Türkis, aktiv=Grün,
     verfügbar=Blau, außer Betrieb=Rot, nicht mehr im Bestand=Grau */
  --st-geplant: oklch(83% 0.16 90);
  --st-bestellt: oklch(70% 0.11 195);
  --st-aktiv: oklch(62% 0.13 150);
  --st-verfuegbar: oklch(60% 0.15 250);
  --st-ausserbetrieb: oklch(58% 0.19 25);
  --st-nichtbestand: oklch(66% 0.008 250);
  --st-werkstatt: oklch(68% 0.14 70);  /* noch für die Bestellungsansicht */
  --st-inaktiv: oklch(58% 0.01 250);
  /* Bereichs-Farbcodes (KFZ-23): dezente, transparente Flächentöne + kräftigere Linie */
  --area-fahrzeug: rgba(91, 147, 211, 0.09);
  --area-fahrzeug-strong: rgba(91, 147, 211, 0.20);
  --area-fahrzeug-line: rgba(91, 147, 211, 0.65);
  --area-vertrag: rgba(198, 161, 94, 0.14);
  --area-vertrag-strong: rgba(198, 161, 94, 0.28);
  --area-vertrag-line: rgba(190, 150, 80, 0.75);
  --area-einstellungen: rgba(104, 184, 108, 0.13);
  --area-einstellungen-strong: rgba(104, 184, 108, 0.26);
  --area-einstellungen-line: rgba(88, 168, 92, 0.75);
  /* Mitarbeiter-Bereich – übernimmt das frühere Bestellungs-Lila (KFZ-170) */
  --area-mitarbeiter: rgba(160, 120, 205, 0.13);
  --area-mitarbeiter-strong: rgba(160, 120, 205, 0.26);
  --area-mitarbeiter-line: rgba(140, 96, 195, 0.75);
  /* Auswertungen: Türkis (KFZ-100) */
  --area-auswertung: rgba(32, 178, 170, 0.13);
  --area-auswertung-strong: rgba(32, 178, 170, 0.28);
  --area-auswertung-line: rgba(20, 150, 145, 0.85);
  /* TÜV: Indigo – eigener Rahmen auf der Übersicht (KFZ-138) */
  --area-tuev: rgba(112, 104, 200, 0.12);
  --area-tuev-strong: rgba(112, 104, 200, 0.24);
  --area-tuev-line: rgba(96, 88, 190, 0.80);
  /* Übersicht: Grau (KFZ-109) */
  --area-uebersicht: rgba(120, 125, 135, 0.11);
  --area-uebersicht-strong: rgba(120, 125, 135, 0.22);
  --area-uebersicht-line: rgba(95, 100, 110, 0.75);
  /* Hilfsprogramme: Orange (KFZ-86) */
  --area-hilfsprogramme: rgba(240, 140, 40, 0.16);
  --area-hilfsprogramme-strong: rgba(240, 140, 40, 0.32);
  --area-hilfsprogramme-line: rgba(215, 110, 25, 0.88);
  /* ToDo: Gelb (KFZ-143) */
  --area-todo: rgba(235, 200, 30, 0.18);
  --area-todo-strong: rgba(235, 200, 30, 0.36);
  --area-todo-line: rgba(200, 165, 10, 0.90);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--text);
}
a { color: inherit; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: none; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: oklch(85% 0.004 250); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* App-Shell */
.app-shell { width: 100%; height: 100vh; display: flex; flex-direction: column; overflow: hidden; }

/* Header */
.app-header {
  flex: none; height: 52px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; background: #fff; border-bottom: 1px solid var(--border); z-index: 20;
}
.app-header .brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.app-header .brand .title { font-size: 14px; font-weight: 600; letter-spacing: .1px; white-space: nowrap; }
.app-header .brand .mandant-logo { height: 30px; max-width: 120px; object-fit: contain; flex: none; }
.hamburger {
  width: 30px; height: 30px; border: none; background: transparent; border-radius: 7px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; cursor: pointer; flex: none;
}
.hamburger span { display: block; width: 16px; height: 2px; background: oklch(35% 0.006 250); border-radius: 2px; }
.app-header .user { display: flex; align-items: center; gap: 9px; flex: none; }
.app-header .user .meta { text-align: right; line-height: 1.25; }
.app-header .user .meta .n { font-size: 12.5px; font-weight: 600; }
.app-header .user .meta .r { font-size: 11px; color: var(--text-muted); }
.app-header .user .avatar {
  width: 32px; height: 32px; border-radius: 999px; background: oklch(90% 0.02 230);
  display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 700;
  color: oklch(35% 0.09 230); flex: none;
}

/* Meldungsstreifen (Flash) */
.msg-strip {
  flex: none; padding: 8px 20px; background: var(--accent-strip);
  border-bottom: 1px solid var(--accent-strip-border);
  font-size: 12.5px; font-weight: 500;
}
.msg-strip.danger { background: oklch(94% 0.05 25); border-bottom-color: oklch(85% 0.08 25); color: oklch(40% 0.12 25); }
.msg-strip.warning { background: oklch(95% 0.06 85); border-bottom-color: oklch(85% 0.09 85); color: oklch(42% 0.1 70); }
.msg-strip.success { background: oklch(94% 0.05 150); border-bottom-color: oklch(84% 0.08 150); color: oklch(40% 0.11 150); }
.msg-strip .m + .m { margin-top: 3px; }

/* Body */
.app-body { flex: 1; display: flex; min-height: 0; overflow: hidden; }

/* Sidebar */
.sidebar {
  flex: none; width: 212px; display: flex; flex-direction: column; background: var(--bg-sidebar);
  border-right: 1px solid var(--border); transition: width .18s ease; min-height: 0;
}
.app-shell.collapsed .sidebar { width: 56px; }
.sidebar .items { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; }
.menu-row {
  display: flex; align-items: center; gap: 11px; height: 36px; padding: 0 10px; border-radius: 8px;
  cursor: pointer; color: oklch(32% 0.006 250); text-decoration: none; transition: background .12s ease;
}
.menu-row:hover { background: oklch(93% 0.006 250); }
.menu-row.active { background: var(--accent-soft); color: oklch(30% 0.06 230); }
.app-shell.collapsed .menu-row { padding: 0; justify-content: center; }
.menu-row .ico { width: 20px; height: 20px; flex: none; display: flex; align-items: center; justify-content: center; }
.menu-row .lbl { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.app-shell.collapsed .menu-row .lbl { display: none; }
.menu-row .chev { font-size: 11px; color: oklch(55% 0.006 250); transition: transform .15s ease; }
.app-shell.collapsed .menu-row .chev { display: none; }
.submenu { display: flex; flex-direction: column; gap: 1px; padding: 2px 0 4px; }
.app-shell.collapsed .submenu { display: none; }
.submenu a { font-size: 12.5px; color: var(--text-muted); padding: 7px 10px 7px 41px; border-radius: 7px; text-decoration: none; }
.submenu a:hover { background: oklch(93% 0.006 250); }
.submenu a.active { color: oklch(30% 0.06 230); font-weight: 600; }
/* Vertragsende + Restlaufzeit im Vertragskopf (KFZ-71) */
.vertrag-ende { font-weight: 600; }
.vertrag-ende.urgent { color: oklch(55% 0.19 25); }
/* Vertragsende neben der Gruppen-Überschrift auf dem Fahrzeug (KFZ-73) */
.vertrag-ende-inline { flex: none; font-size: 11.5px; font-weight: 600; color: var(--text-muted); background: var(--bg-input); padding: 2px 8px; border-radius: 999px; }
.vertrag-ende-inline.urgent { color: oklch(55% 0.19 25); background: color-mix(in srgb, oklch(55% 0.19 25) 12%, white); }

/* Abmelden unten in der Sidebar (KFZ-70) */
.sidebar .logout-row { flex: none; margin: 4px 8px; }
.sidebar .foot { flex: none; padding: 10px 14px; font-size: 10.5px; color: oklch(60% 0.006 250); border-top: 1px solid var(--border); }
.app-shell.collapsed .sidebar .foot { display: none; }

/* Fahrzeugliste (KFZ-8: ~30% schmaler, 272px -> 190px) */
.vehicle-list {
  flex: none; width: 190px; display: flex; flex-direction: column; background: #fff;
  border-right: 1px solid var(--border); min-height: 0;
}
.vehicle-list .head { padding: 12px 12px 10px; }

/* Status-Filter (Multiselect, oben & einklappbar – KFZ-11) */
.status-filter { border-bottom: 1px solid var(--border); background: #fff; }
.status-filter .sf-head {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 9px 12px;
  background: transparent; border: none; cursor: pointer; font: inherit; text-align: left;
}
.status-filter .sf-head:hover { background: oklch(97% 0.004 250); }
.status-filter .sf-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); flex: none; }
.status-filter .sf-summary { flex: 1; min-width: 0; font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-filter .sf-chevron { flex: none; font-size: 12px; color: var(--text-muted); transition: transform .15s ease; }
.status-filter.collapsed .sf-chevron { transform: rotate(-90deg); }
.status-filter .sf-body { padding: 0 10px 9px; }
.status-filter.collapsed .sf-body { display: none; }
.status-filter .sf-options { display: flex; flex-direction: column; gap: 2px; }
.sf-chip { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text); cursor: pointer; padding: 3px 5px; border-radius: 6px; }
.sf-chip:hover { background: oklch(96% 0.004 250); }
.sf-chip.on { background: var(--accent-soft); }
.sf-chip input { margin: 0; flex: none; }
.sf-chip .v-dot { width: 7px; height: 7px; }
.vehicle-list .head .cap { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 8px; }
.vehicle-list .search {
  width: 100%; height: 34px; padding: 0 10px; border: 1px solid oklch(88% 0.004 250); border-radius: 7px;
  font-size: 12.5px; background: var(--bg-input); color: var(--text);
}
.vehicle-list .rows { flex: 1; overflow-y: auto; padding: 0 8px 8px; display: flex; flex-direction: column; gap: 2px; }
.v-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; cursor: pointer; text-decoration: none; color: inherit; }
.v-row:hover { background: oklch(96% 0.004 250); }
.v-row.active { background: var(--accent-soft); }
.v-dot { width: 7px; height: 7px; border-radius: 999px; flex: none; }
.v-dot.geplant { background: var(--st-geplant); }
.v-dot.bestellt { background: var(--st-bestellt); }
.v-dot.aktiv { background: var(--st-aktiv); }
.v-dot.verfuegbar { background: var(--st-verfuegbar); }
.v-dot.ausserbetrieb { background: var(--st-ausserbetrieb); }
.v-dot.nichtbestand { background: var(--st-nichtbestand); }
.v-dot.werkstatt { background: var(--st-werkstatt); }
.v-dot.inaktiv { background: var(--st-inaktiv); }
.v-row .plate { font-size: 12.5px; font-weight: 600; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.v-row .name { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vehicle-list .empty { padding: 20px 8px; text-align: center; font-size: 12px; color: oklch(55% 0.006 250); }
.vehicle-list .count { flex: none; padding: 9px 14px; border-top: 1px solid var(--border-soft); font-size: 11.5px; color: var(--text-muted); }

/* Hauptbereich */
.main { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 24px 32px; min-width: 0; }
.main .wrap { max-width: 760px; }
.main .wrap.wrap-wide { max-width: 1180px; }
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 4px; gap: 16px; }
.detail-head .plate { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.detail-head .sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.detail-head .head-verwendung { font-size: 11.5px; color: var(--text-muted); margin-top: 6px; }
/* Fahrzeugbild klein im Kopf (links neben dem Status) – KFZ-12 */
/* Kopf-Bild über beide Zeilen (Kennzeichen + Bezeichnung), oben bündig mit dem Status – KFZ-14 */
.detail-head .head-bild { width: 74px; height: 54px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border); flex: none; }
/* Vorschau neben dem „Bild öffnen“-Link */
.bild-preview { width: 160px; max-width: 100%; height: 104px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); display: block; }
.status-badge { font-size: 11.5px; font-weight: 600; padding: 5px 11px; border-radius: 999px; color: #fff; white-space: nowrap; flex: none; }
.status-badge.geplant { background: var(--st-geplant); color: oklch(32% 0.06 90); }
.status-badge.bestellt { background: var(--st-bestellt); }
.status-badge.aktiv { background: var(--st-aktiv); }
.status-badge.verfuegbar { background: var(--st-verfuegbar); }
.status-badge.ausserbetrieb { background: var(--st-ausserbetrieb); }
.status-badge.nichtbestand { background: var(--st-nichtbestand); }
.status-badge.werkstatt { background: var(--st-werkstatt); }
.status-badge.inaktiv { background: var(--st-inaktiv); }

/* Status farbig in der Gruppen-Kurzinfo „Allgemein“ (KFZ-166) */
.fgroup-summary .sum-st { display: inline-flex; align-items: center; padding: 1px 9px; border-radius: 999px; font-weight: 600; font-size: 11px; color: #fff; }
.sum-st.geplant { background: var(--st-geplant); color: oklch(32% 0.06 90); }
.sum-st.bestellt { background: var(--st-bestellt); }
.sum-st.aktiv { background: var(--st-aktiv); }
.sum-st.verfuegbar { background: var(--st-verfuegbar); }
.sum-st.ausserbetrieb { background: var(--st-ausserbetrieb); }
.sum-st.nichtbestand { background: var(--st-nichtbestand); }
.sum-st.inaktiv { background: var(--st-inaktiv); }
.rule { height: 1px; background: var(--border); margin: 18px 0 22px; }

/* Fluent/responsives Feld-Raster: mehr Breite -> mehr Spalten */
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px 20px; }
.field { display: flex; flex-direction: column; gap: 6px; }

/* Sonderausstattung: kompaktes Raster aus Anhakfeldern (KFZ-204) */
.ausstattung-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px 20px; }
.ausstattung-item { display: flex; align-items: center; gap: 9px; font-size: 13px; cursor: pointer; }
.ausstattung-item input[type="checkbox"] { width: 17px; height: 17px; flex: none; accent-color: var(--accent); cursor: pointer; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 11.5px; font-weight: 600; color: var(--text-muted); }
.field .control {
  height: 36px; padding: 0 10px; border-radius: 7px; border: 1px solid oklch(88% 0.004 250);
  font-size: 13px; background: #fff; color: var(--text); width: 100%;
}
.field textarea.control { height: auto; padding: 8px 10px; min-height: 72px; }
/* Berechnete, schreibgeschützte Felder (z. B. KM-Prognose, KFZ-80) */
.field .control.ro { display: flex; align-items: center; background: var(--bg-input); color: var(--text-muted); }
.field .control.ro.neg { color: oklch(52% 0.16 25); font-weight: 600; }
.field .control.ro.pos { color: oklch(50% 0.13 150); font-weight: 600; }
/* Mehrkilometer-Warnung (KFZ-42) */
.km-warn { color: oklch(68% 0.17 65); }
.km-warn[hidden] { display: none; }
.km-warn-ic { vertical-align: -2px; }
.km-warn-sm { display: inline-flex; vertical-align: -1px; }
.km-warn-lg { vertical-align: -3px; }
.field .err { color: oklch(52% 0.16 25); font-size: 11.5px; }

/* Einklappbare Feldgruppen (Fluent) */
.fgroup { border: 1px solid var(--border); border-radius: 10px; background: #fff; margin-bottom: 12px; overflow: hidden; }
.fgroup-head {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  background: var(--bg-sidebar); border: none; cursor: pointer; text-align: left; font: inherit;
}
.fgroup-head:hover { background: oklch(94% 0.004 250); }
.fgroup-title { font-size: 12.5px; font-weight: 700; letter-spacing: .01em; color: var(--text); flex: none; }
.fgroup-summary { flex: 1; min-width: 0; text-align: right; font-size: 11.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fgroup-summary.urgent { color: oklch(52% 0.16 25); font-weight: 600; }
.fgroup-chevron { flex: none; font-size: 12px; color: var(--text-muted); transition: transform .15s ease; }
.fgroup.collapsed .fgroup-chevron { transform: rotate(-90deg); }
.fgroup-body { padding: 16px 14px; }
.fgroup.collapsed .fgroup-body { display: none; }
/* Kurzinfo nur im eingeklappten Zustand zeigen */
.fgroup:not(.collapsed) .fgroup-summary { display: none; }

/* Monate bis TÜV */
.tuev-badge { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: oklch(35% 0.09 230); margin-left: 6px; }
.tuev-badge.urgent { background: oklch(93% 0.05 25); color: oklch(52% 0.16 25); }
/* TÜV Monat/Jahr-Auswahl nebeneinander */
.tuev-select { display: flex; gap: 8px; }
.tuev-select .control { flex: 1; min-width: 0; }
/* Vorhandener offener TÜV-Termin am Fahrzeug (KFZ-116) – Anzeige statt Auswahl */
.tuev-vorhanden { display: flex; align-items: baseline; gap: 10px; min-height: 34px; flex-wrap: wrap; }
.tuev-vorhanden strong { font-size: 14px; }
.tuev-vorhanden .tuev-termin { font-size: 12px; color: var(--text-muted); }

/* Autocomplete (Fahrzeug-Suche im Vertrag – KFZ-9) */
.ac { position: relative; }
.ac-list {
  position: absolute; left: 0; right: 0; top: 40px; z-index: 40; background: #fff;
  border: 1px solid var(--border); border-radius: 8px; overflow-y: auto; max-height: 240px;
  box-shadow: 0 8px 24px oklch(50% 0.02 250 / .14); display: none;
}
.ac-item { padding: 8px 10px; font-size: 12.5px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-item:hover { background: var(--accent-soft); }
.ac-clear { color: var(--text-muted); border-top: 1px solid var(--border-soft); }

.actions { display: flex; gap: 10px; margin-top: 26px; align-items: center; }

/* Aktions-Menüband über der ersten Gruppe (KFZ-145). Segmentierte Soft-Buttons,
   jeweils mit erklärendem Symbol in matter, funktionsbezogener Farbe. */
.toolbar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  /* Menüband unter der Trennlinie positioniert; die 22px Unterrand der
     Trennlinie klappen mit dieser Margin zusammen. 52px -> Band sitzt netto
     30px unter der Trennlinie, 10px Abstand darunter (KFZ-147, KFZ-149). */
  margin: 52px 0 10px; padding: 7px 8px; border-radius: 12px;
  background: linear-gradient(180deg, #fff, oklch(98% 0.003 250));
  border: 1px solid var(--border); box-shadow: 0 1px 2px rgba(20,25,40,.05);
}
.tb-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 15px; border-radius: 9px;
  border: 1px solid transparent; background: transparent;
  font-size: 13px; font-weight: 600; color: oklch(30% 0.01 250);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .12s ease, border-color .12s ease, box-shadow .12s ease, transform .06s ease;
}
.tb-btn:hover { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(20,25,40,.10); }
.tb-btn:active { transform: translateY(0); box-shadow: none; }
.tb-ico { display: inline-flex; }
.tb-ico svg { width: 17px; height: 17px; }
/* Speichern – mattes Grün */
.tb-save { background: oklch(96% 0.035 150); border-color: oklch(88% 0.055 150); }
.tb-save .tb-ico { color: oklch(52% 0.10 150); }
.tb-save:hover { background: oklch(93% 0.06 150); }
/* Sperre – mattes Bernstein (nutzt die vorhandene Sperr-Schaltfläche) */
.toolbar .btn-sperre {
  height: 38px; padding: 0 15px; border-radius: 9px; gap: 8px; margin: 0;
  border: 1px solid oklch(88% 0.05 75); background: oklch(96% 0.035 75);
  color: oklch(30% 0.01 250); font-size: 13px; font-weight: 600;
  transition: background .12s ease, box-shadow .12s ease, transform .06s ease;
}
.toolbar .btn-sperre svg { color: oklch(58% 0.10 75); }
.toolbar .btn-sperre:not(.is-locked):hover { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(20,25,40,.10); background: oklch(93% 0.06 75); }
.toolbar .btn-sperre.is-locked { background: oklch(96% 0.006 250); border-color: var(--border); }
.toolbar .btn-sperre.is-locked svg { color: var(--text-muted); }
/* Verwerfen – mattes Grau */
.tb-cancel { background: oklch(97% 0.002 250); border-color: oklch(88% 0.004 250); }
.tb-cancel .tb-ico { color: oklch(52% 0.02 250); }
.tb-cancel:hover { background: oklch(94% 0.003 250); }
/* Löschen – mattes Rot, rechts abgesetzt */
.tb-del { margin-left: auto; background: oklch(96% 0.03 25); border-color: oklch(87% 0.06 25); }
.tb-del .tb-ico { color: oklch(55% 0.14 25); }
.tb-del:hover { background: oklch(93% 0.06 25); }
/* Kompaktes Menüband für die Einstellungen-Masken (KFZ-150): ohne den
   Sperr-Schild-Vorlauf, sitzt direkt unter dem Titel über den Feldern. */
.toolbar.toolbar-kompakt { margin: 6px 0 20px; }
.btn-accent { height: 36px; padding: 0 18px; border-radius: 7px; border: none; background: var(--accent); color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn-ghost { height: 36px; padding: 0 18px; border-radius: 7px; border: 1px solid oklch(85% 0.004 250); background: transparent; color: oklch(35% 0.006 250); font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.btn-danger { height: 36px; padding: 0 16px; border-radius: 7px; border: 1px solid oklch(80% 0.08 25); background: transparent; color: oklch(52% 0.16 25); font-size: 13px; font-weight: 600; cursor: pointer; margin-left: auto; }

.veh-image { margin-top: 22px; }
.veh-image img { max-width: 320px; border-radius: 10px; border: 1px solid var(--border); }
.placeholder { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--text-muted); font-size: 13px; }

/* Einfache Tabellen (Admin) */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.tbl th, .tbl td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border-soft); }
.tbl th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); background: var(--bg-sidebar); }
.tbl tr:last-child td { border-bottom: none; }
/* Excel-Export-Leiste über Tabellen (KFZ-85) */
.tbl-export { display: flex; justify-content: flex-end; margin: 0 0 10px; }
.btn-export { height: 32px; padding: 0 12px; gap: 7px; font-size: 12.5px; }
.btn-export:hover { border-color: oklch(62% 0.13 150); color: oklch(45% 0.12 150); }
.btn-export:disabled { opacity: .55; cursor: default; }
.page-title { font-size: 20px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 4px; }
.page-sub { font-size: 13px; color: var(--text-muted); margin: 0 0 20px; }
.pill { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: oklch(35% 0.09 230); }

/* Warnung bei ungespeicherten Änderungen (KFZ-16) */
.guard-overlay { position: fixed; inset: 0; background: oklch(20% 0.02 250 / .45); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.guard-box { background: #fff; border-radius: 12px; padding: 22px 22px 18px; width: 440px; max-width: calc(100% - 32px); box-shadow: 0 20px 60px oklch(20% 0.02 250 / .3); }
.guard-title { font-size: 15px; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.guard-text { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin-bottom: 18px; }
.guard-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.btn-guard-leave { color: oklch(52% 0.16 25); border-color: oklch(80% 0.08 25); }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.login-card { width: 340px; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 28px 26px; box-shadow: 0 8px 30px oklch(50% 0.02 250 / .08); }
.login-card h1 { font-size: 18px; font-weight: 700; margin: 0 0 4px; }
.login-card p.sub { font-size: 12.5px; color: var(--text-muted); margin: 0 0 20px; }
.login-card .field { margin-bottom: 14px; }
.login-card .btn-accent { width: 100%; }
.login-card .checkbox { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-muted); margin-bottom: 16px; }

/* --------------------------------------------------------------------- */
/* Bereichs-Farbcodes (KFZ-23): Hintergrund der Masken + Menüeinträge     */
/* --------------------------------------------------------------------- */
/* Masken-Hintergrund je Bereich */
.area-fahrzeug .main,
.area-fahrzeug .vehicle-list { background: var(--area-fahrzeug); }
.area-vertrag .main,
.area-vertrag .vehicle-list { background: var(--area-vertrag); }
.area-einstellungen .main { background: var(--area-einstellungen); }
.area-mitarbeiter .main,
.area-mitarbeiter .vehicle-list { background: var(--area-mitarbeiter); }
.area-hilfsprogramme .main { background: var(--area-hilfsprogramme); }
.area-uebersicht .main { background: var(--area-uebersicht); }
.area-todo .main { background: var(--area-todo); }

/* Menü links: dauerhaft farbcodiert je Bereich (Legende) */
.menu-row.m-uebersicht { background: var(--area-uebersicht); box-shadow: inset 3px 0 0 var(--area-uebersicht-line); }
.menu-row.m-uebersicht:hover,
.menu-row.m-uebersicht.active { background: var(--area-uebersicht-strong); color: oklch(32% 0.01 250); }

.menu-row.m-todo { background: var(--area-todo); box-shadow: inset 3px 0 0 var(--area-todo-line); }
.menu-row.m-todo:hover,
.menu-row.m-todo.active { background: var(--area-todo-strong); color: oklch(42% 0.09 85); }

.menu-row.m-fahrzeug { background: var(--area-fahrzeug); box-shadow: inset 3px 0 0 var(--area-fahrzeug-line); }
.menu-row.m-fahrzeug:hover,
.menu-row.m-fahrzeug.active { background: var(--area-fahrzeug-strong); color: oklch(30% 0.06 230); }

.menu-row.m-vertrag { background: var(--area-vertrag); box-shadow: inset 3px 0 0 var(--area-vertrag-line); }
.menu-row.m-vertrag:hover,
.menu-row.m-vertrag.active { background: var(--area-vertrag-strong); color: oklch(34% 0.05 75); }

.menu-row.m-mitarbeiter { background: var(--area-mitarbeiter); box-shadow: inset 3px 0 0 var(--area-mitarbeiter-line); }
.menu-row.m-mitarbeiter:hover,
.menu-row.m-mitarbeiter.active { background: var(--area-mitarbeiter-strong); color: oklch(34% 0.09 300); }

.menu-row.m-einstellungen { background: var(--area-einstellungen); box-shadow: inset 3px 0 0 var(--area-einstellungen-line); }
.menu-row.m-einstellungen:hover,
.menu-row.m-einstellungen.active { background: var(--area-einstellungen-strong); color: oklch(34% 0.08 150); }
.menu-group.m-einstellungen .submenu a:hover { background: var(--area-einstellungen); }
.menu-group.m-einstellungen .submenu a.active { background: var(--area-einstellungen-strong); color: oklch(34% 0.08 150); }

/* Auswertungen: Türkis (KFZ-100) */
.area-auswertung .main { background: var(--area-auswertung); }
.menu-row.m-auswertung { background: var(--area-auswertung); box-shadow: inset 3px 0 0 var(--area-auswertung-line); }
.menu-row.m-auswertung:hover,
.menu-row.m-auswertung.active { background: var(--area-auswertung-strong); color: oklch(38% 0.09 195); }
.menu-group.m-auswertung .submenu a:hover { background: var(--area-auswertung); }
.menu-group.m-auswertung .submenu a.active { background: var(--area-auswertung-strong); color: oklch(38% 0.09 195); }
.app-shell.collapsed .menu-row.m-auswertung { border-radius: 8px; }

/* Auswertungs-Bausteine */
.aw-filter {
  display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: flex-end;
  padding: 14px 16px; margin: 6px 0 18px; background: #fff;
  border: 1px solid var(--border); border-radius: 12px;
}
.aw-fld { display: flex; flex-direction: column; gap: 7px; }
.aw-fld-label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.aw-select { height: 34px; padding: 0 10px; border: 1px solid oklch(88% 0.004 250); border-radius: 7px;
  font-size: 12.5px; background: var(--bg-input); color: var(--text); min-width: 190px; cursor: pointer; }
.aw-karte { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 18px; }
.aw-karte-titel { font-size: 13px; font-weight: 700; color: oklch(36% 0.06 195); margin: 0 0 12px; }
/* Diagramme flacher (KFZ-102) */
.aw-chart { position: relative; height: 300px; width: 100%; }

/* Einklappbare Karten für Filter, Diagramme und Pivot (KFZ-102) */
.aw-klapp {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  margin-bottom: 14px; overflow: hidden;
}
/* Enthält die Karte ein eigenes Dropdown (Abteilungsfilter), darf sie nicht
   clippen – sonst wird die aufgeklappte Liste abgeschnitten (KFZ-157). */
.aw-klapp:has(.lz-dd) { overflow: visible; }
.aw-klapp-kopf {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  background: transparent; border: none; border-bottom: 1px solid var(--border-soft);
  cursor: pointer; font: inherit; text-align: left;
}
.aw-klapp-kopf:hover { background: color-mix(in srgb, var(--area-auswertung-line) 7%, white); }
.aw-klapp-titel { font-size: 13px; font-weight: 700; color: oklch(36% 0.06 195); flex: none; }
.aw-klapp-info {
  flex: 1; min-width: 0; text-align: right; font-size: 11.5px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.aw-klapp-chev { flex: none; font-size: 12px; color: var(--text-muted); transition: transform .15s ease; }
.aw-klapp.zu .aw-klapp-chev { transform: rotate(-90deg); }
.aw-klapp-body { padding: 14px; }
.aw-klapp.zu .aw-klapp-body { display: none; }
.aw-klapp.zu .aw-klapp-kopf { border-bottom: none; }

.aw-filter-grid { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: flex-end; }
.aw-fld-weit { flex: 1; min-width: 320px; }
/* Zwei-Griff-Regler: ein Strich, zwei Kreise auf derselben Linie (KFZ-113) */
.aw-dual { position: relative; height: 34px; min-width: 260px; }
.aw-dual-spur, .aw-dual-fill {
  position: absolute; top: 50%; transform: translateY(-50%);
  height: 4px; border-radius: 999px; pointer-events: none;
}
.aw-dual-spur { left: 0; right: 0; background: oklch(88% 0.004 250); }
.aw-dual-fill { background: var(--area-auswertung-line); }
.aw-dual input[type="range"] {
  position: absolute; top: 0; left: 0; width: 100%; height: 34px; margin: 0;
  -webkit-appearance: none; appearance: none; background: transparent;
  pointer-events: none;   /* nur die Griffe sind bedienbar */
}
.aw-dual input[type="range"]:focus { outline: none; }
.aw-dual input[type="range"]::-webkit-slider-runnable-track { background: transparent; height: 34px; }
.aw-dual input[type="range"]::-moz-range-track { background: transparent; height: 34px; }
.aw-dual input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; pointer-events: auto; cursor: grab;
  width: 17px; height: 17px; border-radius: 50%;
  background: #fff; border: 2px solid var(--area-auswertung-line);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .22); margin-top: 8px;
}
.aw-dual input[type="range"]::-moz-range-thumb {
  pointer-events: auto; cursor: grab;
  width: 17px; height: 17px; border-radius: 50%;
  background: #fff; border: 2px solid var(--area-auswertung-line);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .22);
}
.aw-dual input[type="range"]:active::-webkit-slider-thumb { cursor: grabbing; }
.aw-dual input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--area-auswertung-strong); }
#awAnwenden:disabled { opacity: .45; cursor: default; }
.aw-hinweis {
  display: flex; gap: 9px; align-items: flex-start; padding: 10px 13px; margin: 0 0 16px;
  background: color-mix(in srgb, var(--area-auswertung-line) 10%, white);
  border: 1px solid color-mix(in srgb, var(--area-auswertung-line) 30%, white);
  border-radius: 9px; font-size: 12.5px; color: var(--text);
}
/* Pivot-Tabellen */
.pivot th, .pivot td { white-space: nowrap; }
.pivot td.zahl, .pivot th.zahl { text-align: right; font-variant-numeric: tabular-nums; }
.pivot .gruppe { background: var(--area-auswertung); font-weight: 600; }
.pivot tr.summe td, .pivot td.summe, .pivot th.summe {
  font-weight: 700; background: var(--area-auswertung); border-top: 2px solid var(--area-auswertung-line);
}
.pivot td.summe, .pivot th.summe { border-top: none; border-left: 2px solid var(--area-auswertung-line); }
.pivot tbody tr:hover td { background: color-mix(in srgb, var(--area-auswertung-line) 7%, white); }

.menu-row.m-hilfsprogramme { background: var(--area-hilfsprogramme); box-shadow: inset 3px 0 0 var(--area-hilfsprogramme-line); }
.menu-row.m-hilfsprogramme:hover,
.menu-row.m-hilfsprogramme.active { background: var(--area-hilfsprogramme-strong); color: oklch(45% 0.14 55); }
.menu-group.m-hilfsprogramme .submenu a:hover { background: var(--area-hilfsprogramme); }
.menu-group.m-hilfsprogramme .submenu a.active { background: var(--area-hilfsprogramme-strong); color: oklch(45% 0.14 55); }
/* „Imports"-Zwischenüberschrift im Untermenü (KFZ-69) */
.submenu-cap { padding: 6px 10px 3px 41px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
/* Einträge, die zu einer Untergruppe gehören, leicht einrücken (KFZ-182) */
.submenu .submenu-cap ~ a { padding-left: 54px; }

/* Eingeklapptes Menü: nur der farbige Balken bleibt sichtbar */
.app-shell.collapsed .menu-row.m-fahrzeug,
.app-shell.collapsed .menu-row.m-vertrag,
.app-shell.collapsed .menu-row.m-einstellungen,
.app-shell.collapsed .menu-row.m-hilfsprogramme { border-radius: 8px; }

/* --------------------------------------------------------------------- */
/* Vertragslaufzeiten – Gantt-Ansicht (KFZ-24)                            */
/* --------------------------------------------------------------------- */
.lz-gantt { --lz-grid: rgba(60, 90, 130, 0.10); }
.lz-filter {
  display: flex; flex-wrap: wrap; gap: 22px 32px; align-items: flex-end;
  padding: 14px 16px; margin: 6px 0 18px; background: #fff;
  border: 1px solid var(--border); border-radius: 12px;
}
.lz-fld { display: flex; flex-direction: column; gap: 8px; min-width: 220px; }
.lz-fld-label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.lz-abt { display: flex; flex-wrap: wrap; gap: 7px; }
.lz-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px;
  padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px;
  cursor: pointer; background: var(--bg-input); user-select: none;
}
.lz-chip input { accent-color: var(--accent); }
.lz-none { color: var(--text-muted); font-size: 13px; }
.lz-range { width: 260px; accent-color: var(--accent); cursor: pointer; }
.lz-fld-label b { color: var(--accent); }

/* Filter: Abteilungs-Dropdown (durchsuchbar, Mehrfachauswahl) + Bestellung (KFZ-92) */
.lz-select {
  height: 34px; padding: 0 10px; border: 1px solid oklch(88% 0.004 250); border-radius: 7px;
  font-size: 12.5px; background: var(--bg-input); color: var(--text); min-width: 200px; cursor: pointer;
}
.lz-dd { position: relative; min-width: 240px; }
.lz-dd-btn {
  width: 100%; height: 34px; padding: 0 10px; display: flex; align-items: center; gap: 8px;
  justify-content: space-between; border: 1px solid oklch(88% 0.004 250); border-radius: 7px;
  background: var(--bg-input); color: var(--text); font: inherit; font-size: 12.5px; cursor: pointer;
}
.lz-dd-btn:hover { border-color: var(--accent); }
.lz-dd.open .lz-dd-btn { border-color: var(--accent); }
.lz-dd-chev { flex: none; font-size: 12px; color: var(--text-muted); transition: transform .15s ease; }
.lz-dd.open .lz-dd-chev { transform: rotate(180deg); }
.lz-dd-panel {
  position: absolute; z-index: 60; top: calc(100% + 4px); left: 0; width: 300px; max-width: 90vw;
  background: #fff; border: 1px solid var(--border); border-radius: 9px; padding: 8px;
  box-shadow: 0 10px 30px oklch(50% 0.02 250 / .18);
}
.lz-dd-search {
  width: 100%; height: 32px; padding: 0 9px; border: 1px solid oklch(88% 0.004 250);
  border-radius: 6px; font-size: 12.5px; background: var(--bg-input); color: var(--text);
}
.lz-dd-actions { display: flex; gap: 6px; margin: 7px 0; }
.lz-dd-actions button {
  flex: 1; height: 27px; border: 1px solid var(--border); border-radius: 6px;
  background: #fff; color: var(--text-muted); font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer;
}
.lz-dd-actions button:hover { border-color: var(--accent); color: var(--accent); }
.lz-dd-list { max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; }
.lz-dd-opt {
  display: flex; align-items: center; gap: 8px; padding: 5px 7px; border-radius: 6px;
  font-size: 12.5px; cursor: pointer; user-select: none;
}
.lz-dd-opt:hover { background: oklch(96% 0.004 250); }
.lz-dd-opt input { accent-color: var(--accent); flex: none; }
.lz-dd-opt span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lz-dd-leer { padding: 10px 7px; font-size: 12px; color: var(--text-muted); text-align: center; }

.lz-gantt { display: flex; flex-direction: column; gap: 4px; }
.lz-row { display: flex; align-items: center; height: 38px; }
.lz-row.lz-axis { height: 22px; margin-bottom: 2px; }
.lz-rowlabel {
  flex: none; width: 168px; padding-right: 12px; font-size: 12.5px; font-weight: 600;
  color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  /* Zweizeilig: Kennzeichen, darunter der Fahrer (KFZ-135) */
  display: flex; flex-direction: column; justify-content: center; line-height: 1.25;
}
.lz-rowlabel > * { overflow: hidden; text-overflow: ellipsis; }
.lz-fahrer { font-size: 11px; font-weight: 500; color: var(--text-muted); }
.lz-track { position: relative; flex: 1; height: 100%; min-width: 0; }
.lz-axis .lz-track { border-bottom: 1px solid var(--border); }
.lz-tick {
  position: absolute; top: 2px; transform: translateX(-50%);
  font-size: 10.5px; color: var(--text-muted);
}
.lz-tick::after {
  content: ""; position: absolute; left: 50%; top: 16px; height: 6px; width: 1px;
  background: var(--border);
}

/* Verstrichener Teil (Strich) – animiert von 0 auf Zielbreite */
.lz-elapsed {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  height: 7px; border-radius: 5px; background: var(--accent);
  transition: width 1.1s cubic-bezier(.22, .61, .36, 1);
}
/* Marker (Dokument + Vertragsnummer) am Anfang des Pfeils */
.lz-marker {
  position: absolute; left: 100%; top: 50%; transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  background: #fff; border: 1px solid var(--border); border-radius: 999px;
  padding: 2px 9px 2px 7px; font-size: 11px; font-weight: 700; color: var(--accent);
  box-shadow: 0 1px 4px rgba(20, 40, 70, 0.14); z-index: 3;
  text-decoration: none; cursor: pointer; transition: box-shadow .12s ease, transform .12s ease;
}
.lz-marker:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(20, 40, 70, 0.22);
  transform: translate(-50%, -50%) translateY(-1px);
}
.lz-marker .lz-num { color: var(--text); }

/* Pfeil (Restlaufzeit) – erscheint nach der Animation */
.lz-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); height: 0;
  border-top: 2px dashed color-mix(in srgb, var(--accent) 55%, white);
  opacity: 0; transition: opacity .45s ease; z-index: 1;
}
.lz-arrow.show { opacity: 1; }
.lz-arrow::after {
  content: ""; position: absolute; right: -1px; top: 50%; transform: translateY(-50%);
  border-left: 8px solid color-mix(in srgb, var(--accent) 55%, white);
  border-top: 5px solid transparent; border-bottom: 5px solid transparent;
}
.lz-car {
  position: absolute; top: 50%; transform: translateY(-50%);
  color: #1b7a3d; opacity: 0; transition: opacity .45s ease; z-index: 2;  /* immer dunkelgrün (KFZ-36) */
  display: inline-flex; align-items: center;
}
.lz-car.show { opacity: 1; }

/* Kennzeichen-Link in der Y-Achse (KFZ-36) */
.lz-rowlabel .lz-kennzeichen { color: var(--text); text-decoration: none; }
.lz-rowlabel .lz-kennzeichen:hover { color: var(--accent); text-decoration: underline; }

.lz-empty { color: var(--text-muted); font-size: 13px; padding: 20px 4px; }
/* KPI-Verträge ohne Beginn-Datum, die der Zeitstrahl nicht zeigen kann (KFZ-148) */
.lz-ohne-beginn { margin: 14px 0 4px; padding: 12px 14px; border-radius: 10px;
  background: oklch(97% 0.03 90); border: 1px solid oklch(88% 0.06 90); max-width: 720px; }
.lz-ohne-beginn-titel { margin: 0 0 8px; font-size: 12.5px; font-weight: 600; color: oklch(42% 0.06 80); }
.lz-ohne-beginn ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.lz-ohne-beginn li { font-size: 13px; color: var(--text); }
.lz-ohne-beginn-tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 600; background: oklch(90% 0.06 80); color: oklch(42% 0.08 70); }

/* Verlinkung im Detailkopf (z. B. Vertrag → Fahrzeug, KFZ-26) */
.detail-link { color: var(--accent); font-weight: 600; text-decoration: none; }
.detail-link:hover { text-decoration: underline; }
/* Link aus einer Vorschlagstabelle in die gefilterte Fahrzeugliste (KFZ-168) */
.filter-link { color: var(--accent); text-decoration: none; font-variant-numeric: tabular-nums; }
.filter-link:hover { text-decoration: underline; }

/* DKV-Import-Staging-Tabelle (KFZ-76) */
.dkv-tbl td { vertical-align: middle; }
.dkv-tbl .ctl-sm { height: 30px; font-size: 12px; padding: 0 6px; }
.dkv-tbl td input.ctl-sm { min-width: 90px; }
.dkv-row.st-prüfen { background: color-mix(in srgb, oklch(80% 0.16 85) 16%, white); }
.dkv-row.st-nicht-importieren { background: color-mix(in srgb, oklch(58% 0.19 25) 8%, white); }
.dkv-aktionen { display: inline-flex; gap: 8px; flex-wrap: wrap; }

/* Schönes „Datei auswählen"-Feld (KFZ-78) */
.filepick { display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fp-native { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.btn-file {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px;
  border-radius: 10px; border: 1px solid oklch(86% 0.02 250);
  background: linear-gradient(180deg, #fff, oklch(97% 0.004 250));
  color: var(--text); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,.05); transition: border-color .12s, background .12s, box-shadow .12s;
}
.btn-file:hover { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.btn-file:active { transform: translateY(1px); }
.btn-file svg { color: var(--accent); flex: none; }
.fp-name { font-size: 13px; color: var(--text-muted); }
.fp-name.has { color: var(--text); font-weight: 600; }

/* Kilometerstände-Tabelle (KFZ-52) */
.km-tbl td { vertical-align: middle; }
.km-tbl .km-neu { background: var(--accent-soft); }
.km-tbl .km-neu .control { width: 100%; }

/* Usersperre – Heftklammer, Button, Schloss (KFZ-58) */
.wrap { position: relative; }
/* KFZ-65: tiefer + weiter links, damit die Infos oben rechts (Status/Verwendung) frei bleiben */
.sperre-clip { position: absolute; top: 50px; left: 150px; z-index: 6; transform: rotate(var(--rot, -3deg)); transform-origin: top center; }
.sperre-schild {
  background: #fff9e6; border: 1px solid #ece0b3; border-radius: 3px;
  padding: 4px 14px 6px; box-shadow: 1px 3px 7px rgba(0,0,0,.18);
  font-family: "Comic Sans MS", "Comic Sans", "Chalkboard SE", cursive;
  text-align: center; min-width: 96px;
}
.sperre-label { display: block; font-size: 9px; color: #a01818; text-transform: uppercase; letter-spacing: .08em; }
.sperre-name { display: block; font-size: 15px; font-weight: 700; color: #3a3320; line-height: 1.15; }
.sperre-datum { display: block; font-size: 9.5px; color: #9a8c60; margin-top: 1px; }
.sperre-x {
  position: absolute; top: 1px; right: 2px; width: 18px; height: 18px;
  border: none; background: transparent; color: oklch(55% 0.2 25);
  font-size: 19px; font-weight: 700; line-height: 1;
  cursor: pointer; display: none; align-items: center; justify-content: center; padding: 0;
}
.sperre-clip:hover .sperre-x { display: inline-flex; }
.btn-sperre { display: inline-flex; align-items: center; gap: 5px; }

/* ToDo am Objekt (KFZ-142) – Post-it im Look der Usersperre, rechts daneben. */
.todo-postit {
  position: absolute; top: 46px; left: 278px; z-index: 6;
  /* left wird bei gesetzter Sperre erhöht, siehe .sperre-clip + .todo-postit */
  transform: rotate(2.5deg); transform-origin: top center;
  background: #fff7ad; border: 1px solid #ecdf7a; border-radius: 3px;
  padding: 4px 14px 6px; box-shadow: 1px 3px 7px rgba(0,0,0,.18);
  text-align: center; max-width: 190px;
  font-family: "Comic Sans MS", "Comic Sans", "Chalkboard SE", cursive;
}
.todo-postit-cap { display: block; font-size: 9px; color: #9a8b1e; text-transform: uppercase; letter-spacing: .08em; }
.todo-postit-user { display: block; font-size: 14px; font-weight: 700; color: #3a3320; line-height: 1.15; }
.todo-postit-text { display: block; font-size: 10px; color: #6b6320; margin-top: 1px; overflow-wrap: anywhere; }
/* Bei gesetzter Usersperre das Post-it rechts neben das Sperr-Schild rücken (KFZ-144).
   Sperr-Schild und Post-it sind Nachbar-Elemente; ohne Sperre fehlt das Schild
   und das Post-it bleibt an seiner Standardposition. */
.sperre-clip + .todo-postit { left: 372px; }
/* Liste + Schnelleingabe der ToDo-Gruppe */
.todo-objekt-liste { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.todo-objekt-liste li { display: flex; align-items: center; gap: 10px; padding: 7px 10px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; }
.todo-objekt-liste li.ueberfaellig { border-color: oklch(70% 0.14 25); }
.todo-objekt-haken { margin: 0; flex: none; display: flex; }
.todo-objekt-text { flex: 1; min-width: 0; font-size: 13px; }
.todo-objekt-meta { flex: none; font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.todo-schnell { display: flex; gap: 8px; align-items: center; }
.todo-schnell .control { flex: 1; }
.btn-sperre.is-locked { color: var(--text-muted); cursor: default; opacity: .8; }
.v-lock { color: oklch(58% 0.16 60); vertical-align: -1px; }
/* Filter „Meine Gesperrten" über der Liste (KFZ-68) */
.lock-filter {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 8px;
  padding: 5px 10px; border-radius: 999px; border: 1px solid var(--border);
  background: #fff; color: var(--text-muted); font-size: 12px; font-weight: 600;
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.lock-filter:hover { border-color: oklch(58% 0.16 60); color: var(--text); }
.lock-filter.on { background: oklch(58% 0.16 60); border-color: oklch(58% 0.16 60); color: #fff; }

/* Durchsuchbare Auswahlfelder Fahrer/Abteilung (KFZ-61) */
.ss-wrap { position: relative; }
.ss-native { display: none !important; }
.ss-input { width: 100%; cursor: text; }
.ss-wrap.open .ss-input { border-color: var(--accent); }
.ss-panel {
  position: fixed; z-index: 1000; max-height: 260px; overflow-y: auto;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 4px;
}
.ss-item { padding: 7px 10px; border-radius: 6px; font-size: 13px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-item.hi, .ss-item:hover { background: var(--accent-soft); }
.ss-item.sel { font-weight: 600; }
.ss-empty { padding: 8px 10px; font-size: 12.5px; color: var(--text-muted); }

/* KM-Erfassung in der Fahrzeug-Gruppe „Aktuelles" (KFZ-55) */
.km-erfassung .km-eingabe { display: flex; gap: 8px; align-items: center; }
.km-erfassung .km-eingabe input[type="date"] { flex: 0 0 150px; max-width: 160px; }
.km-erfassung .km-eingabe input[type="number"] { flex: 1 1 auto; min-width: 0; }
/* +-Button zur Direkt-Speicherung des KM-Standes (KFZ-56) */
.km-add-btn {
  flex: 0 0 auto; width: 36px; height: 36px; padding: 0;
  font-size: 20px; line-height: 1; font-weight: 600; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
}
.km-add-btn:disabled { opacity: .5; cursor: default; }
.km-verlauf {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px;
  margin-top: 2px; font-size: 12px; color: var(--text-muted);
}
.km-verlauf-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.km-verlauf .km-item strong { color: var(--text); font-weight: 600; }
.km-verlauf .km-sep { opacity: .5; }

/* --------------------------------------------------------------------- */
/* Leerzustände Fahrzeug/Vertrag – Comic-Grafik + Hand (KFZ-25)          */
/* --------------------------------------------------------------------- */
.es {
  position: relative;
  height: 100%; min-height: 320px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 20px; text-align: center;
  padding: 24px; animation: es-in .5s ease both;
}
@keyframes es-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.es-hint { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.es-text { font-size: 16px; font-weight: 700; color: var(--text); }
.es-sub { font-size: 12.5px; color: var(--text-muted); }
/* Hand direkt an der Filterspalte (linker Rand), zeigt nach links (KFZ-27) */
.es-hand { position: absolute; left: 16px; top: 50%; width: 116px; height: auto;
  filter: drop-shadow(0 3px 5px rgba(20, 40, 70, 0.15)); animation: es-point 1.3s ease-in-out infinite; }
@keyframes es-point {
  0%, 100% { transform: translateY(-50%) translateX(0); }
  50% { transform: translateY(-50%) translateX(-12px); }
}

/* Auto */
.es-car { width: min(320px, 66%); overflow: visible; animation: es-bob 1.8s ease-in-out infinite; }
@keyframes es-bob { 0%, 100% { transform: translateY(0) rotate(-.5deg); } 50% { transform: translateY(-9px) rotate(.5deg); } }
.es-wheel { transform-box: fill-box; transform-origin: center; animation: es-spin 1.15s linear infinite; }
@keyframes es-spin { to { transform: rotate(360deg); } }
.es-shadow { transform-box: fill-box; transform-origin: center; animation: es-shadow 1.8s ease-in-out infinite; }
@keyframes es-shadow { 0%, 100% { transform: scaleX(1); opacity: .18; } 50% { transform: scaleX(.86); opacity: .12; } }

/* Dokument */
.es-doc { width: min(220px, 48%); overflow: visible; animation: es-float 2.6s ease-in-out infinite; }
@keyframes es-float { 0%, 100% { transform: translateY(0) rotate(-1.6deg); } 50% { transform: translateY(-10px) rotate(1.6deg); } }

@media (prefers-reduced-motion: reduce) {
  .es, .es-car, .es-wheel, .es-shadow, .es-doc, .es-hand { animation: none; }
}

/* ===== KFZ-81: Optik-Politur der Vertragsansicht (scoped auf .area-vertrag) ===== */
/* Auswahlliste links: Vertrags-Ton für aktive/hover-Zeile + Akzentbalken */
.area-vertrag .vehicle-list .head .cap { color: var(--area-vertrag-line); }
.area-vertrag .v-row { padding: 9px 8px; transition: background .12s ease, box-shadow .12s ease; }
.area-vertrag .v-row:hover:not(.active) { background: var(--area-vertrag); }
.area-vertrag .v-row.active {
  background: var(--area-vertrag-strong);
  box-shadow: inset 3px 0 0 var(--area-vertrag-line);
}
.area-vertrag .v-row.active .plate { color: oklch(34% 0.06 80); }
.area-vertrag .v-row .v-dot { box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 14%, transparent); }

/* Kopfbereich: Monogramm-Badge, Ende-Angabe als Pille */
.area-vertrag .detail-head .plate { display: inline-flex; align-items: center; gap: 11px; }
.area-vertrag .v-monogram {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; flex: none; border-radius: 9px;
  background: var(--area-vertrag-strong); color: var(--area-vertrag-line);
}
.area-vertrag .detail-head .sub .detail-link:hover { color: var(--area-vertrag-line); }
.area-vertrag .vertrag-ende {
  display: inline-block; margin-top: 9px; padding: 3px 11px; border-radius: 999px;
  background: var(--area-vertrag); color: oklch(38% 0.06 80); font-weight: 600; font-size: 12px;
}
.area-vertrag .vertrag-ende.urgent {
  background: color-mix(in srgb, oklch(55% 0.19 25) 12%, white); color: oklch(52% 0.19 25);
}
.area-vertrag .rule {
  background: linear-gradient(to right, var(--area-vertrag-line), var(--border) 42%, var(--border));
  margin-top: 16px;
}

/* Formular-Gruppen: Akzentbalken, weicher Schatten, Hover-Hebung */
.area-vertrag .fgroup {
  border-left: 3px solid var(--area-vertrag-line);
  box-shadow: 0 1px 2px rgba(35, 30, 15, .04);
  transition: box-shadow .16s ease, transform .16s ease;
}
.area-vertrag .fgroup:hover { box-shadow: 0 3px 12px rgba(35, 30, 15, .09); }
.area-vertrag .fgroup-title { color: oklch(36% 0.05 80); }
/* KFZ-84: Bei Mehrkilometer-Warnung Gruppentitel „KM Prognose" dunkelrot */
.area-vertrag .fgroup.km-alert .fgroup-title { color: oklch(42% 0.18 27); }

/* Berechnete Felder (KM-Prognose) im Vertrags-Ton hervorheben */
.area-vertrag .field .control.ro {
  background: var(--area-vertrag); border-color: var(--area-vertrag-strong);
  color: oklch(38% 0.02 80); font-variant-numeric: tabular-nums;
}
.area-vertrag .field .control.ro.neg { color: oklch(52% 0.16 25); }
.area-vertrag .field .control.ro.pos { color: oklch(48% 0.13 150); }

/* ToDo-Seite (KFZ-114) */
.todo-neu { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; }
.todo-neu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px 18px; }
.todo-neu .actions { margin-top: 12px; }
.todo-filter { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 14px; }
.todo-zeile.erledigt .todo-text { text-decoration: line-through; color: var(--text-muted); }
.todo-zeile.ueberfaellig .todo-text { font-weight: 600; }
.todo-haken {
  width: 22px; height: 22px; border-radius: 6px; padding: 0; cursor: pointer;
  border: 2px solid oklch(80% 0.01 250); background: #fff; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
}
.todo-haken:hover { border-color: var(--st-aktiv); }
.todo-haken.an { background: var(--st-aktiv); border-color: var(--st-aktiv); }
.todo-frist { display: inline-block; margin-left: 7px; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; }
.todo-frist.ueberfaellig { background: color-mix(in srgb, oklch(55% 0.19 25) 14%, white); color: oklch(50% 0.19 25); }
.todo-frist.heute { background: color-mix(in srgb, oklch(68% 0.14 70) 18%, white); color: oklch(48% 0.14 70); }
.todo-frist.bald { background: var(--bg-input); color: var(--text-muted); }

/* KFZ-119: kurz aufleuchten, wenn ein Feld aus den Konditionen des
   Leasinggebers vorbelegt wurde – der Benutzer soll sehen, was sich ändert. */
.control.vorbelegt { animation: feld-vorbelegt 2s ease-out; }
@keyframes feld-vorbelegt {
  0%   { background: var(--area-vertrag-strong); border-color: var(--area-vertrag-line); }
  70%  { background: var(--area-vertrag-strong); border-color: var(--area-vertrag-line); }
  100% { background: var(--bg-input); border-color: var(--border); }
}

/* KFZ-108: TÜV-Übersicht – Kennzahlen und Hervorhebung überfälliger Zeilen */
.tuev-kennzahlen { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0 0; }
.tuev-kennzahlen .kennzahl { font-size: 12.5px; padding: 5px 12px; border-radius: 999px;
  background: var(--bg-input); color: var(--text-muted); border: 1px solid var(--border); }
.tuev-kennzahlen .kennzahl strong { color: var(--text); font-size: 14px; margin-right: 3px; }
.tuev-kennzahlen .kennzahl.urgent { background: oklch(93% 0.05 25); border-color: oklch(80% 0.08 25); }
.tuev-kennzahlen .kennzahl.urgent strong { color: oklch(52% 0.16 25); }
.tbl tr.tuev-zeile-faellig td { background: oklch(97% 0.02 25); }
.tbl td.tuev-rest-urgent { color: oklch(52% 0.16 25); font-weight: 700; }

/* KFZ-125: grüner Haken – Termin beim Prüfer steht fest */
.haken { color: #2e9e5b; font-weight: 700; }

/* KFZ-126/127: Dokumente eines Objekts in Fahrzeug-/Vertragsmaske */
.dokumente-block { display: flex; flex-direction: column; gap: 8px; }
.dokumente-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.dokumente-liste li { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.dok-meta { font-size: 11.5px; color: var(--text-muted); }
.dok-bearbeiten { font-size: 11.5px; color: var(--text-muted); text-decoration: underline; }
.dok-leer { margin: 0; font-size: 12.5px; color: var(--text-muted); }
.dok-neu { align-self: flex-start; height: 30px; padding: 0 14px; font-size: 12.5px;
  display: inline-flex; align-items: center; text-decoration: none; }
.stichwort { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 8px;
  border-radius: 999px; background: var(--accent-soft); color: oklch(35% 0.09 230); }

/* KFZ-138: Übersicht als Metaplanwand – gerahmte Objektgruppen mit
   plastischen Karten. */
/* KFZ-176: „Fluid" – der Inhalt (.uebersicht-fit) wird per JS (uebersicht.js)
   über `zoom` zwischen 100 % und 50 % skaliert, damit möglichst alles ohne
   Scrollen sichtbar bleibt; passt es bei 50 % nicht, greift der Scroll. */
.uebersicht-titel { font-size: 30px; font-weight: 800; letter-spacing: -.5px; margin: 4px 0 6px; }
.uebersicht-sub { color: var(--text-muted); font-size: 13.5px; max-width: 720px; margin: 0; }

/* Eine Objektgruppe = eine gerahmte Pinnwand. Titel steht vertikal links in der
   Gruppe (KFZ-155) – das spart die Kopfzeile und macht die Gruppe flacher. */
.board {
  display: flex; align-items: stretch; gap: 14px;
  margin-top: 16px; padding: 14px 18px 14px 12px; border-radius: 18px;
  border: 1.5px solid var(--brd, var(--border)); background: var(--tint, #fff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 2px 12px -4px rgba(0, 0, 0, .06);
}
.board-seite { flex: none; display: flex; flex-direction: column;
  align-items: center; justify-content: center; }
/* Vertikaler Titel: gleiche Gruppenfarbe (dunkler), Großbuchstaben, 50% transparent (KFZ-155/156) */
.board-titel { margin: 0; writing-mode: vertical-rl; transform: rotate(180deg);
  font-size: 19px; font-weight: 800; letter-spacing: .6px; white-space: nowrap;
  text-transform: uppercase; opacity: .5;
  color: color-mix(in oklab, var(--dot, var(--text-muted)), black 26%); }
.board-raster { flex: 1 1 auto; display: grid; gap: 16px; align-content: start;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* Karte: wirkt wie eine echte Karte auf der Wand (Schatten, Anheben, Pinnnadel) */
.karte {
  position: relative; display: flex; flex-direction: column; gap: 2px;
  padding: 22px 20px 18px; border-radius: 14px; text-decoration: none;
  background: #fff; border: 1px solid var(--border); border-top: 3px solid var(--dot, var(--accent));
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 10px 22px -10px rgba(0, 0, 0, .22);
  transition: transform .16s ease, box-shadow .16s ease;
}
.karte:hover { transform: translateY(-4px) rotate(-.4deg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .07), 0 18px 34px -12px rgba(0, 0, 0, .32); }
.karte-pin {
  position: absolute; top: -7px; left: 50%; transform: translateX(-50%);
  width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .85), var(--dot, var(--accent)));
  box-shadow: 0 2px 3px rgba(0, 0, 0, .35);
}
/* Der Titel ist der Link in die Maske – bewusst groß und gut lesbar (KFZ-139) */
.karte-titel { display: inline-flex; align-items: center; gap: 6px; font-size: 15.5px;
  font-weight: 700; line-height: 1.3; color: var(--text); }
.karte-titel svg { width: 15px; height: 15px; flex: none; color: var(--dot, var(--accent)); }
.karte:hover .karte-titel { text-decoration: underline; }
.karte-wert { font-size: 44px; font-weight: 800; line-height: 1.05; margin-top: 10px; color: var(--text); }
.karte-einheit { font-size: 12px; color: var(--text-muted); }

/* Farb-Kennung je Objektgruppe (KFZ-138) */
.board-fahrzeug { --tint: var(--area-fahrzeug); --brd: var(--area-fahrzeug-line); --dot: var(--area-fahrzeug-line); }
.board-vertrag  { --tint: var(--area-vertrag);  --brd: var(--area-vertrag-line);  --dot: var(--area-vertrag-line); }
.board-tuev     { --tint: var(--area-tuev);     --brd: var(--area-tuev-line);     --dot: var(--area-tuev-line); }
.board-todo     { --tint: var(--area-todo);     --brd: var(--area-todo-line);     --dot: var(--area-todo-line); }
.board-mitarbeiter { --tint: var(--area-mitarbeiter); --brd: var(--area-mitarbeiter-line); --dot: var(--area-mitarbeiter-line); }
/* Leere Gruppe (alle Kacheln 0, KFZ-189): schmaler Streifen, Titel horizontal
   statt vertikal – so bleibt die Gruppe nur so hoch, dass der Titel lesbar ist. */
.board-leer { padding-top: 9px; padding-bottom: 9px; }
.board-leer .board-seite { align-items: flex-start; justify-content: center; }
.board-leer .board-titel { writing-mode: horizontal-tb; transform: none; letter-spacing: .8px; }
/* Hinweis, dass die Liste aus einer Kennzahl heraus gefiltert ist (KFZ-109) */
.kpi-hinweis { display: flex; align-items: center; gap: 6px; margin-top: 8px;
  font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px;
  background: var(--area-uebersicht-strong); color: oklch(32% 0.01 250); }
.kpi-hinweis span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi-hinweis a { flex: none; text-decoration: none; font-size: 14px; line-height: 1; opacity: .7; }
.kpi-hinweis a:hover { opacity: 1; }
/* KFZ-134: rotes X statt grünem Auto, wenn der Fahrer eine Leasingsperre hat */
.lz-car.lz-sperre { color: oklch(52% 0.19 25); }

/* Feld, das eigentlich gefüllt sein sollte, ist leer: leichtes rotes Leuchten (KFZ-163) */
.feld-warn-text { display: none; margin-left: 6px; font-size: 11px; font-weight: 600;
  color: oklch(52% 0.19 25); }
.field.feld-warn .feld-warn-text { display: inline; }
.field.feld-warn .control {
  border-color: oklch(62% 0.19 25);
  box-shadow: 0 0 0 3px oklch(62% 0.19 25 / 0.18);
}

/* Fahrzeugliste als Tabulator-Tabelle (mächtige Client-Tabelle) */
.ft-kopf { display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; }
.ft-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ft-tools .control { width: 260px; }
#fahrzeugTabelle, #verfuegbarTabelle { margin-top: 4px; }

/* Verfügbare Fahrzeuge: Ansichts-Umschalter Kalender/Tabelle/Gantt (KFZ-205/206/207) */
.ansicht-tabs { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ansicht-tab { font: inherit; font-size: 13px; font-weight: 600; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: #fff; color: var(--text-muted); cursor: pointer; user-select: none; }
.ansicht-tab:hover { border-color: var(--accent); color: var(--text); }
.ansicht-tab.active { background: var(--area-fahrzeug); border-color: transparent; color: var(--text); }
.ansicht-tab.disabled { opacity: .6; cursor: not-allowed; }
.ansicht-bald { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-muted); background: #eef1f5; padding: 1px 6px; border-radius: 999px; margin-left: 5px; }

/* Von-/Bis-Filter */
.vf-filter { align-items: flex-end; }
.vf-range { display: flex; flex-direction: column; gap: 3px; font-size: 11px; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }
.vf-range .control { width: auto; }

/* Kalender */
.vf-kal { display: flex; flex-wrap: wrap; gap: 18px; }
.vf-month { border: 1px solid var(--border); border-radius: 12px; background: #fff; padding: 12px; min-width: 280px; }
.vf-month-titel { font-weight: 700; font-size: 14px; margin: 0 0 8px; }
.vf-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.vf-wd { text-align: center; font-size: 11px; font-weight: 700; color: var(--text-muted); padding: 2px 0; }
.vf-cell { position: relative; aspect-ratio: 1 / 1; border: 1px solid var(--border); border-radius: 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: #fff; cursor: pointer; transition: border-color .1s, box-shadow .1s; }
.vf-cell:hover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.vf-cell.vf-empty, .vf-cell.vf-out { background: #f6f7f9; border-color: transparent; cursor: default; box-shadow: none; }
.vf-cell.vf-out { opacity: .45; }
.vf-cell.vf-out:hover { border-color: transparent; box-shadow: none; }
.vf-daynum { font-size: 11px; color: var(--text-muted); }
.vf-count { font-size: 15px; font-weight: 700; color: #fff; background: var(--accent);
  min-width: 24px; height: 22px; padding: 0 6px; border-radius: 999px; display: inline-flex;
  align-items: center; justify-content: center; }
.vf-count.vf-zero { background: #eef1f5; color: var(--text-muted); }
.vf-cell.vf-today { border-color: var(--accent); }
.vf-cell.vf-sel { box-shadow: 0 0 0 2px var(--accent); border-color: var(--accent); }

/* Tabellen-Kopf über der Tag-Tabelle */
.vf-tab-kopf { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; margin: 0 0 10px; }

/* Gantt (KFZ-207) */
.vf-gantt { border: 1px solid var(--border); border-radius: 12px; background: #fff; overflow-x: auto; }
.vf-g-row { display: grid; grid-template-columns: 200px minmax(320px, 1fr); align-items: center;
  min-height: 34px; border-top: 1px solid var(--border); }
.vf-g-row:first-child { border-top: 0; }
.vf-g-head { position: sticky; top: 0; background: var(--area-fahrzeug); min-height: 30px; z-index: 1; }
.vf-g-label { padding: 4px 10px; font-size: 12px; display: flex; flex-direction: column; gap: 1px;
  border-right: 1px solid var(--border); overflow: hidden; }
.vf-g-head .vf-g-label { font-weight: 700; justify-content: center; }
.vf-g-sub { color: var(--text-muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vf-g-track { position: relative; height: 26px; margin: 4px 8px; }
.vf-g-head .vf-g-track { height: 22px; }
.vf-g-mon { position: absolute; top: 0; height: 100%; font-size: 10px; font-weight: 700; color: var(--text-muted);
  border-left: 1px solid var(--border); padding-left: 4px; white-space: nowrap; box-sizing: border-box;
  display: flex; align-items: center; }
.vf-g-bar { position: absolute; top: 3px; height: 20px; background: var(--accent); border-radius: 6px; min-width: 3px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); }
.vf-g-open { border-top-right-radius: 0; border-bottom-right-radius: 0;
  -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent);
  mask-image: linear-gradient(90deg, #000 82%, transparent); }
.vf-g-leer { padding: 16px; color: var(--text-muted); font-size: 13px; }
/* Heute-Linie quer durchs Diagramm (KFZ-207) */
.vf-g-heute { position: absolute; top: -4px; bottom: -4px; width: 0;
  border-left: 2px solid oklch(58% 0.19 25); z-index: 3; pointer-events: none; }
.vf-g-head .vf-g-heute { top: 0; bottom: 0; }
.vf-g-heute-lbl { position: absolute; top: 1px; left: 3px; font-size: 9px; font-weight: 700;
  color: oklch(50% 0.19 25); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
/* Vertragsende: gestrichelter Pfeil hinter dem Balken (KFZ-207) */
.vf-g-ende { position: absolute; top: 50%; height: 0; transform: translateY(-1px);
  border-top: 2px dashed var(--text-muted); z-index: 2; }
.vf-g-ende::after { content: ""; position: absolute; right: -1px; top: -5px;
  border: 5px solid transparent; border-left-color: var(--text-muted); }

.tabulator { border: 1px solid var(--border); border-radius: 12px; background: #fff;
  font-size: 13px; overflow: hidden; }
.tabulator .tabulator-header { background: var(--area-fahrzeug); border-bottom: 1px solid var(--border); }
.tabulator .tabulator-header .tabulator-col { background: transparent; border-right: 1px solid rgba(0,0,0,.05); }
.tabulator .tabulator-header .tabulator-col.tabulator-sortable:hover { background: var(--area-fahrzeug-strong); }
.tabulator .tabulator-col-title { font-weight: 700; color: var(--text); font-size: 12.5px; }
.tabulator .tabulator-header-filter input,
.tabulator .tabulator-header-filter select {
  border: 1px solid var(--border); border-radius: 6px; padding: 3px 6px;
  font-size: 12px; width: 100%; background: #fff; }
.tabulator-row { cursor: pointer; }
.tabulator-row.tabulator-row-even { background: oklch(98.5% 0.003 250); }
.tabulator-row.tabulator-selectable:hover,
.tabulator-row:hover { background: var(--area-fahrzeug-strong) !important; }
.tabulator .tabulator-cell { border-right: 1px solid rgba(0,0,0,.04); padding: 8px 10px; }
.tabulator .tabulator-footer { background: #fff; border-top: 1px solid var(--border); color: var(--text-muted); }
.tabulator .tabulator-footer .tabulator-page.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Leasingkosten-Pivot (KFZ-177): Summenspalten + berechnete Gesamtzeile hervorheben */
#awPivot .tabulator-row { cursor: default; }
#awPivot .tabulator-cell.pv-sum { font-weight: 700; background: var(--area-fahrzeug); }
#awPivot .tabulator-calcs .tabulator-cell,
#awPivot .tabulator-row.tabulator-calcs { font-weight: 700; background: var(--area-fahrzeug-strong); }
/* Ein-/Ausklappbare Jahres-Gruppenköpfe (KFZ-177-Änderung): Klick-Affordanz + Pfeil */
#awPivot .tabulator-col.tabulator-col-group > .tabulator-col-content { cursor: pointer; }
#awPivot .tabulator-col.tabulator-col-group > .tabulator-col-content .tabulator-col-title::after {
  content: " ▾"; font-size: 10px; opacity: .65;
}
#awPivot .tabulator-col.tabulator-col-group.pv-collapsed > .tabulator-col-content .tabulator-col-title::after {
  content: " ▸";
}

/* Änderungsprotokoll / Logging (KFZ-210) */
.log-liste { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.log-liste li { display: flex; align-items: baseline; gap: 8px; font-size: 11.5px; flex-wrap: wrap; }
.log-art { font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 999px; white-space: nowrap;
  text-transform: uppercase; letter-spacing: .03em; }
.log-erstellt { background: var(--area-fahrzeug); color: oklch(42% 0.09 150); }
.log-geaendert { background: oklch(95% 0.06 75); color: oklch(45% 0.12 70); }
.log-geloescht { background: oklch(94% 0.05 25); color: oklch(48% 0.16 25); }
.log-text { flex: 1; min-width: 140px; color: var(--text); }
.log-meta { color: var(--text-muted); font-size: 10.5px; white-space: nowrap; }
.log-leer { margin: 0 0 8px; color: var(--text-muted); font-size: 11px; }
.log-chip { font-size: 12px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--border);
  background: #fff; color: var(--text-muted); text-decoration: none; }
.log-chip.on { background: var(--area-fahrzeug); border-color: transparent; color: var(--text); }
