:root {
  --green: #006B3F; --green-d: #004d2d; --green-l: #e6f3ed; --gold: #D4A017; --gold-l: #fdf3d8; --red: #CE1126; --red-l: #fde8ea;
  --ink: #17201b; --muted: #5b6b62; --line: #dfe6e1; --bg: #f4f7f5; --card: #ffffff; --radius: 14px; --shadow: 0 2px 10px rgba(0,0,0,.06);
  --nav-h: 62px; --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 -apple-system, "Segoe UI", Roboto, Inter, sans-serif; -webkit-tap-highlight-color: transparent; }
body { overscroll-behavior-y: none; }
a { color: var(--green); }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 .6em; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app { min-height: 100vh; display: flex; flex-direction: column; }
.splash { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--green); color: #fff; }
.logo-big { font-size: 64px; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .tiny { font-size: .75rem; } .bold { font-weight: 700; } .right { text-align: right; } .center { text-align: center; }
.green { color: var(--green); } .gold { color: var(--gold); } .red { color: var(--red); }
.row { display: flex; gap: 10px; align-items: center; } .row.between { justify-content: space-between; } .row.wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.hide { display: none !important; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* layout */
.topbar { position: sticky; top: 0; z-index: 30; background: var(--green); color: #fff; padding: calc(10px + env(safe-area-inset-top)) 14px 10px; display: flex; align-items: center; gap: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.topbar .brand { font-weight: 800; letter-spacing: .3px; font-size: 1.1rem; display: flex; align-items: center; gap: 8px; }
.topbar .brand small { font-weight: 500; opacity: .85; font-size: .75rem; }
.topbar .spacer { flex: 1; }
.topbar button.icon { background: rgba(255,255,255,.14); color: #fff; border: 0; border-radius: 10px; width: 38px; height: 38px; font-size: 18px; position: relative; }
.topbar .badge { position: absolute; top: -4px; right: -4px; background: var(--red); color: #fff; border-radius: 10px; font-size: .68rem; padding: 1px 5px; font-weight: 700; }
.topbar select { background: rgba(255,255,255,.14); color: #fff; border: 0; border-radius: 10px; padding: 8px 10px; max-width: 150px; }
.topbar select option { color: var(--ink); }
.main { flex: 1; padding: 14px 14px calc(var(--nav-h) + var(--safe-b) + 14px); max-width: 720px; width: 100%; margin: 0 auto; }
.main.wide { max-width: 1280px; }
.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--card); border-top: 1px solid var(--line); display: flex; height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b); }
.bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: .7rem; font-weight: 600; }
.bottomnav a .ic { font-size: 22px; line-height: 1; }
.bottomnav a.active { color: var(--green); }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin-bottom: 12px; }
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.card.green { background: var(--green); color: #fff; } .card.green .muted { color: rgba(255,255,255,.8); }
.card.gold { background: var(--gold-l); border: 1px solid #f0d98a; }
.card.danger { background: var(--red-l); border: 1px solid #f3b4bb; }
.hero { background: linear-gradient(135deg, var(--green), #0b8a55); color: #fff; border-radius: 18px; padding: 18px; margin-bottom: 14px; }
.hero h1 { font-size: 1.4rem; } .hero p { opacity: .9; }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.quick button { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 6px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 700; font-size: .85rem; color: var(--ink); box-shadow: var(--shadow); }
.quick button .ic { font-size: 30px; }
.quick button.primary { background: var(--green); color: #fff; border-color: var(--green); }

/* buttons / forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 12px; padding: 11px 16px; font-weight: 700; text-decoration: none; min-height: 44px; }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #1a1a1a; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; } .btn.sm { padding: 6px 10px; min-height: 34px; font-size: .85rem; border-radius: 9px; } .btn.lg { font-size: 1.05rem; min-height: 52px; }
.btn:disabled { opacity: .5; cursor: default; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.field label { font-size: .8rem; font-weight: 700; color: var(--muted); }
.field input, .field select, .field textarea { border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; background: #fff; width: 100%; min-height: 44px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--green); border-color: var(--green); }
.field .hint { font-size: .75rem; color: var(--muted); }
.otp input { letter-spacing: 8px; font-size: 1.4rem; text-align: center; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: 20px; height: 20px; }
.seg { display: flex; background: var(--bg); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 9px 6px; border-radius: 9px; font-weight: 700; color: var(--muted); }
.seg button.active { background: var(--card); color: var(--green); box-shadow: var(--shadow); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 20px; padding: 7px 12px; font-size: .85rem; font-weight: 600; }
.chip.active { background: var(--green-l); border-color: var(--green); color: var(--green); }
.pill { display: inline-block; border-radius: 20px; padding: 2px 10px; font-size: .75rem; font-weight: 700; background: var(--bg); color: var(--muted); }
.pill.green { background: var(--green-l); color: var(--green); } .pill.gold { background: var(--gold-l); color: #8a6605; } .pill.red { background: var(--red-l); color: var(--red); } .pill.blue { background: #e7eefc; color: #2b4fa3; }
.autocomplete { position: relative; }
.autocomplete .list { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 20px rgba(0,0,0,.12); max-height: 260px; overflow: auto; }
.autocomplete .list div { padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.autocomplete .list div:hover { background: var(--green-l); }
.autocomplete .list .k { font-size: .7rem; color: var(--muted); margin-left: 6px; }

/* vehicle cards */
.vcard { border: 2px solid var(--line); border-radius: 14px; padding: 12px; display: flex; gap: 12px; align-items: center; background: var(--card); cursor: pointer; }
.vcard.active { border-color: var(--green); background: var(--green-l); }
.vcard .ic { font-size: 34px; } .vcard .price { font-weight: 800; font-size: 1.15rem; white-space: nowrap; }
.vcard .sub { font-size: .8rem; color: var(--muted); }
.fare-table { width: 100%; font-size: .9rem; } .fare-table td { padding: 3px 0; } .fare-table td:last-child { text-align: right; } .fare-table tr.total td { font-weight: 800; border-top: 1px solid var(--line); padding-top: 6px; font-size: 1.05rem; }
input[type=range] { width: 100%; accent-color: var(--green); }
.steps { display: flex; gap: 6px; margin-bottom: 12px; } .steps span { flex: 1; height: 5px; border-radius: 4px; background: var(--line); } .steps span.done { background: var(--green); }

/* map */
.map { height: 260px; border-radius: 14px; overflow: hidden; background: #e9efe9; position: relative; margin-bottom: 12px; border: 1px solid var(--line); }
.map.tall { height: 46vh; min-height: 300px; } .map.full { height: calc(100vh - 220px); min-height: 360px; }
.map .schematic { position: absolute; inset: 0; }
.map .fallback-note { position: absolute; bottom: 6px; left: 8px; font-size: .7rem; color: var(--muted); background: rgba(255,255,255,.85); padding: 2px 6px; border-radius: 6px; z-index: 5; }
.leaflet-container { font: inherit; }
.marker-rider { font-size: 26px; line-height: 1; filter: drop-shadow(0 1px 2px rgba(0,0,0,.4)); }
.marker-pin { width: 16px; height: 16px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.marker-pin.p { background: var(--green); } .marker-pin.d { background: var(--red); }

/* timeline */
.timeline { display: flex; justify-content: space-between; margin: 10px 0; }
.timeline div { flex: 1; text-align: center; font-size: .68rem; color: var(--muted); position: relative; }
.timeline div::before { content: ''; display: block; width: 14px; height: 14px; border-radius: 50%; background: var(--line); margin: 0 auto 4px; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.timeline div.done::before { background: var(--green); box-shadow: 0 0 0 1px var(--green); }
.timeline div.done { color: var(--green); font-weight: 700; }
.timeline div.now::before { background: var(--gold); box-shadow: 0 0 0 3px var(--gold-l); }
.pulse { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--green); animation: pulse 1.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(0,107,63,.5); } 100% { box-shadow: 0 0 0 14px rgba(0,107,63,0); } }
.searching { text-align: center; padding: 20px 10px; }
.searching .ring { width: 90px; height: 90px; border-radius: 50%; border: 6px solid var(--green-l); border-top-color: var(--green); margin: 0 auto 12px; animation: spin 1s linear infinite; display: flex; align-items: center; justify-content: center; font-size: 34px; }
@keyframes spin { to { transform: rotate(360deg); } }
.rider-card { display: flex; gap: 12px; align-items: center; }
.avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--green-l); display: flex; align-items: center; justify-content: center; font-size: 26px; overflow: hidden; flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.stars { color: var(--gold); letter-spacing: 2px; font-size: 1.6rem; cursor: pointer; }
.list { display: flex; flex-direction: column; gap: 8px; }
.item { background: var(--card); border-radius: 12px; padding: 12px; box-shadow: var(--shadow); display: flex; gap: 10px; align-items: center; cursor: pointer; }
.item .ic { font-size: 24px; width: 34px; text-align: center; }
.sos { position: fixed; right: 14px; bottom: calc(var(--nav-h) + var(--safe-b) + 14px); z-index: 25; background: var(--red); color: #fff; border: 0; border-radius: 50%; width: 58px; height: 58px; font-weight: 900; font-size: .8rem; box-shadow: 0 4px 14px rgba(206,17,38,.45); }
.online-toggle { width: 100%; border: 0; border-radius: 18px; padding: 20px; font-size: 1.2rem; font-weight: 800; background: var(--line); color: var(--muted); }
.online-toggle.on { background: var(--green); color: #fff; }
.stat { background: var(--card); border-radius: 12px; padding: 12px; box-shadow: var(--shadow); }
.stat .v { font-size: 1.4rem; font-weight: 800; } .stat .l { font-size: .75rem; color: var(--muted); font-weight: 600; }
.offer-timer { height: 6px; background: var(--line); border-radius: 4px; overflow: hidden; margin: 8px 0; } .offer-timer div { height: 100%; background: var(--gold); transition: width 1s linear; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 90px; } .bars div { flex: 1; background: var(--green); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; } .bars div span { position: absolute; bottom: -16px; left: 0; right: 0; text-align: center; font-size: .6rem; color: var(--muted); }
.chat { max-height: 220px; overflow: auto; display: flex; flex-direction: column; gap: 6px; padding: 6px 0; }
.chat .m { max-width: 80%; padding: 8px 10px; border-radius: 12px; background: var(--bg); font-size: .9rem; } .chat .m.me { align-self: flex-end; background: var(--green-l); }

/* modal / toast */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: var(--card); width: 100%; max-width: 560px; border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + var(--safe-b)); max-height: 92vh; overflow: auto; animation: up .2s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: .5; } }
@media (min-width: 700px) { .modal-bg { align-items: center; } .modal { border-radius: 18px; } }
.toasts { position: fixed; top: calc(70px + env(safe-area-inset-top)); left: 0; right: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; box-shadow: 0 4px 14px rgba(0,0,0,.25); max-width: 90%; font-size: .9rem; animation: up .2s; pointer-events: auto; }
.toast.err { background: var(--red); } .toast.ok { background: var(--green); }
.banner-offline { background: var(--gold); color: #1a1a1a; text-align: center; font-size: .8rem; font-weight: 700; padding: 5px; }

/* admin */
.admin-layout { display: flex; min-height: 100vh; }
.sidenav { width: 210px; background: var(--green-d); color: #fff; padding: 14px 10px; flex-shrink: 0; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow: auto; }
.sidenav .brand { font-weight: 800; font-size: 1.05rem; padding: 6px 10px 14px; }
.sidenav a { color: rgba(255,255,255,.85); text-decoration: none; padding: 9px 10px; border-radius: 8px; font-size: .9rem; font-weight: 600; }
.sidenav a.active, .sidenav a:hover { background: rgba(255,255,255,.14); color: #fff; }
.sidenav .foot { margin-top: auto; font-size: .75rem; opacity: .7; padding: 10px; }
.admin-main { flex: 1; padding: 18px; min-width: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .85rem; background: var(--card); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
table.tbl th, table.tbl td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
table.tbl th { background: var(--bg); font-size: .75rem; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
table.tbl tr:hover td { background: #fafcfb; } table.tbl tr.click { cursor: pointer; }
.tbl-wrap { overflow-x: auto; margin-bottom: 14px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar input, .toolbar select { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; min-height: 40px; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: var(--card); z-index: 55; box-shadow: -6px 0 20px rgba(0,0,0,.2); overflow: auto; padding: 18px; animation: slidein .2s; }
@keyframes slidein { from { transform: translateX(40px); opacity: .5; } }
.ussd-phone { background: #111; color: #9f9; font-family: ui-monospace, Menlo, monospace; border-radius: 14px; padding: 14px; white-space: pre-wrap; min-height: 180px; font-size: .9rem; }
.tier-metro { color: #2b4fa3; } .tier-city { color: var(--green); } .tier-town { color: #8a6605; } .tier-rural { color: #7a4a1d; }
@media (max-width: 860px) { .admin-layout { flex-direction: column; } .sidenav { width: auto; height: auto; position: static; flex-direction: row; flex-wrap: wrap; } .sidenav .brand { width: 100%; padding-bottom: 6px; } .sidenav .foot { display: none; } .admin-main { padding: 12px; } }
@media (min-width: 700px) { .main { padding-top: 20px; } }
@media print { .topbar, .bottomnav, .sos, .sidenav { display: none !important; } }
