/* ================================================================
   BGE TripLog — HUBTEX Design System
   Basiert auf design/styles.css | Vollständig überarbeitet
   ================================================================ */

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
  /* Brand — HUBTEX Rot */
  --hx-red:        #FF661B;
  --hx-red-600:    #E5550D;
  --hx-red-700:    #C24607;
  --hx-red-glow:   rgba(255, 102, 27, 0.22);

  /* Helle Surfaces */
  --bg:            #F4F5F7;
  --bg-2:          #ECEEF1;
  --surface:       #FFFFFF;
  --surface-2:     #FAFBFC;
  --line:          #E4E7EB;
  --line-2:        #EDEFF3;
  --line-strong:   #D4D8DE;

  /* Dunkle Surfaces — Sidebar */
  --ink:           #0E1216;
  --ink-2:         #14181D;
  --ink-3:         #1F2429;
  --ink-4:         #2B3138;
  --ink-5:         #353C44;
  --ink-line:      #2A3037;
  --ink-line-2:    #1A1F24;

  /* Text */
  --text:          #0F1318;
  --text-2:        #3B434C;
  --text-3:        #6B7480;
  --text-4:        #98A0AA;
  --text-on-ink:   #E8ECF0;
  --text-on-ink-2: #A8B0BA;
  --text-on-ink-3: #6E7882;

  /* Status */
  --ok:            #16A34A;
  --ok-bg:         #DCFCE7;
  --warn:          #F59E0B;
  --warn-bg:       #FEF3C7;
  --crit:          #DC2626;
  --crit-bg:       #FEE2E2;
  --info:          #2563EB;
  --info-bg:       #DBEAFE;

  /* Radii */
  --r-sm: 4px;
  --r:    6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;

  /* Schatten */
  --sh-1: 0 1px 0 rgba(15,19,24,.04), 0 1px 2px rgba(15,19,24,.04);
  --sh-2: 0 1px 0 rgba(15,19,24,.03), 0 4px 12px -2px rgba(15,19,24,.06);
  --sh-3: 0 2px 0 rgba(15,19,24,.02), 0 12px 32px -8px rgba(15,19,24,.10);
  --sh-pop: 0 24px 60px -16px rgba(15,19,24,.22), 0 4px 12px -4px rgba(15,19,24,.08);

  /* Typografie */
  --f-sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;

  /* Layout */
  --sidebar-w:   248px;
  --topbar-h:    60px;
  --content-pad: 28px;
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-sans);
  font-size: 14px;
  font-weight: 450;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; }
a { text-decoration: none; color: inherit; }

/* Monospace-Zahlen */
.num {
  font-family: var(--f-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* ── App Shell ────────────────────────────────────────────── */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  background: var(--ink);
  color: var(--text-on-ink);
  border-right: 1px solid var(--ink-line-2);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 30;
  overflow: hidden;
  transition: transform 0.22s ease;
}

.sb-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 16px;
  height: var(--topbar-h);
  border-bottom: 1px solid var(--ink-line);
  flex-shrink: 0;
}

.sb-logo {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: var(--hx-red);
  color: white;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: -0.04em;
  border-radius: var(--r-sm);
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(255,255,255,.06),
              0 8px 16px -8px var(--hx-red-glow);
}

.sb-brand-name {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-on-ink);
  line-height: 1.25;
}
.sb-brand-name span { color: var(--hx-red); }

.sb-brand-tag {
  font-family: var(--f-mono);
  font-size: 9px;
  color: var(--text-on-ink-3);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sb-nav {
  flex: 1;
  padding: 8px;
  overflow-y: auto;
}

.sb-section {
  padding: 12px 10px 5px;
  font-family: var(--f-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-on-ink-3);
}

.sb-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 12px;
  border-radius: var(--r);
  color: var(--text-on-ink-2);
  font-size: 13.5px;
  font-weight: 500;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  position: relative;
  transition: background 0.12s, color 0.12s;
  cursor: pointer;
}
.sb-link:hover {
  background: var(--ink-3);
  color: var(--text-on-ink);
}
.sb-link.active {
  background: var(--ink-3);
  color: white;
}
.sb-link.active::before {
  content: "";
  position: absolute;
  left: -8px; top: 8px; bottom: 8px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--hx-red);
  box-shadow: 0 0 12px var(--hx-red-glow);
}
.sb-link svg { flex-shrink: 0; }

.sb-divider {
  height: 1px;
  background: var(--ink-line);
  margin: 6px 0;
}

.sb-foot {
  padding: 10px 12px;
  border-top: 1px solid var(--ink-line);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.sb-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #353C44, #1F2429);
  border: 1px solid var(--ink-line);
  display: grid; place-items: center;
  color: var(--text-on-ink);
  font-weight: 700;
  font-size: 11px;
  flex-shrink: 0;
  letter-spacing: -0.02em;
}

.sb-user-name { font-size: 12.5px; font-weight: 600; color: var(--text-on-ink); }
.sb-user-role {
  font-family: var(--f-mono);
  font-size: 9px;
  color: var(--text-on-ink-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sb-iconbtn {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid var(--ink-line);
  border-radius: var(--r);
  color: var(--text-on-ink-3);
  margin-left: auto;
  transition: background 0.12s, color 0.12s;
  flex-shrink: 0;
}
.sb-iconbtn:hover { background: var(--ink-3); color: var(--text-on-ink); }

/* Mobile overlay */
.sb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 25;
  backdrop-filter: blur(2px);
}
.sb-overlay.show { display: block; }

/* ── Hauptspalte ─────────────────────────────────────────── */
.main-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ── Topbar ──────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 var(--content-pad);
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 20;
  flex-shrink: 0;
}

