:root {
  --bg: #f6f3ee;
  --surface: #ffffff;
  --surface-2: #faf8f4;
  --ink: #1d2327;
  --ink-2: #4b555c;
  --muted: #7a848b;
  --line: #e4ded4;
  --brand: #0e6b5c;
  --brand-ink: #ffffff;
  --brand-soft: #e3f1ed;
  --accent: #e0882f;
  --danger: #b4352b;
  --danger-soft: #fbe9e7;
  --ok: #1f7a3a;
  --ok-soft: #e4f4e8;
  --warn: #9a6200;
  --warn-soft: #fdf1dc;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 30, 40, .06), 0 6px 20px rgba(20, 30, 40, .06);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Telugu", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
.hidden { display: none !important; }

/* ---------- header ---------- */
.topbar {
  background: var(--brand);
  color: var(--brand-ink);
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 16px; }
.brand { display: flex; align-items: center; gap: .65rem; color: inherit; text-decoration: none; }
.brand img { width: 38px; height: 38px; }
.brand b { font-size: 1.15rem; letter-spacing: .2px; }
.brand small { display: block; font-size: .75rem; opacity: .85; font-weight: 400; }
.topbar nav { display: flex; gap: .4rem; flex-wrap: wrap; }
.topbar nav a, .topbar nav button {
  color: var(--brand-ink); text-decoration: none; font: inherit; font-size: .9rem;
  background: rgba(255,255,255,.12); border: 0; padding: .45rem .8rem; border-radius: 999px; cursor: pointer;
}
.topbar nav a:hover, .topbar nav button:hover { background: rgba(255,255,255,.22); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

.hero { padding: 2rem 0 1rem; }
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); }
.hero p { color: var(--ink-2); margin: 0; max-width: 46rem; }

/* ---------- cards & layout ---------- */
.grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.25rem; align-items: start; padding-bottom: 2.5rem; }
@media (max-width: 860px) { .grid { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; }
.card + .card { margin-top: 1.25rem; }
.card h2 { font-size: 1.15rem; }
.sub { color: var(--muted); font-size: .9rem; margin: 0 0 1rem; }

/* ---------- vehicle picker ---------- */
.vehicles { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-bottom: 1rem; }
.vehicle {
  position: relative; border: 1.5px solid var(--line); border-radius: 12px; padding: .8rem .5rem; text-align: center;
  cursor: pointer; background: var(--surface-2); transition: border-color .15s, background .15s;
}
.vehicle input { position: absolute; opacity: 0; pointer-events: none; }
.vehicle svg { width: 40px; height: 40px; display: block; margin: 0 auto .3rem; color: var(--ink-2); }
.vehicle b { display: block; font-size: .95rem; }
.vehicle span { font-size: .75rem; color: var(--muted); }
.vehicle:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.vehicle:has(input:checked) svg { color: var(--brand); }
.vehicle:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- forms ---------- */
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.fields .full { grid-column: 1 / -1; }
@media (max-width: 520px) { .fields { grid-template-columns: 1fr; } }
label.f { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; font-weight: 600; color: var(--ink-2); }
input, select, textarea {
  font: inherit; font-size: .95rem; color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--line); border-radius: 10px; padding: .6rem .7rem; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea { resize: vertical; min-height: 64px; }
.hint { font-weight: 400; color: var(--muted); font-size: .78rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font: inherit; font-weight: 600; font-size: .95rem; border: 0; border-radius: 10px; padding: .7rem 1.1rem;
  background: var(--brand); color: var(--brand-ink); cursor: pointer; text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--brand); border: 1.5px solid var(--brand); }
.btn.accent { background: var(--accent); }
.btn.small { padding: .4rem .7rem; font-size: .85rem; border-radius: 8px; }
.btn.danger { background: var(--danger); }

.fare {
  display: flex; align-items: baseline; justify-content: space-between; gap: .5rem;
  background: var(--surface-2); border: 1px dashed var(--line); border-radius: 12px; padding: .8rem 1rem; margin: 1rem 0;
}
.fare .amt { font-size: 1.6rem; font-weight: 700; color: var(--brand); }
.fare small { color: var(--muted); display: block; font-size: .78rem; }

