/* =====================================================================
   WD-SafeRoute – Designsystem
   Schwarz · Gold · Weiß – passend zu Logo und Fahrzeugbeklebung
   ===================================================================== */
:root {
  --bg: #0a0a0b;
  --bg-2: #101012;
  --surface: #151518;
  --surface-2: #1c1c20;
  --surface-3: #25252a;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #f5f3ee;
  --muted: #a3a09a;
  --faint: #6f6c67;
  --gold: #c9a043;
  --gold-2: #e6c26a;
  --gold-soft: rgba(201, 160, 67, 0.15);
  --ok: #3cb878;
  --ok-soft: rgba(60, 184, 120, 0.14);
  --warn: #e7a33a;
  --warn-soft: rgba(231, 163, 58, 0.14);
  --danger: #ef5350;
  --danger-soft: rgba(239, 83, 80, 0.14);
  --info: #5b9bff;
  --info-soft: rgba(91, 155, 255, 0.14);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
  min-height: 100dvh;
}
img { max-width: 100%; display: block; }
a { color: var(--gold-2); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
p { margin: 0; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.gold { color: var(--gold-2); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-lg { display: flex; flex-direction: column; gap: 20px; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.logo svg, .logo .logo-img { height: 40px; width: auto; }
.login-card .logo .logo-img { height: 64px; }
.portal-hero .logo .logo-img { height: 38px; }
.sidebar .logo .logo-img { height: 46px; }
.logo .logo-sub { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  background: var(--surface-3); color: var(--text);
  font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none;
  transition: transform .08s ease, background .15s ease, border-color .15s ease, opacity .15s;
  white-space: nowrap;
}
.btn:hover { background: #2e2e34; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #151208; border-color: rgba(0,0,0,.2); }
.btn-primary:hover { background: linear-gradient(180deg, #f7d676, #dcb13a); }
.btn-ghost { background: transparent; border-color: var(--line-2); }
.btn-ghost:hover { background: rgba(255,255,255,.05); }
.btn-danger { background: var(--danger-soft); color: #ff8a87; border-color: rgba(239,83,80,.35); }
.btn-danger:hover { background: rgba(239,83,80,.24); }
.btn-ok { background: var(--ok); color: #06140c; }
.btn-ok:hover { background: #4ccb8a; }
.btn-lg { min-height: 54px; font-size: 16px; border-radius: var(--radius); padding: 0 22px; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; padding: 0; }
.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; border-color: rgba(255,255,255,.3); border-top-color: var(--text);
  animation: spin .7s linear infinite;
}
.btn-primary.loading::after { border-color: rgba(0,0,0,.25); border-top-color: #151208; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field .hint { font-size: 12px; color: var(--faint); }
.input, select.input, textarea.input {
  width: 100%; min-height: 46px; padding: 10px 14px;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s;
  font-size: 16px; /* verhindert Zoom auf iOS */
}
textarea.input { min-height: 88px; resize: vertical; }
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.input::placeholder { color: var(--faint); }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath stroke='%23a3a09a' stroke-width='1.6' d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
.input-lg { min-height: 56px; font-size: 20px; font-weight: 600; letter-spacing: .02em; }
.input-pin { letter-spacing: .5em; text-align: center; font-size: 24px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 520px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.check input { width: 20px; height: 20px; accent-color: var(--gold); }
.form-error { background: var(--danger-soft); border: 1px solid rgba(239,83,80,.35); color: #ffb3b1; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 14px; }

/* Segmented control */
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { border: 0; background: transparent; padding: 7px 12px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; min-height: 34px; }
.seg button.on { background: var(--surface-3); color: var(--text); }
.seg button.on.ok { background: var(--ok-soft); color: #7fe0ae; }
.seg button.on.bad { background: var(--danger-soft); color: #ff9a97; }
.seg-block { display: flex; width: 100%; }
.seg-block button { flex: 1; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; }
.card-tight { padding: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-title { font-size: 16px; font-weight: 700; }
.card-gold { border-color: rgba(201,160,67,.35); background: linear-gradient(160deg, rgba(201,160,67,.12), rgba(201,160,67,.02) 60%), var(--surface); }
.divider { height: 1px; background: var(--line); margin: 4px 0; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Badges / Chips */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-3); color: var(--muted); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.nodot::before { display: none; }
.badge-ok { background: var(--ok-soft); color: #6fdca5; }
.badge-warn { background: var(--warn-soft); color: #f3c07a; }
.badge-danger { background: var(--danger-soft); color: #ff8f8c; }
.badge-info { background: var(--info-soft); color: #97bfff; }
.badge-gold { background: var(--gold-soft); color: var(--gold-2); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line-2); background: transparent; color: var(--muted); padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.chip:hover { color: var(--text); }
.chip.on { background: var(--gold-soft); border-color: rgba(201,160,67,.5); color: var(--gold-2); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }

/* Kennzeichen im deutschen Stil */
.plate { display: inline-flex; align-items: stretch; border: 2px solid #111; border-radius: 5px; background: #fff; color: #111; font-weight: 800; font-size: 14px; letter-spacing: .04em; overflow: hidden; line-height: 1; white-space: nowrap; box-shadow: 0 1px 0 rgba(255,255,255,.1); }
.plate::before { content: "D"; background: #1b44b8; color: #fff; font-size: 9px; padding: 10px 3px 2px; display: flex; align-items: flex-end; }
.plate span { padding: 5px 8px; font-family: "DIN Alternate", "Arial Narrow", var(--font); }
.plate-lg { font-size: 20px; }
.plate-lg span { padding: 8px 12px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--bg-2); position: sticky; top: 0; white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .1s; }
.table tbody tr.click { cursor: pointer; }
.table tbody tr.click:hover { background: rgba(255,255,255,.03); }
.table td.r, .table th.r { text-align: right; font-variant-numeric: tabular-nums; }
.table tfoot td { font-weight: 800; background: var(--bg-2); border-top: 1px solid var(--line-2); }
.table .group-row td { background: var(--bg-2); font-weight: 700; color: var(--gold-2); font-size: 13px; letter-spacing: .02em; }

/* ---------- Empty state / loader ---------- */
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty svg { width: 40px; height: 40px; margin: 0 auto 10px; opacity: .5; }
.skeleton { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius); }
@keyframes shimmer { to { background-position: -200% 0; } }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line-2); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; margin: 40px auto; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + var(--safe-bottom)); z-index: 1000; display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100% - 32px)); pointer-events: none; }
.toast { background: #1f1f24; border: 1px solid var(--line-2); border-left: 4px solid var(--gold); padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); font-size: 14px; font-weight: 600; animation: toastIn .2s ease; pointer-events: auto; }
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
body.has-bottomnav .toasts { bottom: calc(92px + var(--safe-bottom)); }

/* ---------- Modal / Sheet ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.65); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: 900; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-lg); width: min(560px, 100%); max-height: calc(100dvh - 40px); display: flex; flex-direction: column; box-shadow: var(--shadow); animation: pop .18s ease; }
.modal.wide { width: min(860px, 100%); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 18px; }
.modal-body { padding: 20px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px calc(14px + var(--safe-bottom)); border-top: 1px solid var(--line); flex-wrap: wrap; }
@media (max-width: 640px) {
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal, .modal.wide { width: 100%; border-radius: 22px 22px 0 0; max-height: 94dvh; animation: sheet .22s ease; }
  .modal-foot .btn { flex: 1; }
  @keyframes sheet { from { transform: translateY(40px); opacity: .6; } }
}
.close-x { background: transparent; border: 0; color: var(--muted); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.close-x:hover { background: rgba(255,255,255,.06); color: var(--text); }

/* ---------- Fotos ---------- */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.photo { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); }
.photo img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.photo .rm { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.7); color: #fff; cursor: pointer; font-size: 15px; line-height: 1; }
.photo-add { display: grid; place-items: center; aspect-ratio: 1; border: 1.5px dashed var(--line-2); border-radius: 10px; color: var(--muted); cursor: pointer; text-align: center; font-size: 12px; font-weight: 600; gap: 4px; padding: 6px; }
.photo-add:hover { border-color: var(--gold); color: var(--gold-2); }
.photo-add svg { width: 24px; height: 24px; margin: 0 auto; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 1100; display: grid; place-items: center; padding: 20px; cursor: zoom-out; }
.lightbox img { max-height: 90vh; max-width: 95vw; border-radius: 10px; }

/* =====================================================================
   LOGIN (alle drei Apps)
   ===================================================================== */
.login { position: relative; min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; overflow: hidden; }
.login-bg { position: absolute; inset: 0; z-index: 0; }
.login-bg img { width: 100%; height: 100%; object-fit: cover; object-position: 72% center; }
.login-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #0a0a0b 0%, rgba(10,10,11,.96) 30%, rgba(10,10,11,.55) 55%, rgba(10,10,11,.05) 80%); }
.login-inner { position: relative; z-index: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 40px clamp(20px, 5vw, 72px); }
.login-card { width: min(420px, 100%); display: flex; flex-direction: column; gap: 26px; }
.login-card .eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-2); }
.login-card .eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--gold); }
.login-card h1 { font-size: clamp(30px, 4vw, 42px); font-weight: 800; letter-spacing: -.02em; }
.login-card .lead { color: var(--muted); font-size: 16px; margin-top: 10px; max-width: 34ch; }
.login-form { display: flex; flex-direction: column; gap: 14px; background: rgba(21,21,24,.72); border: 1px solid var(--line-2); border-radius: var(--radius-lg); padding: 22px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.login-foot { font-size: 12px; color: var(--faint); }
@media (max-width: 760px) {
  .login { align-items: flex-end; }
  .login-bg img { height: 58%; object-position: 70% center; }
  .login-bg::after { background: linear-gradient(180deg, rgba(10,10,11,.1) 0%, rgba(10,10,11,.25) 30%, #0a0a0b 57%); }
  .login-inner { padding: 24px 16px calc(24px + var(--safe-bottom)); }
  .login-card { gap: 18px; }
  .login-card .lead { font-size: 15px; }
}

/* =====================================================================
   PORTAL (Fahrer & Vorarbeiter) – mobil zuerst
   ===================================================================== */
.portal { max-width: 640px; margin: 0 auto; padding-bottom: calc(100px + var(--safe-bottom)); }
.portal-hero { position: relative; overflow: hidden; padding: calc(18px + env(safe-area-inset-top, 0px)) 16px 22px; min-height: 190px; display: flex; flex-direction: column; justify-content: space-between; gap: 18px; }
.portal-hero .bg { position: absolute; inset: 0; z-index: 0; }
.portal-hero .bg img { width: 100%; height: 100%; object-fit: cover; object-position: 78% 30%; }
.portal-hero .bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,10,11,.95) 0%, rgba(10,10,11,.75) 45%, rgba(10,10,11,.25) 100%), linear-gradient(0deg, var(--bg) 0%, transparent 45%); }
.portal-hero > * { position: relative; z-index: 1; }
.portal-hero .top { display: flex; align-items: center; justify-content: space-between; }
.portal-hero .hello { font-size: 13px; color: var(--muted); font-weight: 600; }
.portal-hero h1 { font-size: 26px; font-weight: 800; margin-top: 2px; }
.portal-main { padding: 0 16px; display: flex; flex-direction: column; gap: 14px; }
.section-title { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; margin: 8px 2px -2px; }

.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: rgba(16,16,18,.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + var(--safe-bottom)); }
.bottomnav .inner { max-width: 640px; margin: 0 auto; display: flex; }
.bottomnav button { flex: 1; background: transparent; border: 0; color: var(--faint); display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px; font-size: 11px; font-weight: 700; cursor: pointer; border-radius: 12px; position: relative; }
.bottomnav button svg { width: 24px; height: 24px; }
.bottomnav button.on { color: var(--gold-2); }
.bottomnav .count { position: absolute; top: 4px; left: calc(50% + 6px); background: var(--danger); color: #fff; font-size: 10px; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 5px; }

.status-card { position: relative; overflow: hidden; }
.status-card .big { font-size: 30px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(60,184,120,.6); animation: pulse 1.8s infinite; flex: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(60,184,120,0); } 100% { box-shadow: 0 0 0 0 rgba(60,184,120,0); } }
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.action { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 14px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; cursor: pointer; text-align: left; color: var(--text); transition: border-color .15s, background .15s; min-height: 108px; }
.action:hover { border-color: var(--line-2); background: var(--surface-2); }
.action .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold-2); }
.action .ic svg { width: 22px; height: 22px; }
.action.red .ic { background: var(--danger-soft); color: #ff8f8c; }
.action.green .ic { background: var(--ok-soft); color: #6fdca5; }
.action strong { font-size: 15px; }
.action small { color: var(--muted); font-size: 12px; margin-top: -6px; }
.action.wide { grid-column: 1 / -1; flex-direction: row; align-items: center; min-height: 0; }
.action > svg { width: 20px; height: 20px; flex: none; color: var(--faint); }
.action.wide small { margin-top: 0; }
.badge svg { width: 12px; height: 12px; }
.day .avatar svg { width: 18px; height: 18px; }

.checklist { display: flex; flex-direction: column; }
.check-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.check-item:last-child { border-bottom: 0; }
.check-item .t { font-size: 14px; font-weight: 600; }
.check-note { margin: -4px 0 10px; }

.day-list { display: flex; flex-direction: column; }
.day { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.day:last-child { border-bottom: 0; }
.day .date { width: 48px; text-align: center; flex: none; background: var(--surface-2); border-radius: 10px; padding: 6px 0; }
.day .date b { display: block; font-size: 18px; line-height: 1.1; }
.day .date span { font-size: 11px; color: var(--muted); text-transform: uppercase; font-weight: 700; }

.stat-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat .v { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat .l { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }

.team-item { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.team-item.pending { border-color: rgba(231,163,58,.45); background: linear-gradient(90deg, rgba(231,163,58,.08), transparent 70%), var(--surface); }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); font-weight: 800; font-size: 15px; flex: none; color: var(--gold-2); border: 1px solid var(--line-2); }

.banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--radius); background: var(--info-soft); border: 1px solid rgba(91,155,255,.3); font-size: 14px; }
.banner.ok { background: var(--ok-soft); border-color: rgba(60,184,120,.35); }
.banner.warn { background: var(--warn-soft); border-color: rgba(231,163,58,.4); }
.banner svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }

/* =====================================================================
   MANAGER – Desktop-Layout mit Seitenleiste
   ===================================================================== */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--bg-2); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 20px 14px; gap: 22px; }
.sidebar .logo { padding: 0 8px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav button { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; text-align: left; position: relative; }
.nav button svg { width: 19px; height: 19px; flex: none; }
.nav button:hover { background: rgba(255,255,255,.04); color: var(--text); }
.nav button.on { background: var(--gold-soft); color: var(--gold-2); }
.nav button .count { margin-left: auto; background: var(--danger); color: #fff; font-size: 11px; border-radius: 9px; padding: 1px 7px; font-weight: 800; }
.sidebar .foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; font-size: 12px; color: var(--faint); padding: 0 8px; }
.live { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--muted); }
.live .pulse { width: 8px; height: 8px; }
.live.off .pulse { background: var(--faint); animation: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 28px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: rgba(10,10,11,.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); z-index: 40; flex-wrap: wrap; }
.topbar h2 { font-size: 22px; font-weight: 800; }
.content { padding: 24px 28px 60px; display: flex; flex-direction: column; gap: 20px; max-width: 1400px; width: 100%; }

.hero { position: relative; border-radius: var(--radius-lg); overflow: hidden; min-height: 210px; display: flex; align-items: flex-end; padding: 26px; border: 1px solid var(--line); }
.hero .bg { position: absolute; inset: 0; }
.hero .bg img { width: 100%; height: 100%; object-fit: cover; object-position: 70% 35%; }
.hero .bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,10,11,.97) 0%, rgba(10,10,11,.8) 38%, rgba(10,10,11,.1) 75%); }
.hero > div:not(.bg) { position: relative; }
.hero h1 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.hero p { color: var(--muted); margin-top: 6px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; cursor: default; }
.kpi.click { cursor: pointer; }
.kpi.click:hover { border-color: var(--line-2); }
.kpi .l { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; display: flex; align-items: center; gap: 8px; }
.kpi .l svg { width: 16px; height: 16px; color: var(--gold); }
.kpi .v { font-size: 28px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 12px; color: var(--faint); }

.cols { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar .input { min-height: 40px; width: auto; font-size: 14px; }
.month-picker { display: inline-flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: 3px; }
.month-picker span { min-width: 136px; text-align: center; font-weight: 700; font-size: 14px; }
.month-picker button { width: 34px; height: 34px; border: 0; background: transparent; color: var(--muted); border-radius: 8px; cursor: pointer; font-size: 18px; }
.month-picker button:hover { background: rgba(255,255,255,.06); color: var(--text); }

.fleet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.vehicle { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px; display: flex; flex-direction: column; gap: 14px; cursor: pointer; transition: border-color .15s, transform .15s; }
.vehicle:hover { border-color: var(--line-2); transform: translateY(-1px); }
.vehicle .meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; font-size: 13px; }
.vehicle .meta b { display: block; font-size: 14px; color: var(--text); font-variant-numeric: tabular-nums; }
.vehicle .meta span { color: var(--muted); font-size: 12px; }
.client-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; display: flex; flex-direction: column; gap: 14px; border-top: 4px solid var(--c, var(--gold)); }

.menu-toggle { display: none; }
@media (max-width: 1100px) { .cols { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 272px; z-index: 800; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow); }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 700; }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: 12px 16px; }
  .topbar h2 { font-size: 18px; }
  .content { padding: 16px 16px 60px; }
  .hero { min-height: 170px; padding: 18px; }
  .hero h1 { font-size: 22px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi .v { font-size: 22px; }
}

