/* ============================================================
   StarMart Express — Ticketing Portal
   Modern SaaS rebuild. Familiar crimson identity, clean light UI.
   ============================================================ */

:root {
  /* Brand — StarMart BOMS red (#E01F3D) */
  --brand: #e01f3d;
  --brand-600: #cc1b37;
  --brand-700: #b3172f;
  --brand-soft: #feebee;
  --brand-ring: rgba(224, 31, 61, 0.16);

  /* Gold star accent (BOMS) */
  --accent: #f0a821;
  --accent-ink: #3d2900;
  --accent-soft: rgba(240, 168, 33, 0.15);

  /* Sidebar — BOMS white shell */
  --side-bg: #ffffff;
  --side-bg-2: #f1f5fa;
  --side-item: #5c657a;
  --side-item-hover: #10172a;
  --side-active-bg: #feebee;
  --side-active-bar: var(--brand);
  --side-heading: #8a92a6;
  --side-line: #e4e8f0;

  /* Neutrals — BOMS slate-blue */
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafd;
  --ink: #10172a;
  --ink-2: #2f3a52;
  --muted: #5c657a;
  --muted-2: #949cb0;
  --border: #e4e8f0;
  --border-2: #edf0f6;

  /* Semantic — BOMS */
  --ok: #047857;
  --ok-soft: #ecfdf5;
  --warn: #b45309;
  --warn-soft: #fffaeb;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --info: #1e3a8a;
  --info-soft: #eef3ff;
  --neu: #474f63;
  --neu-soft: #f1f3f7;

  /* Elevation — BOMS */
  --shadow-sm: 0 1px 2px rgba(11, 20, 40, 0.04), 0 1px 3px rgba(11, 20, 40, 0.06);
  --shadow-md: 0 4px 12px rgba(11, 20, 40, 0.07), 0 2px 6px rgba(11, 20, 40, 0.05);
  --shadow-lg: 0 24px 60px -20px rgba(8, 12, 28, 0.45);

  /* Radii — BOMS: card 14, control 8 */
  --r-sm: 8px;
  --r: 10px;
  --r-lg: 14px;
  --r-xl: 18px;

  /* Spacing (dense dashboard scale) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s7: 32px; --s8: 40px;

  --sidebar-w: 256px;
  --topbar-h: 62px;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Sora", var(--font);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1,h2,h3,h4 { font-family: var(--display); margin: 0; letter-spacing: -0.01em; color: var(--ink); }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

.sidebar {
  background: var(--side-bg);
  color: var(--side-item);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  border-right: 1px solid var(--side-line);
}
.brand { display: flex; align-items: center; gap: var(--s3); padding: 20px 18px 18px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  color: #fff; background: linear-gradient(145deg, var(--brand) 0%, var(--brand-700) 100%);
  box-shadow: 0 6px 16px rgba(224,31,61,0.32);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--display); font-size: 16px; color: var(--ink); font-weight: 800; }
.brand-text span { font-size: 11px; color: var(--side-heading); letter-spacing: 0.02em; }

.nav { flex: 1; overflow-y: auto; padding: 6px 12px 12px; }
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }
.nav-heading {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.18em;
  color: var(--side-heading); font-weight: 700; padding: 18px 12px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 9px 12px; border-radius: var(--r-sm); color: var(--side-item);
  font-size: 13px; font-weight: 500; cursor: pointer; border: 0; background: transparent;
  position: relative; text-align: left; transition: background .16s ease, color .16s ease;
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; opacity: .9; }
.nav-item:hover { background: var(--side-bg-2); color: var(--side-item-hover); }
.nav-item:hover svg { opacity: 1; }
.nav-item.active { background: var(--side-active-bg); color: var(--brand); font-weight: 600; }
.nav-item.active svg { color: var(--brand); opacity: 1; }
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  height: 20px; width: 3px; border-radius: 0 3px 3px 0; background: var(--side-active-bar);
}
.nav-item .badge-count {
  margin-left: auto; font-size: 10.5px; background: var(--brand); color: #fff;
  padding: 1px 7px; border-radius: 20px; font-weight: 700;
}

.sidebar-foot {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border-top: 1px solid var(--side-line);
}
.avatar {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--brand) 0%, var(--brand-700) 100%);
  color: #fff; font-weight: 700; font-size: 13px;
}
.who { display: flex; flex-direction: column; line-height: 1.2; flex: 1; min-width: 0; }
.who strong { font-size: 13px; color: var(--ink); }
.who span { font-size: 11px; color: var(--side-heading); }

/* ---------- Main ---------- */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: var(--topbar-h); background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: var(--s3); padding: 0 var(--s6);
  position: sticky; top: 0; z-index: 20;
}
.crumb { font-family: var(--display); font-weight: 700; font-size: 16px; }
.topbar-spacer { flex: 1; }
.topbar-meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.topbar-meta .dot { color: var(--muted-2); }
.clock { font-variant-numeric: tabular-nums; font-weight: 500; color: var(--ink-2); }
.station-pill {
  display: inline-flex; align-items: center; gap: 5px; background: var(--bg);
  padding: 5px 10px; border-radius: 20px; font-weight: 500; color: var(--ink-2);
  border: 1px solid var(--border);
}
.station-pill svg { color: var(--brand); }
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: 6px; }

