/* Taxi Yami — shared design tokens (colours taken from the proposal deck) */
:root {
  --navy: #0D47A1;
  --navy-700: #0A3A85;
  --navy-900: #082E6B;
  --ink: #1A1D24;
  --muted: #6B7280;
  --muted-2: #9AA5B1;
  --yellow: #FFC107;
  --yellow-600: #E0A800;
  --yellow-100: #FFF4D1;
  --green: #1BAF7A;
  --green-100: #DDF5EC;
  --red: #D03B3B;
  --red-100: #FBE4E4;
  --bg: #F2F4F8;
  --card: #FFFFFF;
  --line: #E7E9EE;
  --tint: #E4ECFB;
  --tint-2: #CADCFC;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 40px rgba(8, 46, 107, .22);
  --serif: Cambria, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: Calibri, "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, .serif { font-family: var(--serif); font-weight: 700; letter-spacing: -.01em; margin: 0; }
p { margin: 0; }
a { color: var(--navy); }
button, input, select, textarea { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--yellow-600); }
.eyebrow.blue { color: var(--navy); }
.hidden { display: none !important; }

/* Wordmark: "My" + "Taxi" in yellow, like the deck */
.wordmark { font-family: var(--serif); font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.wordmark b { color: var(--yellow); font-weight: 700; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 13px 18px; font-weight: 700; font-size: 15px;
  cursor: pointer; text-decoration: none; transition: transform .08s ease, background .15s ease, opacity .15s;
  user-select: none; white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-700); }
