:root {
  --ink: #0f172a;
  --ink-2: #1e293b;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --border: #e3e8ef;
  --text: #0f172a;
  --muted: #64748b;
  --brand: #1d4ed8;
  --brand-600: #1e40af;
  --st-neu: #64748b;
  --st-zugewiesen: #2563eb;
  --st-angenommen: #b45309;
  --st-unterwegs: #047857;
  --st-abgeschlossen: #94a3b8;
  --st-storniert: #b91c1c;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15,23,42,.06), 0 4px 12px rgba(15,23,42,.05);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 16px; }

/* ---------- Topbar ---------- */
.topbar {
  background: var(--ink);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }
.topbar .brand .dot { width: 10px; height: 10px; border-radius: 50%; background: #38bdf8; box-shadow: 0 0 0 4px rgba(56,189,248,.2); }
.topbar .who { font-size: 13px; color: #cbd5e1; }
.topbar button.logout {
  background: transparent; color: #cbd5e1; border: 1px solid #334155;
  padding: 6px 12px; border-radius: 8px; font-size: 13px;
}
.topbar button.logout:hover { color: #fff; border-color: #475569; }

/* ---------- Layout ---------- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 20px 16px 60px; }
.driver-wrap { max-width: 560px; }

/* ---------- Status-Pill (Signatur-Element) ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; color: #fff; white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.85); }
.pill.neu { background: var(--st-neu); }
.pill.zugewiesen { background: var(--st-zugewiesen); }
.pill.angenommen { background: var(--st-angenommen); }
.pill.unterwegs { background: var(--st-unterwegs); }
.pill.abgeschlossen { background: var(--st-abgeschlossen); }
.pill.storniert { background: var(--st-storniert); }

/* ---------- Cards / Board ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 24px 0 12px; }
.section-head h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px;
}
.rides { display: grid; gap: 12px; }

.ride {
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--st-neu);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px;
}
.ride.zugewiesen { border-left-color: var(--st-zugewiesen); }
.ride.angenommen { border-left-color: var(--st-angenommen); }
.ride.unterwegs { border-left-color: var(--st-unterwegs); }
.ride.abgeschlossen { border-left-color: var(--st-abgeschlossen); opacity: .7; }
.ride.storniert { border-left-color: var(--st-storniert); opacity: .6; }

.ride-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.route { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.route .arrow { color: var(--brand); font-weight: 800; }
.meta { color: var(--muted); font-size: 13px; margin-top: 2px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.meta b { color: var(--text); font-weight: 600; }
.when { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink-2); }

.ride-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.assign-row { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.assign-row select { flex: 1; }

/* ---------- Forms / Buttons ---------- */
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 0 0 4px; }
.field { margin-bottom: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
input[type=text], input[type=password], input[type=tel], input[type=number],
input[type=datetime-local], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 10px; background: #fff; color: var(--text); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(29,78,216,.14); }
textarea { min-height: 64px; resize: vertical; }

.btn {
  border: 1px solid transparent; border-radius: 10px; padding: 11px 16px;
  font-weight: 700; font-size: 14px; background: var(--brand); color: #fff;
}
.btn:hover { background: var(--brand-600); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.block { width: 100%; }
.btn.ghost { background: #fff; color: var(--ink-2); border-color: var(--border); }
.btn.ghost:hover { background: #f8fafc; }
.btn.big { padding: 16px; font-size: 16px; }
.btn.go { background: var(--st-unterwegs); } .btn.go:hover { filter: brightness(.94); }
.btn.accept { background: var(--st-zugewiesen); } .btn.accept:hover { filter: brightness(.94); }
.btn.done { background: var(--ink-2); } .btn.done:hover { background: var(--ink); }
.btn.danger { background: #fff; color: var(--st-storniert); border-color: #fca5a5; }
.btn.danger:hover { background: #fef2f2; }
.btn.small { padding: 7px 12px; font-size: 13px; }

/* ---------- Login ---------- */
.login-screen { min-height: 100dvh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(1200px 600px at 50% -10%, #1e293b, var(--ink)); }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,.35); padding: 28px 24px; }
.login-card .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; margin-bottom: 4px; }
.login-card .brand .dot { width: 11px; height: 11px; border-radius: 50%; background: #38bdf8; }
.login-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 20px; }

/* ---------- Utilities ---------- */
.error { background: #fef2f2; border: 1px solid #fecaca; color: var(--st-storniert);
  padding: 10px 12px; border-radius: 10px; font-size: 14px; margin-bottom: 12px; }
.error:empty { display: none; }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; font-size: 15px; }
.hidden { display: none !important; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.tab { border: 1px solid var(--border); background: #fff; color: var(--muted);
  padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.count { font-variant-numeric: tabular-nums; }

@media (max-width: 560px) {
  .grid2 { grid-template-columns: 1fr; }
  .ride-top { flex-direction: column; }
}