.tb-menu-btn {
  display: none;
  width: 36px; height: 36px;
  place-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  color: var(--text-2);
  transition: background 0.12s, border 0.12s;
}
.tb-menu-btn:hover { background: var(--bg); border-color: var(--line); }

.tb-crumb {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-3);
}
.tb-crumb .sep { opacity: 0.4; }
.tb-crumb .now { font-weight: 600; color: var(--text); }

.tb-spacer { flex: 1; }

.tb-actions { display: flex; align-items: center; gap: 6px; }

.tb-iconbtn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  color: var(--text-2);
  transition: background 0.12s, border 0.12s;
  position: relative;
}
.tb-iconbtn:hover { background: var(--bg); border-color: var(--line); }

.tb-divider { width: 1px; height: 22px; background: var(--line); margin: 0 2px; }

/* ── Inhalt ──────────────────────────────────────────────── */
.content {
  padding: var(--content-pad);
  flex: 1;
}

/* ── Seitenkopf ──────────────────────────────────────────── */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.2;
  margin: 0 0 3px;
}

.page-sub {
  font-size: 12.5px;
  color: var(--text-3);
}

.page-actions { display: flex; align-items: center; gap: 8px; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  white-space: nowrap;
  transition: background 0.12s, border 0.12s, transform 0.06s;
}
.btn:hover { background: var(--bg); border-color: var(--line-strong); }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--hx-red);
  border-color: var(--hx-red-600);
  color: white;
  box-shadow: 0 1px 0 rgba(255,255,255,.15) inset,
              0 6px 16px -6px var(--hx-red-glow);
}
.btn-primary:hover {
  background: var(--hx-red-600);
  border-color: var(--hx-red-700);
  color: white;
}

.btn-dark {
  background: var(--ink-3);
  border-color: var(--ink-4);
  color: white;
}
.btn-dark:hover { background: var(--ink-4); color: white; }

.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--bg); border-color: var(--line); }

.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; }
.btn-lg { height: 42px; padding: 0 20px; font-size: 14px; font-weight: 700; }

/* Großer Absende-Button */
.btn-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 44px;
  background: var(--hx-red);
  border: 1px solid var(--hx-red-600);
  color: white;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--r-md);
  letter-spacing: 0.01em;
  box-shadow: 0 1px 0 rgba(255,255,255,.15) inset,
              0 8px 20px -8px var(--hx-red-glow);
  transition: background 0.12s, transform 0.06s;
}
.btn-submit:hover { background: var(--hx-red-600); }
.btn-submit:active { transform: translateY(1px); }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  margin-bottom: 14px;
}

.card-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-2);
}
.card-hd h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}
.card-hd .meta {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.04em;
}

.card-bd { padding: 18px; }
.card-bd.p0 { padding: 0; }

/* ── KPI-Karten ──────────────────────────────────────────── */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 15px 17px 13px;
  box-shadow: var(--sh-1);
  transition: box-shadow 0.16s, transform 0.16s;
  position: relative;
  overflow: hidden;
}
.kpi:hover { box-shadow: var(--sh-2); transform: translateY(-1px); }

.kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
}
.kpi-label {
  font-family: var(--f-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-3);
}
.kpi-icon {
  width: 26px; height: 26px;
  border-radius: var(--r);
  background: var(--bg);
  display: grid; place-items: center;
  color: var(--text-2);
}
.kpi.accent { border-color: rgba(255,102,27,.18); }
.kpi.accent::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(255,102,27,.05) 0%, transparent 55%);
  pointer-events: none;
}
.kpi.accent .kpi-icon { background: rgba(255,102,27,.08); color: var(--hx-red); }

.kpi-val {
  font-family: var(--f-mono);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.1;
  display: flex;
  align-items: baseline;
  gap: 5px;
  color: var(--text);
}
.kpi-val .unit {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: 0;
}

.kpi-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 11px;
  color: var(--text-3);
}

/* ── Status-Pills ────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-family: var(--f-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1;
}
.pill .dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }

.pill.ok      { background: var(--ok-bg);   color: #166534; }
.pill.ok .dot { background: var(--ok); }
.pill.warn      { background: var(--warn-bg); color: #92400E; }
.pill.warn .dot { background: var(--warn); }
.pill.crit      { background: var(--crit-bg); color: #991B1B; }
.pill.crit .dot { background: var(--crit); }
.pill.info      { background: var(--info-bg); color: #1E40AF; }
.pill.info .dot { background: var(--info); }
.pill.neutral      { background: var(--bg-2, #ECEEF1); color: var(--text-2); }
.pill.neutral .dot { background: var(--text-3); }
.pill.dark      { background: var(--ink-3); color: white; }
.pill.dark .dot { background: var(--ok); }

/* ── Tabellen ────────────────────────────────────────────── */
.tbl-wrap {
  overflow-x: auto;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  box-shadow: var(--sh-1);
  background: var(--surface);
}

