/* Waga Delivery — shared design system */
:root {
  --accent: #4f46e5;
  --accent-dark: #4338ca;
  --accent-soft: #eef2ff;
  --bg: #f4f5f9;
  --surface: #ffffff;
  --surface-2: #fafbfd;
  --border: #e4e7ee;
  --text: #16181d;
  --muted: #6b7280;
  --faint: #9aa1ad;
  --ok: #16a34a;
  --ok-soft: #e8f7ee;
  --warn: #d97706;
  --warn-soft: #fef4e6;
  --danger: #dc2626;
  --danger-soft: #fdeaea;
  --info-soft: #e8f0fe;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 8px 24px -12px rgba(16,24,40,.18);
  --shadow-lg: 0 12px 40px -12px rgba(16,24,40,.28);
  --head-h: 66px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Ethiopic", Ubuntu, sans-serif;
}
body.driver-app { --accent: #059669; --accent-dark: #047857; --accent-soft: #e7f7f1; }
body.admin-app  { --accent: #1d4ed8; --accent-dark: #1e40af; --accent-soft: #e8efff; --bg: #f1f3f8; }

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; font-size: 15px; line-height: 1.5;
}
h1,h2,h3,h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .6em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
small { font-size: .8rem; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ---------- layout ---------- */
.app { display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 10px 18px;
  background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 60;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: -.02em; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: #087dbd; overflow: hidden; flex: none;
}
.brand .logo img { width: 100%; height: 100%; display: block; object-fit: cover; }
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; }
.spacer { flex: 1; }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 7px 14px; border-radius: 999px; border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: .9rem; font-weight: 550; color: var(--muted); white-space: nowrap;
}
.tab:hover { background: var(--surface-2); color: var(--text); }
.tab.active { background: var(--accent); color: #fff; }
main { flex: 1; width: 100%; }
.page { display: none; }
.page.active { display: block; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 20px 18px 60px; }
.wrap.narrow { max-width: 760px; }
.split { display: grid; grid-template-columns: minmax(0,1fr) 400px; gap: 18px; align-items: start; }
.split.reverse { grid-template-columns: 400px minmax(0,1fr); }
@media (max-width: 980px) { .split, .split.reverse { grid-template-columns: 1fr; } }

/* ---------- cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px;
}
.card.tight { padding: 14px; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head h2, .card-head h3 { margin: 0; }
.card-head .spacer { flex: 1; }
.section-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 650; margin-bottom: 8px; }

.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(190px,1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(165px,1fr)); }

.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 15px 16px; box-shadow: var(--shadow); }
.stat .label { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 600; }
.stat .value { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; }
.stat .sub { font-size: .8rem; color: var(--muted); }
.stat.accent { background: linear-gradient(140deg, var(--accent), var(--accent-dark)); border-color: transparent; color: #fff; }
.stat.accent .label, .stat.accent .sub { color: rgba(255,255,255,.82); }

/* ---------- forms ---------- */
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font: inherit; background: var(--surface); color: var(--text); transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}
input[disabled], select[disabled] { background: var(--surface-2); color: var(--faint); }
textarea { resize: vertical; min-height: 70px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }
.inline { display: flex; align-items: center; gap: 8px; }

button {
  font: inherit; font-weight: 600; cursor: pointer; border: 1px solid transparent;
  border-radius: var(--radius-sm); padding: 10px 16px; background: var(--accent); color: #fff;
  transition: filter .15s, background .15s, transform .05s;
}
button:hover:not(:disabled) { filter: brightness(1.06); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.ghost { background: transparent; color: var(--text); border-color: var(--border); }
button.ghost:hover:not(:disabled) { background: var(--surface-2); }
button.subtle { background: var(--accent-soft); color: var(--accent-dark); }
button.danger { background: var(--danger); }
button.ok { background: var(--ok); }
button.warn { background: var(--warn); }
button.sm { padding: 6px 11px; font-size: .84rem; }
button.xs { padding: 4px 9px; font-size: .78rem; border-radius: 7px; }
button.block { width: 100%; }
button.big { padding: 14px; font-size: 1.02rem; width: 100%; }

/* ---------- pills & badges ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px;
  font-size: .76rem; font-weight: 650; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
  white-space: nowrap;
}
.pill.ok { background: var(--ok-soft); color: #15803d; border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: #b45309; border-color: transparent; }
.pill.danger { background: var(--danger-soft); color: #b91c1c; border-color: transparent; }
.pill.info { background: var(--info-soft); color: #1d4ed8; border-color: transparent; }
.pill.accent { background: var(--accent-soft); color: var(--accent-dark); border-color: transparent; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); display: inline-block; }
.dot.live { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); animation: pulse 1.8s infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .45 } }

/* ---------- table ---------- */
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th {
  text-align: left; padding: 10px 14px; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--faint); font-weight: 650; background: var(--surface-2); border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
}
td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:hover { background: var(--surface-2); }
tbody tr.clickable { cursor: pointer; }
.table-scroll { overflow: auto; max-height: 68vh; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- map ---------- */
.map-shell { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: #e8eaf0; box-shadow: var(--shadow); }
.map-shell .map-canvas { display: block; width: 100%; height: 100%; }
/* Google draws its own attribution inside the map, so nothing sits over it. */
.map-pin-label { text-shadow: 0 1px 3px rgba(255,255,255,.95), 0 0 2px rgba(255,255,255,.95); }
.map-tools { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 6px; z-index: 5; }
.map-tools button { width: 34px; height: 34px; padding: 0; background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow); font-size: 1rem; }
.map-legend {
  position: absolute; left: 10px; bottom: 10px; background: rgba(255,255,255,.94); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 7px 11px; font-size: .76rem; color: var(--muted); box-shadow: var(--shadow);
  display: flex; gap: 12px; flex-wrap: wrap; max-width: calc(100% - 20px);
}
.map-hint {
  position: absolute; left: 10px; top: 10px; background: rgba(255,255,255,.94); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 6px 11px; font-size: .78rem; font-weight: 600; box-shadow: var(--shadow); z-index: 5;
}

/* ---------- timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 26px; }
.timeline li::before {
  content: ''; position: absolute; left: 5px; top: 4px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--border);
}
.timeline li::after { content: ''; position: absolute; left: 10px; top: 17px; bottom: 0; width: 2px; background: var(--border); }
.timeline li:last-child::after { display: none; }
.timeline li.done::before { background: var(--ok); border-color: var(--ok); }
.timeline li.current::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.timeline .t-title { font-weight: 600; font-size: .92rem; }
.timeline .t-time { font-size: .78rem; color: var(--faint); }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(16,18,24,.5); backdrop-filter: blur(2px);
  display: grid; place-items: center; z-index: 200; padding: 18px;
}
.modal {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  width: min(520px, 100%); max-height: 90vh; overflow: auto; padding: 22px;
}
.modal.wide { width: min(880px, 100%); }
.modal-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.modal-head h2 { flex: 1; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions > * { flex: 1; }
.close-x { background: transparent; color: var(--muted); border: 0; font-size: 1.3rem; padding: 0 6px; line-height: 1; }

/* ---------- toast ---------- */
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 9px; z-index: 400; max-width: 340px; }
.toast {
  background: #1e2128; color: #fff; padding: 11px 15px; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); font-size: .89rem; animation: slideIn .2s ease-out; display: flex; gap: 9px; align-items: flex-start;
}
.toast.ok { background: #15803d; } .toast.error { background: #b91c1c; } .toast.warn { background: #b45309; }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0 } }

/* ---------- misc ---------- */
.muted { color: var(--muted); } .faint { color: var(--faint); }
.center { text-align: center; }
.empty { text-align: center; padding: 34px 18px; color: var(--faint); }
.empty .icon { font-size: 2.2rem; display: block; margin-bottom: 8px; }
.divider { height: 1px; background: var(--border); margin: 14px 0; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: .9rem; }
.kv .k { color: var(--muted); } .kv .v { font-weight: 600; text-align: right; }
.kv.total { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 10px; font-size: 1rem; }
.scroll-y { overflow-y: auto; }
.badge-count {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff;
  font-size: .7rem; font-weight: 700; display: inline-grid; place-items: center;
}
.avatar {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; font-size: .9rem;
}
.avatar.lg { width: 52px; height: 52px; font-size: 1.1rem; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.otp-box {
  font-family: ui-monospace, monospace; font-size: 1.9rem; font-weight: 700; letter-spacing: .35em;
  text-align: center; padding: 12px; background: var(--accent-soft); color: var(--accent-dark); border-radius: var(--radius-sm);
}
.progress { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); transition: width .3s; }
.countdown-bar { height: 5px; background: rgba(255,255,255,.25); border-radius: 3px; overflow: hidden; }
.countdown-bar > div { height: 100%; background: #fff; transition: width 1s linear; }
.veh-option {
  display: flex; align-items: center; gap: 12px; padding: 11px 13px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; margin-bottom: 8px; background: var(--surface); transition: all .15s;
}
.veh-option:hover { border-color: var(--accent); background: var(--surface-2); }
.veh-option.selected { border-color: var(--accent); background: var(--accent-soft); }
.veh-option.disabled { opacity: .5; cursor: not-allowed; }
.veh-option .veh-icon { font-size: 1.6rem; }
.veh-option .veh-name { font-weight: 650; }
.veh-option .veh-meta { font-size: .78rem; color: var(--muted); }
.veh-option .veh-price { margin-left: auto; text-align: right; font-weight: 700; }
.chart { width: 100%; height: 170px; display: block; }
.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(160deg, var(--accent-soft), var(--bg) 55%); }
.auth-card { width: min(430px,100%); background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 28px; }
.auth-switch { text-align: center; margin-top: 14px; font-size: .88rem; color: var(--muted); }
.demo-creds { margin-top: 16px; padding: 11px 13px; background: var(--surface-2); border: 1px dashed var(--border); border-radius: var(--radius-sm); font-size: .8rem; color: var(--muted); }
.demo-creds b { color: var(--text); }
.suggest {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 40; margin-top: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); overflow: hidden; max-height: 240px; overflow-y: auto;
}
.suggest div { padding: 9px 12px; cursor: pointer; font-size: .88rem; border-bottom: 1px solid var(--border); }
.suggest div:last-child { border-bottom: 0; }
.suggest div:hover { background: var(--accent-soft); }
.suggest .none { color: var(--faint); cursor: default; }
.suggest .none:hover { background: transparent; }
.hide { display: none !important; }

