/* ===================================================================
   KARGADA — simple booking UI
   White surfaces, one neon-blue accent, a full-height map.
   =================================================================== */

:root {
  --brand: #1f51ff;
  --neon: #00c8ff;
  --brand-dark: #1238d6;
  --brand-soft: #eef2ff;
  --ink: #1f2329;
  --ink-2: #4b5563;
  --muted: #8a919c;
  --line: #e6e8ec;
  --bg: #f5f6f8;
  --card: #ffffff;
  --drop: #2b2f36;
  --ok: #18a058;
  --danger: #d93025;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(20, 24, 31, .06);
  --shadow-lg: 0 12px 40px rgba(20, 24, 31, .18);
  --topbar: 60px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ------------------------------------------------------------ top bar */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  height: var(--topbar);
  display: flex; align-items: center; gap: 28px;
  padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 32px; height: 32px; display: block; flex: none;
}
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: .5px; }

.tabs { display: flex; gap: 4px; height: 100%; }
.tab {
  height: 100%; padding: 0 14px;
  font-weight: 600; color: var(--ink-2);
  border-bottom: 3px solid transparent;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }

.support { margin-left: auto; color: var(--muted); font-size: 13px; }

/* -------------------------------------------------------------- views */
.view { display: none; }
.view.active { display: block; }

#view-book.active {
  display: flex;
  position: fixed; inset: var(--topbar) 0 0 0;
}

/* -------------------------------------------------------------- panel */
.panel {
  width: 420px; flex: none;
  display: flex; flex-direction: column;
  background: #fff;
  border-right: 1px solid var(--line);
  z-index: 2;
}
.panel-scroll { flex: 1; overflow-y: auto; padding: 20px 20px 24px; }

.pane { display: none; }
.pane.active { display: block; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.section-title { margin: 22px 0 10px; font-size: 15px; font-weight: 700; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; }
.text-btn { color: var(--brand); font-weight: 600; font-size: 13px; }
.text-btn:hover { text-decoration: underline; }

/* route card: stops joined by a dotted line */
.route-card { padding: 6px 8px 4px 14px; }
.stop-row {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--line);
}
.stop-row::before {
  content: ""; position: absolute; left: 6px; top: -10px; height: 20px;
  border-left: 2px dotted #c4c8cf;
}
.route-card > .stop-row:first-child::before { display: none; }
#destinations .stop-row:last-child { border-bottom: 0; }

.stop-dot {
  width: 14px; height: 14px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 9px; font-weight: 700; color: #fff;
  position: relative; z-index: 1;
}
.stop-dot.pickup { background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.stop-dot.drop { background: var(--drop); border-radius: 4px; }

.autocomplete { position: relative; flex: 1; min-width: 0; }
.stop-input {
  width: 100%; height: 48px; border: 0; outline: 0; background: transparent;
  font-size: 15px;
}
.stop-input::placeholder { color: var(--muted); }

.icon-btn {
  width: 32px; height: 32px; flex: none; border-radius: 8px;
  display: grid; place-items: center; color: var(--muted);
}
.icon-btn:hover { background: var(--bg); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }

.add-stop {
  display: flex; align-items: center; gap: 12px;
  width: 100%; height: 42px; padding-left: 0;
  color: var(--brand); font-weight: 600;
  border-top: 1px solid var(--line);
}
.add-stop span {
  width: 14px; text-align: center; font-size: 18px; line-height: 1;
}

.suggestions {
  display: none;
  position: absolute; left: -36px; right: -40px; top: 100%; z-index: 30;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-lg); overflow: hidden; max-height: 320px; overflow-y: auto;
}
.suggestions.open { display: block; }
.suggestion {
  display: flex; gap: 10px; align-items: flex-start; width: 100%;
  padding: 10px 14px; text-align: left;
}
.suggestion:hover { background: var(--bg); }
.suggestion svg { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--muted); }
.suggestion b { display: block; font-weight: 600; }
.suggestion small { display: block; color: var(--muted); font-size: 12px; }

/* inputs */
.input {
  display: block; width: 100%;
  height: 44px; padding: 0 14px; margin-bottom: 10px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  outline: 0; transition: border-color .15s;
}
textarea.input { height: auto; padding: 10px 14px; resize: vertical; }
.input:focus { border-color: var(--brand); }
.phone-row { display: flex; gap: 8px; }
.phone-row .cc {
  height: 44px; padding: 0 12px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink-2);
}
.phone-row .input { flex: 1; }

