/* 2.78.0 Fuhrpark-Optik (Marvin 04.11.): kompakter und einheitlicher - Uebersicht, Tages-Dispo, Touren, Fahrer, Fahrzeuge, Historie, Einstellungen.
   Wird als letztes Fuhrpark-Stylesheet geladen und ueberschreibt gezielt mit #fleetView. */

/* ---------- Uebersicht ---------- */
#fleetView .fleet-dashboard-grid { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 14px; align-items: start; }
#fleetView .fleet-dashboard-grid > .fleet-summary { padding: 14px 16px; }
#fleetView .fleet-summary .fleet-section-heading { align-items: center; }
#fleetView .fleet-summary .fleet-section-heading h3, #fleetView .fleet-alert-panel .fleet-section-heading h3 { font-size: 16px; margin: 0; }
#fleetView .fleet-summary .fleet-section-heading button, #fleetView .fleet-alert-panel .fleet-section-heading button { height: 32px; padding: 0 12px !important; font-size: 13px; }
#fleetView .fleet-summary .fleet-metrics { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 12px; }
#fleetView .fleet-summary .fleet-metrics-compact { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
#fleetView .fleet-summary .fleet-metric { flex-direction: row; align-items: center; gap: 10px; min-height: 0; height: 52px; padding: 0 12px; border-radius: 10px; }
#fleetView .fleet-summary .fleet-metric strong { min-width: 34px; font-size: 21px; line-height: 1; font-variant-numeric: tabular-nums; }
#fleetView .fleet-summary .fleet-metric span { font-size: 12.5px; line-height: 1.2; }
#fleetView .fleet-summary .fleet-metric-clickable { transition: transform .15s ease, box-shadow .15s ease; }
#fleetView .fleet-summary .fleet-metric-clickable:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.06); }
#fleetView .fleet-alert-panel { margin-top: 14px; padding: 14px 16px; }
#fleetView .fleet-alert-list { gap: 6px; margin-top: 10px; }
#fleetView .fleet-alert-list button, #fleetView .fleet-alert-list .fleet-alert-static { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; min-height: 0; padding: 8px 12px; border-radius: 9px; }
#fleetView .fleet-alert-list button strong { font-size: 13.5px; }
#fleetView .fleet-alert-list button span { font-size: 12px; white-space: nowrap; }
#fleetView .fleet-alert-list button.danger { border-color: #f0c2bc !important; background: #fff6f5 !important; border-left: 4px solid #d66055 !important; }
#fleetView .fleet-alert-list button.warning { border-left: 4px solid #d3a62a !important; }