/* ---------- Setup-Hinweis ---------- */
.setup { max-width: 640px; margin: 10vh auto; padding: 24px; }
.setup code { background: var(--surface-2); padding: 2px 6px; border-radius: 6px; font-size: 13px; }

/* ---------- Startseite ---------- */
.landing { position: relative; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.landing-bg { position: fixed; inset: 0; z-index: 0; }
.landing-bg img { width: 100%; height: 100%; object-fit: cover; object-position: 70% center; }
.landing-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,10,11,.96) 0%, rgba(10,10,11,.82) 40%, rgba(10,10,11,.35) 75%, rgba(10,10,11,.2) 100%), linear-gradient(0deg, rgba(10,10,11,.9) 0%, transparent 50%); }
.landing-inner { position: relative; z-index: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 40px clamp(16px, 5vw, 64px); display: flex; flex-direction: column; gap: 36px; }
.landing-inner .brand { height: clamp(80px, 12vw, 120px); width: auto; align-self: flex-start; }
.landing-card { display: flex; flex-direction: column; gap: 14px; padding: 22px; border-radius: var(--radius-lg); text-decoration: none; color: var(--text); background: rgba(21,21,24,.62); border: 1px solid var(--line-2); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); transition: transform .15s, border-color .15s, background .15s; }
.landing-card:hover { transform: translateY(-3px); border-color: rgba(201,160,67,.6); background: rgba(28,28,32,.75); }
.landing-card .ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold-2); }
.landing-card .ic svg { width: 26px; height: 26px; }
.landing-card h2 { font-size: 21px; font-weight: 800; }
.landing-card .go { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--gold-2); font-weight: 700; font-size: 14px; }
@media (max-width: 760px) { .landing-bg img { object-position: 72% center; } .landing-bg::after { background: linear-gradient(180deg, rgba(10,10,11,.55) 0%, rgba(10,10,11,.85) 45%, #0a0a0b 100%); } }
.landing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.landing-tile { position: relative; overflow: hidden; border-radius: var(--radius-lg); border: 1px solid var(--line); min-height: 280px; display: flex; flex-direction: column; justify-content: flex-end; padding: 22px; text-decoration: none; color: var(--text); transition: transform .15s, border-color .15s; }
.landing-tile:hover { transform: translateY(-3px); border-color: rgba(201,160,67,.5); }
.landing-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.landing-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(10,10,11,.97) 15%, rgba(10,10,11,.35) 75%); }
.landing-tile > div { position: relative; z-index: 1; }
.landing-tile h2 { font-size: 22px; font-weight: 800; }
@media (max-width: 860px) { .landing-grid { grid-template-columns: 1fr; } .landing-tile { min-height: 180px; } }

/* ---------- Druck (Abrechnung) ---------- */
@media print {
  :root { color-scheme: light; }
  body { background: #fff; color: #000; }
  .sidebar, .topbar .actions, .no-print, .toasts, .menu-toggle { display: none !important; }
  .shell { display: block; }
  .topbar { position: static; background: #fff; border: 0; }
  .content { padding: 0; }
  .table-wrap { border: 0; background: #fff; }
  .table th, .table tfoot td, .table .group-row td { background: #f1f1f1 !important; color: #000; }
  .table td { color: #000; border-color: #ddd; }
  .badge { border: 1px solid #999; background: none !important; color: #000 !important; }
}