.msg { border-radius: 10px; padding: .7rem .9rem; font-size: .9rem; margin: .8rem 0 0; }
.msg.error { background: var(--danger-soft); color: var(--danger); }
.msg.ok { background: var(--ok-soft); color: var(--ok); }
.msg.info { background: var(--warn-soft); color: var(--warn); }

/* ---------- payment ---------- */
.pay { text-align: center; }
.pay .bid { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.05rem; background: var(--surface-2); border: 1px solid var(--line); padding: .3rem .6rem; border-radius: 8px; display: inline-block; }
#qr { display: inline-block; padding: 12px; background: #fff; border-radius: 12px; border: 1px solid var(--line); margin: 1rem 0 .5rem; }
#qr img, #qr canvas { display: block; width: 220px !important; height: 220px !important; }
.upi-id { font-size: .9rem; color: var(--ink-2); }
.steps { text-align: left; font-size: .9rem; color: var(--ink-2); padding-left: 1.2rem; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; margin: .8rem 0; }

/* ---------- status ---------- */
.badge { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .3px; padding: .2rem .55rem; border-radius: 999px; text-transform: uppercase; white-space: nowrap; }
.s-PENDING_PAYMENT { background: var(--warn-soft); color: var(--warn); }
.s-PAYMENT_SUBMITTED { background: #e7eefb; color: #2a5bb5; }
.s-CONFIRMED { background: var(--brand-soft); color: var(--brand); }
.s-ASSIGNED { background: #efe6fa; color: #6a3eb0; }
.s-COMPLETED { background: var(--ok-soft); color: var(--ok); }
.s-CANCELLED { background: var(--danger-soft); color: var(--danger); }

dl.kv { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; margin: .8rem 0; font-size: .92rem; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; padding: 0 0 2.5rem; }
@media (max-width: 720px) { .features { grid-template-columns: 1fr; } }
.features div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.features b { display: block; margin-bottom: .2rem; }
.features p { margin: 0; font-size: .88rem; color: var(--ink-2); }

footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; padding: 1.2rem 0 2rem; }
footer .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ---------- staff ---------- */
.login-box { max-width: 380px; margin: 3rem auto; }
.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--line); margin: 1.2rem 0 1rem; overflow-x: auto; }
.tabs button { font: inherit; font-weight: 600; font-size: .92rem; background: none; border: 0; padding: .6rem .9rem; color: var(--muted); border-bottom: 2.5px solid transparent; cursor: pointer; white-space: nowrap; }
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; margin-bottom: 1rem; }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .8rem 1rem; }
.stat small { color: var(--muted); font-size: .78rem; display: block; }
.stat b { font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .8rem; }
.filters > * { width: auto; flex: 1 1 140px; }
.filters .btn { flex: 0 0 auto; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface-2); color: var(--ink-2); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .3px; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--surface-2); }
td.num { font-variant-numeric: tabular-nums; text-align: right; }
td .mono, .mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; }
.empty { padding: 2rem; text-align: center; color: var(--muted); }

dialog { border: 0; border-radius: var(--radius); padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.25); color: var(--ink); background: var(--surface); }
dialog::backdrop { background: rgba(20, 25, 30, .45); }
dialog .dhead { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); }
dialog .dbody { padding: 1rem 1.2rem; max-height: 70vh; overflow-y: auto; }
dialog .dfoot { padding: .8rem 1.2rem; border-top: 1px solid var(--line); display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; }
.x { background: none; border: 0; font-size: 1.4rem; cursor: pointer; color: var(--muted); line-height: 1; }
.log { font-size: .8rem; color: var(--ink-2); list-style: none; padding: 0; margin: .5rem 0 0; }
.log li { padding: .3rem 0; border-bottom: 1px dashed var(--line); }

@media print {
  .topbar nav, .no-print, footer { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; }
}