.btn-yellow { background: var(--yellow); color: var(--ink); }
.btn-yellow:hover { background: #FFCA2C; }
.btn-green { background: var(--green); color: #fff; }
.btn-red { background: var(--red); color: #fff; }
.btn-ghost { background: transparent; color: var(--navy); }
.btn-ghost:hover { background: var(--tint); }
.btn-light { background: var(--tint); color: var(--navy); }
.btn-outline { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: 9px; }
.btn-lg { padding: 16px 20px; font-size: 16px; border-radius: 14px; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 700; color: var(--ink); }
.input {
  width: 100%; border: 1.5px solid var(--line); background: #fff; border-radius: 12px;
  padding: 12px 14px; font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--navy); box-shadow: 0 0 0 4px rgba(13, 71, 161, .12); }
.input.mono { font-family: var(--mono); letter-spacing: .08em; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; min-width: 0; }

/* Cards */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 16px; }

/* Status pills */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.searching { background: var(--yellow-100); color: #9A6B00; }
.pill.accepted, .pill.arrived { background: var(--tint); color: var(--navy); }
.pill.onboard { background: #E8E3FF; color: #5B3FD0; }
.pill.completed { background: var(--green-100); color: #12805A; }
.pill.cancelled, .pill.no_driver { background: #EEF0F3; color: var(--muted); }
.pill.online { background: var(--green-100); color: #12805A; }
.pill.on_trip { background: var(--tint); color: var(--navy); }
.pill.offline { background: #EEF0F3; color: var(--muted); }

/* Toasts */
.toasts { position: fixed; left: 50%; top: calc(12px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-weight: 600; font-size: 14px; animation: toastIn .25s ease; pointer-events: auto; }
.toast.ok { background: #0F7A55; }
.toast.err { background: var(--red); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* Spinner */
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .8s linear infinite; }
.spinner.dark { border-color: var(--tint-2); border-top-color: var(--navy); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Leaflet markers */
.mk { display: grid; place-items: center; border-radius: 50%; font-weight: 800; font-size: 12px; color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.3); border: 3px solid #fff; }
.mk-a { width: 30px; height: 30px; background: var(--green); }
.mk-b { width: 30px; height: 30px; background: var(--navy); }
.mk-taxi { width: 38px; height: 38px; background: var(--yellow); color: var(--ink); border-color: var(--navy); }
.mk-taxi svg { width: 20px; height: 20px; }
.mk-taxi.offline { background: #D5DAE1; border-color: #9AA5B1; }
.mk-taxi.on_trip { background: var(--yellow); border-color: var(--green); }
.mk-taxi-label { position: absolute; top: 38px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 6px; white-space: nowrap; }
.mk-pulse::after { content: ""; position: absolute; inset: -9px; border-radius: 50%; border: 3px solid var(--yellow); animation: pulse 1.6s ease-out infinite; }
@keyframes pulse { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
.leaflet-container { font-family: var(--sans); background: #E9EEF5; }
.map-offline-note { position: absolute; z-index: 500; left: 8px; bottom: 8px; background: rgba(255,255,255,.9); font-size: 11px; padding: 3px 8px; border-radius: 6px; color: var(--muted); }

/* ---------- dropdowns (every <select>) ---------- */
select, select.input {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  padding: 11px 38px 11px 14px; font-size: 15px; font-family: inherit; line-height: 1.3;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1.5 1.5 7 7l5.5-5.5' stroke='%230D47A1' stroke-width='2.2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
  border: 1.5px solid var(--line); border-radius: 12px; font-weight: 600; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
select:hover { border-color: #B9C3D3; }
select:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(13,71,161,.15); }
select:disabled { opacity: .55; cursor: not-allowed; }
select option { font-weight: 500; padding: 8px; }
select option:checked { background: var(--tint); color: var(--navy); font-weight: 700; }
select.compact { padding-top: 7px; padding-bottom: 7px; border-radius: 10px; }

/* ---------- scrollbars ---------- */
* { scrollbar-width: thin; scrollbar-color: #B9C3D3 transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #B9C3D3; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--navy); background-clip: padding-box; }
*::-webkit-scrollbar-corner { background: transparent; }
.navs::-webkit-scrollbar-thumb, .side *::-webkit-scrollbar-thumb { background: rgba(255,255,255,.28); background-clip: padding-box; }
.side * { scrollbar-color: rgba(255,255,255,.28) transparent; }

/* ---------- dropdown control (built from <select> by common.js) ---------- */
.dd { position: relative; display: block; width: 100%; }
.dd select { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dd > select.dd-done { width: 1px !important; min-width: 0 !important; height: 1px !important; padding: 0 !important; border: 0 !important; overflow: hidden; }   /* the real select stays hidden even inside toolbars */
.dd-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; font: inherit; font-weight: 600; color: var(--ink); background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 13px 11px 14px; font-size: 15px; cursor: pointer; transition: border-color .15s, box-shadow .15s; min-height: 44px; }
.dd-input .dd-btn { padding: 12px 13px 12px 14px; font-size: 16px; }
.dd-compact .dd-btn, .toolbar .dd .dd-btn, .tbl .dd .dd-btn { padding: 8px 10px 8px 12px; font-size: 14px; border-radius: 10px; min-height: 40px; }
.toolbar .dd, .tbl .dd, .head .right .dd, .card-h .dd { width: auto; display: inline-block; }
.dd-btn:hover { border-color: #B9C3D3; }
.dd-btn:focus-visible, .dd-btn:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 4px rgba(13,71,161,.12); }
.dd-btn:disabled { opacity: .55; cursor: not-allowed; }
.dd-btn.dd-empty .dd-val { color: var(--muted-2); font-weight: 500; }
.dd-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-chev { flex: none; color: var(--navy); transition: transform .15s; }
.dd-wrap { position: fixed; inset: 0; z-index: 12000; }
.dd-menu { position: fixed; background: #fff; border-radius: 14px; box-shadow: 0 12px 40px rgba(8,46,107,.22), 0 0 0 1px var(--line); overflow: auto; padding: 6px; animation: ddIn .14s ease; }
.dd-menu.up { animation-name: ddInUp; }
@keyframes ddIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes ddInUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.dd-opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left; border: 0; background: none; font: inherit; font-size: 15px; font-weight: 600; color: var(--ink); padding: 10px 12px; border-radius: 10px; cursor: pointer; min-height: 42px; }
.dd-opt svg { width: 18px; height: 18px; color: var(--navy); flex: none; }
.dd-opt:hover, .dd-opt:focus-visible { background: var(--bg); outline: none; }
.dd-opt.on { background: var(--tint); color: var(--navy); }
.dd-opt.off { opacity: .45; cursor: default; }
.dd-group { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 10px 12px 4px; }
.dd-sheet-wrap { background: rgba(8,46,107,.5); display: flex; align-items: flex-end; animation: fadeIn .15s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.dd-sheet { width: 100%; background: #fff; border-radius: 22px 22px 0 0; padding: 10px 12px calc(14px + env(safe-area-inset-bottom)); max-height: 80dvh; display: flex; flex-direction: column; animation: ddSheet .22s ease; }
@keyframes ddSheet { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
.dd-sheet .grab { width: 42px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
.dd-title { font-family: var(--serif); font-size: 18px; font-weight: 700; padding: 2px 10px 10px; }
.dd-sheet .dd-list { overflow-y: auto; }
.dd-sheet .dd-opt { font-size: 16px; min-height: 50px; }

/* ---- file pickers match the rest of the form ---- */
input[type="file"] { font: inherit; font-size: 14px; color: var(--muted, #6B7280); }
input[type="file"]::file-selector-button { font: inherit; font-size: 14px; font-weight: 700; color: var(--navy); background: var(--tint, #E8EEFA); border: 0; border-radius: 9px; padding: 8px 14px; margin-right: 12px; cursor: pointer; }
input[type="file"]::file-selector-button:hover { background: #D9E4F8; }
input[type="file"].input, .input input[type="file"] { padding: 6px 8px; }
/* date / time pickers: same height and chevron weight as text inputs */
input[type="date"].input, input[type="time"].input, input[type="datetime-local"].input { min-height: 46px; -webkit-appearance: none; appearance: none; }

/* Phones: iOS zooms the page when a field with text smaller than 16px gets focus. Keep every field at 16px on small screens. */
@media (max-width: 700px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]), select, textarea, .input, .dd-btn { font-size: 16px !important; }
}