.tbl {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.tbl thead th {
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  padding: 9px 13px;
  text-align: left;
  font-family: var(--f-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  white-space: nowrap;
}
.tbl thead th:first-child { padding-left: 18px; }
.tbl thead th:last-child  { padding-right: 18px; }

.tbl tbody td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
}
.tbl tbody td:first-child { padding-left: 18px; }
.tbl tbody td:last-child  { padding-right: 18px; }
.tbl tbody tr { transition: background 0.1s; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tbody tr:last-child td { border-bottom: none; }

.tbl-strong { font-weight: 600; color: var(--text); }
.tbl-sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.tbl-mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.tbl-muted { color: var(--text-3); }

/* Aktions-Schaltfläche in Tabelle */
.tbl-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: var(--r);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-3);
  transition: background 0.12s, color 0.12s, border 0.12s;
}
.tbl-action:hover { background: var(--crit-bg); border-color: rgba(220,38,38,.2); color: var(--crit); }

/* ── Filter-Bar ──────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.filter-field label {
  font-family: var(--f-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* ── Formular-Sections ───────────────────────────────────── */
.form-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  margin-bottom: 14px;
  overflow: hidden;
}

.form-section-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--line-2);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface-2);
}
.form-section-hd svg { color: var(--text-3); }

.form-section-bd { padding: 18px; }

.form-grid {
  display: grid;
  gap: 14px;
}
.form-grid.g2 { grid-template-columns: 1fr 1fr; }
.form-grid.g3 { grid-template-columns: 1fr 1fr 1fr; }

/* Felder */
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.field label {
  font-family: var(--f-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}
.field label .req { color: var(--hx-red); }

.input, .select {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 0 12px;
  height: 38px;
  font-size: 13.5px;
  color: var(--text);
  outline: none;
  width: 100%;
  transition: border 0.12s, box-shadow 0.12s;
}
.input:focus, .select:focus {
  border-color: var(--ink-4);
  box-shadow: 0 0 0 3px rgba(15,19,24,.05);
}
.input.is-error, .select.is-error, .textarea.is-error {
  border-color: var(--crit);
  box-shadow: 0 0 0 3px rgba(220,38,38,.07);
}
.input::placeholder { color: var(--text-4); font-weight: 400; }

.textarea {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 10px 12px;
  font-size: 13.5px;
  color: var(--text);
  outline: none;
  width: 100%;
  resize: vertical;
  min-height: 82px;
  line-height: 1.5;
  transition: border 0.12s, box-shadow 0.12s;
}
.textarea:focus { border-color: var(--ink-4); box-shadow: 0 0 0 3px rgba(15,19,24,.05); }
.textarea::placeholder { color: var(--text-4); }

.field-error {
  font-size: 11.5px;
  color: var(--crit);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Toggle-Gruppe (dienstlich / privat) ─────────────────── */
.toggle-group {
  display: flex;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--bg);
}
.toggle-group input[type="radio"] { display: none; }
.toggle-group label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--f-sans);
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-3);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  border-right: 1px solid var(--line);
  user-select: none;
}
.toggle-group label:last-of-type { border-right: none; }
.toggle-group input[type="radio"]:checked + label {
  background: var(--ink-3);
  color: white;
}

/* ── KM-Differenz ────────────────────────────────────────── */
.km-diff {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--f-mono);
  font-size: 11.5px;
  color: var(--text-3);
  padding: 7px 11px;
  background: var(--surface-2);
  border: 1px dashed var(--line);
  border-radius: var(--r);
  margin-top: 10px;
  letter-spacing: 0.02em;
}
.km-diff.err { color: var(--crit); background: var(--crit-bg); border-color: rgba(220,38,38,.3); }

/* ── Hinweis-Boxen ───────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 16px;
  border-radius: var(--r-md);
  font-size: 13px;
  margin-bottom: 16px;
  border: 1px solid transparent;
  line-height: 1.5;
}
.alert svg { flex-shrink: 0; margin-top: 1px; }
.alert strong { font-weight: 700; display: block; margin-bottom: 2px; }
.alert.alert-ok   { background: var(--ok-bg);   color: #166534; border-color: #86EFAC; }
.alert.alert-err  { background: var(--crit-bg); color: #991B1B; border-color: #FCA5A5; }
.alert.alert-warn { background: var(--warn-bg); color: #92400E; border-color: #FCD34D; }

/* ── Login-Seite ─────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--bg);
  padding: 24px;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-3);
  padding: 36px 32px 32px;
  width: 100%;
  max-width: 380px;
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.login-logo-icon {
  width: 38px; height: 38px;
  background: var(--hx-red);
  border-radius: var(--r-md);
  display: grid; place-items: center;
  color: white;
  font-weight: 800;
  font-size: 13px;
  box-shadow: 0 4px 12px -4px var(--hx-red-glow);
}
.login-title { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.login-sub   { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* ── Puls-Punkt ──────────────────────────────────────────── */
.pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ok);
  flex-shrink: 0;
  position: relative;
}
.pulse::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: inherit;
  opacity: 0.3;
  animation: pulse-ring 1.8s ease-out infinite;
}
@keyframes pulse-ring {
  from { transform: scale(0.8); opacity: 0.5; }
  to   { transform: scale(2.5); opacity: 0; }
}

