/* Waxi Control — black, gold, white. One sheet for every screen. */
:root {
  --bg: #0b0b0f; --panel: #15151c; --panel-2: #1d1d26; --line: #2a2a36; --line-2: #363645;
  --text: #f4f4f6; --muted: #9a9aab; --faint: #6b6b7b;
  --gold: #f5b400; --gold-2: #ffd54a; --gold-ink: #1a1200;
  --ok: #2bb673; --warn: #ff8a00; --bad: #e8453c; --info: #3b82f6;
  --r: 16px; --r-s: 10px; --shadow: 0 10px 30px rgba(0,0,0,.45);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
:root[data-theme="light"] {
  --bg: #f6f4ee; --panel: #ffffff; --panel-2: #f1efe8; --line: #e6e2d8; --line-2: #d9d4c8;
  --text: #141418; --muted: #5d5d6a; --faint: #8a8a98; --shadow: 0 10px 30px rgba(20,20,24,.10);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--gold-2); text-decoration: none; }
img { display: block; max-width: 100%; }

.wrap { max-width: 520px; margin: 0 auto; padding: 0 16px 40px; }
.wrap.wide { max-width: 1400px; }

/* brand */
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 0 8px; }
.mark { width: 42px; height: 42px; border-radius: 13px; background: var(--gold); color: var(--gold-ink); display: grid; place-items: center; font-weight: 900; font-size: 22px; letter-spacing: -1px; box-shadow: 0 6px 18px rgba(245,180,0,.35); }
.wordmark { font-weight: 900; font-size: 24px; letter-spacing: 1px; }
.tagline { color: var(--muted); font-size: 12px; margin-top: -2px; }
.brand .spacer { flex: 1; }

/* generic */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.card + .card { margin-top: 12px; }
.card h2 { font-size: 15px; font-weight: 800; margin-bottom: 10px; }
.card h2 small { color: var(--muted); font-weight: 600; }
.row { display: flex; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
.row.wrap-row { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12px; } .tiny { font-size: 11px; }
.gold { color: var(--gold-2); } .ok { color: var(--ok); } .bad { color: var(--bad); } .warn { color: var(--warn); }
.mt { margin-top: 12px; } .mt-s { margin-top: 6px; } .mb { margin-bottom: 12px; }
.hide { display: none !important; }
.center { text-align: center; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font-weight: 700; cursor: pointer; transition: transform .08s, background .15s; min-height: 44px; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--gold); color: var(--gold-ink); border-color: transparent; }
.btn.primary:hover { background: var(--gold-2); }
.btn.ghost { background: transparent; }
.btn.danger { background: rgba(232,69,60,.12); color: #ff8d85; border-color: rgba(232,69,60,.35); }
.btn.ok { background: rgba(43,182,115,.14); color: #5fd79a; border-color: rgba(43,182,115,.35); }
.btn.block { width: 100%; }
.btn.big { padding: 16px 18px; font-size: 17px; border-radius: 14px; }
.btn.sm { padding: 8px 12px; min-height: 36px; font-size: 13px; border-radius: 10px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn .price { margin-left: auto; font-weight: 900; }

.field { display: block; margin-top: 12px; }
.field > span { display: block; font-size: 12px; color: var(--muted); font-weight: 700; margin-bottom: 6px; letter-spacing: .3px; text-transform: uppercase; }
.input { width: 100%; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); outline: none; min-height: 48px; }
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(245,180,0,.18); }
.input.sm { min-height: 40px; padding: 8px 12px; }
textarea.input { min-height: 70px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); font-weight: 700; cursor: pointer; font-size: 14px; white-space: nowrap; }
.chip.active { background: var(--gold); color: var(--gold-ink); border-color: transparent; }
.chip.sm { padding: 6px 10px; font-size: 12px; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .3px; text-transform: uppercase; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.pill.new { background: rgba(255,138,0,.15); color: #ffb256; border-color: rgba(255,138,0,.35); }
.pill.assigned { background: rgba(59,130,246,.15); color: #86b4ff; border-color: rgba(59,130,246,.35); }
.pill.enroute { background: rgba(245,180,0,.16); color: var(--gold-2); border-color: rgba(245,180,0,.4); }
.pill.onboard { background: rgba(43,182,115,.15); color: #5fd79a; border-color: rgba(43,182,115,.35); }
.pill.done { background: rgba(154,154,171,.12); color: var(--muted); }
.pill.cancelled { background: rgba(232,69,60,.12); color: #ff8d85; }
.pill.gold { background: var(--gold); color: var(--gold-ink); border-color: transparent; }

.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 14px; color: #0b0b0f; flex: 0 0 auto; }
.avatar.lg { width: 56px; height: 56px; font-size: 18px; }

.map { width: 100%; height: 260px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: #11131a; }
.map.tall { height: 420px; }
.leaflet-container { font-family: var(--font); background: #11131a; }
.tiles-dark { filter: invert(1) hue-rotate(190deg) brightness(.82) contrast(.92) saturate(.55); }
.leaflet-control-attribution { background: rgba(0,0,0,.55) !important; color: #aaa !important; font-size: 9px !important; }
.leaflet-control-attribution a { color: #ccc !important; }
.drv-pin { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 11px; color: #0b0b0f; border: 2px solid #fff; box-shadow: 0 3px 10px rgba(0,0,0,.5); position: relative; }
.drv-pin.busy::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid currentColor; opacity: .5; animation: ring 1.4s ease-out infinite; }
@keyframes ring { from { transform: scale(.7); opacity: .8 } to { transform: scale(1.3); opacity: 0 } }
.pt-pin { width: 16px; height: 16px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.5); }
.pt-pin.pickup { background: var(--gold); } .pt-pin.drop { background: var(--info); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: #fff; color: #111; padding: 12px 18px; border-radius: 12px; font-weight: 700; opacity: 0; pointer-events: none; transition: .2s; z-index: 3000; box-shadow: var(--shadow); max-width: 90vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--bad); color: #fff; }

.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.6); opacity: 0; pointer-events: none; transition: .2s; z-index: 1000; }
.scrim.show { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; background: var(--panel); border-radius: 22px 22px 0 0; padding: 18px 16px 28px; transform: translateY(105%); transition: transform .25s; z-index: 1001; max-height: 92vh; overflow-y: auto; border-top: 1px solid var(--line-2); }
.sheet.show { transform: translateY(0); }
.sheet h3 { font-size: 18px; font-weight: 900; margin-bottom: 10px; }
.sheet .handle { width: 42px; height: 4px; border-radius: 2px; background: var(--line-2); margin: -6px auto 14px; }
@media (min-width: 720px) { .sheet { left: 50%; right: auto; width: 520px; transform: translate(-50%, 105%); border-radius: 22px; bottom: 24px; } .sheet.show { transform: translate(-50%, 0); } }

/* PIN gate */
.gate { max-width: 360px; margin: 10vh auto; }
.pin-dots { display: flex; gap: 12px; justify-content: center; margin: 18px 0; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-2); }
.pin-dots i.on { background: var(--gold); border-color: var(--gold); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.keypad button { padding: 16px; font-size: 20px; font-weight: 800; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); cursor: pointer; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.stat b { display: block; font-size: 22px; font-weight: 900; letter-spacing: -.5px; }
.stat span { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
@media (max-width: 560px) { .stats { grid-template-columns: repeat(2, 1fr); } .grid4 { grid-template-columns: 1fr 1fr; } }

/* lists */
.list { display: flex; flex-direction: column; gap: 8px; }
.item { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; cursor: pointer; transition: border-color .15s; }
.item:hover { border-color: var(--line-2); }
.item.selected { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(245,180,0,.2); }
.item .title { font-weight: 800; }
.route { display: grid; grid-template-columns: 14px 1fr; gap: 4px 10px; align-items: center; font-size: 13px; margin-top: 6px; }
.route i { width: 10px; height: 10px; border-radius: 50%; display: block; margin-left: 2px; }
.route i.p { background: var(--gold); } .route i.d { background: var(--info); }
.tl { list-style: none; padding-left: 0; }
.tl li { display: grid; grid-template-columns: 54px 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.tl li:last-child { border-bottom: 0; }
.tl time { color: var(--muted); font-variant-numeric: tabular-nums; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); }
.tbl th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .4px; font-weight: 800; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding-top: 8px; }
.bars .bar { flex: 1; background: linear-gradient(180deg, var(--gold-2), var(--gold)); border-radius: 6px 6px 2px 2px; position: relative; min-height: 3px; }
.bars .bar span { position: absolute; bottom: -20px; left: 0; right: 0; text-align: center; font-size: 10px; color: var(--muted); }
.bars .bar b { position: absolute; top: -18px; left: 0; right: 0; text-align: center; font-size: 10px; }
.mix { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--panel-2); }
.mix i { display: block; height: 100%; }
.seatbar { height: 10px; border-radius: 5px; background: var(--panel-2); overflow: hidden; }
.seatbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-2)); }

/* control layout */
.ctl { display: grid; grid-template-columns: 380px 1fr 300px; gap: 14px; align-items: start; }
.ctl .col { min-width: 0; }
.ctl .col.sticky { position: sticky; top: 10px; }
.ctl .map { height: calc(100vh - 190px); min-height: 420px; }
.tabs { display: none; gap: 6px; margin: 10px 0; }
.tabs button { flex: 1; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); font-weight: 800; cursor: pointer; }
.tabs button.active { background: var(--gold); color: var(--gold-ink); border-color: transparent; }
@media (max-width: 1000px) {
  .ctl { grid-template-columns: 1fr; min-height: 0; }
  .ctl .col { display: none; } .ctl .col.show { display: block; }
  .ctl .map { min-height: 60vh; }
  .tabs { display: flex; }
}
.section-h { font-size: 11px; font-weight: 900; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin: 14px 0 6px; display: flex; align-items: center; gap: 8px; }
.section-h b { background: var(--panel-2); border-radius: 999px; padding: 1px 8px; color: var(--text); }
.alert-bar { background: var(--bad); color: #fff; padding: 12px 14px; border-radius: 12px; font-weight: 800; display: flex; align-items: center; gap: 10px; margin-bottom: 10px; animation: pulse 1s infinite alternate; }
@keyframes pulse { from { filter: brightness(1) } to { filter: brightness(1.25) } }

/* driver screen */
.shift { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); }
.switch { width: 64px; height: 36px; border-radius: 18px; background: var(--line-2); position: relative; cursor: pointer; transition: .2s; border: 0; }
.switch::after { content: ""; position: absolute; top: 4px; left: 4px; width: 28px; height: 28px; border-radius: 50%; background: #fff; transition: .2s; }
.switch.on { background: var(--ok); } .switch.on::after { left: 32px; }
.job-hero { background: linear-gradient(160deg, #1d1d26, #15151c); border: 1px solid var(--line-2); border-radius: 20px; padding: 18px; }
.job-hero .big { font-size: 20px; font-weight: 900; }
.panic { width: 100%; padding: 18px; border-radius: 16px; background: var(--bad); color: #fff; font-weight: 900; font-size: 16px; border: 0; letter-spacing: .5px; cursor: pointer; }
.panic:active { transform: scale(.98); }

/* status hero (track) */
.hero { background: linear-gradient(160deg, #26200a, #15151c 60%); border: 1px solid rgba(245,180,0,.3); border-radius: 22px; padding: 20px; }
.hero .status { font-size: 22px; font-weight: 900; }
.hero .code { font-variant-numeric: tabular-nums; color: var(--gold-2); font-weight: 900; letter-spacing: 1px; }
.dots { display: flex; gap: 6px; margin-top: 10px; }
.dots i { flex: 1; height: 5px; border-radius: 3px; background: var(--line-2); }
.dots i.on { background: var(--gold); }

.lang { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; overflow: hidden; }
.lang button { padding: 6px 10px; background: transparent; border: 0; font-weight: 800; font-size: 12px; cursor: pointer; color: var(--muted); }
.lang button.active { background: var(--gold); color: var(--gold-ink); }
.note { font-size: 12px; color: var(--muted); background: var(--panel-2); border-radius: 10px; padding: 8px 10px; }
.note.sample { border-left: 3px solid var(--warn); }
.price-card { display: flex; align-items: center; justify-content: space-between; background: var(--panel-2); border-radius: 14px; padding: 12px 14px; margin-top: 12px; border: 1px solid var(--line-2); }
.price-card b { font-size: 26px; font-weight: 900; letter-spacing: -.5px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; }
.stepper button { width: 44px; height: 44px; background: var(--panel-2); border: 0; font-size: 18px; cursor: pointer; }
.stepper span { width: 40px; text-align: center; font-weight: 800; }
.suggest { position: absolute; left: 0; right: 0; top: 100%; background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; margin-top: 4px; z-index: 50; box-shadow: var(--shadow); overflow: hidden; max-height: 240px; overflow-y: auto; }
.suggest div { padding: 10px 12px; cursor: pointer; font-size: 14px; }
.suggest div:hover, .suggest div.active { background: var(--panel-2); }
.suggest small { display: block; color: var(--muted); font-size: 11px; }
.rel { position: relative; }
