:root {
  --ink: #14181F;
  --muted: #5B6472;
  --line: #E3E6EA;
  --line-soft: #EDEFF2;
  --ground: #F3F4F6;
  --surface: #FFFFFF;
  --nav: #12161C;
  --nav-2: #2A313C;
  --accent: #C2410C;
  --accent-dark: #9A3412;
  --green: #15803D;
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--ground);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.4;
}
a { color: var(--accent); }
h1, h2, h3 { margin: 0; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }

/* Top bar */
.topbar {
  background: var(--nav);
  color: #fff;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
}
.brand { font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 8px; background: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
}
.topbar nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 300px; }
.topbar nav a {
  color: #C9CED6; text-decoration: none; padding: 8px 12px; border-radius: 6px; font-size: 14px;
}
.topbar nav a.active { color: #fff; background: var(--nav-2); font-weight: 600; }
.topbar .who { font-size: 13px; color: #C9CED6; }

/* Layout */
.wrap { max-width: 1440px; margin: 0 auto; padding: 20px; display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.main { flex: 999 1 640px; min-width: 0; }
.side { flex: 1 1 340px; min-width: 280px; display: flex; flex-direction: column; gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card-pad { padding: 16px 18px; }
.card-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.muted { color: var(--muted); }
.small { font-size: 12px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat { padding: 14px 16px; }
.stat .label { font-size: 13px; color: var(--muted); }
.stat .value { font-size: 26px; font-weight: 700; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase;
  letter-spacing: .04em; font-weight: 600; padding: 10px 8px;
}
th:first-child, td:first-child { padding-left: 18px; }
td { border-top: 1px solid var(--line-soft); padding: 12px 8px; vertical-align: top; }

/* Forms */
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
input, select, textarea {
  font: inherit; color: var(--ink); border: 1px solid #D3D7DD; border-radius: 6px;
  padding: 9px 10px; background: #fff; width: 100%;
}
textarea { resize: vertical; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.check { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); }
.check input { width: 18px; height: 18px; }

/* Buttons */
button, .btn {
  font: inherit; font-weight: 600; border-radius: 8px; border: 1px solid #D3D7DD;
  background: #fff; color: var(--ink); padding: 10px 14px; min-height: 44px; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
button:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-green { background: var(--green); border-color: var(--green); color: #fff; }
.btn-block { width: 100%; }
.btn-big { min-height: 54px; font-size: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border-radius: 999px; padding: 6px 14px; font-size: 13px; min-height: 36px; font-weight: 500;
}
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); font-weight: 600; }

/* Status pills */
.pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  white-space: nowrap; background: #EEF0F3; color: #3B4452;
}
.s-dispatched { background: #DBEAFE; color: #1E40AF; }
.s-en_route, .s-waiting_payment { background: #FFEDD5; color: #9A3412; }
.s-on_scene, .s-towing { background: #F3E8FF; color: #6B21A8; }
.s-destination_arrival { background: #E0F2FE; color: #075985; }
.s-completed { background: #FEF3C7; color: #92400E; }
.s-acknowledged { background: #DCFCE7; color: #166534; }
.flag-bad { color: #B42318; font-weight: 600; }
.flag-warn { color: #9A3412; font-weight: 600; }
.flag-ok { color: #166534; font-weight: 600; }

/* Quote lines */
.lines { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.lines .l { display: flex; justify-content: space-between; gap: 10px; }
.lines .total { border-top: 1px solid var(--line); padding-top: 8px; font-weight: 700; font-size: 16px; }

/* Login */
.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 100%; max-width: 380px; padding: 28px; display: flex; flex-direction: column; gap: 14px; }

/* Driver app (phone first) */
.phone { max-width: 520px; margin: 0 auto; }
.phone .topbar { flex-direction: column; align-items: stretch; gap: 10px; }
.earn { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.earn div { border-radius: 10px; padding: 10px 12px; background: var(--nav-2); }
.earn .today { background: var(--green); }
.earn .v { font-size: 24px; font-weight: 700; }
.earn .k { font-size: 12px; opacity: .85; }
.section-label {
  font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em;
}
.callcard { padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.callcard.current { border: 2px solid var(--accent); }
.kv .k { font-size: 12px; color: var(--muted); }
.kv .v { font-weight: 600; }
.timer { font-size: 44px; font-weight: 700; text-align: center; }
.prompt { border: 2px solid var(--accent); background: #FFF7ED; border-radius: 12px; padding: 16px; }
.zelle-box { border: 2px solid var(--ink); border-radius: 12px; padding: 16px; text-align: center; }
.zelle-box img { max-width: 200px; width: 100%; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%) translateY(120px);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; font-weight: 600;
  transition: transform .2s; z-index: 50; max-width: 90vw;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.error { background: #B42318; }

.hidden { display: none !important; }
@media (max-width: 640px) {
  .grid3, .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wrap { padding: 12px; }
}

/* Install banner */
.install-banner {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 40;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0,0,0,.15); padding: 12px 14px;
  display: flex; align-items: center; gap: 10px;
}
.install-banner > div { flex: 1; }