/* ── Utilities ───────────────────────────────────────────── */
.row { display: flex; align-items: center; gap: 8px; }
.col { display: flex; flex-direction: column; gap: 8px; }
.gap-4  { gap: 4px; }
.gap-6  { gap: 6px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.flex-1 { flex: 1; min-width: 0; }
.muted  { color: var(--text-3); }
.mono   { font-family: var(--f-mono); }
.strong { font-weight: 600; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-0  { margin-bottom: 0; }
.divider { height: 1px; background: var(--line); margin: 12px 0; }
.empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}

/* Plattendesign-Vorschau */
.plate {
  display: inline-flex;
  align-items: center;
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: .1em;
  color: var(--ink);
  background: #f0f4ff;
  border: 2px solid var(--line);
  border-radius: var(--r-md);
  padding: 6px 18px;
  min-width: 160px;
  justify-content: center;
}

/* QR-Code-Bild */
.qr-img {
  width: 240px; height: 240px;
  border: 5px solid var(--ink);
  border-radius: var(--r-lg);
  display: block;
  margin: 0 auto;
  transition: opacity .2s;
}
.qr-img.loading { opacity: .3; }

.qr-url-box {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--text-3);
  word-break: break-all;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px 13px;
  margin: 14px 0;
  letter-spacing: 0.02em;
}

/* ── Scrollbalken ────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 4px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: #B0B8C4; }
.sidebar ::-webkit-scrollbar-thumb { background: var(--ink-5); border-color: var(--ink); }

/* ── Drucken ──────────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .tb-menu-btn, .no-print { display: none !important; }
  .app-shell { display: block; }
  .content { padding: 0; }
  .kpi-row { grid-template-columns: repeat(3, 1fr); }
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }

  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    z-index: 50;
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--sh-pop);
  }

  .tb-menu-btn { display: grid; }

  .kpi-row { grid-template-columns: 1fr 1fr; }
  .filter-bar { gap: 8px; }
}

@media (max-width: 560px) {
  :root { --content-pad: 16px; }
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .form-grid.g2,
  .form-grid.g3 { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .login-card { padding: 28px 20px; }
}

/* ═══════════════════════════════════════════════════════════
   PHASE 1 — ERWEITERUNGEN
   ═══════════════════════════════════════════════════════════ */

/* ── Detail-Drawer ──────────────────────────────────────── */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(14,18,22,.45);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}
.drawer-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(480px, 96vw);
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -8px 0 40px rgba(0,0,0,.18);
  z-index: 101;
  transform: translateX(100%);
  transition: transform .25s cubic-bezier(.22,.6,.36,1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.drawer.open { transform: translateX(0); }

.drawer-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.drawer-hd h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
  display: flex;
  align-items: center;
  gap: 8px;
}
.drawer-close {
  width: 32px; height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--text-3);
  transition: background .15s, color .15s;
}
.drawer-close:hover { background: var(--surface-2); color: var(--text-1); }

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.drawer-section {
  margin-bottom: 20px;
}
.drawer-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-4);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.drawer-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 7px 0;
  font-size: 13px;
  gap: 12px;
}
.drawer-row + .drawer-row { border-top: 1px solid var(--line); }
.drawer-label {
  color: var(--text-3);
  flex-shrink: 0;
  min-width: 110px;
}
.drawer-val {
  color: var(--text-1);
  font-weight: 500;
  text-align: right;
  word-break: break-word;
}
.drawer-km-big {
  font-family: var(--f-mono);
  font-size: 32px;
  font-weight: 700;
  color: var(--hx-red);
  text-align: center;
  padding: 16px 0 4px;
}
.drawer-km-label {
  text-align: center;
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 16px;
}

/* ── Sortier-Indikatoren in Tabellen-Kopf ───────────────── */
.tbl th a {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.tbl th a:hover { color: var(--hx-red); }
.sort-asc::after  { content: ' ↑'; color: var(--hx-red); }
.sort-desc::after { content: ' ↓'; color: var(--hx-red); }

/* ── Tabellenzeile Hervorhebung >500 km ─────────────────── */
.tbl tr.row-warn td { background: rgba(255, 102, 27, .04); }
.tbl tr.row-warn td:first-child { border-left: 2px solid var(--hx-red); }

/* Klickbare Zeilen */
.tbl tbody tr.clickable { cursor: pointer; }
.tbl tbody tr.clickable:hover td { background: var(--surface-2); }

/* ── Pagination ─────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0 2px;
  flex-wrap: wrap;
  gap: 10px;
}
.pagination-info {
  font-size: 12px;
  color: var(--text-3);
}
.pagination-btns {
  display: flex;
  gap: 4px;
  align-items: center;
}
.page-btn {
  height: 30px;
  min-width: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  display: grid;
  place-items: center;
  text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
}
.page-btn:hover:not(.active):not([disabled]) {
  background: var(--surface-2);
  border-color: var(--line-strong);
  color: var(--text-1);
}
.page-btn.active {
  background: var(--hx-red);
  border-color: var(--hx-red);
  color: #fff;
  font-weight: 700;
}
.page-btn[disabled] {
  opacity: .4;
  cursor: not-allowed;
}
.per-page-select {
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-2);
  font-size: 12px;
  cursor: pointer;
}

/* ── Toast Notification ─────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 200;
  background: var(--ink);
  color: #fff;
  border-radius: var(--r-md);
  padding: 12px 20px;
  font-size: 13.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--sh-pop);
  transform: translateY(16px);
  opacity: 0;
  transition: opacity .22s, transform .22s;
  pointer-events: none;
  max-width: 360px;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}
.toast.toast-ok  { background: #1a6b3c; }
.toast.toast-err { background: #8b1a1a; }
.toast.toast-warn { background: #7a4800; }

/* ── Analytics / Bar Charts ─────────────────────────────── */
.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}
@media (max-width: 900px) {
  .analytics-grid { grid-template-columns: 1fr; }
}

.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bar-row {
  display: grid;
  grid-template-columns: 120px 1fr 56px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}