/* ---------- app shell: fixed side navigation (admin + driver) ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 246px; flex: none; background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 70;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.side-nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.side-who {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.side-who .grow { min-width: 0; }
.nav-group {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: var(--faint);
  font-weight: 700; padding: 14px 10px 6px;
}
.nav-group:first-child { padding-top: 4px; }
.side-nav .tab {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 11px; border-radius: 9px; margin-bottom: 2px; font-size: .92rem; font-weight: 550;
  color: var(--text); background: transparent; white-space: nowrap;
}
.side-nav .tab .ic { font-size: 1.05rem; width: 20px; text-align: center; flex: none; }
.side-nav .tab:hover { background: var(--surface-2); }
.side-nav .tab.active { background: var(--accent); color: #fff; box-shadow: 0 6px 14px -8px var(--accent); }
.side-nav .tab .badge-count { margin-left: auto; }
.side-foot { border-top: 1px solid var(--border); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.side-foot .who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.side-foot .who .grow { min-width: 0; }

.shell-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.main-head {
  display: flex; align-items: center; gap: 12px; padding: 14px 22px;
  background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50;
  /* The full-map page sizes itself against this, so it is measured once here
     rather than guessed at in two places. */
  min-height: var(--head-h);
  box-sizing: border-box;
}
.main-head h1 { font-size: 1.22rem; }
.main-head .crumb { font-size: .8rem; color: var(--faint); }
#menu-toggle { display: none; }
.admin-app .wrap { max-width: 1340px; padding-top: 18px; }
.side-backdrop { position: fixed; inset: 0; background: rgba(16,18,24,.42); z-index: 65; }

@media (max-width: 980px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; height: 100vh;
    transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  #menu-toggle { display: inline-flex; }
}

/* ---------- full-map stage with a sheet that slides up ---------- */
.map-stage {
  position: relative;
  /* Fills what is left under the app header, so the map is the screen. */
  height: calc(100vh - 68px);
  overflow: hidden;
}
.map-stage #driver-map, .map-stage .map-shell { height: 100% !important; border-radius: 0; border: 0; box-shadow: none; }

.map-fab {
  position: absolute; right: 16px; z-index: 20;
  width: 42px; height: 42px; padding: 0; border-radius: 50%;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  box-shadow: var(--shadow); font-size: 1.15rem; line-height: 1;
}

.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 30;
  height: 52%;
  background: var(--surface);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -10px 30px -12px rgba(16,18,24,.35);
  display: flex; flex-direction: column;
  transition: height .22s ease;
}
.sheet.dragging { transition: none; }
.sheet-grip { padding: 10px 0 8px; cursor: grab; touch-action: none; flex: none; }
.sheet-grip:active { cursor: grabbing; }
.sheet-grip span { display: block; width: 44px; height: 4.5px; margin: 0 auto; border-radius: 3px; background: var(--border); }
.sheet-body { flex: 1; overflow-y: auto; padding: 0 16px 20px; }
.sheet-body > .card:first-child { margin-top: 0; }

/* ---------- on/off duty switch ---------- */
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  position: relative; width: 44px; height: 25px; border-radius: 999px;
  background: var(--border); transition: background .18s ease; flex: none;
}
.switch .knob {
  position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .18s ease;
}
.switch input:checked + .track { background: var(--ok); }
.switch input:checked + .track .knob { transform: translateX(19px); }
.switch input:disabled + .track { opacity: .5; cursor: not-allowed; }
.switch-label { font-size: .88rem; font-weight: 600; color: var(--muted); }
.switch input:checked ~ .switch-label { color: var(--ok); }

@media (max-width: 720px) {
  .map-stage { height: calc(100vh - 60px); }
}

/* ─────────── driver documents ─────────── */
/* Licence, libre and insurance scans: a small preview beside the review
   controls, so an admin can judge a paper without opening it full size. */
.banner {
  padding: 9px 12px;
  border-radius: 10px;
  font-size: .85rem;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.banner.ok { border-color: color-mix(in srgb, var(--ok) 45%, transparent); color: var(--ok); }
.banner.warn { border-color: color-mix(in srgb, var(--warn) 45%, transparent); color: var(--warn); }

.doc-group { padding: 8px 0; border-bottom: 1px solid var(--border); }
.doc-group:last-child { border-bottom: 0; }

.doc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.doc-row .grow { flex: 1; min-width: 140px; }

.doc-thumb {
  width: 60px;
  height: 60px;
  flex: none;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: .72rem;
  color: var(--muted);
}
.doc-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* File inputs are native and unstyled by default; match the other fields. */
.doc-field input[type=file] {
  font-size: .84rem;
  padding: 9px 10px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: transparent;
  color: inherit;
  width: 100%;
}

/* ─────────── phone fields ─────────── */
/* Every number on the platform is Ethiopian, so the country code is furniture,
   not something to type. The input holds the nine national digits. */
.phone-field {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
}
.phone-field:focus-within { border-color: var(--accent); }

.phone-cc {
  display: grid;
  place-items: center;
  padding: 0 10px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-2);
  border-right: 1px solid var(--border);
  user-select: none;
  flex: none;
}

.phone-field input {
  border: 0;
  border-radius: 0;
  flex: 1;
  min-width: 0;
  letter-spacing: .04em;
}
.phone-field input:focus { outline: none; box-shadow: none; }

/* ─────────── full-map home with a slide-up sheet ───────────
   The map is the page. The form rides over it on a sheet that snaps between
   three heights: a peek of the two addresses, half, and the whole form. A
   courier app is used one-handed while walking, so the thing you touch most —
   the two ends and the price — never leaves the screen. */
.map-stage {
  position: relative;
  height: calc(100vh - var(--head-h));
  overflow: hidden;
}
.map-stage #order-map { position: absolute; inset: 0; height: 100% !important; }

.map-tools {
  position: absolute;
  right: 14px;
  top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 5;
}
.map-btn {
  width: 42px; height: 42px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  font-size: 1.05rem;
  cursor: pointer;
  display: grid; place-items: center;
}
.map-btn:hover { background: var(--surface-2); }