/* ---------- Tages-Disposition: gleich hohe Felder, kleine Knoepfe nebeneinander ---------- */
#fleetView .fleet-dispatch-list { gap: 8px; }
#fleetView .fleet-dispatch-card { grid-template-columns: minmax(110px, .55fr) repeat(4, minmax(0, 1fr)) 200px; align-items: stretch; gap: 6px 10px; padding: 10px 12px; }
#fleetView .fleet-dispatch-card > .fleet-tour-identity, #fleetView .fleet-dispatch-card > .fleet-assignment:not(.fleet-additional-drivers), #fleetView .fleet-dispatch-card > .fleet-inline-field { display: flex; flex-direction: column; gap: 3px; min-height: 0; }
#fleetView .fleet-dispatch-card > .fleet-assignment:not(.fleet-additional-drivers) > .fleet-assignment-button,
#fleetView .fleet-dispatch-card > .fleet-inline-field > textarea { flex: 1 1 auto; min-height: 58px !important; margin: 0 !important; box-sizing: border-box; }
#fleetView .fleet-dispatch-card .fleet-assignment-button { justify-content: flex-start; align-items: flex-start; }
#fleetView .fleet-dispatch-card .fleet-inline-field > textarea { resize: none; }
#fleetView .fleet-dispatch-card .fleet-card-actions { display: grid; grid-template-columns: 1fr 1fr; align-content: start; justify-items: stretch; gap: 5px; max-width: none; margin: 0; }
#fleetView .fleet-dispatch-card .fleet-card-actions > .fleet-status-pill { grid-column: 1 / -1; justify-self: start; }
#fleetView .fleet-dispatch-card .fleet-card-actions > .fleet-status-change, #fleetView .fleet-dispatch-card .fleet-card-actions > select, #fleetView .fleet-dispatch-card .fleet-card-actions > label { grid-column: 1 / -1; }
#fleetView .fleet-dispatch-card .fleet-card-actions .fleet-status-change select, #fleetView .fleet-dispatch-card .fleet-card-actions > select { width: 100%; height: 30px; }
#fleetView .fleet-dispatch-card .fleet-card-actions > button { grid-column: auto; height: 28px; padding: 0 8px !important; font-size: 12px; white-space: nowrap; }
/* Fusszeile: Mitfahrer und Zusatzfahrten in EINER schmalen Zeile */
#fleetView .fleet-dispatch-card > .fleet-additional-drivers { grid-column: 2 / 5; margin: 0; padding-top: 6px; border-top: 1px dashed var(--ui-line, #e2e7e0); }
#fleetView .fleet-dispatch-card > .fleet-split-section { grid-column: 5 / -1; margin: 0; padding-top: 6px; border-top: 1px dashed var(--ui-line, #e2e7e0); }
#fleetView .fleet-dispatch-card > .fleet-split-section:has(.fleet-split-list) { grid-column: 1 / -1; }
#fleetView .fleet-dispatch-card > .fleet-additional-drivers::before { content: ""; }
#fleetView .fleet-dispatch-card .fleet-split-heading { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 0; }
#fleetView .fleet-dispatch-card .fleet-split-heading > span, #fleetView .fleet-dispatch-card .fleet-additional-drivers > span { font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--ui-muted, #6e776d); font-weight: 700; }
#fleetView .fleet-dispatch-card .fleet-split-section:not(:has(.fleet-split-list)) .fleet-split-heading > span { display: none; }
#fleetView .fleet-dispatch-card .fleet-add-split, #fleetView .fleet-dispatch-card .fleet-additional-driver-add { height: 26px; padding: 0 10px !important; font-size: 12px; border-radius: 999px; }
#fleetView .fleet-dispatch-card > .fleet-tour-identity { padding-right: 4px; }
@media (max-width: 1280px) {
  #fleetView .fleet-dispatch-card { grid-template-columns: 110px repeat(2, minmax(0, 1fr)); }
  #fleetView .fleet-dispatch-card .fleet-card-actions { grid-column: 1 / -1; grid-template-columns: auto 1fr auto auto; }
  #fleetView .fleet-dispatch-card > .fleet-additional-drivers, #fleetView .fleet-dispatch-card > .fleet-split-section { grid-column: 1 / -1; }
}