.bar-label {
  color: var(--text-2);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar-track {
  height: 8px;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: var(--hx-red);
  border-radius: 4px;
  transition: width .4s ease;
  min-width: 2px;
}
.bar-fill.bar-blue  { background: #3b82f6; }
.bar-fill.bar-green { background: #22c55e; }
.bar-val {
  color: var(--text-3);
  font-family: var(--f-mono);
  font-size: 11px;
  text-align: right;
}

/* Donut / Typ-Verteilung */
.type-dist {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 8px 0;
}
.type-donut-wrap {
  position: relative;
  flex-shrink: 0;
}
.type-donut-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: var(--text-1);
  line-height: 1.1;
}
.type-donut-label small {
  font-size: 9px;
  font-weight: 500;
  color: var(--text-4);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.type-legend {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.type-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}
.type-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Monthly trend sparkline using CSS only */
.month-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 60px;
  padding-bottom: 20px;
  position: relative;
}
.month-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  position: relative;
  gap: 3px;
}
.month-bar-fill {
  width: 100%;
  background: var(--hx-red);
  border-radius: 2px 2px 0 0;
  opacity: .85;
  transition: opacity .15s;
  min-height: 2px;
}
.month-bar-fill:hover { opacity: 1; }
.month-bar-lbl {
  position: absolute;
  bottom: -18px;
  font-size: 9px;
  color: var(--text-4);
  text-align: center;
  white-space: nowrap;
  left: 50%;
  transform: translateX(-50%);
}
.month-bar-fill.current { background: #3b82f6; }

/* ── Erweiterte Filter ──────────────────────────────────── */
.filter-bar.expanded {
  flex-wrap: wrap;
}
.filter-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}
.filter-sep {
  height: 20px;
  width: 1px;
  background: var(--line);
  flex-shrink: 0;
}

/* ── KPI 9-er Grid ──────────────────────────────────────── */
.kpi-row.kpi-9 {
  grid-template-columns: repeat(5, 1fr);
}
@media (max-width: 1100px) {
  .kpi-row.kpi-9 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .kpi-row.kpi-9 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .kpi-row.kpi-9 { grid-template-columns: 1fr 1fr; }
}

/* Tabellenzeilen-Auswahl */
.tbl tbody tr.selected td { background: rgba(255,102,27,.07); }

/* ═══════════════════════════════════════════════════════════
   PHASE 2.1 — FAHRZEUG-STAMMDATEN
   ═══════════════════════════════════════════════════════════ */

/* ── Fahrzeug-Kennzeichen-Chip ──────────────────────────── */
.fz-plate {
  display: inline-flex;
  align-items: center;
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--ink);
  background: #f0f4ff;
  border: 1.5px solid #c7d2fe;
  border-radius: 5px;
  padding: 2px 10px;
  white-space: nowrap;
}

/* ── Fahrzeug-Status-Badges ─────────────────────────────── */
.fz-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid transparent;
}
.fz-aktiv    { background:#dcfce7; color:#166534; border-color:#86efac; }
.fz-inaktiv  { background:var(--surface-2); color:var(--text-3); border-color:var(--line); }
.fz-wartung  { background:#fff7ed; color:#9a3412; border-color:#fed7aa; }
.fz-gesperrt { background:var(--crit-bg); color:#991b1b; border-color:#fecaca; }

/* ── Fälligkeits-Badges ─────────────────────────────────── */
.faellig-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  vertical-align: middle;
  margin-left: 4px;
}
.faellig-badge.soon    { background:#fff7ed; color:#9a3412; border:1px solid #fed7aa; }
.faellig-badge.overdue { background:var(--crit-bg); color:#991b1b; border:1px solid #fecaca; }
td.faellig-overdue { color: var(--crit) !important; }
td.faellig-soon    { color: #c2410c; }

/* ── Status-Dropdown-Menü ───────────────────────────────── */
.fz-status-menu { position: relative; }
.fz-status-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-pop);
  min-width: 120px;
  z-index: 30;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.fz-status-dropdown.open { display: flex; }
.fz-dropdown-item {
  background: none;
  border: none;
  padding: 9px 14px;
  text-align: left;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-1);
  font-family: var(--f-sans);
  transition: background .12s;
}
.fz-dropdown-item:hover { background: var(--surface-2); }

/* ── Fahrzeug-Selector im Formular ──────────────────────── */
.fz-selector-wrap {
  position: relative;
}
.fz-selector-input {
  width: 100%;
}
.fz-selector-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--r-sm);
  font-size: 12px;
  color: #1e40af;
  margin-top: 6px;
}

/* ── Fahrzeug-KPI-Zeile ─────────────────────────────────── */
.kpi-row.kpi-fz {
  grid-template-columns: repeat(6, 1fr);
  margin-top: 0;
}
@media (max-width: 1100px) { .kpi-row.kpi-fz { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px)  { .kpi-row.kpi-fz { grid-template-columns: 1fr 1fr; } }

/* ── Drawer: Fahrzeug-Abschnitt ─────────────────────────── */
.drawer-fz-plate {
  font-family: var(--f-mono);
  font-weight: 800;
  font-size: 20px;
  color: var(--ink);
  background: #f0f4ff;
  border: 2px solid #c7d2fe;
  border-radius: 6px;
  padding: 4px 16px;
  display: inline-block;
  margin-bottom: 12px;
  letter-spacing: .06em;
}

/* ── KM-Start Auto-Fill Hint ────────────────────────────── */
#km-start-hint {
  gap: 6px;
  align-items: center;
  padding: 5px 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.4;
}
#km-fetch-btn {
  white-space: nowrap;
  gap: 5px;
}
#km-fetch-btn:disabled {
  opacity: .6;
  cursor: wait;
}

