:root {
  --bg: #f2f4f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --ink: #101828;
  --ink-2: #344054;
  --muted: #667085;
  --line: #e4e7ec;
  --brand: #4338ca;
  --brand-dark: #312e81;
  --brand-soft: #eef2ff;
  --green: #067647;
  --green-soft: #ecfdf3;
  --amber: #b54708;
  --amber-soft: #fffaeb;
  --red: #b42318;
  --red-soft: #fef3f2;
  --teal: #0e7490;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 4px 16px rgba(16, 24, 40, 0.05);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, 0.18);
  --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body { min-height: 100vh; }

#app {
  max-width: 680px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; padding: 0; }
a { color: var(--brand); text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
svg.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ------------------------------------------------ top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(242, 244, 249, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar .tb-text { min-width: 0; flex: 1; }
.topbar h1 { font-size: 20px; font-weight: 750; letter-spacing: -0.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .sub { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; margin-top: 1px; }
.topbar .sub svg { width: 14px; height: 14px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2);
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
  flex: none;
}
.icon-btn:active { transform: scale(0.95); }
.icon-btn.plain { background: transparent; border-color: transparent; box-shadow: none; }
.icon-btn.brand { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ------------------------------------------------ layout */
.view {
  padding: 4px 16px calc(var(--tab-h) + var(--safe-b) + 40px);
  min-height: 60vh;
}
.view.no-tabs { padding-bottom: calc(var(--safe-b) + 32px); }

.section { margin-top: 20px; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 10px; padding: 0 2px;
}
.section-head h2 { font-size: 15px; font-weight: 700; letter-spacing: -0.1px; }
.section-head .hint { font-size: 12.5px; color: var(--muted); }
.link-btn { color: var(--brand); font-size: 13.5px; font-weight: 650; display: inline-flex; align-items: center; gap: 3px; }
.link-btn svg { width: 15px; height: 15px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.pad { padding: 16px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.mono { font-variant-numeric: tabular-nums; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

/* ------------------------------------------------ date strip */
.datestrip {
  display: flex; align-items: center; gap: 8px;
  margin-top: 8px;
}
.datepill {
  flex: 1; display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 9px 12px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.datepill .dp-day { font-size: 15px; font-weight: 700; }
.datepill .dp-date { font-size: 12px; color: var(--muted); }
.datepill svg { color: var(--brand); }
.datepill input[type="date"], .datepill input[type="month"] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; border: 0; padding: 0; cursor: pointer;
}
.datepill.today { border-color: #c7d2fe; background: linear-gradient(180deg, #fbfbff, #f4f6ff); }

/* ------------------------------------------------ hero / summary */
.hero {
  border-radius: 20px; padding: 18px;
  background: linear-gradient(135deg, #312e81 0%, #4338ca 55%, #4f46e5 100%);
  color: #fff; position: relative; overflow: hidden;
  box-shadow: 0 10px 30px rgba(67, 56, 202, 0.28);
}
.hero::after {
  content: ""; position: absolute; right: -50px; top: -70px;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255,255,255,.09);
}
.hero::before {
  content: ""; position: absolute; right: 30px; bottom: -80px;
  width: 150px; height: 150px; border-radius: 50%;
  background: rgba(255,255,255,.05);
}
.hero .hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; position: relative; z-index: 1; }
.hero .eyebrow { font-size: 11.5px; text-transform: uppercase; letter-spacing: 1.1px; opacity: .72; font-weight: 600; }
.hero .hero-value { font-size: 29px; font-weight: 780; letter-spacing: -0.8px; margin-top: 3px; }
.hero .hero-note { font-size: 12px; opacity: .8; margin-top: 2px; }
.hero-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  margin-top: 16px; background: rgba(255,255,255,.16); border-radius: 13px; overflow: hidden;
  position: relative; z-index: 1;
}
.hero-grid > div { padding: 10px 11px; background: rgba(255,255,255,.07); }
.hero-grid .hg-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .7px; opacity: .72; font-weight: 600; }
.hero-grid .hg-value { font-size: 16.5px; font-weight: 720; margin-top: 2px; letter-spacing: -0.3px; }

/* ------------------------------------------------ vehicle / trip cards */
.bus-card { margin-bottom: 12px; overflow: hidden; }
.trip-card {
  margin-bottom: 12px; padding: 0; overflow: hidden;
  border-left: 4px solid var(--line);
}
.trip-card.up { border-left-color: #4338ca; background: linear-gradient(180deg, #fbfbff, #fff); }
.trip-card.down { border-left-color: #0e7490; background: linear-gradient(180deg, #f7feff, #fff); }
.trip-card.empty { border-left-color: var(--line); }
.trip-card-head { display: flex; align-items: center; gap: 10px; padding: 13px 13px 8px; }
.dir-icon {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
}
.dir-icon.up { background: #eef2ff; color: #4338ca; }
.dir-icon.down { background: #ecfeff; color: #0e7490; }
.dir-icon.muted { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.dir-icon svg { width: 20px; height: 20px; }
.trip-route-title { font-size: 16px; font-weight: 770; letter-spacing: -0.25px; line-height: 1.25; color: var(--ink); }
.trip-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.trip-sub b { color: var(--ink-2); font-weight: 700; }
.trip-card .progress { margin: 0 13px; }
.trip-card .trip-stats { padding: 7px 13px 2px; margin-top: 0; flex-wrap: wrap; }
.trip-money { margin-left: auto; text-align: right; font-size: 11px; line-height: 1.3; }
.trip-money b { font-size: 12.5px; }
.trip-money .due { color: var(--amber); font-weight: 650; }
.trip-money .advance { color: var(--green); font-weight: 650; }
.trip-card .trip-actions { padding: 0 13px 13px; margin-top: 10px; }
.trip-card .prev-trip { margin: 8px 13px 0; }
.trip-empty-row { display: flex; align-items: center; gap: 10px; padding: 0 13px 13px; color: var(--muted); font-size: 13px; }
.bus-head { display: flex; align-items: center; gap: 11px; padding: 14px 15px 12px; }
.bus-badge {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); flex: none;
}
.bus-badge svg { width: 23px; height: 23px; }
.bus-title { font-size: 15px; font-weight: 730; letter-spacing: -0.2px; }
.bus-meta { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; margin-top: 1px; }

.trip-row { border-top: 1px solid var(--line); padding: 12px 15px 14px; }
.trip-row:first-of-type { border-top: 1px dashed var(--line); }
.trip-head { display: flex; align-items: center; gap: 8px; }
.dir-chip {
  font-size: 10px; font-weight: 750; letter-spacing: .6px; padding: 3px 7px; border-radius: 6px;
  text-transform: uppercase; background: var(--brand-soft); color: var(--brand);
}
.dir-chip.down { background: #e0f2fe; color: #0369a1; }
.trip-route { font-weight: 680; font-size: 14px; flex: 1; min-width: 0; }
.trip-route small { color: var(--muted); font-weight: 500; font-size: 11.5px; display: block; }
.trip-stats { display: flex; align-items: center; gap: 14px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.trip-stats b { color: var(--ink); font-weight: 700; font-size: 13.5px; }
.progress { height: 5px; border-radius: 99px; background: #eef1f6; overflow: hidden; margin-top: 8px; }
.progress > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #4f46e5, #6366f1); }
.trip-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.trip-actions .btn { padding: 9px 10px; font-size: 13px; }
.prev-trip {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 9px; padding: 7px 9px; font-size: 11.5px; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px;
}
.prev-trip .badge { flex: none; }
.prev-trip b { color: var(--ink); font-weight: 700; }
.trip-edit {
  width: 26px; height: 26px; border: 0; background: transparent; color: #98a2b3;
  display: inline-grid; place-items: center; flex: none; margin-left: 4px; border-radius: 7px;
}
.trip-edit svg { width: 15px; height: 15px; }
.trip-edit:active { background: var(--surface-2); }
.trip-create {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); border: 1px solid #dfe3ff;
}
.trip-create svg { width: 17px; height: 17px; }
.trip-create:active { transform: scale(.97); }

/* home open-trip cards */
.open-trip-list { display: flex; flex-direction: column; gap: 9px; }
.open-trip-card { padding: 12px 13px; border-left: 3px solid #c7d2fe; }
.otc-head { display: flex; align-items: center; gap: 9px; }
.otc-head .dir-icon { width: 34px; height: 34px; border-radius: 10px; }
.otc-head .dir-icon svg { width: 17px; height: 17px; }
.otc-date { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 730; letter-spacing: -.15px; }
.otc-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.otc-sub b { color: var(--ink-2); }
.otc-stats { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11px; color: var(--muted); margin: 8px 0 9px 43px; }
.otc-stats b { color: var(--ink-2); }
.otc-stats .due { color: var(--amber); font-weight: 650; }
.otc-stats .advance { color: var(--green); font-weight: 650; }
.otc-actions { display: flex; gap: 6px; }
.otc-actions .btn { min-height: 34px; padding: 5px 10px; font-size: 12.5px; flex: 1; }
.otc-actions .btn.ghost[data-close-trip] { flex: 0 0 auto; }

/* round-trip history cards */
.roundtrip-card { margin-bottom: 12px; overflow: hidden; }
.round-head { display: flex; align-items: center; gap: 10px; padding: 13px 14px 10px; border-bottom: 1px solid var(--line); width: 100%; background: none; text-align: left; font: inherit; color: inherit; }
.roundtrip-card.collapsed .round-head { border-bottom: none; padding-bottom: 13px; }
.roundtrip-card.collapsed .round-body { display: none; }
.round-chev { width: 16px; height: 16px; color: #b6bfcc; flex: none; transition: transform .15s; }
.round-chev.open { transform: rotate(90deg); }
.round-date { font-size: 17px; font-weight: 780; letter-spacing: -0.25px; }
.round-bus-meta { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.round-legs { display: flex; flex-direction: column; }
.leg { padding: 11px 14px; border-bottom: 1px solid var(--line); }
.leg.up { background: linear-gradient(90deg, rgba(67, 56, 202, .045), transparent 70%); }
.leg.down { background: linear-gradient(90deg, rgba(14, 116, 144, .055), transparent 70%); }
.leg-head { display: flex; align-items: center; gap: 9px; }
.leg-head .dir-icon { width: 30px; height: 30px; border-radius: 9px; }
.leg-head .dir-icon svg { width: 16px; height: 16px; }
.leg-route { font-weight: 700; font-size: 13.5px; letter-spacing: -0.1px; }
.leg-open { color: #b6bfcc; display: inline-grid; place-items: center; width: 28px; height: 28px; flex: none; }
.agent-lines { display: flex; flex-direction: column; gap: 7px; margin-top: 9px; padding-left: 39px; }
.agent-line { display: grid; grid-template-columns: 1fr auto; column-gap: 10px; row-gap: 1px; }
.al-name { font-size: 11.5px; font-weight: 700; grid-column: 1; grid-row: 1; }
.al-total { font-size: 12px; font-weight: 700; text-align: right; grid-column: 2; grid-row: 1; font-variant-numeric: tabular-nums; }
.al-seats { font-size: 10.5px; color: var(--muted); grid-column: 1; grid-row: 2; }
.al-modes {
  display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 5px;
  font-size: 10.5px; color: var(--muted); text-align: right; grid-column: 2; grid-row: 2;
  font-variant-numeric: tabular-nums;
}
.pay-mark { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.pay-mark svg { width: 12px; height: 12px; color: #667085; }
.upi-logo {
  display: inline-block; padding: 0 2px; border-radius: 3px;
  font-size: 8.5px; line-height: 1.35; font-weight: 800; font-style: italic; letter-spacing: .2px;
  color: #0e7490; background: #ecfeff; border: 1px solid #a5f3fc;
}
.leg-foot { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; padding-left: 39px; font-size: 10.5px; color: var(--muted); }
.leg-foot b { color: var(--ink-2); }
.leg-luggage {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px;
  margin-top: 7px; padding-left: 39px; font-size: 10.5px; color: var(--muted);
}
.leg-luggage svg { width: 13px; height: 13px; }
.leg-luggage b { color: var(--ink-2); }
.leg-luggage .due { color: var(--amber); font-weight: 650; }
.round-totals {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px;
  padding: 12px 14px; background: var(--surface-2);
}
.rt-label { display: block; font-size: 9.5px; text-transform: uppercase; letter-spacing: .6px; font-weight: 700; color: var(--muted); }
.rt-value { display: block; font-size: 14px; font-weight: 750; margin-top: 1px; font-variant-numeric: tabular-nums; }
.rt-note { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 10px; color: var(--muted); margin-top: 1px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 16px; border-radius: 12px; font-weight: 650; font-size: 14px;
  background: var(--brand); color: #fff; border: 1px solid transparent;
  transition: transform .12s, filter .12s;
  min-height: 44px;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: .55; }
.btn svg { width: 17px; height: 17px; }
.btn.ghost { background: var(--surface); color: var(--ink-2); border-color: var(--line); box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.btn.ghost svg { color: var(--muted); }
.btn.soft { background: var(--brand-soft); color: var(--brand); border-color: #dfe3ff; }
.btn.green { background: var(--green); }
.btn.danger { background: var(--red-soft); color: var(--red); border-color: #fecdca; }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn.lg { min-height: 50px; font-size: 15px; }

.empty {
  text-align: center; padding: 30px 20px; color: var(--muted); font-size: 13.5px;
  border: 1px dashed #d3d9e4; border-radius: var(--radius); background: var(--surface-2);
}
.empty .em-icon { width: 46px; height: 46px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin: 0 auto 10px; }
.empty .em-title { color: var(--ink); font-weight: 650; font-size: 14.5px; margin-bottom: 4px; }

/* badges */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 680; padding: 3px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
  white-space: nowrap;
}
.badge.green { background: var(--green-soft); color: var(--green); border-color: #abefc6; }
.badge.amber { background: var(--amber-soft); color: var(--amber); border-color: #fedf89; }
.badge.red { background: var(--red-soft); color: var(--red); border-color: #fecdca; }
.badge.brand { background: var(--brand-soft); color: var(--brand); border-color: #dfe3ff; }
.badge.dot::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.money { font-variant-numeric: tabular-nums; font-weight: 700; }
.money.pos { color: var(--red); }
.money.neg { color: var(--green); }
.money.zero { color: var(--muted); }

/* ------------------------------------------------ trip sub-header */
.trip-hero {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 15px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 11px;
}
.trip-hero .th-top { display: flex; align-items: flex-start; gap: 10px; }
.trip-hero .th-route { font-size: 16px; font-weight: 750; letter-spacing: -0.25px; }
.trip-hero .th-meta { font-size: 12px; color: var(--muted); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 8px; }
.th-badges { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.th-extra {
  display: flex; flex-wrap: wrap; gap: 5px 12px; padding-top: 9px;
  border-top: 1px dashed var(--line); font-size: 11px; color: var(--muted);
}
.th-extra b { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.th-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.th-metrics-3 { grid-template-columns: repeat(3, 1fr); }
.th-metric { background: var(--surface-2); border-radius: 10px; padding: 7px 9px; }
.th-metric .tm-label { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 650; }
.th-metric .tm-value { font-size: 15px; font-weight: 730; margin-top: 1px; letter-spacing: -0.2px; }

/* ------------------------------------------------ seats */
.legend { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 11px; color: var(--muted); padding: 2px; }
.legend .lg-item { display: inline-flex; align-items: center; gap: 5px; }
.legend .swatch { width: 12px; height: 12px; border-radius: 4px; border: 1.5px solid #cdd5e1; background: #fff; }
.legend .swatch.booked { background: var(--brand); border-color: var(--brand); }
.legend .swatch.unpaid { background: #b42318; border-color: #b42318; }
.legend .swatch.pending { background: #d97706; border-color: #d97706; }
.legend .swatch.paid { background: #059669; border-color: #059669; }
.legend .swatch.boarded { background: #059669; border-color: #059669; box-shadow: inset 0 0 0 2px #fff; }

.deck-tabs { display: flex; gap: 6px; padding: 4px; background: #e9edf5; border-radius: 12px; margin-top: 14px; }
.deck-tab {
  flex: 1; text-align: center; padding: 8px 6px; border-radius: 9px; font-size: 13px; font-weight: 650;
  color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 6px;
}
.deck-tab.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(16,24,40,.12); }
.deck-tab .dt-count { font-size: 11px; color: var(--muted); font-weight: 600; }

.bus-shell {
  position: relative; margin-top: 12px; padding: 14px 14px 16px;
  background: linear-gradient(180deg, #fbfcfe, #f5f7fb);
  border: 1.5px solid #dde3ee; border-radius: 26px;
  box-shadow: inset 0 2px 0 #fff, var(--shadow);
}
.bus-front {
  display: flex; align-items: center; justify-content: space-between;
  padding: 2px 8px 10px; color: #98a2b3; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; font-weight: 650;
}
.steering { width: 26px; height: 26px; border: 2.5px solid #cbd3e0; border-radius: 50%; position: relative; }
.steering::after { content: ""; position: absolute; inset: 6px; border: 1.5px solid #cbd3e0; border-radius: 50%; }
.aisle { display: flex; flex-direction: column; gap: 9px; position: relative; }
.seat-row {
  display: grid; align-items: stretch;
  grid-template-columns: minmax(64px, 92px) minmax(20px, 1fr) minmax(150px, 214px);
  gap: 8px;
}
.seat-aisle { position: relative; }
.seat-aisle::before {
  content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px;
  background: repeating-linear-gradient(180deg, #e3e8f1, #e3e8f1 6px, transparent 6px, transparent 12px);
  transform: translateX(-50%);
}
.seat-col { display: flex; flex-direction: column; gap: 4px; justify-content: flex-start; }
.double-pair { display: flex; flex-direction: row; gap: 4px; min-width: 0; justify-content: flex-start; }
.double-pair .seat { flex: 1 1 0; min-width: 0; }
.double-pair.combined { gap: 0; }
.double-pair.combined .seat { border-radius: 0; }
.double-pair.combined .seat:first-child {
  border-top-left-radius: 9px; border-bottom-left-radius: 9px;
  border-right-color: rgba(255,255,255,.35);
}
.double-pair.combined .seat:last-child {
  border-top-right-radius: 9px; border-bottom-right-radius: 9px;
}
.double-pair.combined .seat + .seat { border-left: none; }

.seat {
  position: relative; border-radius: 9px; border: 1.5px solid #cdd5e1; background: #fff;
  min-height: 88px; padding: 6px 8px; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 1px;
  font-size: 11.5px; font-weight: 650; color: var(--ink-2); text-align: left;
  transition: transform .1s, box-shadow .1s;
  overflow: hidden; cursor: pointer;
}
.seat:active { transform: scale(0.97); }
.seat:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.seat .st-head { display: flex; align-items: center; justify-content: space-between; gap: 4px; width: 100%; }
.seat .st-label { font-variant-numeric: tabular-nums; letter-spacing: .1px; font-size: 12.5px; line-height: 1.15; }
.seat .st-type { font-size: 9px; font-weight: 600; color: #98a2b3; text-transform: uppercase; letter-spacing: .4px; }
.seat.single { border-left: 3px solid #c7d2fe; }
.seat.double { border-left: 3px solid #bae6fd; }
.seat.double .st-label { font-size: 11.5px; }
.seat.booked { background: linear-gradient(135deg, #4338ca, #4f46e5); border-color: #4338ca; color: #fff; }
.seat.booked .st-type { color: rgba(255,255,255,.65); }
.seat.booked.cash { background: linear-gradient(135deg, #0f766e, #0d9488); border-color: #0f766e; }
.seat.booked.unpaid { background: linear-gradient(135deg, #b42318, #dc2626); border-color: #b42318; }
.seat.booked.pending { background: linear-gradient(135deg, #b45309, #d97706); border-color: #b45309; }
.seat.booked.paid { background: linear-gradient(135deg, #047857, #059669); border-color: #047857; }
.seat.booked.boarded { box-shadow: inset 0 0 0 2px rgba(255,255,255,.45); }
.seat .st-status {
  font-size: 8.5px; line-height: 1.2; font-weight: 700;
  color: rgba(255,255,255,.92); white-space: normal;
}
.seat-call {
  width: 21px; height: 21px; border-radius: 7px; flex: none;
  display: grid; place-items: center; color: inherit; text-decoration: none;
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.35);
}
.seat-call svg { width: 12px; height: 12px; }
.seat-actions { display: flex; gap: 4px; margin-top: 3px; }
.seat-actions .seat-board, .seat-actions .seat-pay { flex: 1; min-width: 0; }
.seat-board, .seat-pay {
  min-height: 22px; border-radius: 7px; padding: 1px 4px;
  display: inline-flex; align-items: center; justify-content: center; gap: 2px;
  font-size: 8.5px; font-weight: 700; color: #fff; white-space: nowrap;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.4);
}
.seat-board svg, .seat-pay svg { width: 10px; height: 10px; flex: none; }
.seat-board.on { background: #fff; color: #047857; border-color: #fff; }
.seat-pay { background: rgba(255,255,255,.9); color: #047857; border-color: #fff; }
.seat-board:disabled, .seat-pay:disabled { opacity: .55; }
.seat.wasted {
  background: #f1f3f7; border-style: dashed; border-color: #d8dee9; color: #98a2b3;
  grid-column: 1 / -1; min-height: 30px; font-size: 10.5px; justify-content: center;
}
.seat .st-note { font-size: 9.5px; opacity: .85; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.seat-grid-note { display: flex; align-items: center; justify-content: center; gap: 5px; color: #98a2b3; font-size: 10.5px; margin-top: 12px; }

/* layout builder preview */
.deck-config { border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; background: var(--surface-2); }
.layout-preview { display: flex; flex-direction: column; gap: 15px; }
.pv-deck-head { display: flex; justify-content: space-between; align-items: center; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin-bottom: 7px; }
.pv-seats { display: flex; flex-wrap: wrap; gap: 5px; }
.pv-seat {
  min-width: 42px; height: 33px; padding: 0 6px; border-radius: 7px; border: 1.5px solid #cdd5e1;
  background: #fff; font-size: 10.5px; font-weight: 650; color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center;
}
.pv-seat.single { border-left: 3px solid #c7d2fe; }
.pv-seat.double { border-left: 3px solid #bae6fd; }
.pv-seat.wasted { background: #f1f3f7; color: #98a2b3; border-color: #d8dee9; text-decoration: line-through; border-left-color: #d8dee9; }

/* ------------------------------------------------ list rows */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.list-item {
  display: flex; align-items: center; gap: 12px; padding: 13px 15px;
  border-top: 1px solid var(--line); width: 100%; text-align: left; background: none;
}
.list-item:first-child { border-top: none; }
.list-item:active { background: var(--surface-2); }
.list-item .li-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); flex: none; border: 1px solid var(--line); }
.list-item .li-title { font-weight: 650; font-size: 14px; }
.list-item .li-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.list-item .li-trail { margin-left: auto; text-align: right; display: flex; align-items: center; gap: 8px; }
.list-item svg.chev { width: 17px; height: 17px; color: #b6bfcc; }
.list-item.inactive { opacity: .55; }

/* avatar */
.avatar {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  font-weight: 730; font-size: 15px; flex: none;
  background: var(--brand-soft); color: var(--brand);
}
.avatar.green { background: var(--green-soft); color: var(--green); }
.avatar.amber { background: var(--amber-soft); color: var(--amber); }
.avatar.teal { background: #ecfeff; color: #0e7490; }

/* ------------------------------------------------ forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12.5px; font-weight: 650; color: var(--ink-2); display: flex; justify-content: space-between; gap: 8px; }
.field > label .opt { font-weight: 500; color: var(--muted); }
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input, .select, .textarea {
  width: 100%; border: 1.5px solid #d8dee9; border-radius: 11px; background: #fff;
  padding: 11px 12px; font-size: 15px; min-height: 45px; outline: none;
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: #818cf8; box-shadow: 0 0 0 3.5px rgba(99,102,241,.13); }
.input::placeholder { color: #b0b8c6; }
.password-field { position: relative; }
.password-field .input { padding-right: 44px; }
.password-toggle {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center; color: var(--muted);
}
.password-toggle:active { background: var(--surface-2); color: var(--ink-2); }
.password-toggle svg { width: 18px; height: 18px; }
.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px;
}
.textarea { min-height: 76px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.quick-inputs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.quick-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 0 2px; }
.quick-chips:empty { display: none; }
.option-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.option-chip {
  min-height: 30px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid #d6dce8; background: var(--surface); color: var(--ink-2);
  font-size: 11.5px; font-weight: 650;
}
.option-chip.active { background: var(--brand-soft); border-color: #c7d2fe; color: var(--brand); }
.fare-stepper { display: flex; align-items: center; gap: 7px; }
.fare-stepper .input-affix { flex: 1; }
.fare-step {
  width: 42px; height: 42px; flex: none; border-radius: 11px;
  border: 1px solid #d6dce8; background: var(--surface-2); color: var(--ink);
  font-size: 20px; font-weight: 600; line-height: 1;
}
.fare-step:active { background: var(--brand-soft); }
.fare-quick { padding-top: 7px; }
.req { color: var(--red); font-weight: 700; }
.quick-chip {
  min-height: 28px; padding: 3px 10px; border-radius: 999px;
  border: 1px solid #d6dce8; background: var(--surface-2); color: var(--ink-2);
  font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.quick-chip.active { background: var(--brand-soft); border-color: #c7d2fe; color: var(--brand); }
.quick-chip:disabled { opacity: .55; }
.form-section { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; }
.form-section-title { font-size: 11px; text-transform: uppercase; letter-spacing: .9px; color: var(--muted); font-weight: 700; margin-bottom: 10px; }

.segmented { display: flex; gap: 4px; background: #eef1f7; padding: 4px; border-radius: 11px; }
.segmented button {
  flex: 1; padding: 8px 6px; border-radius: 8px; font-size: 12.5px; font-weight: 650; color: var(--muted);
  display: flex; align-items: center; justify-content: center; gap: 4px;
}
.segmented button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(16,24,40,.12); }
.segmented button:disabled { opacity: .4; cursor: not-allowed; }
.segmented button.active.green { color: var(--green); }
.segmented button.active.red { color: var(--red); }
.segmented button.active.amber { color: var(--amber); }

.input-affix { position: relative; }
.input-affix .prefix {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-weight: 650; font-size: 14px; pointer-events: none;
}
.input-affix .input { padding-left: 28px; font-variant-numeric: tabular-nums; font-weight: 650; }
.input-affix .suffix { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 11px; }

.stepper { display: flex; align-items: center; border: 1.5px solid #d8dee9; border-radius: 11px; background: #fff; overflow: hidden; }
.stepper button { width: 38px; height: 43px; display: grid; place-items: center; color: var(--ink-2); background: var(--surface-2); font-size: 18px; }
.stepper button:active { background: #eef1f7; }
.stepper input { flex: 1; width: 100%; border: none; text-align: center; font-size: 15px; font-weight: 700; outline: none; min-width: 0; padding: 0; height: 43px; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ------------------------------------------------ bottom sheet */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 100; background: rgba(16, 24, 40, 0.45);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .18s ease-out;
  backdrop-filter: blur(2px);
}
.sheet {
  width: 100%; max-width: 680px; max-height: 92vh; background: var(--surface);
  border-radius: 22px 22px 0 0; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  animation: slideup .22s cubic-bezier(.22,.8,.3,1);
  padding-bottom: var(--safe-b);
}
.sheet-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.sheet-head .sh-title { font-size: 16.5px; font-weight: 750; letter-spacing: -0.2px; }
.sheet-head .sh-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.sheet-body { padding: 16px 18px; overflow-y: auto; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; gap: 13px; }
.sheet-foot { padding: 12px 18px calc(14px + var(--safe-b)); border-top: 1px solid var(--line); background: var(--surface-2); display: flex; gap: 8px; }
.sheet-foot .btn { flex: 1; }
.sheet-grab { width: 38px; height: 4px; background: #d8dee9; border-radius: 99px; margin: 6px auto -2px; flex: none; }
@keyframes slideup { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } }

/* ------------------------------------------------ cash agent cards */
.cash-card { padding: 0; overflow: hidden; margin-bottom: 12px; }
.cash-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0 11px; padding: 12px 14px; width: 100%; text-align: left; background: none; }
.cash-head .grow { min-width: 0; }
.cash-head .ch-name { display: block; font-weight: 700; font-size: 14.5px; }
.cash-head .ch-sub { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.cash-head .ch-updated {
  flex: 1 0 100%; margin-left: 49px; margin-top: 5px;
  font-size: 10px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cash-head .ch-updated b { color: var(--ink-2); font-weight: 650; }
.cash-head .ch-trail { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; flex: none; }
.cash-head .chev { transition: transform .15s; width: 16px; height: 16px; color: #b6bfcc; }
.cash-head .chev.open { transform: rotate(90deg); }
.save-indicator {
  width: 0; height: 16px; flex: none; border-radius: 50%;
  display: grid; place-items: center; position: relative;
  opacity: 0; transition: opacity .15s, width .15s, background-color .15s;
}
.save-indicator.pending, .save-indicator.saved, .save-indicator.error { width: 16px; }
.save-indicator::after {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: #f59e0b; opacity: 0; transition: opacity .15s;
}
.save-indicator.pending { opacity: 1; }
.save-indicator.pending::after { opacity: 1; animation: savepulse 1s ease-in-out infinite; }
.save-indicator.saved { opacity: 1; background: #059669; }
.save-indicator.saved::after {
  opacity: 1; width: 7px; height: 4px; background: none; border-radius: 0;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px); animation: none;
}
.save-indicator.error { opacity: 1; }
.save-indicator.error::after { opacity: 1; background: #dc2626; }
@keyframes savepulse {
  0%, 100% { transform: scale(1); opacity: .55; }
  50% { transform: scale(1.35); opacity: 1; }
}
.cash-body { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.picker-block { display: flex; flex-direction: column; gap: 5px; }
.picker-label { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 650; color: var(--ink-2); }
.number-picker { display: flex; gap: 5px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
.number-picker::-webkit-scrollbar { display: none; }
.num-chip {
  min-width: 34px; height: 34px; padding: 0 6px; flex: none;
  border: 1.5px solid var(--line); border-radius: 9px; background: #fff;
  font-size: 12.5px; font-weight: 650; color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center;
}
.num-chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.num-chip:disabled { opacity: .5; }
.amount-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.mini-field { display: flex; flex-direction: column; gap: 4px; font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.mini-input { min-height: 40px; padding: 7px 8px; font-size: 14px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 650; }
.expense-card { padding: 0; overflow: hidden; margin-bottom: 10px; }
.expense-head { display: flex; align-items: center; gap: 10px; padding: 11px 14px 6px; }
.expense-head .ch-name { display: block; font-weight: 700; font-size: 14px; }
.expense-head .ch-sub { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
.expense-body { display: flex; align-items: center; gap: 8px; padding: 0 14px 12px; }
.expense-note { padding: 0 14px 12px; }
.mode-toggle { display: flex; flex: none; background: #eef1f7; border-radius: 9px; padding: 3px; }
.mode-toggle button {
  padding: 7px 10px; border-radius: 7px; font-size: 12px; font-weight: 650; color: var(--muted);
}
.mode-toggle button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(16,24,40,.12); }
.mode-toggle button:disabled { opacity: .6; }
.expense-list { padding: 0; overflow: hidden; }
.expense-entry { border-bottom: 1px solid var(--line); }
.expense-entry:last-child { border-bottom: 0; }
.expense-line { display: flex; align-items: center; gap: 8px; padding: 9px 12px; }
.exp-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 650; }
.exp-mode { display: flex; flex: none; background: #eef1f7; border-radius: 8px; padding: 2px; }
.exp-mode button { padding: 5px 7px; border-radius: 6px; font-size: 10.5px; font-weight: 650; color: var(--muted); }
.exp-mode button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(16, 24, 40, .12); }
.exp-mode button:disabled { opacity: .6; }
.exp-amount { width: 104px; flex: none; }
.exp-amount .input { min-height: 36px; padding: 6px 8px 6px 23px; font-size: 13px; font-weight: 650; }
.exp-amount .prefix { left: 8px; font-size: 10px; }
.expense-entry .expense-note { padding: 0 12px 9px; }
.expense-entry .expense-note .input { min-height: 36px; font-size: 12.5px; }
.expense-entry .quick-chips { padding: 0 12px 9px; }

/* luggage carton stepper */
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper .input { flex: 1; text-align: center; padding-left: 6px; padding-right: 6px; }
.stepper button {
  width: 36px; height: 36px; flex: none; border-radius: 9px;
  display: grid; place-items: center; font-size: 19px; font-weight: 600;
  color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line);
}
.stepper button:active { transform: scale(.97); }
.cash-summary {  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; padding: 9px 12px;
  font-size: 12px; color: var(--muted);
}
.cash-summary b { display: block; font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -0.2px; }
.booking-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 2px 9px; }
.last-updated { padding: 0 4px 6px; line-height: 1.4; }
.last-updated b { color: var(--ink-2); font-weight: 650; }
.switch-wrap { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.switch { width: 34px; height: 20px; border-radius: 999px; background: #d8dee9; position: relative; transition: background .15s; display: inline-block; flex: none; }
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .2);
  transition: transform .15s;
}
.switch.on { background: var(--brand); }
.switch.on::after { transform: translateX(14px); }
.cash-net { font-size: 13px; font-weight: 700; text-align: right; }
.cash-net small { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 650; }
.chart-hint { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: #0369a1; background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 9px; padding: 7px 9px; }
.chart-hint svg { width: 14px; height: 14px; }
.chart-hint .link-btn { margin-left: auto; font-size: 11.5px; }

/* ------------------------------------------------ misc */
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 7px 0; }
.kv + .kv { border-top: 1px dashed var(--line); }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; text-align: right; }

.tabs-scroll { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.tabs-scroll::-webkit-scrollbar { display: none; }
.management-tabs { padding-bottom: 0; margin-bottom: 10px; }
.management-hero { margin-top: 0; }
.management-hero .last-updated { padding: 8px 0 0; }
.chip {
  padding: 7px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 650; white-space: nowrap;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
}
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.route-picker { display: flex; flex-wrap: wrap; gap: 6px; }

.searchbox { position: relative; margin-bottom: 10px; }
.searchbox svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); }
.searchbox input { padding-left: 37px; background: var(--surface); }

.fab-space { height: 8px; }

.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; z-index: 50;
  width: 100%; max-width: 680px; height: calc(var(--tab-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  display: flex; align-items: stretch;
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: #5f6b7a; font-size: 11px; font-weight: 650; letter-spacing: .1px; padding-top: 4px;
}
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a.active { color: var(--brand); }
.tabbar a.active svg { stroke-width: 2.1; }

.toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--tab-h) + var(--safe-b) + 14px); z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 7px; pointer-events: none; padding: 0 16px; }
.toast {
  background: #101828; color: #fff; font-size: 13px; font-weight: 600; padding: 10px 15px;
  border-radius: 11px; box-shadow: var(--shadow-lg); max-width: 420px;
  display: flex; align-items: center; gap: 8px; animation: toastin .2s ease-out;
}
.toast.error { background: var(--red); }
.toast.success { background: #054f31; }
@keyframes toastin { from { transform: translateY(8px); opacity: 0; } }

.skeleton { background: linear-gradient(90deg, #eef1f6 25%, #f6f8fb 50%, #eef1f6 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.loading-pad { padding: 40px 16px; display: flex; flex-direction: column; gap: 10px; }
.loading-pad .skeleton { height: 60px; }

@media (min-width: 720px) {
  .view { padding-left: 20px; padding-right: 20px; }
  .topbar { padding-left: 20px; padding-right: 20px; }
  .hero .hero-value { font-size: 34px; }
  .th-metrics { grid-template-columns: repeat(4, 1fr); }
}

/* ------------------------------------------------ auth */
body.auth-mode { background: linear-gradient(180deg, #eef2ff 0%, var(--bg) 46%); }
body.auth-mode #app { background: transparent; }
.auth-wrap {
  min-height: 100vh;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 32px) 20px calc(env(safe-area-inset-bottom, 0px) + 28px);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.auth-brand { text-align: center; margin-top: auto; margin-bottom: 22px; }
.auth-logo {
  width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 12px;
  display: grid; place-items: center;
  background: var(--brand); color: #fff;
  box-shadow: 0 10px 24px rgba(67, 56, 202, .25);
}
.auth-logo svg { width: 32px; height: 32px; }
.auth-name { font-size: 22px; font-weight: 800; letter-spacing: -.4px; }
.auth-tag {
  margin-top: 3px; font-size: 11px; font-weight: 700; letter-spacing: .8px;
  text-transform: uppercase; color: var(--muted);
}
.auth-card { padding: 22px 20px; border-radius: 20px; box-shadow: 0 16px 40px rgba(16, 24, 40, .08); }
.auth-kicker {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .8px;
  font-weight: 750; color: var(--brand); margin-bottom: 3px;
}
.auth-card h2 { font-size: 21px; font-weight: 780; letter-spacing: -.3px; }
.auth-lead { font-size: 13px; color: var(--muted); line-height: 1.5; margin: 6px 0 17px; }
.auth-error {
  background: var(--red-soft); border: 1px solid #fecdca; color: var(--red);
  border-radius: 10px; padding: 9px 11px; font-size: 12.5px; line-height: 1.45;
}
.auth-note { margin-top: 13px; text-align: center; font-size: 11px; color: var(--muted); line-height: 1.45; }
.auth-foot {
  margin-top: 18px; margin-bottom: auto; display: flex; align-items: center; justify-content: center; gap: 5px;
  font-size: 11px; color: #98a2b3;
}
.auth-foot svg { width: 13px; height: 13px; }