/* ---------- Touren: Wochen-Board wie "Woche" ---------- */
#fleetView .fleet-tour-board { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
#fleetView .fleet-tour-board .fleet-week-day > header { padding: 10px 12px; }
#fleetView .fleet-tour-board .fleet-week-day-list { max-height: none; overflow: visible; }
#fleetView .fleet-tour-card { position: relative; }
#fleetView .fleet-tour-card[hidden] { display: none !important; }
#fleetView .fleet-tour-card > .fleet-week-card { width: 100%; padding-right: 64px; }
#fleetView .fleet-tour-card.inactive { opacity: .55; }
#fleetView .fleet-tour-count { margin-left: 6px; padding: 0 6px; border-radius: 999px; background: #eef2ec; color: #5c685f; font-style: normal; font-size: 10.5px; font-weight: 700; vertical-align: 1px; }
#fleetView .fleet-tour-card.warning .fleet-week-card-assignment strong .fleet-tour-count { background: #fff1d6; color: #8a5a00; }
#fleetView .fleet-tour-kunden { position: absolute; top: 8px; right: 8px; height: 22px; padding: 0 8px !important; border-radius: 999px; font-size: 11px; background: transparent !important; border: 1px solid var(--ui-line, #dfe5e3) !important; color: var(--ui-muted, #6e776d) !important; opacity: 0; transition: opacity .15s ease; }
#fleetView .fleet-tour-card:hover .fleet-tour-kunden, #fleetView .fleet-tour-kunden:focus-visible { opacity: 1; }
@media (hover: none) { #fleetView .fleet-tour-kunden { opacity: 1; } }

/* ---------- Fahrer: kompakte Karten im Raster ---------- */
#fleetView .fleet-master-list:has(.fleet-driver-row) { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 8px; }
#fleetView .fleet-driver-row { position: relative; display: block; margin: 0; padding: 10px 12px; border-radius: 12px; }
#fleetView .fleet-driver-row[hidden] { display: none !important; }
#fleetView .fleet-driver-row > .fleet-row-main { display: grid; grid-template-columns: 1fr; gap: 2px; padding-right: 86px; }
#fleetView .fleet-driver-row > .fleet-row-main > span:first-child { font-size: 10px; }
#fleetView .fleet-driver-row > .fleet-row-main > strong { font-size: 15px; }
#fleetView .fleet-driver-row > .fleet-row-main > small { font-size: 12px; }
#fleetView .fleet-driver-row > .fleet-row-main > em { font-style: normal; font-size: 12px; }
#fleetView .fleet-driver-row .fleet-chip-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
#fleetView .fleet-driver-row .fleet-chip { font-size: 10.5px; padding: 2px 7px; }
#fleetView .fleet-driver-row > button.secondary { position: absolute; top: 10px; right: 10px; height: 28px; padding: 0 10px !important; font-size: 12px; }
#fleetView .fleet-driver-row.inactive { opacity: .55; }

/* ---------- Fahrzeuge als Mappen: Reiter oben mit Statusfarbe, Papierkante, Akte "liegt" im Regal ---------- */
#fleetView .fleet-record-vehicle-grid { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 26px 16px; padding-top: 16px; }
#fleetView .fleet-record-vehicle-card { --mappe: #f7f3e8; --mappe-rand: #e3dac2; --reiter: #9aa39a; position: relative; overflow: visible; margin-top: 2px; border: 1px solid var(--mappe-rand); border-radius: 4px 14px 14px 14px; background: linear-gradient(180deg, color-mix(in srgb, var(--reiter) 10%, var(--mappe)) 0, #fffdf8 54px); box-shadow: 4px 4px 0 -1px #fffdf8, 4px 4px 0 0 var(--mappe-rand), 0 10px 22px rgba(60, 50, 20, .07); transition: transform .18s ease, box-shadow .18s ease; }
#fleetView .fleet-record-vehicle-card::before { content: ""; position: absolute; left: -1px; top: -19px; width: 42%; height: 20px; border: 1px solid var(--mappe-rand); border-bottom: 0; border-radius: 10px 14px 0 0; background: color-mix(in srgb, var(--reiter) 26%, var(--mappe)); clip-path: polygon(0 0, 86% 0, 100% 100%, 0 100%); }
#fleetView .fleet-record-vehicle-card::after { content: ""; position: absolute; left: 12px; top: -11px; width: 34px; height: 6px; border-radius: 3px; background: var(--reiter); box-shadow: 0 1px 0 rgba(255,255,255,.6); }
#fleetView .fleet-record-vehicle-card[data-group="available"] { --reiter: #6fa52c; }
#fleetView .fleet-record-vehicle-card[data-group="busy"] { --reiter: #3f7fbf; }
#fleetView .fleet-record-vehicle-card[data-group="workshop"] { --reiter: #e09a1a; }
/* Werkstatt-Gruppe umfasst auch Defekt und Ausser Betrieb (fleet-records.js) */
#fleetView .fleet-record-vehicle-card[data-due="danger"] { --mappe-rand: #e8c7b8; }
#fleetView .fleet-record-vehicle-card:hover { transform: translateY(-3px) rotate(-.3deg); box-shadow: 5px 5px 0 -1px #fffdf8, 5px 5px 0 0 var(--mappe-rand), 0 16px 30px rgba(60, 50, 20, .12); }
#fleetView .fleet-record-vehicle-card.inactive { filter: grayscale(.7); }
#fleetView .fleet-record-vehicle-card .fleet-record-card-main { background: transparent !important; }
#fleetView .fleet-record-vehicle-card .vehicle-image-frame { border-radius: 10px; overflow: hidden; background: #efe9d8; border: 1px solid var(--mappe-rand); }
#fleetView .fleet-record-vehicle-card .vehicle-placeholder { color: #a99d78; }
#fleetView .fleet-record-vehicle-card .fleet-record-card-facts { margin: 0 12px; border-top: 1px dashed var(--mappe-rand); background: transparent; }
#fleetView .fleet-record-vehicle-card .fleet-record-card-facts > div { background: transparent; }
#fleetView .fleet-record-vehicle-card .fleet-record-card-actions { border-top: 0; background: transparent; }

/* ---------- Historie: kompakt ---------- */
#fleetView .fleet-history-kompakt { padding: 14px 16px; }
#fleetView .fleet-history-kompakt .fleet-section-heading { align-items: center; }
#fleetView .fleet-history-kompakt .fleet-section-heading > p { margin: 0; font-size: 12.5px; }
#fleetView .fleet-history-kompakt .fleet-history-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; margin: 10px 0 6px; }
#fleetView .fleet-history-kompakt .fleet-history-filters > label { display: grid; gap: 3px; flex: 0 0 150px; font-size: 11px; font-weight: 600; color: var(--ui-muted, #6e776d); }
#fleetView .fleet-history-kompakt .fleet-history-filters > label.fleet-history-frei { flex: 1 1 220px; }
#fleetView .fleet-history-kompakt .fleet-history-filters input, #fleetView .fleet-history-kompakt .fleet-history-filters select { height: 34px; }
#fleetView .fleet-history-mehr { position: relative; }
#fleetView .fleet-history-mehr > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 1px solid var(--ui-line, #e2e7e0); border-radius: 9px; background: var(--ui-surface, #fff); cursor: pointer; font-size: 13px; font-weight: 600; }
#fleetView .fleet-history-mehr > summary::-webkit-details-marker { display: none; }
#fleetView .fleet-history-mehr > summary::after { content: "\25BE"; font-size: 11px; transition: transform .2s ease; }
#fleetView .fleet-history-mehr[open] > summary::after { transform: rotate(180deg); }
#fleetView .fleet-history-mehr-felder { position: absolute; z-index: 25; top: calc(100% + 6px); left: 0; display: grid; grid-template-columns: repeat(2, 200px); gap: 8px; padding: 12px; border: 1px solid var(--ui-line, #e2e7e0); border-radius: 12px; background: var(--ui-surface, #fff); box-shadow: 0 12px 30px rgba(0,0,0,.12); }
#fleetView .fleet-history-mehr-felder label { display: grid; gap: 3px; font-size: 11px; font-weight: 600; color: var(--ui-muted, #6e776d); }
#fleetView .fleet-history-filters > button { height: 34px; }
#fleetView .fleet-hist-liste { display: grid; gap: 10px; margin: 0; padding: 0; border: 0; }
#fleetView .fleet-hist-liste::before { display: none; }
#fleetView .fleet-hist-tag h4 { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px; margin: 0 0 4px; padding: 4px 0; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ui-muted, #6e776d); background: var(--ui-surface, #fff); }
#fleetView .fleet-hist-tag h4 small { padding: 0 7px; border-radius: 999px; background: #eef2ec; font-size: 11px; }
#fleetView .fleet-hist-row { display: grid; grid-template-columns: 48px 110px 170px minmax(0, 1fr) 140px; align-items: baseline; gap: 10px; margin: 0; padding: 6px 10px; border: 0; border-left: 3px solid #8CC63F; border-radius: 6px; background: transparent; font-size: 13px; }
#fleetView .fleet-hist-row::before, #fleetView .fleet-hist-row::after { display: none; }
#fleetView .fleet-hist-row:nth-child(even) { background: #f8faf7; }
#fleetView .fleet-hist-row:hover { background: #f1f6ea; }
#fleetView .fleet-hist-row.ist-system { border-left-color: #c9b26a; }
#fleetView .fleet-hist-row time { color: var(--ui-muted, #6e776d); font-variant-numeric: tabular-nums; }
#fleetView .fleet-hist-row strong { font-size: 13px; }
#fleetView .fleet-hist-aktion { font-weight: 600; }
#fleetView .fleet-hist-text { color: var(--ui-text, #20251f); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#fleetView .fleet-hist-text em { font-style: normal; color: var(--ui-muted, #6e776d); }
#fleetView .fleet-hist-row:hover .fleet-hist-text { white-space: normal; }
#fleetView .fleet-hist-wer { text-align: right; color: var(--ui-muted, #6e776d); font-size: 12px; }
@media (max-width: 900px) { #fleetView .fleet-hist-row { grid-template-columns: 44px 1fr; } #fleetView .fleet-hist-aktion, #fleetView .fleet-hist-text, #fleetView .fleet-hist-wer { grid-column: 2; text-align: left; } }

/* ---------- Einstellungen: Reiter, immer nur ein Bereich ---------- */
#fleetView .fleet-settings-reiter { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 12px; padding: 5px; border: 1px solid var(--ui-line, #e2e7e0); border-radius: 12px; background: var(--ui-surface, #fff); }
#fleetView .fleet-settings-reiter button { height: 34px; padding: 0 14px !important; border: 0 !important; border-radius: 8px; background: transparent !important; color: var(--ui-text, #20251f) !important; font-weight: 600; font-size: 13.5px; box-shadow: none !important; transition: background .15s ease; }
#fleetView .fleet-settings-reiter button:hover { background: var(--ui-surface-soft, #f4f7f2) !important; }
#fleetView .fleet-settings-reiter button.active { background: var(--ui-green, #315f46) !important; color: #fff !important; }
#fleetView .fleet-settings-page [data-bereich-karte] { display: none; }
#fleetView .fleet-settings-page[data-bereich="ampel"] [data-bereich-karte="ampel"],
#fleetView .fleet-settings-page[data-bereich="erinnerungen"] [data-bereich-karte="erinnerungen"],
#fleetView .fleet-settings-page[data-bereich="kontrolle"] [data-bereich-karte="kontrolle"],
#fleetView .fleet-settings-page[data-bereich="kraftstoff"] [data-bereich-karte="kraftstoff"] { display: block; animation: fp-auftauchen .25s ease-out; }
#fleetView .fleet-settings-page[data-bereich="listen"] .fleet-listen[data-bereich-karte="listen"] { display: grid; animation: fp-auftauchen .25s ease-out; }
#fleetView .fleet-settings-page[data-bereich="listen"] .fleet-settings-section-title[data-bereich-karte="listen"] { display: block; }
#fleetView .fleet-settings-page .fleet-settings-head { margin-bottom: 10px; }
#fleetView .fleet-settings-page .fleet-settings-head p { display: none; }
#fleetView .fleet-settings-page[data-bereich="kraftstoff"] .fleet-settings-head > button, #fleetView .fleet-settings-page[data-bereich="listen"] .fleet-settings-head > button { display: none; }
#fleetView .fleet-settings-page .fleet-settings-actions { display: none; }
/* Listen: kompakte Tabellen im Raster */
#fleetView .fleet-listen { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 10px; }
#fleetView .fleet-liste { padding: 12px 14px; }
#fleetView .fleet-liste .fleet-section-heading span { display: none; }
#fleetView .fleet-liste .fleet-section-heading h3 { font-size: 15px; margin: 0; }
#fleetView .fleet-liste > .fleet-record-note { margin: 2px 0 8px; font-size: 12px; line-height: 1.35; color: var(--ui-muted, #6e776d); }
#fleetView .fleet-liste-tabelle { width: 100%; border-collapse: collapse; font-size: 13px; }
#fleetView .fleet-liste-tabelle th { padding: 4px 6px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; text-align: left; color: var(--ui-muted, #6e776d); border-bottom: 1px solid var(--ui-line, #e2e7e0); }
#fleetView .fleet-liste-tabelle td { padding: 4px 6px; border-bottom: 1px solid #f0f2ee; }
#fleetView .fleet-liste-tabelle tr.is-inaktiv td { color: #9aa39a; text-decoration: none; }
#fleetView .fleet-liste-tabelle tr.is-inaktiv td:first-child { text-decoration: line-through; }
#fleetView .fleet-liste-aktionen { display: flex; justify-content: flex-end; gap: 4px; }
#fleetView .fleet-liste-aktionen button { height: 24px; padding: 0 8px !important; font-size: 11.5px; }
#fleetView .fleet-liste-neu { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 6px; margin-top: 8px; }
#fleetView .fleet-liste-neu input, #fleetView .fleet-liste-neu button { height: 32px; }
/* Speichern rechts neben den Reitern, doppelte Ueberschrift weg */
#fleetView .fleet-settings-page { position: relative; }
#fleetView .fleet-settings-page .fleet-settings-head { position: absolute; top: 5px; right: 6px; z-index: 6; margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
#fleetView .fleet-settings-page .fleet-settings-head > div { display: none; }
#fleetView .fleet-settings-page .fleet-settings-head > button { height: 34px; }
#fleetView .fleet-settings-reiter { padding-right: 130px; }
#fleetView .fleet-liste-tabelle td:first-child, #fleetView .fleet-liste-tabelle td:nth-child(2) { white-space: nowrap; }
#fleetView .fleet-liste-tabelle td:nth-child(3) { width: 1%; font-size: 12px; color: var(--ui-muted, #6e776d); }