/* ── Sicherheits-Check Styles ───────────────────────────── */
.check-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.check-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
  transition: border-color .15s;
}
.check-item:hover { border-color: var(--line-strong); }
.check-item-critical { border-left: 3px solid var(--warn, #F59E0B); }
.check-item-critical.has-mangel { border-left-color: var(--crit, #DC2626); }

.check-item-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.check-item-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-1);
}
.check-crit-dot {
  font-size: 14px;
  flex-shrink: 0;
  color: var(--warn, #F59E0B);
}
.check-item-critical.has-mangel .check-crit-dot { color: var(--crit, #DC2626); }

.check-status-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.cs-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--line);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: background .12s, border-color .12s, color .12s;
  user-select: none;
}
.cs-label input[type="radio"] { display: none; }

/* OK */
.cs-label.cs-ok  { color: var(--text-2); }
.cs-label.cs-ok:has(input:checked) { background: #f0fdf4; border-color: #22c55e; color: #166534; }
/* Hinweis */
.cs-label.cs-warn { color: var(--text-2); }
.cs-label.cs-warn:has(input:checked) { background: var(--warn-bg); border-color: var(--warn, #F59E0B); color: #92400E; }
/* Mangel */
.cs-label.cs-crit { color: var(--text-2); }
.cs-label.cs-crit:has(input:checked) { background: var(--crit-bg); border-color: var(--crit, #DC2626); color: #991B1B; }
/* Nicht geprüft */
.cs-label.cs-neutral { color: var(--text-3); font-size: 12px; }
.cs-label.cs-neutral:has(input:checked) { background: var(--surface-2); border-color: var(--line-strong); color: var(--text-2); }

/* Hover auf nicht-ausgewählten */
.cs-label.cs-ok:not(:has(input:checked)):hover    { background: #f0fdf4; border-color: #86efac; }
.cs-label.cs-warn:not(:has(input:checked)):hover  { background: var(--warn-bg); border-color: #FCD34D; }
.cs-label.cs-crit:not(:has(input:checked)):hover  { background: var(--crit-bg); border-color: #FECACA; }
.cs-label.cs-neutral:not(:has(input:checked)):hover { background: var(--surface-2); }

.check-bem-wrap {
  margin-top: 10px;
}
.check-bem-toggle {
  font-size: 11px;
  color: var(--text-3);
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
}
.check-bem-toggle:hover { color: var(--text-1); }

/* Check-Status-Badge für Fahrtenliste */
.check-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.check-badge.cb-ok      { background: #f0fdf4; color: #166534; border: 1px solid #86efac; }
.check-badge.cb-hinweis { background: var(--warn-bg); color: #92400E; border: 1px solid #FCD34D; }
.check-badge.cb-kritisch{ background: var(--crit-bg); color: #991B1B; border: 1px solid #FECACA; }
.check-badge.cb-missing { background: var(--surface-2); color: var(--text-3); border: 1px solid var(--line); }

/* ── Fehlende Pill-Varianten ────────────────────────────── */
.pill-blue { background: #EFF6FF; color: #1E40AF; border-color: #BFDBFE; }
.pill-gray { background: var(--surface-2); color: var(--text-2); }

/* ── Danger-Button ──────────────────────────────────────── */
.btn-danger {
  background: var(--crit-bg, #FEF2F2);
  color: var(--crit, #DC2626);
  border-color: #FECACA;
}
.btn-danger:hover { background: #FEE2E2; border-color: var(--crit); }

/* ── Kleine Input-Variante ──────────────────────────────── */
.input-sm {
  height: 32px;
  padding: 0 10px;
  font-size: 13px;
}
select.input-sm { padding: 0 28px 0 10px; }

/* ═══════════════════════════════════════════════════════════
   DESIGN-DENSITY v2 — Enterprise / Fleet-Control Kompaktierung
   Ziel: höhere Informationsdichte, technischer Leitstand-Look
   Keine Funktionsänderungen — nur Typografie, Abstände, Layout
   ═══════════════════════════════════════════════════════════ */

/* ── Layout-Tokens (Override) ───────────────────────────── */
:root {
  --content-pad: 22px;
  --topbar-h:    56px;
}

/* ── KPI-Karten: Horizontal-Layout (Icon links, Text rechts) */
.kpi {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 15px;
}
.kpi-icon {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  margin-top: 1px;
}
.kpi-body {
  flex: 1;
  min-width: 0;
}
.kpi-val {
  font-size: clamp(18px, 1.55vw, 23px);
  letter-spacing: -0.035em;
  line-height: 1.08;
}
/* KPI-Label: monospace uppercase wie Fleet-Control */
.kpi-lbl {
  font-family: var(--f-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kpi-row {
  gap: 10px;
  margin-bottom: 10px;
}

/* ── Cards — kompaktere Innenabstände ───────────────────── */
.card { margin-bottom: 10px; }
.card-hd { padding: 10px 16px; }
.card-hd h3 { font-size: 12.5px; }
.card-bd { padding: 14px 16px; }

/* ── Seitenkopf ─────────────────────────────────────────── */
.page-head {
  margin-bottom: 14px;
  padding-top: 2px;
}
.page-title {
  font-size: 18px;
  gap: 8px;
  margin-bottom: 2px;
}
.page-sub { font-size: 12px; }

/* ── Tabelle — dichter, professioneller ─────────────────── */
.tbl { font-size: 12.5px; }
.tbl thead th {
  padding: 6px 10px;
  font-size: 9px;
  letter-spacing: 0.11em;
}
.tbl thead th:first-child { padding-left: 14px; }
.tbl thead th:last-child  { padding-right: 14px; }
.tbl tbody td { padding: 7px 10px; }
.tbl tbody td:first-child { padding-left: 14px; }
.tbl tbody td:last-child  { padding-right: 14px; }
.tbl tbody td > div[style*="font-weight:600"],
.tbl tbody td > div[style*="font-weight: 600"] {
  font-size: 12.5px;
}
.tbl tbody td > div[style*="font-size:11px"],
.tbl tbody td > div[style*="font-size: 11px"] {
  font-size: 10.5px;
}

/* ── Filter-Leiste — kompakter ──────────────────────────── */
.filter-bar { gap: 8px; }
.input-sm {
  height: 30px;
  padding: 0 8px;
  font-size: 12px;
}
select.input-sm { padding: 0 24px 0 8px; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; }

/* ── Analytics — kompakter ──────────────────────────────── */
.analytics-grid { gap: 10px; margin-top: 10px; }
.month-bars { height: 76px; }
.bar-chart { gap: 6px; }
.bar-row {
  grid-template-columns: 100px 1fr 48px;
  gap: 8px;
  font-size: 11.5px;
}
.bar-label { font-size: 11.5px; }
.bar-val { font-size: 11px; }
.bar-track { height: 7px; }
.type-legend-item { font-size: 12px; gap: 6px; }
.type-legend { gap: 7px; }

/* ── Drawer — kompakter ─────────────────────────────────── */
.drawer-hd { padding: 14px 20px; }
.drawer-hd h3 { font-size: 14px; }
.drawer-body { padding: 18px 20px; }
.drawer-km-big { font-size: 28px; padding: 10px 0 2px; }
.drawer-km-label { font-size: 10px; margin-bottom: 12px; }
.drawer-section { margin-bottom: 14px; }
.drawer-row { padding: 5px 0; font-size: 12.5px; }
.drawer-label { min-width: 100px; font-size: 12px; }

/* ── Sidebar — kompakter ────────────────────────────────── */
.sb-nav { padding: 6px; }
.sb-link {
  padding: 7px 10px;
  font-size: 13px;
  gap: 9px;
}
.sb-section { padding: 10px 8px 4px; font-size: 8.5px; }
.sb-divider { margin: 4px 0; }
.sb-foot { padding: 8px 10px; }
.sb-user-name { font-size: 12px; }
.sb-user-role { font-size: 8.5px; }

/* ── Pagination — kompakter ─────────────────────────────── */
.pagination { padding: 10px 0 2px; }
.page-btn {
  height: 28px;
  min-width: 28px;
  font-size: 12px;
}
.per-page-select {
  height: 28px;
  font-size: 12px;
  padding: 0 6px;
}

/* ── Topbar Breadcrumb ──────────────────────────────────── */
.tb-crumb { font-size: 12.5px; }

/* ── Alert — kompakter ──────────────────────────────────── */
.alert { padding: 10px 14px; font-size: 12.5px; margin-bottom: 12px; }

/* ── Leerer Zustand ─────────────────────────────────────── */
.empty-state { padding: 32px 20px; font-size: 12.5px; }

/* ── Responsive Anpassungen ─────────────────────────────── */
@media (max-width: 960px) {
  .kpi { padding: 11px 13px; }
  .kpi-val { font-size: 18px; }
}
@media (max-width: 560px) {
  :root { --content-pad: 14px; }
  .kpi-val { font-size: 16px; }
}

/* ═══════════════════════════════════════════════════════════
   PHASE 2.2 — FAHRZEUGAKTE / VEHICLE DETAIL
   ═══════════════════════════════════════════════════════════ */

/* ── Tab Navigation ─────────────────────────────────────── */
.tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}
.tab-nav::-webkit-scrollbar { display: none; }
.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 15px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-3);
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  white-space: nowrap;
  transition: color .12s, border-color .12s;
  text-decoration: none;
}
.tab-btn:hover { color: var(--text-1); }
.tab-btn.active {
  color: var(--hx-red);
  border-bottom-color: var(--hx-red);
  font-weight: 600;
}
.tab-badge {
  font-family: var(--f-mono);
  font-size: 9.5px;
  background: var(--bg-2);
  color: var(--text-3);
  padding: 1px 5px;
  border-radius: 10px;
  font-weight: 700;
}
.tab-badge.warn { background: var(--warn-bg); color: #92400e; }
.tab-badge.crit { background: var(--crit-bg); color: var(--crit); }
.tab-panel { display: none; padding: 18px; }
.tab-panel.active { display: block; }

/* ── Vehicle Header ─────────────────────────────────────── */
.vehicle-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 22px;
  margin-bottom: 10px;
  box-shadow: var(--sh-1);
}
.vehicle-header-left { flex: 1; min-width: 0; }
.vehicle-header-plate {
  font-family: var(--f-mono);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 4px;
}
.vehicle-header-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 8px;
}
.vehicle-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 8px;
}
.vehicle-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
}
.vehicle-meta-sep {
  width: 1px; height: 12px;
  background: var(--line-strong);
  flex-shrink: 0;
}
.vehicle-header-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: flex-start;
  flex-shrink: 0;
}
@media (max-width: 800px) {
  .vehicle-header { flex-direction: column; }
  .vehicle-header-actions { flex-direction: row; }
}

/* ── Locked vehicle banner ──────────────────────────────── */
.vehicle-locked-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  background: var(--crit-bg);
  border: 1px solid #fecaca;
  border-radius: var(--r-md);
  margin-bottom: 10px;
  color: #991b1b;
  font-size: 13px;
  font-weight: 600;
  border-left: 4px solid var(--crit);
}
.vehicle-maintenance-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  background: var(--warn-bg);
  border: 1px solid #fde68a;
  border-radius: var(--r-md);
  margin-bottom: 10px;
  color: #92400e;
  font-size: 13px;
  font-weight: 600;
  border-left: 4px solid var(--warn);
}

/* ── Due Date / Maintenance Cards ───────────────────────── */
.due-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 0;
}
@media (max-width: 700px) { .due-cards-grid { grid-template-columns: 1fr; } }

.maintenance-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  box-shadow: var(--sh-1);
}
.maintenance-card.due-warning {
  border-color: rgba(245,158,11,.35);
  background: linear-gradient(160deg, #fffbeb 0%, var(--surface) 50%);
}
.maintenance-card.due-critical {
  border-color: rgba(220,38,38,.3);
  background: linear-gradient(160deg, #fef2f2 0%, var(--surface) 50%);
}
.maintenance-card-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.maintenance-card-label {
  font-family: var(--f-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-3);
}
.maintenance-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.maintenance-badge.ok      { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.maintenance-badge.soon    { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.maintenance-badge.overdue { background: var(--crit-bg); color: #991b1b; border: 1px solid #fecaca; }
.maintenance-badge.na      { background: var(--surface-2); color: var(--text-3); border: 1px solid var(--line); }

.maintenance-card-date {
  font-size: 15px;
  font-weight: 700;
  font-family: var(--f-mono);
  color: var(--text-1);
  margin-bottom: 4px;
  letter-spacing: -.02em;
}
.maintenance-card-sub {
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 8px;
}

.due-progress {
  height: 4px;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid var(--line-2);
}
.due-progress-bar {
  height: 100%;
  border-radius: 2px;
  transition: width .4s ease;
}
.due-progress-bar.ok      { background: var(--ok); }
.due-progress-bar.soon    { background: var(--warn); }
.due-progress-bar.overdue { background: var(--crit); width: 100% !important; }

/* ── Vehicle Timeline (Status Log) ──────────────────────── */
.vehicle-timeline {
  display: flex;
  flex-direction: column;
}
.timeline-item {
  display: flex;
  gap: 14px;
  padding: 10px 0 10px 20px;
  border-left: 2px solid var(--line-2);
  margin-left: 5px;
  position: relative;
}
.timeline-item:last-child { border-left-color: transparent; }
.timeline-dot {
  position: absolute;
  left: -7px;
  top: 14px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--line-strong);
  flex-shrink: 0;
}
.timeline-dot.ok   { border-color: var(--ok);   background: var(--ok-bg);   }
.timeline-dot.warn { border-color: var(--warn);  background: var(--warn-bg); }
.timeline-dot.crit { border-color: var(--crit);  background: var(--crit-bg); }
.timeline-dot.info { border-color: var(--info);  background: var(--info-bg); }
.timeline-dot.gray { border-color: var(--line-strong); background: var(--bg-2); }
.timeline-content { flex: 1; min-width: 0; }
.timeline-title { font-size: 12.5px; font-weight: 600; color: var(--text-1); }
.timeline-sub   { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.timeline-time  {
  font-size: 10.5px;
  color: var(--text-4);
  font-family: var(--f-mono);
  white-space: nowrap;
  margin-top: 3px;
}

/* ── Wartung List ───────────────────────────────────────── */
.wartung-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wartung-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color .12s;
}
.wartung-item:hover { border-color: var(--line-strong); }
.wartung-item.w-erledigt { opacity: .7; }
.wartung-typ-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 700;
  font-family: var(--f-mono);
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}
.wt-UVV        { background: #eff6ff; color: #1e40af; }
.wt-Service    { background: #f0fdf4; color: #166534; }
.wt-Reparatur  { background: #fef2f2; color: #991b1b; }
.wt-Inspektion { background: #fdf4ff; color: #7e22ce; }
.wt-Sonstige   { background: var(--surface-2); color: var(--text-2); }

.wartung-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 9.5px;
  font-weight: 600;
  margin-left: 6px;
}
.ws-offen   { background: var(--warn-bg); color: #92400e; }
.ws-geplant { background: var(--info-bg); color: #1e40af; }
.ws-erledigt{ background: var(--ok-bg);   color: #166534; }

/* ── Vehicle specs table in Übersicht ───────────────────── */
.spec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.spec-row {
  display: flex;
  padding: 7px 0;
  font-size: 12.5px;
  border-bottom: 1px solid var(--line-2);
  gap: 12px;
}
.spec-row:last-child { border-bottom: none; }
.spec-label { color: var(--text-3); min-width: 120px; flex-shrink: 0; font-size: 12px; }
.spec-value { color: var(--text-1); font-weight: 500; }

/* ── Section dividers inside tabs ───────────────────────── */
.tab-section-hd {
  font-family: var(--f-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--text-4);
  margin: 18px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-2);
}
.tab-section-hd:first-child { margin-top: 0; }