.sheet {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -10px 40px rgba(15, 23, 42, .18);
  transition: height .28s cubic-bezier(.32, .72, 0, 1);
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
}
/* Three snap points. The peek always clears the two addresses. */
.sheet[data-state="peek"] { height: 210px; }
.sheet[data-state="half"] { height: 58%; }
.sheet[data-state="full"] { height: calc(100% - 12px); }

.sheet-grip {
  padding: 9px 0 5px;
  cursor: grab;
  flex: none;
  display: grid;
  place-items: center;
  touch-action: none;
}
.sheet-grip span {
  width: 40px; height: 4px;
  border-radius: 3px;
  background: var(--border);
  display: block;
}
.sheet-grip:active { cursor: grabbing; }

.sheet-scroll { flex: 1; overflow-y: auto; padding: 0 16px; }
.sheet-head { padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.sheet-body { padding: 14px 0 8px; }

.sheet-foot {
  flex: none;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* The two ends, as a route: dot, line, dot. */
.ends { position: relative; }
.end {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 6px;
  background: none;
  border: 0;
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  color: inherit;
}
.end:hover { background: var(--surface-2); }
.end .dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  flex: none;
  margin-left: 4px;
}
.end .dot.pickup { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }
.end .dot.dropoff { background: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 22%, transparent); }
.end-text { display: flex; flex-direction: column; min-width: 0; }
.end-text small { font-size: .72rem; color: var(--muted); letter-spacing: .02em; }
.end-text b { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* The line joining the two dots. */
.end-line {
  position: absolute;
  left: 13px;
  top: 34px;
  height: 24px;
  width: 2px;
  background: repeating-linear-gradient(var(--border) 0 3px, transparent 3px 6px);
}
.sheet-price { display: flex; justify-content: flex-end; padding: 4px 6px 0; }

/* Segmented "I'm sending / I'm receiving". */
.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border-radius: 12px;
  margin-bottom: 14px;
}
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: block;
  text-align: center;
  padding: 9px 8px;
  border-radius: 9px;
  font-size: .88rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.seg input:checked + span {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow);
}

@media (max-width: 720px) {
  .sheet { max-width: none; border-radius: 18px 18px 0 0; }
  .sheet[data-state="half"] { height: 64%; }
}

/* An avatar showing a real photograph rather than initials. */
.avatar.has-photo {
  background-size: cover;
  background-position: center;
  color: transparent;
}

/* ═══════════════ driver earnings ═══════════════
   The page a driver opens most often after the job list, and the one where the
   numbers have to be legible at a glance on a phone propped on a handlebar. */

.earn-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  box-shadow: 0 10px 30px -12px rgba(5, 150, 105, .55);
}
/* A soft light behind the figure, so the card reads as a surface rather than a
   flat rectangle. Pointer-events off: it sits over the buttons. */
.earn-hero::after {
  content: '';
  position: absolute;
  inset: -60% -20% auto auto;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.20), transparent 65%);
  pointer-events: none;
}
/* Owing money is a different state, not a smaller number, so it gets its own
   colour rather than a minus sign the eye slides past. */
.earn-hero.owing {
  background: linear-gradient(135deg, #dc2626, #9f1239);
  box-shadow: 0 10px 30px -12px rgba(220, 38, 38, .55);
}
.earn-hero .hero-label {
  font-size: .78rem; letter-spacing: .09em; text-transform: uppercase;
  opacity: .85; font-weight: 650;
}
.earn-hero .hero-value {
  font-size: clamp(2rem, 7vw, 2.9rem); font-weight: 760; line-height: 1.05;
  margin: 6px 0 2px; font-variant-numeric: tabular-nums;
}
.earn-hero .hero-sub { font-size: .9rem; opacity: .9; max-width: 46ch; }
.earn-hero .hero-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.earn-hero .hero-actions button {
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.34);
  color: #fff; font-weight: 640;
  backdrop-filter: blur(6px);
}
.earn-hero .hero-actions button:hover:not(:disabled) { background: rgba(255,255,255,.26); }
.earn-hero .hero-actions button.solid {
  background: #fff; color: var(--accent-dark); border-color: #fff;
}
.earn-hero .hero-actions button.solid:hover:not(:disabled) { background: #f2f4f8; }
.earn-hero .hero-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.3);
  padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 620;
  margin-top: 10px;
}