/* segmented control */
.segmented {
  display: flex; gap: 4px; padding: 4px; margin-bottom: 10px;
  background: var(--bg); border-radius: 10px;
}
.seg {
  flex: 1; height: 36px; border-radius: 8px;
  font-weight: 600; color: var(--ink-2); font-size: 13px;
}
.seg.active { background: #fff; color: var(--brand); box-shadow: var(--shadow); }

/* vehicles */
.veh-list { display: grid; gap: 8px; }
.veh {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 12px 14px; text-align: left;
  border: 1.5px solid var(--line); border-radius: var(--radius); background: #fff;
  transition: border-color .15s, background .15s;
}
.veh:hover { border-color: #a9bbff; }
.veh.selected { border-color: var(--brand); background: var(--brand-soft); }
.veh-icon {
  width: 56px; height: 36px; flex: none; color: var(--ink);
  display: grid; place-items: center;
}
.veh.selected .veh-icon { color: var(--brand); }
.veh-glyph { width: 100%; height: 100%; }
.veh-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.veh-name { font-weight: 700; }
.veh-sub { color: var(--muted); font-size: 12px; }
.veh-blurb { margin-top: 4px; color: var(--ink-2); font-size: 12px; }
.veh-price { font-weight: 700; white-space: nowrap; font-size: 13px; }

/* services */
.svc-list { display: grid; gap: 2px; }
.svc {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 4px; cursor: pointer;
  border-bottom: 1px solid var(--line);
}
.svc:last-child { border-bottom: 0; }
.svc input { position: absolute; opacity: 0; pointer-events: none; }
.check {
  width: 20px; height: 20px; flex: none; border-radius: 6px;
  border: 1.5px solid #c4c8cf; display: grid; place-items: center;
}
.svc input:checked + .check { background: var(--brand); border-color: var(--brand); }
.svc input:checked + .check::after {
  content: ""; width: 5px; height: 10px; margin-top: -2px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.svc input:focus-visible + .check { outline: 2px solid var(--brand); outline-offset: 2px; }
.svc.locked { cursor: default; }
.svc.locked .check { opacity: .55; }
.svc-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.svc-name { font-weight: 600; }
.svc-note { color: var(--muted); font-size: 12px; }
.svc-price { font-weight: 600; font-size: 13px; white-space: nowrap; }

/* step 2 */
.back-link {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--ink-2); font-weight: 600; margin-bottom: 14px;
}
.back-link svg { width: 18px; height: 18px; }
.back-link:hover { color: var(--brand); }

.summary-card { padding: 14px; }
.sum-stop { display: flex; align-items: flex-start; gap: 12px; padding: 4px 0; }
.sum-stop .stop-dot { margin-top: 3px; }
.sum-meta {
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line);
  color: var(--ink-2); font-size: 13px;
}

.breakdown { padding: 6px 14px 10px; }
.kv {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 7px 0; font-size: 13px;
}
.kv span:first-child { color: var(--ink-2); }
.kv span:last-child { text-align: right; font-weight: 600; }
.kv .free { color: var(--ok); }
.kv.total { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 10px; font-size: 15px; }
.kv.total span { color: var(--ink); font-weight: 800; }
.vat { margin: 4px 0 0; color: var(--muted); font-size: 12px; }

/* footer */
.panel-foot {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: #fff;
}
.total { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.total-label { font-size: 12px; color: var(--muted); }
.total-amount { font-size: 22px; font-weight: 800; line-height: 1.2; }
.total-meta { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* buttons */
.btn {
  display: inline-grid; place-items: center;
  height: 46px; padding: 0 26px; border-radius: 10px;
  font-weight: 700; text-decoration: none; white-space: nowrap;
  transition: background .15s, opacity .15s;
}
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.secondary:hover { background: var(--bg); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.full { width: 100%; margin-top: 16px; }
.btn.sm { height: 34px; padding: 0 14px; font-size: 13px; }

/* ---------------------------------------------------------------- map */
.map-wrap { position: relative; flex: 1; min-width: 0; }
#map { position: absolute; inset: 0; }
.map-offline {
  height: 100%; display: grid; place-items: center; text-align: center;
  color: var(--muted); padding: 24px;
}
.map-chip {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
  padding: 8px 16px; border-radius: 999px;
  background: #fff; box-shadow: var(--shadow-lg);
  font-weight: 700; font-size: 13px; white-space: nowrap;
}

.pin { position: relative; width: 32px; height: 42px; cursor: pointer; }
.pin svg { width: 100%; height: 100%; filter: drop-shadow(0 2px 3px rgba(0,0,0,.3)); }
.pin svg path { stroke: #fff; stroke-width: 2; }
.pin-pickup svg path { fill: var(--brand); }
.pin-drop svg path { fill: var(--drop); }
.pin span {
  position: absolute; left: 0; right: 0; top: 8px;
  text-align: center; color: #fff; font-weight: 800; font-size: 13px;
}
.pin-pickup span::after, .pin-drop span:empty::after {
  content: ""; display: inline-block; width: 9px; height: 9px; margin-top: 4px;
  border-radius: 50%; background: #fff;
}
.pin-drop span:empty::after { border-radius: 2px; }

.live-dot {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--brand); border: 3px solid #fff;
  box-shadow: 0 0 0 6px rgba(31, 81, 255, .25), 0 2px 6px rgba(0,0,0,.3);
}

.maplibregl-popup-content { border-radius: 10px; padding: 8px 12px; font-size: 13px; box-shadow: var(--shadow-lg); }

/* -------------------------------------------------------- other pages */
.page { max-width: 960px; margin: 0 auto; padding: calc(var(--topbar) + 32px) 24px 48px; }
.page-title { margin: 0 0 6px; font-size: 26px; font-weight: 800; }
.page-sub { margin: 0 0 24px; color: var(--ink-2); }

.orders { display: grid; gap: 12px; }
.order { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.order-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.order-id { font-weight: 800; }
.order-total { margin-left: auto; font-weight: 800; }
.badge {
  padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 700;
  background: var(--brand-soft); color: var(--brand-dark); text-transform: capitalize;
}
.order-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line);
}
.order-actions { display: flex; gap: 8px; }
.empty {
  padding: 48px 24px; text-align: center; color: var(--muted);
  background: #fff; border: 1px dashed var(--line); border-radius: var(--radius);
}

.fleet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.fleet-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.fleet-head { display: flex; align-items: center; gap: 12px; }
.fleet-blurb { color: var(--ink-2); font-size: 13px; margin: 10px 0 6px; }

/* ------------------------------------------------------------- modals */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  display: none; align-items: center; justify-content: center; padding: 16px;
  background: rgba(17, 20, 26, .45);
}
.modal-backdrop.open { display: flex; }
.modal {
  width: 100%; max-width: 460px; max-height: calc(100vh - 32px);
  display: flex; flex-direction: column;
  background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden;
}
.modal.wide { max-width: 620px; }
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 18px 20px 12px;
}
.modal-head h3 { margin: 0; font-size: 18px; }
.eyebrow { color: var(--brand); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.close { width: 32px; height: 32px; border-radius: 8px; color: var(--muted); }
.close:hover { background: var(--bg); color: var(--ink); }
.modal-body { padding: 0 20px 16px; overflow-y: auto; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px; border-top: 1px solid var(--line);
}
.mini-title { margin: 16px 0 8px; font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 12px; border-radius: 999px; font-size: 13px;
  border: 1px solid var(--line); background: #fff;
}
.chip:hover { border-color: #a9bbff; }
.chip.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }

.rec-card { margin-top: 16px; padding: 14px; border: 1.5px solid var(--brand); border-radius: var(--radius); background: var(--brand-soft); }
.rec-head { display: flex; align-items: center; gap: 12px; }
.rec-head div { flex: 1; display: flex; flex-direction: column; }
.rec-head small { color: var(--muted); }
.rec-card .btn.full { margin-top: 10px; }

.done-badge {
  width: 56px; height: 56px; margin: 4px auto 10px; border-radius: 50%;
  display: grid; place-items: center; font-size: 28px; font-weight: 800;
  background: #e8f6ee; color: var(--ok);
}
.done-text { text-align: center; color: var(--ink-2); margin: 0 0 12px; }

.track-map { height: 300px; background: var(--bg); }
.progress { height: 6px; margin: 16px 0 8px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--brand); border-radius: inherit; }

/* --------------------------------------------------------- quote popup */
.quote-modal { max-width: 480px; }
.quote-head {
  position: relative; padding: 22px 24px 18px; text-align: center;
  background: var(--brand); color: #fff;
}
.quote-title { font-size: 15px; font-weight: 600; opacity: .95; padding: 0 28px; }
.quote-amount { font-size: 32px; font-weight: 800; line-height: 1.2; margin-top: 4px; }
.quote-note { font-size: 12px; opacity: .9; margin-top: 2px; }
.close.light { position: absolute; top: 12px; right: 12px; color: #fff; }
.close.light:hover { background: rgba(255,255,255,.18); color: #fff; }
.quote-vehicle {
  height: 92px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-dark);
}
.quote-vehicle .veh-glyph { width: 150px; height: 80px; }
.quote-modal .modal-body { padding-top: 10px; }
.quote-modal .kv { border-bottom: 1px solid var(--line); padding: 9px 0; }
.quote-modal .kv span:first-child { flex: none; width: 104px; }
.modal-foot.split .btn { flex: 1; }

.modal.small { max-width: 420px; }
.modal.small .input { margin-top: 8px; }

.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover { background: #b3261e; }
.btn.ghost-danger { background: #fff; color: var(--danger); border: 1px solid #f3c2bd; }
.btn.ghost-danger:hover { background: #fdecea; }
.badge.void { background: #fdecea; color: #b3261e; }

.optional { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.field-help { margin: -4px 0 10px; font-size: 12px; color: var(--muted); }
.veh-price { text-align: right; }
.veh-price small { display: block; font-size: 10px; font-weight: 600; color: var(--brand-dark); }

/* -------------------------------------------------------------- toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 11px 18px; border-radius: 10px; max-width: calc(100vw - 32px);
  background: var(--ink); color: #fff; font-weight: 600; box-shadow: var(--shadow-lg);
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); }

/* --------------------------------------------------------------- mobile */
@media (max-width: 860px) {
  .topbar { gap: 12px; padding: 0 14px; }
  .brand-name, .support { display: none; }
  .tabs { flex: 1; }
  .tab { padding: 0 10px; font-size: 13px; }

  #view-book.active { flex-direction: column-reverse; }
  .map-wrap { flex: none; height: 38vh; }
  .panel { width: 100%; flex: 1; min-height: 0; border-right: 0; border-top: 1px solid var(--line); }
  .panel-scroll { padding: 16px; }
  .panel-foot { padding-left: 16px; padding-right: 16px; }
  .suggestions { left: -30px; right: -8px; }
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal { max-width: none; border-radius: 16px 16px 0 0; max-height: 92vh; }
  .track-map { height: 240px; }
}

/* ===================================================== login / sign-up */
.auth-body {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 16px; background: #f7f7f8; position: relative; overflow-x: hidden;
}
.auth-card {
  position: relative; z-index: 1; width: 100%; max-width: 440px;
  background: #fff; border-radius: 16px; box-shadow: 0 10px 40px rgba(20, 24, 31, .08);
  padding: 36px 36px 28px;
}
.auth-logo { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 26px; }
.auth-logo .brand-mark { width: 40px; height: 40px; }
.auth-logo .brand-name { font-size: 24px; color: var(--brand); }
.auth-title { margin: 0; font-size: 22px; font-weight: 800; }
.auth-sub { margin: 4px 0 20px; color: var(--ink-2); }
.auth-label { display: block; margin: 0 0 6px; font-weight: 600; font-size: 13px; }
.auth-form .input { margin-bottom: 14px; }
.auth-form .phone-row .input { margin-bottom: 14px; }
.auth-form .btn.full { margin-top: 4px; height: 48px; font-size: 15px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 64px; }
.pw-toggle {
  position: absolute; right: 8px; top: 7px; height: 30px; padding: 0 10px; border-radius: 7px;
  font-size: 12px; font-weight: 600; color: var(--ink-2);
}
.pw-toggle:hover { background: var(--bg); }
.auth-error { min-height: 18px; margin: -4px 0 8px; color: var(--danger); font-size: 13px; font-weight: 600; }
.auth-switch { margin: 18px 0 0; text-align: center; color: var(--ink-2); }
.auth-switch a { color: var(--brand); font-weight: 700; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }
.auth-foot { position: relative; z-index: 1; margin: 18px 0 0; color: var(--muted); font-size: 12px; }

.auth-body {
  background:
    radial-gradient(1200px 600px at 15% 110%, rgba(31, 81, 255, .16), transparent 60%),
    radial-gradient(900px 500px at 95% -10%, rgba(0, 200, 255, .14), transparent 60%),
    linear-gradient(180deg, #f6f8ff 0%, #eaf0ff 100%);
}
.auth-art { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.auth-art span { position: absolute; filter: drop-shadow(0 18px 24px rgba(16, 42, 140, .18)); }
.auth-art .v3 { width: 100%; height: 100%; }
.auth-art .a-wing   { width: 520px; height: 300px; left: -30px;  bottom: -20px; }
.auth-art .a-pickup { width: 300px; height: 176px; left: 4%;    top: 14%; }
.auth-art .a-sedan  { width: 230px; height: 132px; left: 6%;    top: 46%; opacity: .9; }
.auth-art .a-truck  { width: 440px; height: 256px; right: -20px; bottom: 2%; }
.auth-art .a-mpv    { width: 290px; height: 168px; right: 6%;   top: 8%; }
.auth-art .a-van    { width: 250px; height: 146px; right: 5%;   top: 40%; opacity: .85; }
.auth-card { box-shadow: 0 20px 60px rgba(16, 42, 140, .14); }
@media (max-width: 1100px) { .auth-art .a-sedan, .auth-art .a-van { display: none; } }
@media (max-width: 900px) { .auth-art { display: none; } .auth-card { padding: 28px 22px 22px; } }

/* ------------------------------------------------------- account menu */
.account { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.account .who { color: var(--ink-2); font-size: 13px; font-weight: 600; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account a.admin-link { color: var(--brand); font-weight: 700; font-size: 13px; text-decoration: none; }
.logout { height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.logout:hover { background: var(--bg); }
@media (max-width: 860px) { .account .who { display: none; } }

/* ===================================================== vehicle cards */
.text-btn { display: inline-flex; align-items: center; gap: 5px; }
.text-btn svg { width: 16px; height: 16px; }

.veh-carousel { position: relative; margin: 0 -20px; }
.veh-strip {
  display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 4px 20px 10px; scroll-padding: 0 20px; scrollbar-width: none;
}
.veh-strip::-webkit-scrollbar { display: none; }
.vcard {
  flex: 0 0 122px; height: 150px; scroll-snap-align: start;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding: 10px 8px 12px; text-align: center;
  background: #fff; border: 1.5px solid var(--line); border-radius: 12px;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.vcard:hover { border-color: #a9bbff; transform: translateY(-1px); }
.vcard.selected {
  border-color: var(--brand); background: var(--brand-soft);
  box-shadow: 0 0 0 3px rgba(31, 81, 255, .12), 0 6px 18px rgba(31, 81, 255, .18);
}
.vcard-art {
  flex: 1; width: 100%; display: grid; place-items: center;
  color: var(--brand);
}
.vcard-art .veh-glyph {
  width: 88px; height: 48px; stroke-width: 1.8;
  filter: drop-shadow(0 0 4px rgba(0, 200, 255, .55)) drop-shadow(0 0 10px rgba(31, 81, 255, .25));
}
.vcard.selected .vcard-art .veh-glyph { filter: drop-shadow(0 0 6px rgba(0, 200, 255, .8)) drop-shadow(0 0 14px rgba(31, 81, 255, .45)); }
.vcard-name { font-size: 13px; font-weight: 600; line-height: 1.25; min-height: 33px; display: flex; align-items: center; }
.vcard-price { margin-top: 3px; font-size: 11px; font-weight: 700; color: var(--brand-dark); }

.veh-nav {
  position: absolute; top: 58px; z-index: 2; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; background: #fff; color: var(--brand);
  box-shadow: 0 2px 10px rgba(20, 24, 31, .18);
}
.veh-nav:hover { background: var(--brand-soft); }
.veh-nav svg { width: 18px; height: 18px; }
.veh-nav.prev { left: 6px; }
.veh-nav.next { right: 6px; }

.veh-detail {
  margin-top: 6px; padding: 12px 14px; border-radius: 12px;
  background: var(--brand-soft); border: 1px solid #d6defd;
}
.vd-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.vd-head span { font-weight: 800; color: var(--brand-dark); text-align: right; }
.vd-head small { display: block; font-size: 10px; font-weight: 600; }
.vd-specs { color: var(--ink-2); font-size: 12px; margin-top: 2px; }
.veh-detail p { margin: 6px 0 0; font-size: 12px; color: var(--ink-2); }
.quote-vehicle .veh-glyph { filter: drop-shadow(0 0 6px rgba(0, 200, 255, .6)); }

/* =========================================================== statuses */
.badge.s-pending { background: #fff6e0; color: #9a6700; }
.badge.s-confirmed { background: var(--brand-soft); color: var(--brand-dark); }
.badge.s-completed { background: #e8f6ee; color: #137a43; }
.badge.s-cancelled { background: #fdecea; color: #b3261e; }

/* ============================================================== admin */
.admin-body { background: var(--bg); }
.admin-tag {
  padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .5px;
  text-transform: uppercase; background: var(--brand-soft); color: var(--brand-dark);
}
.admin-page { max-width: 1280px; margin: 0 auto; padding: calc(var(--topbar) + 28px) 24px 48px; }
.admin-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.admin-head .page-sub { margin-bottom: 18px; }
.stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.stat span { color: var(--muted); font-size: 12px; font-weight: 600; }
.stat b { font-size: 22px; font-weight: 800; }
.stat.hot { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31, 81, 255, .08); }
.stat.hot b { color: var(--brand); }
.admin-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.filters { margin: 0; flex: none; }
.filters .seg { flex: none; padding: 0 12px; }
.search { flex: 1; min-width: 220px; margin: 0; }
.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; }
.orders-table { width: 100%; border-collapse: collapse; min-width: 1000px; }
.orders-table th {
  text-align: left; padding: 11px 14px; font-size: 11px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); background: #fafbfc;
}
.orders-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 13px; }
.orders-table tr:last-child td { border-bottom: 0; }
.orders-table tbody tr { cursor: pointer; }
.orders-table tbody tr:hover { background: #fafbff; }
.orders-table tr.is-pending td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.orders-table small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.orders-table .num { text-align: right; }
.orders-table .ref { white-space: nowrap; }
.route-cell { max-width: 260px; }
.actions { white-space: nowrap; }
.actions .btn + .btn { margin-left: 6px; }
.actions-col { width: 1%; }
.table-wrap .empty { border: 0; }
.modal-foot .btn + .btn { margin-left: 0; }
@media (max-width: 1100px) { .stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .stats { grid-template-columns: repeat(2, 1fr); } .admin-page { padding-left: 12px; padding-right: 12px; } }

/* ======================================================= 3D vehicles */
.v3 { display: block; width: 100%; height: 100%; }
.vcard-art .v3 { width: 112px; height: 74px; }
.vcard-art { color: inherit; }
.vcard { justify-content: space-between; height: 160px; padding-top: 6px; }
.fleet-art { width: 120px; height: 72px; flex: none; }
.rec-art { width: 96px; height: 58px; flex: none; }
.quote-vehicle { height: 118px; }
.quote-vehicle .v3 { width: 200px; height: 110px; }

.v3-lane, .v3-grit, .v3-spokes {
  animation-duration: .55s; animation-timing-function: linear; animation-iteration-count: infinite;
  animation-play-state: paused;
}
.v3-lane, .v3-grit { animation-name: v3-flow; }
.v3-spokes { animation-name: v3-spin; animation-duration: .35s; transform-box: fill-box; transform-origin: center; }
@keyframes v3-flow { to { stroke-dashoffset: 26; } }
@keyframes v3-spin { to { transform: rotate(-360deg); } }

/* Hover: the road flows backwards under the vehicle and the wheels turn. */
.vcard:hover .v3-lane, .vcard:hover .v3-grit, .vcard:hover .v3-spokes,
.drive:hover .v3-lane, .drive:hover .v3-grit, .drive:hover .v3-spokes,
.fleet-card:hover .v3-lane, .fleet-card:hover .v3-grit, .fleet-card:hover .v3-spokes,
.quote-vehicle:hover .v3-lane, .quote-vehicle:hover .v3-grit, .quote-vehicle:hover .v3-spokes { animation-play-state: running; }
.vcard:hover .v3 { filter: drop-shadow(0 4px 10px rgba(31, 81, 255, .22)); }
.vcard.selected .v3 { filter: drop-shadow(0 0 8px rgba(0, 200, 255, .45)); }

@media (prefers-reduced-motion: reduce) {
  .v3-lane, .v3-grit, .v3-spokes { animation: none !important; }
}

/* ------------------------------------------------------- google sign-in */
.or { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.google-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  height: 48px; border: 1px solid #d0d5dd; border-radius: 10px; background: #fff;
  color: var(--ink); font-weight: 700; font-size: 15px; text-decoration: none;
  transition: background .15s, border-color .15s;
}
.google-btn:hover { background: #f7f9ff; border-color: #a9bbff; }
.google-btn svg { width: 20px; height: 20px; }

/* --------------------------------------------------------- admin: customers */
.admin-tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.admin-tab { padding: 10px 14px; font-weight: 700; color: var(--ink-2); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.admin-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.cust { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none; object-fit: cover;
  display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-dark); font-weight: 800; font-size: 13px;
}
.method { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.method span { padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: #f1f3f7; color: var(--ink-2); }
.method span.g { background: #e8f0fe; color: #1a56c4; }
.method span.a { background: var(--brand-soft); color: var(--brand-dark); }

/* ---------------------------------------------------------- legal pages */
.legal-body { background: var(--bg); }
.legal { max-width: 760px; margin: 40px auto; padding: 36px 40px; background: #fff; border-radius: 16px; border: 1px solid var(--line); line-height: 1.6; }
.legal .brand { margin-bottom: 22px; }
.legal h1 { font-size: 28px; margin: 0 0 4px; }
.legal h2 { font-size: 17px; margin: 26px 0 6px; }
.legal ul { padding-left: 20px; }
.legal a { color: var(--brand); }
.legal-foot { margin-top: 30px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; }
.auth-foot a { color: var(--muted); }
@media (max-width: 640px) { .legal { margin: 0; border-radius: 0; padding: 24px 18px; } }

/* ===================================================== finding a driver */
.finding-body {
  min-height: 100vh; display: flex; align-items: flex-start; justify-content: center;
  padding: 32px 16px 48px;
  background:
    radial-gradient(900px 500px at 50% -5%, rgba(31,81,255,.12), transparent 60%),
    linear-gradient(180deg, #f6f8ff 0%, #eef2ff 100%);
}
.finding { width: 100%; max-width: 460px; text-align: center; }
.finding .brand { justify-content: center; margin-bottom: 26px; }
.find-state h1 { font-size: 23px; font-weight: 800; margin: 20px 0 6px; }
.find-sub { color: var(--ink-2); margin: 0 0 14px; }
.find-timer { display: inline-block; padding: 5px 14px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; font-size: 13px; }
.find-note { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 16px auto 0; max-width: 380px; }
.find-note b { color: var(--ink-2); }

/* radar / pulse */
.radar { position: relative; width: 150px; height: 150px; margin: 10px auto 4px; display: grid; place-items: center; }
.radar .ring {
  position: absolute; inset: 0; margin: auto; width: 60px; height: 60px; border-radius: 50%;
  border: 2px solid var(--brand); opacity: 0; animation: radar-pulse 2.4s cubic-bezier(.2,.6,.3,1) infinite;
}
.radar .ring:nth-child(2) { animation-delay: .8s; }
.radar .ring:nth-child(3) { animation-delay: 1.6s; }
@keyframes radar-pulse { 0% { transform: scale(.5); opacity: .7; } 100% { transform: scale(2.4); opacity: 0; } }
.radar-core {
  position: relative; z-index: 1; width: 64px; height: 64px; border-radius: 50%;
  background: var(--brand); color: #fff; display: grid; place-items: center;
  box-shadow: 0 10px 24px rgba(31,81,255,.35); animation: radar-bob 2.4s ease-in-out infinite;
}
.radar-core svg { width: 32px; height: 32px; }
@keyframes radar-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

.found-badge, .cancel-badge {
  width: 72px; height: 72px; margin: 6px auto 2px; border-radius: 50%;
  display: grid; place-items: center; font-size: 36px; font-weight: 800;
}
.found-badge { background: #e8f6ee; color: var(--ok); animation: pop .4s ease; }
.cancel-badge { background: #fdecea; color: var(--danger); }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

.find-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 8px 18px; margin: 22px 0; text-align: left; box-shadow: var(--shadow); }
.find-card .kv { padding: 9px 0; }
.find-actions { display: flex; flex-direction: column; gap: 10px; }
.find-actions .btn { width: 100%; }
@media (prefers-reduced-motion: reduce) { .radar .ring, .radar-core { animation: none; } .radar .ring { opacity: .3; } }

.badge.s-searching { background: #eef2ff; color: var(--brand-dark); }
.stat.hot b { color: var(--brand); }

/* ================================================= live order (map card) */
.live-order {
  position: absolute; left: 16px; right: 16px; bottom: 16px; z-index: 5;
  background: #fff; border-radius: 14px; box-shadow: 0 10px 34px rgba(16,42,140,.22);
  overflow: hidden; max-width: 520px; margin: 0 auto;
}
.lo-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.lo-main { flex: 1; min-width: 0; }
.lo-title { font-weight: 700; font-size: 14px; }
.lo-sub { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lo-note { padding: 0 14px 12px; color: var(--muted); font-size: 12px; }

.lo-radar { position: relative; width: 34px; height: 34px; flex: none; display: grid; place-items: center; }
.lo-radar i { position: absolute; inset: 0; margin: auto; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.lo-radar i:nth-child(2), .lo-radar i:nth-child(3) { background: none; border: 2px solid var(--brand); animation: lo-ping 1.8s ease-out infinite; }
.lo-radar i:nth-child(3) { animation-delay: .9s; }
@keyframes lo-ping { 0% { width: 10px; height: 10px; opacity: .7; } 100% { width: 34px; height: 34px; opacity: 0; } }

.lo-avatar { width: 38px; height: 38px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand); color: #fff; font-weight: 800; font-size: 14px; }
.lo-avatar.cancel { background: var(--danger); }
.lo-chat-btn { position: relative; height: 34px; padding: 0 14px; border-radius: 9px; background: var(--brand); color: #fff; font-weight: 700; font-size: 13px; }
.lo-chat-btn:hover { background: var(--brand-dark); }
.lo-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px; border-radius: 999px; background: #fff; color: var(--brand-dark); font-size: 11px; font-weight: 800; vertical-align: middle; }
.lo-x { width: 30px; height: 30px; flex: none; border-radius: 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.lo-x:hover { background: var(--bg); color: var(--ink); }
.lo-foot { display: flex; gap: 6px; padding: 0 10px 10px; }
.lo-link { flex: 1; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-weight: 600; font-size: 13px; text-align: center; line-height: 34px; text-decoration: none; }
.lo-link:hover { background: var(--bg); }

/* chat */
.lo-chat { border-top: 1px solid var(--line); }
.chat-log { max-height: 220px; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; background: #f7f8fb; }
.chat-empty { color: var(--muted); font-size: 12px; text-align: center; padding: 10px; }
.bubble { max-width: 80%; padding: 7px 11px; border-radius: 14px; font-size: 13px; line-height: 1.4; position: relative; }
.bubble.them { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble.me { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.bubble-who { display: block; font-size: 10px; font-weight: 700; color: var(--brand-dark); margin-bottom: 1px; }
.bubble-text { white-space: pre-wrap; word-break: break-word; }
.bubble-edited { display: block; font-size: 9px; opacity: .6; margin-top: 2px; }
.chat-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; outline: 0; }
.chat-form input:focus { border-color: var(--brand); }
.chat-form button { width: 38px; height: 38px; flex: none; border-radius: 50%; background: var(--brand); color: #fff; font-size: 14px; }
.chat-form button:hover { background: var(--brand-dark); }

@media (max-width: 860px) {
  .live-order { left: 8px; right: 8px; bottom: 8px; }
  .chat-log { max-height: 160px; }
}

/* ------------------------------------------------ admin: conversation */
.admin-chat { max-height: 260px; overflow-y: auto; padding: 10px; background: #f7f8fb; border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.abub { display: flex; flex-direction: column; max-width: 85%; padding: 7px 10px; border-radius: 12px; font-size: 13px; position: relative; }
.abub.customer { align-self: flex-start; background: #fff; border: 1px solid var(--line); }
.abub.driver { align-self: flex-end; background: var(--brand-soft); }
.abub.admin { align-self: flex-end; background: #fff4e6; }
.abub-who { font-size: 10px; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.abub-text { white-space: pre-wrap; word-break: break-word; }
.abub-act { align-self: flex-end; margin-top: 2px; font-size: 11px; color: var(--brand-dark); font-weight: 700; padding: 2px 6px; border-radius: 6px; }
.abub-act:hover { background: rgba(31,81,255,.1); }
.abub-edit { width: 100%; height: 32px; padding: 0 8px; border: 1px solid var(--brand); border-radius: 7px; outline: 0; font: inherit; }

/* ---------- live card: compact ---------- */
.live-order { max-width: 440px; border-radius: 12px; left: 12px; right: 12px; bottom: 12px; }
.lo-row { gap: 10px; padding: 9px 10px 9px 12px; }
.lo-title { font-size: 13px; line-height: 1.3; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.lo-time { font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.lo-sub { font-size: 11.5px; line-height: 1.35; }
.lo-radar { width: 24px; height: 24px; }
.lo-radar i { width: 8px; height: 8px; }
@keyframes lo-ping { 0% { width: 8px; height: 8px; opacity: .7; } 100% { width: 24px; height: 24px; opacity: 0; } }
.lo-cancel { flex: none; height: 26px; padding: 0 9px; border-radius: 7px; font-size: 12px; font-weight: 600; color: var(--danger); }
.lo-cancel:hover { background: #fdecea; }
.lo-note { display: none; }
.lo-avatar { width: 32px; height: 32px; font-size: 12px; }
.lo-chat-btn { height: 28px; padding: 0 11px; font-size: 12px; border-radius: 8px; }
.lo-x { width: 26px; height: 26px; }
.lo-foot { gap: 6px; padding: 0 10px 9px; }
.lo-link { height: 28px; line-height: 28px; font-size: 12px; }
.chat-log { max-height: 180px; padding: 10px 12px; }
.chat-form { padding: 8px 10px; }
.chat-form input { height: 34px; }
.chat-form button { width: 34px; height: 34px; }

/* toast at the top so it never covers the map card */
.toast { bottom: auto; top: 76px; transform: translate(-50%, -12px); }
.toast.show { transform: translate(-50%, 0); }

/* ---------------------------------------------- admin: driver & truck form */
.drv-form .mini-title:first-child { margin-top: 0; }
.drv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.drv-f { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.drv-f.wide { grid-column: 1 / -1; }
.drv-f > span { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.drv-f > span i { color: var(--danger); font-style: normal; }
.drv-f .input { margin: 0; }
.drv-f .input.plate { text-transform: uppercase; letter-spacing: 1.5px; font-weight: 700; }
.drv-err { margin: 12px 0 0; padding: 8px 12px; border-radius: 8px; background: #fdecea; color: var(--danger); font-size: 13px; font-weight: 600; }
.plate-tag { display: inline-block; padding: 1px 6px; border: 1.5px solid var(--ink); border-radius: 4px; font-size: 11px; font-weight: 800; letter-spacing: 1px; color: var(--ink); background: #fff; line-height: 1.4; }
.drv-line { display: block; margin-top: 4px; font-size: 12px; color: var(--ink-2); }
.drv-line.warn { color: #b26a00; }
@media (max-width: 560px) { .drv-grid { grid-template-columns: 1fr; } }

/* customer live card: driver contact + plate */
.lo-plate { margin-left: 2px; }
.lo-call { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); color: var(--brand); text-decoration: none; font-size: 15px; }
.lo-call:hover { background: var(--brand-soft); }
.abub-sender { height: 30px; border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; font-size: 12px; background: #fff; margin-bottom: 4px; }
.drv-f > span .opt { font-style: normal; font-weight: 500; color: var(--muted); margin-left: 4px; }

/* ------------------------------------------------------- admin: rates */
.rates-head { display: flex; gap: 20px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; }
.rates-intro { max-width: 620px; margin: 0 0 4px; }
.rates-actions { display: flex; gap: 12px; align-items: flex-end; }
.markup { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.markup span { display: flex; align-items: center; gap: 6px; }
.markup .input { width: 86px; height: 38px; }
.rates-table .rate-in { width: 92px; height: 34px; text-align: right; padding: 0 8px; margin: 0; }
.rates-table td { vertical-align: middle; }
.rate-acts { white-space: nowrap; }
.btn.ghost { background: none; border: 0; color: var(--muted); }
.fit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; margin: 12px 0; }
.fit-grid .input { margin: 0; }
.fit-h { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.fit-res { font-size: 15px; margin: 6px 0 8px; color: var(--brand); }
.fit-out small.ok { color: var(--ok); font-weight: 700; }
.fit-out small.warn { color: #b26a00; font-weight: 700; }