.content { padding: var(--s6); max-width: 1360px; width: 100%; margin: 0 auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 14px; border-radius: var(--r-sm); font-size: 13px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; transition: all .16s ease; white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-soft { background: var(--brand-soft); color: var(--brand); }
.btn-soft:hover { filter: brightness(.98); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { filter: brightness(1.03); }
.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 6px; }
.btn-lg { padding: 12px 20px; font-size: 15px; border-radius: var(--r); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); cursor: pointer;
  transition: all .16s ease;
}
.icon-btn:hover { background: var(--bg); }
.icon-btn.ghost { border-color: transparent; background: transparent; }
.icon-btn.ghost:hover { background: var(--bg); }

/* quick action buttons in topbar */
.qa {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 10px;
  font-size: 13px; font-weight: 600; cursor: pointer; border: 1px solid var(--border);
  background: var(--surface); color: var(--ink-2); transition: all .16s ease;
}
.qa svg { width: 16px; height: 16px; }
.qa:hover { background: var(--bg); }
.qa.qa-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.qa.qa-primary:hover { background: var(--brand-600); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: var(--s5); }
.card-head { display: flex; align-items: center; gap: var(--s3); padding: 16px var(--s5); border-bottom: 1px solid var(--border-2); }
.card-head h3 { font-size: 15px; font-weight: 700; }
.card-head .sub { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.card-head .spacer { flex: 1; }

.page-head { display: flex; align-items: flex-end; gap: var(--s4); margin-bottom: var(--s6); flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 800; }
.page-head .lead { color: var(--muted); font-size: 14px; margin-top: 3px; }
.page-head .spacer { flex: 1; }

/* ---------- Grid helpers ---------- */
.grid { display: grid; gap: var(--s5); }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.row { display: flex; gap: var(--s4); }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.items-center { align-items: center; }
.gap-2 { gap: var(--s2); } .gap-3 { gap: var(--s3); }
.mt-4 { margin-top: var(--s4); } .mt-5 { margin-top: var(--s5); } .mt-6 { margin-top: var(--s6); }
.mb-4 { margin-bottom: var(--s4); }

/* ---------- Stat tiles ---------- */
.stat { display: flex; flex-direction: column; gap: 8px; padding: var(--s5); }
.stat .label { font-size: 12.5px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 7px; }
.stat .label .ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; }
.stat .value { font-family: var(--display); font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.stat .value small { font-size: 14px; color: var(--muted); font-weight: 600; }
.stat .delta { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.delta.up { color: var(--ok); } .delta.down { color: var(--danger); }

.ic.ic-brand { background: var(--brand-soft); color: var(--brand); }
.ic.ic-ok { background: var(--ok-soft); color: var(--ok); }
.ic.ic-warn { background: var(--warn-soft); color: var(--warn); }
.ic.ic-info { background: var(--info-soft); color: var(--info); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--muted); font-weight: 700; padding: 11px var(--s4); border-bottom: 1px solid var(--border);
  white-space: nowrap; background: var(--surface-2);
}
table.data td { padding: 12px var(--s4); border-bottom: 1px solid var(--border-2); color: var(--ink-2); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background .12s ease; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data td .strong { color: var(--ink); font-weight: 600; }
.text-r { text-align: right; } .text-c { text-align: center; }

/* ---------- Badges / chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; line-height: 1.4;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.accent { background: var(--accent-soft); color: var(--accent-ink); }
.badge.neutral { background: var(--neu-soft); color: var(--neu); }
.badge.plain::before { display: none; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--s4); }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 11.5px; color: var(--muted); }
.input, .select {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--ink); font-size: 13.5px; font-family: inherit;
  transition: border .15s ease, box-shadow .15s ease;
}
.input::placeholder { color: var(--muted-2); }
.input:focus, .select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23697386' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 34px; }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13.5px; color: var(--ink-2); user-select: none; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); cursor: pointer; }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: var(--s8) var(--s5); color: var(--muted); }
.empty svg { width: 40px; height: 40px; color: var(--muted-2); margin-bottom: 10px; }
.empty h4 { color: var(--ink-2); font-size: 15px; margin-bottom: 4px; }
.empty p { font-size: 13px; max-width: 340px; margin: 0 auto; }

/* ---------- Booking flow ---------- */
.stepper { display: flex; align-items: center; gap: 6px; margin-bottom: var(--s6); flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 9px; padding: 8px 14px; border-radius: 30px; background: var(--surface); border: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--muted); }
.step .num { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: var(--bg); color: var(--muted); font-weight: 700; }
.step.active { border-color: var(--brand); color: var(--brand-700); background: var(--brand-soft); }
.step.active .num { background: var(--brand); color: #fff; }
.step.done { color: var(--ok); }
.step.done .num { background: var(--ok); color: #fff; }
.step-sep { width: 16px; height: 2px; background: var(--border); border-radius: 2px; }

.station-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.station-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px;
  border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer;
  transition: all .15s ease; text-align: left;
}
.station-btn:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.station-btn.sel { border-color: var(--brand); background: var(--brand-soft); }
.station-btn .code { font-family: var(--display); font-weight: 800; font-size: 13px; color: var(--brand-700); letter-spacing: 0.03em; }
.station-btn .name { font-size: 12px; color: var(--ink-2); font-weight: 500; }

.trip-card {
  display: grid; grid-template-columns: auto 1fr auto; gap: var(--s4); align-items: center;
  padding: 16px var(--s5); border: 1px solid var(--border); border-radius: 14px; background: var(--surface);
  cursor: pointer; transition: all .15s ease;
}
.trip-card:hover { border-color: var(--brand); box-shadow: var(--shadow-md); }
.trip-card.sel { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.trip-time { text-align: center; }
.trip-time .t { font-family: var(--display); font-weight: 800; font-size: 20px; }
.trip-time .d { font-size: 11px; color: var(--muted); }
.trip-mid .route { font-weight: 700; color: var(--ink); font-size: 14px; }
.trip-mid .meta { display: flex; gap: 12px; margin-top: 5px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.trip-mid .meta span { display: inline-flex; align-items: center; gap: 5px; }
.trip-right { text-align: right; }
.trip-right .fare { font-family: var(--display); font-weight: 800; font-size: 18px; }
.trip-right .seats { font-size: 12px; color: var(--muted); }

/* Seat map */
.deck { background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px; padding: var(--s5); max-width: 420px; margin: 0 auto; }
.deck-head { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; margin-bottom: var(--s4); font-weight: 600; justify-content: center; }
.deck-head svg { width: 16px; height: 16px; }
/* icon sizing safety for raw inline icons in otherwise-unsized containers */
.trip-mid .meta svg { width: 14px; height: 14px; }
.stat .label .ic svg { width: 16px; height: 16px; }
.login-art .feat svg { width: 18px; height: 18px; flex-shrink: 0; }
.modal-body svg { width: 24px; height: 24px; }
.notice svg { width: 16px; height: 16px; }
.seat-rows { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.seat-row { display: flex; gap: 10px; justify-content: center; }
.seat {
  width: 48px; height: 48px; border-radius: 11px; border: 1.5px solid var(--border); background: var(--surface);
  display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--ink-2); cursor: pointer;
  transition: all .12s ease; font-variant-numeric: tabular-nums; flex-shrink: 0;
}
.seat:hover:not(.taken) { border-color: var(--brand); color: var(--brand); }
.seat.sel { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 10px var(--brand-ring); }
.seat.taken { background: var(--border-2); color: var(--muted-2); cursor: not-allowed; border-color: var(--border-2); }
.seat.aisle { width: 24px; visibility: hidden; }
.legend { display: flex; gap: var(--s4); margin-top: var(--s4); font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw { width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--border); }
.legend .sw.free { background: var(--surface); }
.legend .sw.sel { background: var(--brand); border-color: var(--brand); }
.legend .sw.taken { background: var(--border-2); border-color: var(--border-2); }

/* Summary rail */
.summary { position: sticky; top: calc(var(--topbar-h) + 24px); }
.sum-row { display: flex; justify-content: space-between; padding: 9px 0; font-size: 13px; border-bottom: 1px dashed var(--border); }
.sum-row .k { color: var(--muted); }
.sum-row .v { font-weight: 600; color: var(--ink); }
.sum-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: var(--s4); margin-top: var(--s2); }
.sum-total .k { font-weight: 700; }
.sum-total .v { font-family: var(--display); font-weight: 800; font-size: 24px; color: var(--brand-700); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 13.5px;
  font-weight: 500; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none;
  transition: all .25s cubic-bezier(.2,.8,.2,1); z-index: 100; display: flex; align-items: center; gap: 9px;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast svg { width: 18px; height: 18px; }
.toast.ok svg { color: #4ade80; } .toast.err svg { color: #f87171; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(20,24,31,0.5); backdrop-filter: blur(3px);
  display: grid; place-items: center; z-index: 90; padding: var(--s5); opacity: 0; transition: opacity .18s ease;
}
.modal-backdrop.show { opacity: 1; }
.modal {
  background: var(--surface); border-radius: var(--r-xl); width: 100%; max-width: 460px;
  box-shadow: var(--shadow-lg); overflow: hidden; transform: scale(.97); transition: transform .18s ease;
}
.modal-backdrop.show .modal { transform: scale(1); }
.modal-head { padding: 20px var(--s6) 0; }
.modal-head h3 { font-size: 18px; }
.modal-head p { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.modal-body { padding: var(--s5) var(--s6); }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 0 var(--s6) var(--s6); }

/* ---------- Login ---------- */
.login-wrap { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.login-art {
  background: linear-gradient(155deg, var(--side-bg) 0%, #34121d 55%, var(--brand-700) 130%);
  color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.login-art .glow { position: absolute; width: 460px; height: 460px; border-radius: 50%; filter: blur(90px); background: rgba(196,22,42,.5); top: -120px; right: -120px; }
.login-art .brand { padding: 0; }
.login-art h1 { color: #fff; font-size: 40px; line-height: 1.1; font-weight: 800; max-width: 440px; }
.login-art p { color: rgba(255,255,255,.7); font-size: 15px; max-width: 400px; margin-top: 16px; }
.login-art .feat { display: flex; gap: 10px; align-items: center; color: rgba(255,255,255,.85); font-size: 14px; margin-top: 12px; }
.login-art .feat svg { color: #ff8b96; }
.login-form-side { display: grid; place-items: center; padding: 40px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-size: 26px; font-weight: 800; }
.login-card .lead { color: var(--muted); margin: 6px 0 28px; }

/* ---------- Notice board ---------- */
.notice { padding: var(--s5); border-left: 3px solid var(--brand); background: var(--brand-soft); border-radius: 0 12px 12px 0; }
.notice.amber { border-color: var(--warn); background: var(--warn-soft); }
.notice h4 { font-size: 14px; margin-bottom: 4px; }
.notice p { font-size: 13px; color: var(--ink-2); margin: 0; }
.notice .sig { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* ---------- Misc ---------- */
.divider { height: 1px; background: var(--border); margin: var(--s5) 0; }
.pill-tabs { display: inline-flex; background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 3px; gap: 3px; }
.pill-tab { padding: 7px 14px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; border: 0; background: transparent; transition: all .14s ease; }
.pill-tab.active { background: var(--surface); color: var(--brand-700); box-shadow: var(--shadow-sm); }
.muted { color: var(--muted); }
.fade-in { animation: fadeIn .3s ease both; }
.stagger > * { animation: rise .34s cubic-bezier(.2,.8,.2,1) both; }
.stagger > *:nth-child(1){animation-delay:.02s}.stagger > *:nth-child(2){animation-delay:.06s}.stagger > *:nth-child(3){animation-delay:.1s}.stagger > *:nth-child(4){animation-delay:.14s}.stagger > *:nth-child(5){animation-delay:.18s}.stagger > *:nth-child(6){animation-delay:.22s}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Function hubs ---------- */
.func-hub { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--s5); align-items: start; }
.func-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.func-group-head {
  background: var(--brand); color: #fff;
  font-family: var(--display); font-weight: 700; font-size: 14px; padding: 13px 18px; letter-spacing: -0.005em;
}
.func-group-body { padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.func-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  padding: 12px 14px; border-radius: 10px; border: 0; background: transparent; cursor: pointer;
  font-size: 13.5px; font-weight: 500; color: var(--ink-2); text-align: left; transition: all .14s ease;
}
.func-btn svg { width: 16px; height: 16px; color: var(--muted-2); transition: transform .15s ease, color .15s ease; }
.func-btn:hover { background: var(--brand-soft); color: var(--brand-700); }
.func-btn:hover svg { color: var(--brand); transform: translateX(2px); }

/* ---------- Sub-screen breadcrumb ---------- */
.subcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.subcrumb a { color: var(--brand-700); font-weight: 600; cursor: pointer; }
.subcrumb a:hover { text-decoration: underline; }
.subcrumb svg { width: 14px; height: 14px; color: var(--muted-2); }
.subcrumb span { color: var(--ink-2); font-weight: 500; }

/* ---------- Maintenance tables ---------- */
.maint-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  padding: 12px var(--s5); border-bottom: 1px solid var(--border-2);
}
.maint-head h3 { font-family: var(--display); font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--brand-700); }
.rowbtn { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; transition: all .14s ease; }
.rowbtn svg { width: 15px; height: 15px; }
.rowbtn.edit:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.rowbtn.del:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }

.cts-chip { display: inline-block; margin-top: 5px; font-size: 10.5px; font-weight: 600; background: #e0f2fe; color: #0369a1; padding: 2px 7px; border-radius: 6px; }
.cts-chip.alt { background: #cffafe; color: #0e7490; }
.text-danger { color: var(--danger); font-weight: 600; }

/* ---------- Split layouts (filter + table) ---------- */
.split { display: grid; grid-template-columns: 320px 1fr; gap: var(--s5); align-items: start; }
.split-wide { display: grid; grid-template-columns: 1fr 280px; gap: var(--s5); align-items: start; }
.filter-card label { color: var(--ink-2); }

/* ---------- Seat transfer / designer ---------- */
.seat-legend { display: flex; flex-wrap: wrap; gap: var(--s4); font-size: 12px; color: var(--muted); }
.seat-legend .sw { width: 14px; height: 14px; border-radius: 4px; display: inline-block; vertical-align: -2px; margin-right: 5px; }
.settings-bar { font-size: 13.5px; color: var(--ink-2); }
.inline-num { width: 64px; display: inline-block; padding: 6px 10px; text-align: center; }
.plan-grid { display: grid; grid-template-columns: repeat(3, 48px); gap: 10px; justify-content: center; }

/* ---------- Home / announcement ---------- */
.notice-card { border-left: 4px solid var(--brand); }
.notice-card .card-head h3 { display: flex; align-items: center; gap: 8px; color: var(--brand-700); }
.notice-card .card-head svg { width: 18px; height: 18px; }
.notice-body p { color: var(--ink-2); font-size: 14px; line-height: 1.6; margin-bottom: 10px; }
.notice-body p:last-child { margin-bottom: 0; }
.stat .sub { font-size: 12px; margin-top: 4px; }
.stat .sub.ok { color: var(--ok, #15a34a); }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.quick-tile {
  display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: var(--r-lg);
  border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 14px;
  color: var(--ink); box-shadow: var(--shadow-sm); transition: all .15s ease; text-align: left;
}
.quick-tile:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.quick-tile > svg:last-child { width: 16px; height: 16px; margin-left: auto; color: var(--muted-2); }
.quick-tile .ic { width: 34px; height: 34px; flex: none; }

/* ---------- Printer setup guide ---------- */
.setup-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.setup-step { display: flex; gap: 14px; align-items: flex-start; }
.step-n { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-700); font-weight: 700; font-size: 14px; }

/* ---------- Report footer ---------- */
.report-foot { padding: 12px var(--s5); border-top: 1px solid var(--border-2); font-size: 12.5px; color: var(--muted); }

/* ---------- Date field + calendar picker ---------- */
.datefield {
  display: inline-flex; align-items: center; gap: 8px; width: 100%;
  padding: 9px 12px; border-radius: var(--r-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 14px;
  cursor: pointer; text-align: left; transition: border-color .14s ease, box-shadow .14s ease;
}
.datefield:hover { border-color: var(--muted-2); }
.datefield.open { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.datefield .df-val { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.datefield.placeholder .df-val { color: var(--muted); }
.datefield svg { width: 16px; height: 16px; color: var(--muted); flex: none; }

.cal-pop { position: fixed; z-index: 200; animation: calpop .14s cubic-bezier(.2,1,.3,1); }
@keyframes calpop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.cal {
  width: 304px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); box-shadow: var(--shadow-lg); padding: 16px;
}
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-title { font-family: var(--display); font-weight: 700; font-size: 16px; color: var(--ink); }
.cal-nav { display: flex; gap: 2px; }
.cal-navbtn { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; transition: all .12s ease; }
.cal-navbtn:hover { background: var(--surface-2); color: var(--brand); }
.cal-navbtn svg { width: 18px; height: 18px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-dow { text-align: center; font-size: 11px; color: var(--muted); font-weight: 600; padding: 2px 0 8px; }
.cal-day { position: relative; height: 40px; display: grid; place-items: center; border: 0; background: transparent; cursor: pointer; padding: 0; }
.cal-daynum { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; font-size: 13.5px; color: var(--ink); transition: background .12s ease; }
.cal-day:hover .cal-daynum { background: var(--surface-2); }
.cal-day.muted .cal-daynum { color: var(--muted-2); }
.cal-day.today .cal-daynum { color: var(--brand); font-weight: 700; }
.cal-day.sel .cal-daynum { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.cal-day.sel:hover .cal-daynum { background: var(--brand-soft); }
.cal-dots { position: absolute; left: 0; right: 0; bottom: 4px; display: flex; justify-content: center; gap: 3px; pointer-events: none; }
.cal-dot { width: 4px; height: 4px; border-radius: 50%; }

/* ---------- Book Ticket (single-screen flow) ---------- */
.book-screen { display: grid; grid-template-columns: 280px 1fr; gap: var(--s5); align-items: start; }
.book-controls .card { position: sticky; top: calc(var(--topbar-h) + 16px); overflow: hidden; }
.book-mode-head { background: var(--brand); padding: 6px; }
.book-mode { width: 100%; background: transparent; border: 0; color: #fff; font-family: var(--display); font-weight: 700; font-size: 14px; padding: 6px 8px; cursor: pointer; -webkit-appearance: none; appearance: none; }
.book-mode option { color: var(--ink); }
.book-main { min-width: 0; }
.dest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.dest-btn { text-align: left; padding: 11px 13px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface); font-size: 13px; font-weight: 500; color: var(--ink-2); cursor: pointer; transition: all .14s ease; }
.dest-btn:hover { border-color: var(--brand); color: var(--brand-700); background: var(--brand-soft); }
.dest-btn.hot { font-weight: 700; color: var(--ink); }
.book-crumbrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.book-flow { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--s5); align-items: start; }
.book-side { min-width: 0; }
.trip-banner { background: var(--brand); color: #fff; font-weight: 700; font-size: 13px; padding: 12px 16px; }
.trip-row { cursor: pointer; }
.trip-row:hover td { background: var(--brand-soft); }
.trip-row.sel td { background: var(--brand-soft); }
.radio { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--muted-2); vertical-align: middle; }
.radio.on { border-color: var(--brand); background: radial-gradient(circle at center, var(--brand) 0 3.5px, transparent 4.5px); }
.link-btn { background: none; border: 0; color: var(--info); font-weight: 600; font-size: 13px; cursor: pointer; text-decoration: underline; padding: 0; }
.side-h { font-family: var(--display); font-size: 13px; font-weight: 700; margin-bottom: 12px; color: var(--brand-700); text-transform: uppercase; letter-spacing: .03em; }
.td-list { display: grid; gap: 7px; margin-bottom: 14px; }
.td-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.td-row span { color: var(--muted); }
.td-row b { color: var(--ink); font-weight: 600; }
.td-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.det-grid { display: grid; grid-template-columns: auto 1fr; gap: 9px 12px; align-items: center; }
.det-grid label { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.det-grid .input { padding: 7px 10px; }
.det-grid .input[readonly] { background: var(--surface-2); color: var(--muted); }
.seat-legend2 { display: flex; flex-wrap: wrap; gap: 8px 12px; font-size: 11.5px; color: var(--muted); margin-bottom: 14px; }
.seat-legend2 span { display: inline-flex; align-items: center; gap: 5px; }
.sw2 { width: 13px; height: 13px; border-radius: 4px; }
.sw2.available { background: #e8f1fb; border: 1px solid #cfe0f0; }
.sw2.selected { background: var(--brand); }
.sw2.reserved { background: #16a34a; }
.sw2.online { background: #f97316; }
.sw2.purchased { background: #eab308; }
.sw2.closed { background: #94a3b8; }
.bdeck { margin-bottom: 14px; }
.bdeck-head { background: var(--brand); color: #fff; font-weight: 700; font-size: 12px; padding: 7px 12px; border-radius: var(--r-sm); text-align: center; margin-bottom: 10px; }
.bseat-grid { display: flex; flex-direction: column; gap: 8px; }
.bseat-row { display: flex; gap: 8px; justify-content: center; align-items: center; }
.bseat-aisle { width: 18px; flex: none; }
.bseat { width: 42px; height: 34px; border-radius: 7px; border: 1px solid transparent; font-size: 12px; font-weight: 700; cursor: pointer; display: grid; place-items: center; transition: transform .1s ease; }
.bseat:disabled { cursor: not-allowed; }
.bseat.available { background: #e8f1fb; border-color: #cfe0f0; color: var(--ink); }
.bseat.available:hover { border-color: var(--brand); transform: translateY(-1px); }
.bseat.selected { background: var(--brand); color: #fff; }
.bseat.reserved { background: #16a34a; color: #fff; }
.bseat.online { background: #f97316; color: #fff; }
.bseat.purchased { background: #eab308; color: #3a2f00; }
.bseat.closed { background: #94a3b8; color: #fff; }
.buy-row { display: flex; gap: 10px; margin-top: 16px; }
.buy-row .btn { flex: 1; }

/* Add / Edit record forms (in modal) */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .field { margin-bottom: 12px; }
.chk-list { max-height: 190px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 10px 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.chk-list .check { font-size: 12.5px; }
.modal:has(.form-grid), .modal:has(.chk-list) { max-width: 640px; }
.modal-body { max-height: 72vh; overflow-y: auto; }
@media (max-width: 560px) { .form-grid, .chk-list { grid-template-columns: 1fr; } }

/* Change Password — update details */
.pw-sep { margin: 18px 0 14px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--ink-2); }

/* Passenger Check-In — found ticket form */
.ci-grid { display: grid; grid-template-columns: 190px 1fr; gap: 10px 18px; align-items: center; margin-bottom: 18px; }
.ci-grid label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.ci-ro { font-size: 13.5px; color: var(--ink); }
@media (max-width: 640px) { .ci-grid { grid-template-columns: 1fr; gap: 3px 0; } .ci-grid label { margin-top: 8px; } }

/* Collect Ticket — detail logs + cancel form */
.log-lines { text-align: right; font-size: 12px; line-height: 1.55; color: var(--ink-2); display: grid; gap: 2px; max-width: 62%; }
.log-lines .muted { color: var(--muted); }
.cancel-warn { background: var(--danger); color: #fff; padding: 8px 12px; border-radius: var(--r-sm); font-size: 13px; font-weight: 600; }
.cancel-form { border-top: 1px solid var(--border); padding-top: 4px; }

/* Book Ticket — page 2 (dedicated booking page) */
.book-page2 { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--s5); align-items: start; }
.p2-side { position: sticky; top: calc(var(--topbar-h) + 16px); display: flex; flex-direction: column; }
.seat-area { display: flex; flex-direction: column; gap: 16px; }
.p2-seats .bseat { width: 46px; height: 38px; font-size: 13px; }

/* ---------- Responsive ---------- */
.sidebar.hidden { display: none; }
@media (max-width: 1100px) {
  .book-screen { grid-template-columns: 1fr; }
  .book-controls .card { position: static; }
  .book-flow, .book-page2 { grid-template-columns: 1fr; }
  .p2-side { position: static; }
}
@media (max-width: 900px) {
  .split, .split-wide { grid-template-columns: 1fr; }
}
@media (max-width: 1080px) {
  .g-4 { grid-template-columns: repeat(2, 1fr); }
  .g-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 50; width: 260px; box-shadow: var(--shadow-lg); transform: translateX(-100%); transition: transform .22s ease; display: flex; }
  .sidebar.open { transform: translateX(0); }
  .topbar-meta { display: none; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { display: none; }
}
@media (max-width: 720px) {
  .g-2, .g-3, .g-4 { grid-template-columns: 1fr; }
  .content { padding: var(--s4); }
  .booking-layout { grid-template-columns: 1fr !important; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