/* ── chart ── */
.earn-chart-card .card-head { align-items: center; }
.chart-legend { display: flex; gap: 14px; font-size: .78rem; color: var(--muted); }
.chart-legend .swatch {
  display: inline-block; width: 10px; height: 10px; border-radius: 3px;
  margin-right: 5px; vertical-align: -1px;
}
.chart-legend .swatch.net { background: var(--accent); }
.chart-legend .swatch.comm { background: #cbd2de; }
.chart-wrap { position: relative; }
.chart-tip {
  position: absolute; pointer-events: none; z-index: 3;
  background: #111826; color: #fff; border-radius: 8px;
  padding: 7px 10px; font-size: .76rem; line-height: 1.45;
  box-shadow: 0 8px 20px -6px rgba(0,0,0,.5);
  transform: translate(-50%, -108%); white-space: nowrap;
}
.chart-tip b { font-variant-numeric: tabular-nums; }

/* ── the three ledgers ── */
.ledger-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.seg {
  display: inline-flex; background: var(--bg); border: 1px solid var(--border);
  border-radius: 999px; padding: 3px; gap: 2px;
}
.seg-btn {
  border: 0; background: transparent; color: var(--muted);
  font: inherit; font-size: .86rem; font-weight: 620;
  padding: 7px 15px; border-radius: 999px; cursor: pointer;
  transition: background .16s, color .16s;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active {
  background: var(--surface); color: var(--accent);
  box-shadow: 0 1px 3px rgba(16, 24, 40, .12);
}
.ledger-total { font-size: .85rem; font-variant-numeric: tabular-nums; }
.ledger-total b { color: var(--text); }

.ledger-list { max-height: 460px; overflow-y: auto; }
.ledger-row {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 16px; border-bottom: 1px solid var(--border);
}
.ledger-row:last-child { border-bottom: 0; }
.ledger-row:hover { background: var(--accent-soft); }
.ledger-ic {
  width: 38px; height: 38px; flex: 0 0 38px; border-radius: 11px;
  display: grid; place-items: center; font-size: 1.05rem;
  background: var(--accent-soft);
}
.ledger-ic.out { background: #fdecec; }
.ledger-ic.in { background: #e7f7f1; }
.ledger-ic.wait { background: #fdf4e3; }
.ledger-main { min-width: 0; flex: 1; }
.ledger-main .t { font-weight: 620; font-size: .92rem; }
.ledger-main .s { font-size: .79rem; color: var(--muted); }
.ledger-amt {
  text-align: right; font-weight: 700; font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ledger-amt .after { display: block; font-size: .74rem; font-weight: 500; color: var(--muted); }
.amt-in { color: var(--ok); }
.amt-out { color: var(--danger); }

.ledger-empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.ledger-empty .big { font-size: 2rem; display: block; margin-bottom: 8px; opacity: .55; }

/* ── how pay works ── */
.pay-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; }
.pay-grid p { font-size: .86rem; margin: 4px 0 0; }
.pay-ic {
  width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft);
  display: grid; place-items: center; font-size: 1rem; margin-bottom: 8px;
}

/* ── top-up dialog ── */
.topup-amounts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 12px; }
.topup-amounts button {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  font-weight: 640; padding: 11px 4px; border-radius: 10px;
}
.topup-amounts button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }

@media (max-width: 640px) {
  .ledger-head { padding: 12px; }
  .seg { width: 100%; }
  .seg-btn { flex: 1; padding: 8px 6px; }
  .ledger-total { width: 100%; text-align: right; }
}

/* Picking a wallet in the dialog sends the driver straight to that rail's own
   page instead of a chooser on the gateway. Named the way a driver names them:
   nobody asks for "AWASH_BIRR", they ask for Awash. */
.tu-label {
  font-size: .74rem; letter-spacing: .07em; text-transform: uppercase;
  font-weight: 700; color: var(--muted); margin: 14px 0 6px;
}
.tu-rails { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tu-rails button {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  font-weight: 620; font-size: .82rem; padding: 11px 6px; border-radius: 10px;
  text-align: center;
}
.tu-rails button.on {
  border-color: var(--accent); background: var(--accent-soft);
  color: var(--accent-dark); box-shadow: inset 0 0 0 1px var(--accent);
}
@media (max-width: 420px) { .tu-rails { grid-template-columns: repeat(2, 1fr); } }

/* The wallet has stopped the work — said on the duty screen, where the driver
   is sitting when they start wondering why nothing is arriving. */
.credit-banner {
  display: flex; align-items: center; gap: 12px;
  background: #fff1f1; border: 1px solid #f6c9c9; color: #8a1c1c;
  border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 12px;
}
.credit-banner .cb-ic { font-size: 1.3rem; }
.credit-banner b { font-size: .92rem; }
.credit-banner .s { font-size: .8rem; opacity: .85; margin-top: 2px; }
.credit-banner button {
  background: #b91c1c; color: #fff; border: 0; font-weight: 650;
  padding: 8px 14px; border-radius: 8px; white-space: nowrap;
}

/* Handing cash to the office is the same errand by another route, so it sits
   under the amount as a quiet alternative rather than competing as a button. */
.tu-cash { font-size: .82rem; color: var(--muted); margin: 14px 0 2px; }

/* The window the earnings page is looking at. One control for the whole page:
   tiles, chart and lists all read it, so they cannot disagree about what
   period is on screen. */
.range-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.range-dates { display: flex; align-items: center; gap: 8px; }
.range-dates input[type="date"] {
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  border-radius: 9px; padding: 8px 10px; font: inherit; font-size: .85rem;
}
.range-dates input[type="date"]:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
@media (max-width: 720px) {
  .range-bar { flex-direction: column; align-items: stretch; }
  .range-bar .seg { width: 100%; overflow-x: auto; }
  .range-bar .seg-btn { flex: 1; white-space: nowrap; }
  .range-dates input[type="date"] { flex: 1; min-width: 0; }
}

/* ═══════════════ driver account ═══════════════
   Was four cards of open form fields, so every visit presented a licence
   number and a PIN box as though they were waiting to be edited. A driver
   comes here to check something, or to do one specific thing. */

.acct-hero {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff; border-radius: var(--radius); padding: 20px;
  margin-bottom: 14px;
  box-shadow: 0 10px 30px -14px rgba(5, 150, 105, .6);
}
.acct-top { display: flex; align-items: center; gap: 14px; }
.acct-name { font-size: 1.2rem; font-weight: 750; }
.acct-phone { font-size: .88rem; opacity: .85; }
.acct-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.acct-pills .pill {
  background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.3); color: #fff;
}
.avatar.xl {
  width: 66px; height: 66px; flex: 0 0 66px; font-size: 1.3rem;
  border: 2px solid rgba(255,255,255,.5);
}
.acct-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin-top: 18px; padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.22);
}
.acct-stats div { text-align: center; }
.acct-stats b { display: block; font-size: 1.02rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.acct-stats span { font-size: .72rem; opacity: .8; }
.acct-warn {
  margin-top: 14px; background: rgba(0,0,0,.18); border-radius: 10px;
  padding: 9px 12px; font-size: .84rem;
}

/* The list of things you might change. */
.acct-rows { display: flex; flex-direction: column; }
.acct-row {
  display: flex; align-items: center; gap: 13px; width: 100%;
  background: none; border: 0; border-bottom: 1px solid var(--border);
  padding: 15px 16px; text-align: left; cursor: pointer; color: var(--text);
  font: inherit;
}
.acct-row:last-child { border-bottom: 0; }
.acct-row:hover { background: var(--accent-soft); }
.acct-row b { display: block; font-size: .93rem; font-weight: 620; }
.acct-row .s { display: block; font-size: .8rem; color: var(--muted); margin-top: 1px; }
.acct-ic {
  width: 38px; height: 38px; flex: 0 0 38px; border-radius: 11px;
  display: grid; place-items: center; font-size: 1.05rem; background: var(--accent-soft);
}
.acct-go { color: var(--muted); font-size: 1.3rem; line-height: 1; }
.acct-badge {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  display: grid; place-items: center; font-size: .74rem; font-weight: 700;
}
.acct-badge.ok { background: #e7f7f1; color: #047857; }
.acct-badge.danger { background: #fdecec; color: #b91c1c; }

/* Documents, in a dialog of their own. */
.doc-list { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 6px; }
.doc-item {
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 13px;
}
.doc-item.locked { background: var(--bg); }
.doc-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 6px; }
.doc-head b { font-size: .88rem; }
.doc-note {
  font-size: .8rem; color: #b45309; background: #fffbeb;
  border-radius: 8px; padding: 7px 9px; margin-bottom: 8px;
}
.doc-upload { display: block; }
.doc-upload span { display: block; font-size: .76rem; color: var(--muted); margin-bottom: 5px; }
.doc-upload input[type="file"] { width: 100%; font-size: .82rem; }
/* An approved paper is settled: a lock and how to open it, not an upload box
   that would silently fail. */
.doc-locked {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: .82rem; color: var(--muted); flex-wrap: wrap;
}
.doc-locked button {
  background: none; border: 0; color: var(--accent); font: inherit;
  font-weight: 620; padding: 0; text-decoration: underline; cursor: pointer;
}
.support-call {
  display: block; text-align: center; font-weight: 680; font-size: 1rem;
  background: var(--accent); color: #fff; border-radius: 11px;
  padding: 13px; margin-bottom: 9px;
}
.support-call.ghost { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.acct-badge.wait { background: #fdf4e3; color: #b45309; }
/* Five papers is taller than a phone. The list scrolls, the dialog does not. */
.doc-list { max-height: min(58vh, 460px); overflow-y: auto; padding-right: 2px; }

/* Facts, not fields — where something is settled and can only be read.
   Deliberately not called .kv: that class already exists on the offer popup's
   fare breakdown, and reusing it restyled those rows too. */
.facts { margin: 0; display: flex; flex-direction: column; gap: 1px; }
.facts > div {
  display: flex; justify-content: space-between; gap: 14px;
  padding: 10px 12px; background: var(--bg); border-radius: 9px;
}
.facts dt { font-size: .82rem; color: var(--muted); margin: 0; }
.facts dd { margin: 0; font-weight: 620; font-size: .88rem; text-align: right; }

/* ═══════════════ my trips ═══════════════
   Was one flat run of rows: fine at ten trips, useless at three hundred. A
   driver looking for a job remembers "the one on Tuesday" or "the one to
   Bole", so it groups by day and filters by period, status and address. */

.trip-filters {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin: 14px 0 10px;
}
.trip-search { flex: 1; min-width: 180px; }
.trip-search input {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 9px 14px; font: inherit; font-size: .86rem;
  color: var(--text);
}
.trip-search input:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}

.trip-days { display: flex; flex-direction: column; gap: 14px; }
.trip-day { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.trip-day-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.trip-day-head b { font-size: .88rem; }
.trip-day-head span { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.trip-row {
  display: flex; align-items: flex-start; gap: 12px; width: 100%;
  background: none; border: 0; border-bottom: 1px solid var(--border);
  padding: 13px 16px; text-align: left; cursor: pointer; font: inherit; color: var(--text);
}
.trip-row:last-child { border-bottom: 0; }
.trip-row:hover { background: var(--accent-soft); }
.trip-ic {
  width: 36px; height: 36px; flex: 0 0 36px; border-radius: 11px;
  display: grid; place-items: center; font-size: 1.05rem; background: var(--accent-soft);
}
.trip-ic.lost { background: #fdecec; filter: grayscale(.6); }
.trip-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.trip-code { font-weight: 680; font-size: .9rem; }
.trip-stars { color: var(--warn); font-weight: 500; }
/* Both ends on their own line: on a phone the addresses are what tell one
   trip from another, and running them together truncates away the half that
   identifies it. */
.trip-leg {
  display: flex; align-items: baseline; gap: 7px;
  font-size: .82rem; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.trip-leg i { font-style: normal; font-size: .6rem; color: var(--accent); flex: 0 0 auto; }
.trip-leg i.to { color: var(--danger); }
.trip-meta { font-size: .75rem; color: var(--muted); margin-top: 2px; }
.trip-right { flex: 0 0 auto; text-align: right; }
.trip-earn { font-weight: 700; color: var(--ok); font-variant-numeric: tabular-nums; }

.trip-money { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.trip-money div { display: flex; justify-content: space-between; padding: 5px 0; font-size: .88rem; }
.trip-money .out { color: var(--danger); }
.trip-money .in { color: var(--ok); }
.trip-money .total { border-top: 1px solid var(--border); margin-top: 5px; padding-top: 9px; font-size: .98rem; }

@media (max-width: 640px) {
  .trip-filters { flex-direction: column; align-items: stretch; }
  .trip-filters .seg { width: 100%; }
  .trip-filters .seg-btn { flex: 1; }
}

/* ═══════════════ admin console ═══════════════ */

/* Icons, sized once. `currentColor` means each takes the colour of the row it
   sits in, so an active nav item's icon turns white with its label. */
.i { width: 18px; height: 18px; flex: none; stroke: currentColor; }
.side-nav .tab .i { width: 19px; height: 19px; opacity: .9; }
.side-nav .tab.active .i { opacity: 1; }
.brand .logo .i { width: 17px; height: 17px; stroke: #fff; }
.icon-btn { display: inline-grid; place-items: center; padding: 7px; line-height: 0; }

/* A page's own header row: title on the left, its actions on the right, so
   every section puts its primary action in the same place. */
.page-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 14px;
}
.page-bar .page-bar-title { font-size: 1.02rem; font-weight: 700; }
.page-bar .page-bar-sub { font-size: .82rem; color: var(--muted); margin-top: 1px; }
.page-bar .page-bar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/*
 * Empty states.
 *
 * A panel with nothing in it used to be a bare line of grey text, or — on the
 * dashboard chart — several hundred pixels of blank white. An empty table on a
 * console is usually a question ("did the filter work?"), so it says which of
 * the two it is and what to do next.
 */
.blank {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 44px 22px; color: var(--muted); gap: 3px;
}
.blank .blank-ic {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center;
  background: var(--surface-2); margin-bottom: 8px;
}
.blank .blank-ic .i { width: 21px; height: 21px; opacity: .55; }
.blank b { color: var(--text); font-size: .95rem; }
.blank span { font-size: .84rem; max-width: 42ch; line-height: 1.5; }
.blank .blank-act { margin-top: 12px; }
/* Inside a fixed-height slot — the chart — it fills rather than adding to it. */
.blank.fill { height: 100%; padding: 0; }

/* The strip of filters above a table. Was an ad-hoc row of inputs in a card on
   each page; now one shape, so they line up from section to section. */
.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px;
}
.toolbar .grow { flex: 1; min-width: 180px; }
.toolbar input[type="search"], .toolbar input[type="text"], .toolbar select, .toolbar input[type="date"] {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: 9px; padding: 9px 12px; font: inherit; font-size: .88rem; color: var(--text);
}
.toolbar input:focus, .toolbar select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.toolbar .count { font-size: .82rem; color: var(--muted); white-space: nowrap; }

/* The chart keeps its slot whether or not there is anything to draw, so the
   panel does not resize between a busy day and a quiet one. */
.chart-slot { position: relative; height: 300px; }
.chart-slot canvas { width: 100%; height: 100%; display: block; }
.chart-legend { display: flex; gap: 14px; font-size: .78rem; color: var(--muted); }
.chart-legend .swatch {
  display: inline-block; width: 10px; height: 10px; border-radius: 3px;
  margin-right: 5px; vertical-align: -1px;
}
.chart-legend .swatch.orders { background: #93a4f4; }
.chart-legend .swatch.revenue { background: var(--accent); }

/* A stat that needs somebody's attention. Reserved for the one that does —
   nothing is urgent about last month's revenue; a job that has been searching
   for a driver for two minutes is. */
.stat.warn { border-color: #f0c98a; background: var(--warn-soft); }
.stat.warn .value, .stat.warn .sub b { color: #92400e; }
.veh-row { margin-bottom: 11px; }
.veh-row:last-child { margin-bottom: 0; }

/* The customer's account hero takes the customer accent rather than the
   driver's green; everything else about the shape is shared. */
.acct-hero.cust {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  box-shadow: 0 10px 30px -14px rgba(79, 70, 229, .6);
}

/* The customer's history row carries a fare and a status rather than an
   earning, so its right-hand column stacks instead of sitting on one line. */
.trip-right .trip-fare { font-weight: 700; display: block; font-variant-numeric: tabular-nums; }
.trip-right > div { margin-top: 3px; }
.trip-right .xs { margin-top: 5px; }
.wallet-figure {
  font-size: 2rem; font-weight: 760; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; margin: 4px 0 2px;
}

/* ═══════════════ tracking more than one parcel ═══════════════
   This was a dropdown, which answers about one delivery and hides the rest
   behind a click — so the state of the others is exactly what you cannot see.
   A strip shows every one at a glance; picking one changes what the map and
   the detail below are following. */
.track-count { font-size: .85rem; margin-bottom: 8px; }
.track-switch {
  display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px;
  margin-bottom: 14px; scrollbar-width: none;
}
.track-switch::-webkit-scrollbar { display: none; }
.track-chip {
  flex: 0 0 auto; min-width: 168px; max-width: 230px; text-align: left;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 11px 13px; cursor: pointer;
  font: inherit; color: var(--text); display: flex; flex-direction: column; gap: 3px;
  transition: border-color .15s, box-shadow .15s;
}
.track-chip:hover { border-color: var(--accent); }
.track-chip.on {
  border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft);
  background: var(--accent-soft);
}
.tc-top { display: flex; align-items: center; gap: 7px; }
.tc-top b { font-size: .88rem; }
.tc-ic { font-size: 1rem; }
/* A live delivery pulses; a finished or failed one does not. */
.tc-dot { width: 8px; height: 8px; border-radius: 50%; margin-left: auto; background: var(--faint); }
.tc-dot.warn { background: var(--warn); animation: tc-pulse 1.6s infinite; }
.tc-dot.info, .tc-dot.accent { background: var(--accent); animation: tc-pulse 1.6s infinite; }
.tc-dot.ok { background: var(--ok); }
.tc-dot.danger { background: var(--danger); }
@keyframes tc-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.tc-status { font-size: .78rem; font-weight: 620; color: var(--accent-dark); }
.track-chip:not(.on) .tc-status { color: var(--muted); }
.tc-where {
  font-size: .76rem; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (prefers-reduced-motion: reduce) { .tc-dot { animation: none; } }

/* ═══════════════ the order sheet, in two steps ═══════════════
   A second page would take the map with it, so the addresses just set would
   vanish while choosing the vehicle for them. Same sheet, same map. */
.step-dots {
  display: flex; gap: 8px; margin-bottom: 14px;
  font-size: .8rem; color: var(--muted);
}
.step-dots span {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px 5px 6px; border-radius: 999px; background: var(--surface-2);
  border: 1px solid var(--border);
}
.step-dots span b {
  width: 19px; height: 19px; border-radius: 50%; display: grid; place-items: center;
  background: var(--border); color: var(--muted); font-size: .72rem;
}
.step-dots span.on { color: var(--accent-dark); background: var(--accent-soft); border-color: transparent; }
.step-dots span.on b { background: var(--accent); color: #fff; }
.step-dots span.done b { background: var(--ok); color: #fff; }

.step-back {
  background: none; border: 0; color: var(--accent); font: inherit; font-weight: 620;
  font-size: .88rem; padding: 0 0 10px; cursor: pointer;
}
/* What you chose on the first step, so the second is not a leap of faith. */
.step-recap {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 11px 13px; margin-bottom: 14px;
  font-size: .84rem; display: flex; flex-direction: column; gap: 4px;
}
.step-recap .leg { display: flex; align-items: baseline; gap: 8px; }
.step-recap .leg i { font-style: normal; font-size: .6rem; color: var(--ok); }
.step-recap .leg i.to { color: var(--danger); }
.step-recap .leg span {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text);
}
.step-recap .what { color: var(--muted); font-size: .8rem; margin-top: 2px; }

/* Home and Office are offered by name because they are the two that mean
   something beyond one customer — the anchors most deliveries run between. */
.place-kinds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.place-kinds button {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  font-weight: 620; font-size: .86rem; padding: 13px 6px; border-radius: 11px;
}
.place-kinds button.on {
  border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark);
  box-shadow: inset 0 0 0 1px var(--accent);
}

/* Settings, one card per group. Thirty inputs in a single scroll make very
   different jobs — dispatch, money, the wallet, branding — look like one
   undifferentiated pile; somebody changing the offer timeout should not have
   to read past the tax rate to find it. */
.settings-group { margin-bottom: 14px; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 18px; }
/* Save stays reachable from any group without scrolling back up. A solid strip
   rather than a fade: a half-visible input under a gradient reads as broken. */
.settings-save {
  position: sticky; bottom: 0; z-index: 2;
  padding: 12px 0; margin-top: 4px;
  background: var(--bg); border-top: 1px solid var(--border);
}
.settings-save button { width: 100%; }
@media (min-width: 640px) { .settings-save button { width: auto; min-width: 200px; } }

/*
 * Detail pages — one order, one driver, one customer, one company.
 *
 * Each used to open with a lone "← All orders" button hanging above a hero
 * card, which read as a stray control rather than as the top of a page. The
 * back link now sits in the same bar as the identity and the actions, so a
 * detail page opens the way a list page does.
 */
.detail-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.detail-back {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px 6px 9px; font-size: .84rem; font-weight: 600;
  color: var(--muted); background: var(--surface);
  border: 1px solid var(--border); border-radius: 999px; cursor: pointer;
}
.detail-back:hover { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.detail-bar .detail-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }

/* Section headings on detail pages carried emoji while the rest of the console
   moved to the icon sprite. Same size, same colour, one vocabulary. */
.card-head h2, .card-head h3 { display: flex; align-items: center; gap: 8px; }
.card-head .i { width: 16px; height: 16px; color: var(--muted); flex: none; }
.detail-back .i { width: 15px; height: 15px; }

/* Admin company workspace. The account identity is unframed; operational
   groups below it use cards only where their contents are discrete tools. */
.company-identity {
  display: flex; align-items: center; gap: 16px; padding: 8px 2px 18px;
  border-bottom: 1px solid var(--border); margin-bottom: 14px;
}
.company-mark, .company-user-avatar {
  display: grid; place-items: center; flex: none; font-weight: 750;
  background: var(--accent-soft); color: var(--accent-dark); border: 1px solid var(--border);
}
.company-mark { width: 54px; height: 54px; border-radius: 8px; font-size: 1.05rem; }
.company-identity-main { min-width: 0; }
.company-identity h2 { margin: 0; font-size: 1.35rem; }
.company-meta { display: flex; flex-wrap: wrap; gap: 5px 16px; margin-top: 5px; color: var(--muted); font-size: .83rem; }
.company-address { margin-top: 5px; font-size: .82rem; }
.company-stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px;
}
.company-stats .stat { min-width: 0; }
.company-stats .value { font-size: 1.18rem; overflow-wrap: anywhere; }
.company-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 14px; align-items: start; }
.company-detail-main, .company-detail-side { min-width: 0; }
.company-section { margin-bottom: 14px; }
.section-sub { font-size: .78rem; margin-top: 2px; }
.company-user {
  display: grid; grid-template-columns: 36px minmax(160px, 1fr) auto auto auto;
  align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border);
}
.company-user:last-child { border-bottom: 0; }
.company-user-avatar { width: 36px; height: 36px; border-radius: 7px; font-size: .73rem; }
.company-user-main { min-width: 0; }
.company-user-main b, .company-user-main span { display: block; overflow-wrap: anywhere; }
.company-user-main b { font-size: .88rem; }
.company-user-main span { color: var(--muted); font-size: .77rem; margin-top: 2px; }
.company-user-actions { display: flex; gap: 5px; justify-content: flex-end; flex-wrap: wrap; }
.company-user-actions .danger { color: var(--danger); }
.company-access-note p { color: var(--muted); font-size: .84rem; line-height: 1.55; margin: 0 0 14px; }
.saved-api-key { display: flex; align-items: center; gap: 8px; min-width: 260px; }
.saved-api-key code {
  display: block; max-width: 430px; overflow-x: auto; padding: 7px 9px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 5px;
  color: var(--text); font-size: .76rem; white-space: nowrap;
}
.saved-api-key .muted { font-size: .74rem; white-space: nowrap; }

@media (max-width: 1000px) {
  .company-detail-grid { grid-template-columns: 1fr; }
  .company-detail-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
}
@media (max-width: 720px) {
  .company-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .company-user { grid-template-columns: 36px minmax(0, 1fr) auto; }
  .company-user > .pill:nth-of-type(2) { display: none; }
  .company-user-actions { grid-column: 2 / -1; justify-content: flex-start; }
  .company-detail-side { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .company-detail-bar .detail-actions { width: 100%; margin-left: 0; }
  .company-identity { align-items: flex-start; }
  .company-mark { width: 44px; height: 44px; }
  .company-meta { display: grid; gap: 3px; }
}

/* ═══════════════════════════ Hosted checkout ═══════════════════════════
 *
 * A page for somebody who has no account and may never have heard of us. It
 * borrows its credibility from the merchant whose name is at the top, so it is
 * deliberately plainer than our own apps: no navigation, nothing to explore,
 * one column of decisions and a rail that always shows the price.
 */
.checkout-page { background: var(--bg); min-height: 100vh; }

.co-boot, .co-dead, .co-done {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; text-align: center;
}
.co-spinner {
  width: 34px; height: 34px; margin: 0 auto 14px;
  border: 3px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: co-spin .8s linear infinite;
}
@keyframes co-spin { to { transform: rotate(360deg); } }

.co-dead-card, .co-done-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 34px 28px; max-width: 440px; width: 100%;
}
.co-dead-icon { font-size: 2.6rem; margin-bottom: 10px; }
.co-dead-card h1, .co-done-card h1 { font-size: 1.24rem; margin: 0 0 8px; }
.co-dead-action, .co-done-action {
  display: inline-block; margin-top: 18px; padding: 11px 20px;
  background: var(--accent); color: #fff; border-radius: var(--radius-sm);
  font-weight: 600; font-size: .92rem; text-decoration: none;
}

/* ── header ── */
/* Sticky: the shop's name is where this page gets its credibility, and a
   stranger scrolling to the recipient fields should still be able to see whose
   delivery they are arranging. */
.co-head {
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.co-head-in {
  max-width: 1040px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; gap: 12px;
}
.co-merchant { display: flex; align-items: center; gap: 11px; }
.co-avatar {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-weight: 700; font-size: 1.05rem;
}
.co-m-name { font-weight: 700; font-size: .98rem; line-height: 1.2; }
.co-m-sub { font-size: .8rem; color: var(--muted); }
.co-badge {
  margin-left: auto; padding: 4px 10px; border-radius: 999px;
  background: #f59e0b; color: #fff; font-size: .68rem; font-weight: 800; letter-spacing: .06em;
}

/* ── layout ── */
.co-body {
  max-width: 1040px; margin: 0 auto; padding: 22px 20px 60px;
  display: grid; grid-template-columns: 1fr 330px; gap: 26px; align-items: start;
}
@media (max-width: 880px) {
  .co-body { grid-template-columns: 1fr; gap: 18px; }
  /* The price follows the reader down rather than sitting under three
     screens of form where nobody scrolls back to find it. */
  .co-rail { position: sticky; bottom: 0; z-index: 5; }
}

.co-step {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
}
.co-step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.co-step-head h2 { font-size: 1rem; margin: 0; }
.co-num {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: .8rem; font-weight: 700;
}

/* ── the two ends ── */
.co-leg { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; }
.co-leg + .co-leg { border-top: 1px solid var(--border); }
.co-dot { width: 11px; height: 11px; border-radius: 50%; margin-top: 26px; flex: none; }
.co-dot.pick { background: #4f46e5; }
.co-dot.drop { background: #dc2626; }
.co-leg-body { flex: 1; min-width: 0; position: relative; }
.co-leg-label { display: block; font-size: .76rem; color: var(--muted); font-weight: 600; margin-bottom: 5px; }
.co-leg-fixed { font-size: .92rem; font-weight: 600; padding: 9px 0; }
.co-leg input { width: 100%; }
.co-pin-btn {
  margin-top: 22px; flex: none; padding: 8px 12px; font-size: .8rem;
  background: var(--surface); color: var(--muted);
  border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer;
}
.co-pin-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.co-results {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 20;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: 0 12px 30px rgba(0,0,0,.14);
  overflow: hidden;
}
.co-result {
  display: block; width: 100%; text-align: left; padding: 10px 13px;
  background: none; color: var(--text); border: 0; border-bottom: 1px solid var(--border); cursor: pointer;
}
.co-result:last-child { border-bottom: 0; }
.co-result:hover { background: var(--accent-soft); }
.co-result b { display: block; font-size: .88rem; }
.co-result span { display: block; font-size: .78rem; color: var(--muted); }

.co-map-wrap { position: relative; margin-top: 14px; }
#co-map { border-radius: var(--radius-sm); overflow: hidden; }
#co-map.pinning { outline: 2px solid var(--accent); outline-offset: 2px; }
.co-map-tip {
  position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 6;
  background: var(--accent); color: #fff; padding: 7px 14px;
  border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap;
}

/* ── vehicles ── */
.co-distance { font-size: .84rem; color: var(--muted); margin-bottom: 12px; }
.co-vehicles { display: flex; flex-direction: column; gap: 8px; }
.co-await { padding: 22px; text-align: center; color: var(--muted); font-size: .88rem; }
.co-await.warn { color: var(--danger); }
.co-veh {
  display: flex; align-items: center; gap: 13px; width: 100%; text-align: left;
  padding: 13px 15px; background: var(--surface); color: var(--text); cursor: pointer;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
}
.co-veh:hover:not(.off) { border-color: var(--accent); }
.co-veh.on { border-color: var(--accent); background: var(--accent-soft); }
.co-veh.off { opacity: .5; cursor: not-allowed; }
.co-veh-icon { font-size: 1.5rem; flex: none; }
.co-veh-body { flex: 1; min-width: 0; }
.co-veh-body b { display: block; font-size: .92rem; }
.co-veh-sub { font-size: .78rem; color: var(--muted); }
.co-veh-fare { font-weight: 700; font-size: 1rem; flex: none; }

.co-fields { display: flex; flex-direction: column; gap: 4px; }
.co-fields .field i { font-style: normal; color: var(--muted); font-weight: 400; }

/* ── the price rail ── */
.co-summary {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
@media (min-width: 881px) { .co-summary { position: sticky; top: 20px; } }
.co-summary h3 { font-size: .95rem; margin: 0 0 14px; }
.co-sum-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 0; font-size: .86rem; border-bottom: 1px solid var(--border);
}
.co-sum-row span { color: var(--muted); }
.co-sum-row b { text-align: right; }
.co-sum-total {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 14px 0 4px; font-size: .9rem;
}
.co-sum-total span { color: var(--muted); }
.co-sum-total b { font-size: 1.35rem; font-weight: 800; }
.co-payer { margin: 8px 0 14px; }
.co-payer-tag {
  display: block; padding: 8px 11px; border-radius: var(--radius-sm);
  font-size: .8rem; font-weight: 600;
}
.co-payer-tag.ok { background: rgba(16,185,129,.12); color: #047857; }
.co-payer-tag.warn { background: rgba(245,158,11,.14); color: #b45309; }

.co-confirm {
  width: 100%; padding: 14px; font-size: .98rem; font-weight: 700;
  background: var(--accent); color: #fff; border: 0;
  border-radius: var(--radius-sm); cursor: pointer;
}
.co-confirm:disabled { opacity: .45; cursor: not-allowed; }
/* Never a greyed-out button with no explanation — that is how a checkout
   loses somebody who was perfectly willing to go through with it. */
.co-missing { font-size: .78rem; color: var(--muted); text-align: center; margin-top: 9px; min-height: 1em; }
.co-cancel {
  width: 100%; margin-top: 8px; padding: 9px; font-size: .84rem;
  background: none; color: var(--muted); border: 0; cursor: pointer;
}
.co-cancel:hover { color: var(--danger); }
.co-trust {
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border);
  font-size: .75rem; color: var(--muted); line-height: 1.5;
}

/* ── booked ── */
.co-tick {
  width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%;
  background: var(--ok); color: #fff; display: grid; place-items: center; font-size: 1.7rem;
}
.co-code-box {
  margin: 18px 0; padding: 16px; border-radius: var(--radius-sm);
  background: var(--accent-soft); border: 1px dashed var(--accent);
}
.co-code-box span { display: block; font-size: .78rem; color: var(--muted); margin-bottom: 4px; }
.co-code-box b { font-size: 2rem; font-weight: 800; letter-spacing: .22em; color: var(--accent); }
.co-done-rows { text-align: left; margin-top: 8px; }
.co-done-card .faint { font-size: .78rem; margin-top: 12px; }
.co-track-shell { width: min(1080px, calc(100% - 32px)); margin: 28px auto; background: #fff; border: 1px solid var(--border); color: var(--text); text-align: left; }
.co-track-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 24px; }
.co-track-head h1 { margin: 3px 0 4px; font-size: 1.45rem; }
.co-track-kicker { color: var(--muted); font-size: .78rem; font-weight: 800; text-transform: uppercase; }
.co-track-status { padding: 8px 12px; background: #e8f7ef; color: #087443; font-weight: 800; font-size: .82rem; }
.co-track-map { width: 100%; min-height: 460px; border-block: 1px solid var(--border); }
.co-track-info { padding: 20px 24px 24px; }
.co-driver { padding: 12px 0; color: var(--text); font-weight: 700; }
.offer-workspace { max-width: 1080px; }
.route-offer-hero { display:grid; grid-template-columns:64px 1fr auto; align-items:center; gap:18px; padding:26px 0 28px; border-bottom:1px solid var(--border); margin-bottom:24px; }
.route-offer-hero h2 { font-size:1.65rem; margin:3px 0 5px; }
.route-offer-hero p { margin:0; color:var(--muted); max-width:650px; }
.route-offer-mark { width:58px; height:58px; display:grid; place-items:center; font-size:1.8rem; background:#e8f7ef; border:1px solid #b8e5cc; border-radius:8px; }
.route-kicker { color:var(--accent); font-size:.72rem; font-weight:800; text-transform:uppercase; }
.offer-section-head { display:flex; justify-content:space-between; align-items:end; margin-bottom:12px; }
.offer-section-head h3 { margin:0; }
.offer-page-head, .market-card-head { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.offer-page-head { margin-bottom:20px; }
.offer-page-head h2, .market-card h3 { margin:0 0 5px; }
.market-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(290px,1fr)); gap:14px; }
.market-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-sm); padding:18px; }
.market-card-head { margin-bottom:14px; }
.market-card-head > b { font-size:1.15rem; color:var(--ok); }
.market-driver { padding:10px; margin:12px 0; background:var(--ok-soft); color:var(--ok); font-weight:700; }
.market-money { display:flex; justify-content:space-between; gap:12px; padding:10px 0; border-top:1px solid var(--border); color:var(--muted); font-size:.82rem; }
.market-money b { color:var(--text); }
.market-stops { margin:12px 0; padding-left:22px; color:var(--muted); }
.batch-stop { display:grid; grid-template-columns:28px 1fr 34px; gap:9px; align-items:start; padding:12px 0; border-bottom:1px solid var(--border); }
.batch-seq { width:26px; height:26px; display:grid; place-items:center; background:var(--accent-soft); color:var(--accent); font-weight:800; border-radius:50%; }
.batch-stop-fields { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.batch-place { position:relative; grid-column:1/-1; }
.batch-place .suggest { z-index:80; top:100%; }
.batch-place .suggest button { display:block; width:100%; border:0; border-bottom:1px solid var(--border); background:var(--surface); padding:10px 12px; text-align:left; color:var(--text); }
.batch-place .suggest button:hover { background:var(--accent-soft); }
.batch-place .suggest small { display:block; color:var(--muted); margin-top:2px; }
.route-modal-head { padding-bottom:14px; border-bottom:1px solid var(--border); }
.commission-preview { display:flex; justify-content:space-between; gap:14px; padding:12px 14px; margin:0 0 14px; background:#eef6ff; border-left:3px solid #2563eb; color:#26415e; font-size:.84rem; }
.route-detail { width:100%; }
.route-detail-head { display:flex; justify-content:space-between; align-items:center; gap:18px; padding:18px 0; }
.route-detail-head h2 { margin:3px 0 4px; }
.route-total { text-align:right; }
.route-total span { display:block; color:var(--muted); font-size:.78rem; }
.route-total b { font-size:1.45rem; color:var(--ok); }
.route-live-map { min-height:390px; border:1px solid var(--border); }
.route-detail-grid { display:grid; grid-template-columns:minmax(0,2fr) minmax(240px,1fr); gap:22px; margin-top:22px; }
.route-stop-list { border-top:1px solid var(--border); }
.route-stop { display:grid; grid-template-columns:30px minmax(0,1fr) auto auto; gap:10px; align-items:center; padding:13px 0; border-bottom:1px solid var(--border); }
.route-stop .grow span { display:block; color:var(--muted); font-size:.8rem; margin-top:3px; }
.route-stop.completed { opacity:.72; }
.route-stop.failed, .route-stop.cancelled { background:#fff7f7; }
.stop-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:6px; }
.delivery-code { color:var(--text)!important; font-size:.82rem!important; }
.delivery-code b { display:inline-block; margin-left:4px; padding:3px 7px; border:1px solid var(--border); background:var(--surface); color:var(--text); font-family:monospace; font-size:1rem; letter-spacing:2px; }
.stop-exception { color:var(--danger)!important; font-weight:650; }
.delivery-code-input { max-width:180px; font-family:monospace; font-size:1.6rem; text-align:center; letter-spacing:8px; }
.office-call { display:inline-block; margin-bottom:14px; }
.route-contact { border-left:1px solid var(--border); padding-left:20px; display:flex; flex-direction:column; gap:6px; }
.route-contact h3 { margin:0 0 8px; }
.phone-link { color:var(--accent); font-weight:700; text-decoration:none; }
.phone-link:hover { text-decoration:underline; }
.batch-trip-group { margin-top:22px; }
.batch-admin-head { margin-top:28px; }
.batch-admin-head p { margin:3px 0 0; color:var(--muted); }
.batch-admin-detail td { background:var(--surface-2); padding:8px 18px 16px; }
.batch-admin-stops { max-width:900px; }
@media (max-width:640px) { .offer-page-head { align-items:flex-start; flex-direction:column; } .route-offer-hero { grid-template-columns:48px 1fr; } .route-offer-hero .big { grid-column:1/-1; width:100%; } .route-offer-mark { width:46px;height:46px; } .batch-stop-fields { grid-template-columns:1fr; } .batch-stop-fields > * { grid-column:1!important; } .commission-preview { flex-direction:column; } .route-detail-grid { grid-template-columns:1fr; }.route-contact{border-left:0;border-top:1px solid var(--border);padding:16px 0 0}.route-stop{grid-template-columns:28px minmax(0,1fr) auto}.route-stop .big{width:100%}.stop-actions{grid-column:2/-1;width:100%}.route-live-map{min-height:50vh}.route-detail-head{align-items:flex-start}.route-total b{font-size:1.15rem} }
@media (max-width: 640px) {
  .co-track-shell { width: 100%; margin: 0; border: 0; }
  .co-track-head { padding: 16px; align-items: flex-start; }
  .co-track-map { min-height: 55vh; }
  .co-track-info { padding: 16px; }
}

/* Integrations: keys and secrets.
 *
 * A secret is shown once. The box below is the only place a plaintext key ever
 * appears in this console, so it is built to be copied rather than admired —
 * monospaced, selectable, and with the copy button beside it. */
.secret-box {
  display: flex; align-items: center; gap: 10px; margin-top: 10px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--accent-soft); border: 1px solid var(--accent);
}
.secret-box code {
  flex: 1; min-width: 0; font-size: .82rem; word-break: break-all; user-select: all;
}

/* Test or live is a real choice, not a confirm box — a Cancel button that
   quietly means "test key instead" is how a live key ends up in staging. */
.key-modes { display: flex; flex-direction: column; gap: 9px; margin: 4px 0 6px; }
.key-mode {
  display: block; padding: 12px 14px; cursor: pointer;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
}
.key-mode.on { border-color: var(--accent); background: var(--accent-soft); }
.key-mode input { width: auto; margin-right: 8px; }
.key-mode b { font-size: .9rem; }
.key-mode span { display: block; margin-top: 4px; font-size: .8rem; color: var(--muted); line-height: 1.45; }
.key-mode .warn-text { color: var(--warn, #b45309); }

/* ═══════════════════════════ Developer docs ═══════════════════════════
 *
 * Read by somebody who has been told to "add delivery" and has an afternoon.
 * A single column, generous line height, and code samples that can be copied
 * without fighting the page.
 */
.docs-page { background: var(--bg); }
.docs-head { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.docs-in {
  max-width: 860px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
}
.docs-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.docs-nav a { color: var(--muted); font-size: .86rem; font-weight: 600; text-decoration: none; }
.docs-nav a:hover { color: var(--accent); }

.docs-body { max-width: 860px; margin: 0 auto; padding: 0 24px 80px; }
.docs-body section { padding: 34px 0; border-bottom: 1px solid var(--border); }
.docs-body h1 { font-size: 1.9rem; margin: 0 0 12px; line-height: 1.2; }
.docs-body h2 { font-size: 1.3rem; margin: 0 0 14px; }
.docs-body h3 { font-size: 1rem; margin: 26px 0 10px; }
.docs-body p { line-height: 1.65; margin: 0 0 12px; font-size: .93rem; }
.docs-body code { background: var(--accent-soft); padding: 1px 5px; border-radius: 4px; font-size: .86em; }

.docs-hero { border-bottom: 0 !important; padding-top: 48px !important; }
.docs-hero p { font-size: 1.02rem; color: var(--muted); max-width: 620px; }
.docs-hero-sub { font-weight: 600; color: var(--text) !important; }

.docs-flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; padding: 0 0 34px !important; border-bottom: 1px solid var(--border); }
.docs-flow-step {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px;
}
.docs-flow-step b {
  display: grid; place-items: center; width: 22px; height: 22px; margin-bottom: 8px;
  background: var(--accent); color: #fff; border-radius: 50%; font-size: .76rem;
}
.docs-flow-step span { font-size: .84rem; line-height: 1.5; color: var(--muted); }

.docs-body pre {
  background: #0f172a; color: #e2e8f0; padding: 16px 18px; border-radius: var(--radius-sm);
  overflow-x: auto; margin: 0 0 16px; line-height: 1.55;
}
.docs-body pre code { background: none; padding: 0; color: inherit; font-size: .82rem; }

.docs-note {
  background: var(--accent-soft); border-left: 3px solid var(--accent);
  padding: 13px 16px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 0 0 16px;
  font-size: .88rem; line-height: 1.6;
}
.docs-warn {
  background: rgba(245,158,11,.12); border-left: 3px solid #f59e0b;
  padding: 13px 16px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: .88rem !important; line-height: 1.6;
}

.docs-table { width: 100%; border-collapse: collapse; margin: 0 0 16px; font-size: .88rem; }
.docs-table th {
  text-align: left; padding: 9px 12px; border-bottom: 2px solid var(--border);
  font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
}
.docs-table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: top; line-height: 1.55; }
.docs-foot { padding: 34px 0; color: var(--muted); font-size: .86rem; }

/* Personal or company.
 *
 * Somebody who works at a company still sends personal parcels, and this used
 * to be a line in a payment dropdown that defaulted to "on account" — so every
 * private parcel landed on their employer's invoice. It is a decision, so it
 * looks like one, and it sits above the parcel details rather than below them. */
.billing-hats { margin-bottom: 14px; }
.hat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hat {
  display: block; text-align: left; padding: 11px 13px; cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-sm);
}
.hat:hover:not(:disabled) { border-color: var(--accent); }
.hat.on { border-color: var(--accent); background: var(--accent-soft); }
.hat:disabled { opacity: .45; cursor: not-allowed; }
.hat-ic { font-size: 1.15rem; }
.hat b { display: block; font-size: .88rem; margin-top: 2px; }
.hat span:last-child { display: block; font-size: .75rem; color: var(--muted); }
#billing-note { display: block; margin-top: 7px; }
