:root {
  --bg: #0B1120;
  --glass: rgba(30, 41, 59, 0.55);
  --glass-soft: rgba(148, 163, 184, 0.08);
  --glass-border: rgba(148, 163, 184, 0.18);
  --text: #F1F5F9;
  --muted: #94A3B8;
  --muted-2: #64748B;
  --accent: #22C55E;
  --accent-2: #16A34A;
  --grad: linear-gradient(135deg, #22C55E, #0ea5e9);
  --blue: #38BDF8;
  --danger: #F87171;
  --radius: 18px;
  --radius-sm: 12px;
  --sidebar-w: 248px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Fira Sans', system-ui, sans-serif;
  background: var(--bg); color: var(--text);
  font-size: 15px; line-height: 1.55; min-height: 100vh;
}
.mono, code, .table-glass td .mono { font-family: 'Fira Code', monospace; }
code { color: var(--blue); background: rgba(56,189,248,.1); padding: 1px 6px; border-radius: 6px; font-size: .85em; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* animated background mesh */
.bg-mesh {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(700px 500px at 12% 8%, rgba(34,197,94,.18), transparent 60%),
    radial-gradient(800px 600px at 88% 0%, rgba(56,189,248,.16), transparent 55%),
    radial-gradient(700px 700px at 75% 100%, rgba(167,139,250,.14), transparent 60%),
    var(--bg);
  animation: meshFloat 18s ease-in-out infinite alternate;
}
@keyframes meshFloat { from { filter: hue-rotate(0deg);} to { filter: hue-rotate(22deg);} }

/* ---------- glass primitive ---------- */
.glass {
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
}
.glass-soft { background: var(--glass-soft); border: 1px solid var(--glass-border); border-radius: var(--radius-sm); }

/* ---------- buttons ---------- */
.btn { font-weight: 600; border-radius: var(--radius-sm); transition: transform .06s, filter .18s, background-color .18s, border-color .18s; }
.btn:active { transform: translateY(1px); }
.btn-grad { background: var(--grad); color: #04210f; border: none; }
.btn-grad:hover { filter: brightness(1.08); color: #04210f; }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--glass-border); }
.btn-ghost:hover { color: var(--text); border-color: var(--muted); background: rgba(255,255,255,.04); }
.btn-icon { background: transparent; border: 1px solid var(--glass-border); color: var(--text); }
.btn-sm { font-size: 12.5px; padding: 4px 10px; }
.btn .spinner-border { width: 1rem; height: 1rem; }

/* ---------- forms ---------- */
.form-control, .form-select {
  background: rgba(11,17,32,.6); border: 1px solid var(--glass-border); color: var(--text);
  border-radius: var(--radius-sm);
}
.form-control:focus, .form-select:focus {
  background: rgba(11,17,32,.8); color: var(--text);
  border-color: var(--accent); box-shadow: 0 0 0 .2rem rgba(34,197,94,.2);
}
.form-control::placeholder { color: var(--muted-2); }
.form-label { font-size: 12.5px; color: var(--muted); margin-bottom: 5px; font-weight: 500; }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted-2); font-size: 13px; }
.input-icon .form-control { padding-left: 36px; }
.search-box { min-width: 200px; }

/* ---------- auth ---------- */
.auth-body { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.auth-wrap { width: 100%; max-width: 440px; }
.auth-card { padding: 34px 30px; }
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.auth-brand h1 { font-size: 19px; margin: 0; font-weight: 700; }
.auth-brand p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.brand-mark {
  width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 13px;
  background: var(--grad); color: #04210f; font-size: 20px;
  box-shadow: 0 6px 18px rgba(34,197,94,.35);
}
.auth-alt { text-align: center; margin: 16px 0 4px; font-size: 13.5px; color: var(--muted); }
.auth-hint { text-align: center; font-size: 12.5px; color: var(--muted-2); margin: 0; }

/* ---------- app shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w); z-index: 40;
  display: flex; flex-direction: column; padding: 20px 16px;
  border-radius: 0; border-left: none; border-top: none; border-bottom: none;
  margin: 12px; height: calc(100vh - 24px); border-radius: var(--radius);
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 18px; }
.sidebar-brand .brand-mark { width: 40px; height: 40px; font-size: 17px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 15px; }
.brand-text span { font-size: 11px; color: var(--muted); }
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--glass-border); }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--radius-sm);
  color: var(--muted); font-weight: 500; font-size: 14px; transition: background-color .16s, color .16s;
}
.nav-link:hover { background: rgba(255,255,255,.05); color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--grad); color: #04210f; font-weight: 600; }
.nav-link i { width: 18px; text-align: center; }

.main-col { flex: 1; margin-left: calc(var(--sidebar-w) + 24px); padding: 12px 24px 40px 0; min-width: 0; }
.topbar {
  position: sticky; top: 12px; z-index: 30; display: flex; align-items: center; gap: 14px;
  padding: 12px 18px; margin-bottom: 18px;
}
.page-title { font-size: 18px; font-weight: 600; margin: 0; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chip, .user-chip {
  font-size: 12.5px; color: var(--muted); border: 1px solid var(--glass-border);
  padding: 6px 12px; border-radius: 999px; white-space: nowrap;
}
.chip b { color: var(--accent); font-family: 'Fira Code', monospace; margin-left: 4px; }
.chip-btn { cursor: pointer; font: inherit; color: var(--muted); transition: border-color .15s, color .15s, background-color .15s; }
.chip-btn:hover { border-color: var(--accent); color: var(--text); background: rgba(34,197,94,.08); }
.chip-btn .add-ic { font-size: 10px; color: var(--accent); margin-left: 2px; }
.user-chip { color: var(--text); background: rgba(255,255,255,.05); }
.content { display: flex; flex-direction: column; gap: 18px; }

.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(2,6,23,.6); z-index: 35; }
@media (max-width: 992px) {
  .sidebar { transform: translateX(-110%); transition: transform .25s ease; }
  .sidebar.open { transform: none; }
  .sidebar-backdrop.show { display: block; }
  .main-col { margin-left: 0; padding: 12px 14px 40px; }
}

/* ---------- panels ---------- */
.panel { padding: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.panel-head h2 { font-size: 15.5px; margin: 0; font-weight: 600; display: inline-flex; align-items: center; gap: 9px; }
.panel-head h2 i { color: var(--accent); }
.muted-line { font-size: 12.5px; color: var(--muted); }

/* ---------- stat cards ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.stat-card {
  padding: 18px; display: flex; align-items: center; gap: 16px;
  transition: transform .2s, box-shadow .2s; animation: rise .4s ease both;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 14px 36px rgba(0,0,0,.45); }
@keyframes rise { from { opacity: 0; transform: translateY(10px);} to { opacity: 1; transform: none; } }
.stat-icon {
  width: 50px; height: 50px; flex: none; display: grid; place-items: center; border-radius: 14px;
  font-size: 20px; color: var(--accent, #22C55E);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
}
.stat-label { font-size: 12px; color: var(--muted); }
.stat-value { font-size: 26px; font-weight: 700; font-family: 'Fira Code', monospace; line-height: 1.1; }

/* ---------- tables ---------- */
.table-glass { color: var(--text); margin: 0; --bs-table-bg: transparent; }
.table-glass thead th {
  color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  font-weight: 600; border-bottom: 1px solid var(--glass-border); padding: 10px 12px; background: transparent;
}
.table-glass tbody td { border-bottom: 1px solid rgba(148,163,184,.1); padding: 12px; vertical-align: middle; background: transparent; color: var(--text); }
.table-glass tbody tr { transition: background-color .15s; }
.table-glass tbody tr:hover td { background: rgba(255,255,255,.03); }
.empty { text-align: center; color: var(--muted-2); padding: 22px; }

/* ---------- badges ---------- */
.badge-status { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.badge-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-good { color: #4ade80; background: rgba(34,197,94,.14); }
.badge-bad { color: #fca5a5; background: rgba(248,113,113,.14); }
.badge-unknown { color: var(--muted); background: rgba(148,163,184,.14); }
/* card payment sent to the bank, not settled yet — neither good nor bad */
.badge-pending { color: #fbbf24; background: rgba(251,191,36,.14); }
.role-pill { font-size: 11px; padding: 2px 9px; border-radius: 999px; background: rgba(148,163,184,.14); color: var(--muted); }
.role-pill.admin { color: var(--blue); background: rgba(56,189,248,.14); }
.blocked-pill { color: #fca5a5; background: rgba(248,113,113,.14); font-size: 11px; padding: 2px 9px; border-radius: 999px; }

/* ---------- stepper ---------- */
.stepper { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 22px; flex-wrap: wrap; }
.stepper li { display: inline-flex; align-items: center; gap: 8px; color: var(--muted-2); font-size: 12.5px; padding: 4px 10px; }
.stepper li span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: rgba(148,163,184,.12); border: 1px solid var(--glass-border); }
.stepper li.active { color: var(--text); }
.stepper li.active span { background: var(--grad); color: #04210f; border: none; }
.stepper li.done span { background: rgba(34,197,94,.18); color: var(--accent); border-color: rgba(34,197,94,.35); }
.stepper li em { font-style: normal; }

.step { animation: rise .25s ease; }
.step-actions { display: flex; gap: 10px; margin-top: 18px; }

/* ---------- booking grids ---------- */
.card-grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px,1fr)); gap: 12px; }
.pick-card {
  position: relative; text-align: left; cursor: pointer; padding: 14px; color: var(--text);
  background: var(--glass-soft); border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
  transition: border-color .15s, background-color .15s, transform .1s;
}
.pick-card:hover { border-color: var(--accent); background: rgba(34,197,94,.1); transform: translateY(-2px); }
.pick-card.active-pick { border-color: var(--accent); background: rgba(34,197,94,.16); box-shadow: 0 0 0 1px var(--accent) inset; }
.pick-card .pc-title { font-weight: 600; }
.pick-card .pc-sub { font-size: 12px; color: var(--muted); margin-top: 3px; font-family: 'Fira Code', monospace; }
.center-card { padding-right: 14px; }
.center-card .seats { display: inline-block; margin-top: 10px; }
.center-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.seats { font-size: 12px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.seats.low { color: #fbbf24; }

/* searchable occupation combobox */
.combo { position: relative; }
.combo-ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted-2); font-size: 13px; pointer-events: none; }
.combo #occ-input { padding-left: 36px; padding-right: 34px; }
.combo-clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: transparent; border: none; color: var(--muted); cursor: pointer; padding: 5px; border-radius: 6px; }
.combo-clear:hover { color: var(--text); background: rgba(255,255,255,.06); }
.combo-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 25;
  max-height: 300px; overflow-y: auto; padding: 6px;
  background: rgba(20, 30, 48, .96); backdrop-filter: blur(18px);
  border: 1px solid var(--glass-border); border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
.combo-menu::-webkit-scrollbar { width: 8px; }
.combo-menu::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 8px; }
.combo-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--text);
  transition: background-color .12s;
}
.combo-item:hover { background: rgba(34,197,94,.16); }
.combo-tag { font-size: 11px; color: var(--muted-2); white-space: nowrap; }
.combo-empty { padding: 12px; color: var(--muted-2); font-size: 13px; }
.sep { border-color: var(--glass-border); opacity: .4; margin: 22px 0 18px; }

/* date cards */
.date-card { padding-top: 12px; }
.dc-day { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: 2px; }

/* scrollable date grid (can hold ~200 dates) */
.dates-grid { max-height: 360px; overflow-y: auto; padding: 4px; margin: -4px; }
.dates-grid::-webkit-scrollbar { width: 8px; }
.dates-grid::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 8px; }
.dates-grid::-webkit-scrollbar-track { background: transparent; }

/* district chooser */
.sched-label { font-size: 13px; color: var(--muted); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.sched-label i { color: var(--accent); }
.sched-label b { color: var(--text); }
.count-pill { font-size: 11px; font-weight: 600; color: var(--accent); background: rgba(34,197,94,.14); padding: 1px 9px; border-radius: 999px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.district-chip {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  background: var(--glass-soft); border: 1px solid var(--glass-border); color: var(--text);
  padding: 9px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 500;
  transition: border-color .15s, background-color .15s, transform .08s;
}
.district-chip:hover { border-color: var(--accent); background: rgba(34,197,94,.1); transform: translateY(-1px); }
.district-chip.active { background: var(--grad); color: #04210f; border-color: transparent; }
.district-chip i { font-size: 12px; }
.dc-badge { font-size: 11px; font-weight: 700; background: rgba(0,0,0,.18); padding: 0 7px; border-radius: 999px; }
.district-chip.active .dc-badge { background: rgba(0,0,0,.22); }

/* low-credit top-up gate + add-credit modal */
.topup-card { text-align: center; padding: 40px 26px; }
.topup-icon {
  width: 68px; height: 68px; display: grid; place-items: center; border-radius: 20px;
  background: rgba(245,158,11,.14); color: #fbbf24; border: 1px solid rgba(245,158,11,.32);
  font-size: 28px; margin: 0 auto 16px;
}
.topup-title { font-size: 20px; font-weight: 700; margin: 0 0 8px; }
.topup-msg { color: var(--muted); max-width: 460px; margin: 0 auto 6px; }
.topup-msg b { color: var(--text); }
.topup-note { max-width: 460px; margin: 0 auto; }
.topup-balance { font-size: 24px; font-weight: 700; font-family: 'Fira Code', monospace; color: var(--accent); }
.topup-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }
.topup-actions .btn.disabled { opacity: .5; pointer-events: none; }
.modal-content .topup-icon { margin-bottom: 10px; }

/* reservation-credit option */
.credit-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 18px; border-radius: var(--radius-sm); margin-bottom: 4px;
  background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.3);
  animation: rise .25s ease;
}
.cb-title { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.cb-title i { color: var(--accent); }
.cb-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.cb-sub b { color: var(--accent); }
.or-divider { display: flex; align-items: center; text-align: center; color: var(--muted-2); font-size: 12px; margin: 16px 0; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; height: 1px; background: var(--glass-border); }
.or-divider span { padding: 0 12px; }

/* ---------- 3-D Secure verification step ---------- */
.verify-card { padding: 32px 28px; text-align: center; max-width: 420px; margin: 0 auto; animation: rise .3s ease; }
.verify-icon {
  width: 60px; height: 60px; display: grid; place-items: center; border-radius: 16px;
  background: rgba(56,189,248,.14); color: var(--blue); border: 1px solid rgba(56,189,248,.32);
  font-size: 24px; margin: 0 auto 14px;
}
.verify-title { font-size: 18px; font-weight: 700; margin: 0 0 6px; }
.verify-sub { color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.verify-card .step-actions { justify-content: center; }

/* ---------- payment summary / result ---------- */
.summary { padding: 16px; display: grid; gap: 8px; font-size: 13px; }
.summary .row2 { display: flex; justify-content: space-between; gap: 12px; }
.summary .row2 span { color: var(--muted); }
.summary .row2 b { font-weight: 600; }
.pay-note { font-size: 12.5px; color: var(--muted); }
.pay-note strong { color: var(--text); }
.result-card { padding: 22px; border-radius: var(--radius-sm); text-align: center; animation: rise .3s ease; }
.result-card .r-icon { font-size: 42px; margin-bottom: 10px; }
.result-card.success { background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.35); }
.result-card.success .r-icon { color: #4ade80; }
.result-card.failed { background: rgba(248,113,113,.12); border: 1px solid rgba(248,113,113,.35); }
.result-card.failed .r-icon { color: #fca5a5; }
.result-card h3 { margin: 0 0 6px; }
.result-card p { color: var(--muted); margin: 4px 0; }

/* ---------- modal ---------- */
.modal-content.glass { color: var(--text); }
.modal-content .modal-header, .modal-content .modal-footer { border-color: var(--glass-border); }
.nav-pills .nav-link { color: var(--muted); }
.nav-pills .nav-link.active { background: var(--grad); color: #04210f; }

/* ---------- toast ---------- */
.toast-host { position: fixed; right: 18px; bottom: 18px; z-index: 1080; display: flex; flex-direction: column; gap: 10px; }
.toast-msg {
  padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 500;
  background: var(--glass); backdrop-filter: blur(16px); border: 1px solid var(--glass-border);
  box-shadow: 0 8px 26px rgba(0,0,0,.4); animation: toastIn .25s ease; min-width: 220px;
}
.toast-msg.ok { border-left: 3px solid var(--accent); }
.toast-msg.err { border-left: 3px solid var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px);} to { opacity: 1; transform: none; } }

.adjust-btns { display: inline-flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }

/* reschedule wizard header (back button + context line) inside the tickets modal */
.resched-topline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.resched-topline .muted-line { flex: 1 1 auto; min-width: 0; }

/* icon-only action/download buttons on small screens, pinned to the visible
   edge of the table's horizontal scroll area so they're never hidden behind
   a scroll gesture the user doesn't know to make */
@media (max-width: 576px) {
  .adjust-btns .btn-txt { display: none; }
  .adjust-btns .btn-sm { padding: 6px 10px; }
  .modal-lg .table-glass thead th, .modal-lg .table-glass tbody td { padding: 8px 8px; }
  .table-glass thead th:last-child, .table-glass tbody td:last-child {
    position: sticky; right: 0; background: #16213a;
    box-shadow: -8px 0 10px -6px rgba(0,0,0,.45);
  }
}
