/* ============================================================
   MySpace Library — Self-Study Library Manager
   Stylesheet — light design system adapted from the team's
   Reference Design (React/shadcn build): Plus Jakarta Sans,
   blue primary, white cards on a soft slate background.
   ============================================================ */

:root {
  /* Palette (variable names kept stable so views.js needs no changes) */
  --ink: #F7F9FC;            /* page background (soft slate) */
  --panel: #FFFFFF;          /* cards / surfaces */
  --panel-hover: #F1F5F9;    /* hover surface */
  --border: #E2E8F0;         /* borders */
  --paper: #0F172A;          /* primary text (slate-900) */
  --paper-dim: #64748B;      /* muted text (slate-500) */
  --brass: #16A34A;          /* PRIMARY — green (brand; swapped from magenta 2026-07-22) */
  --sage: #C026D3;           /* accent/positive — magenta (swapped from green 2026-07-22) */
  --rust: #DC2626;           /* danger — red */
  --rust-bg: #FEE2E2;        /* danger background */
  --rust-text: #B91C1C;      /* danger text */
  --amber: #D97706;          /* warning — amber */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; max-width: 100%; }
body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--ink);
  color: var(--paper);
  min-height: 100vh;
}
/* Media never forces horizontal scroll on small screens */
img, video, iframe, table, pre { max-width: 100%; }
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 4px; }
a { color: var(--brass); }

/* ---------- Header (sticky, white, blurred — per reference) ---------- */
header {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px; border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(8px);
  flex-wrap: wrap; gap: 14px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-title { font-size: 19px; font-weight: 800; letter-spacing: -0.3px; }
.brand-sub { font-size: 11px; color: var(--paper-dim); letter-spacing: 0.6px; text-transform: uppercase; font-weight: 600; }
.brand-logo { width: 42px; height: 42px; border-radius: 10px; object-fit: cover; border: 1px solid var(--border); }
.header-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Pill tab navigation (muted track, active = white pill + blue text + shadow) */
nav { display: flex; gap: 4px; background: var(--panel-hover); padding: 4px; border-radius: 10px; }
.nav-btn {
  display: flex; align-items: center; gap: 6px; background: transparent; border: none;
  color: var(--paper-dim); padding: 8px 16px; border-radius: 8px; font-size: 13.5px; font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-btn:hover { color: var(--paper); }
.nav-btn.active { background: #FFFFFF; color: var(--brass); box-shadow: var(--shadow-sm); }

.btn-ghost-small {
  background: #FFFFFF; border: 1px solid var(--border); color: var(--paper);
  border-radius: 8px; padding: 7px 12px; font-size: 12.5px; font-weight: 600; white-space: nowrap;
  box-shadow: var(--shadow-sm); transition: background 0.15s ease, border-color 0.15s ease;
}
.btn-ghost-small:hover { background: var(--panel-hover); border-color: #CBD5E1; }
.view-pad { padding: 24px 24px 48px; }

/* ---------- Typography helpers ---------- */
.eyebrow {
  font-family: 'IBM Plex Mono', monospace; font-size: 12px; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--brass); margin-bottom: 14px; font-weight: 600;
}
.section-header-row { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-bottom: 14px; }
.section-header-label { font-size: 19px; font-weight: 800; letter-spacing: -0.3px; }
.section-header-count { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--paper-dim); }
.empty-note { color: var(--paper-dim); font-size: 13.5px; font-style: italic; padding: 10px 2px; }

/* ---------- Stat cards ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 30px; }
/* Front-desk quick-nav cards (Members / Expenses / Enquiries / Seats). Class-based
   (not inline) so the mobile 2x2 grid rule below can override the desktop flow. */
.quicknav-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
/* Profitability P&L: fit the full period comparison without horizontal scroll.
   Overrides the wide-table rule (.data-table { min-width: max-content }) so all
   6 period columns compress to the available width instead of scrolling. */
.pnl-table { min-width: 0 !important; width: 100%; font-size: 12px; }
.pnl-table th, .pnl-table td { padding: 6px 6px; }
.pnl-table th > div { line-height: 1.15; }
.stat-card {
  position: relative; background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 18px 18px 16px; text-align: left; overflow: hidden; width: 100%;
  box-shadow: var(--shadow-sm); transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-card-bar { position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.stat-label { font-size: 12.5px; color: var(--paper-dim); margin-bottom: 8px; font-weight: 500; }
.stat-value { font-size: 27px; font-weight: 800; letter-spacing: -0.5px; }

/* ---------- Dashboard rows / columns ---------- */
.dash-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
/* Website analytics: the date-range filter bar. Wraps naturally on desktop;
   on a phone the presets share the width evenly instead of spilling. */
.webfilter-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
/* ---------- Residential area picker ----------
   A combobox rather than a 99-option <select>: typing three letters beats
   scrolling, and the panel is absolutely positioned so it never pushes the
   form around as the list filters. */
/* ---------- Exam picker (multi-select, grouped, searchable) ---------- */
.exam-pick-panel {
  margin-top: 6px; border: 1px solid var(--border); border-radius: 10px;
  padding: 6px; background: var(--panel); box-shadow: var(--shadow-sm);
}
.exam-pick-list { max-height: 280px; overflow-y: auto; }
.exam-pick-group {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--paper-dim); padding: 9px 8px 4px; position: sticky; top: 0; background: var(--panel);
}
.exam-pick-opt {
  display: flex; align-items: center; gap: 9px; padding: 7px 8px;
  font-size: 13px; cursor: pointer; border-radius: 6px;
}
.exam-pick-opt:hover { background: var(--ink); }
.exam-pick-foot {
  font-size: 11px; color: var(--paper-dim); padding: 7px 8px 3px;
  border-top: 1px solid var(--border); margin-top: 4px;
}
@media (max-width: 720px) {
  .exam-pick-list { max-height: 50vh; }
  .exam-pick-opt { padding: 10px 8px; font-size: 14px; }
}

.area-picker { position: relative; }
/* position:FIXED, not absolute. The picker is used inside the member modal,
   whose body is `overflow-y:auto` so it can scroll — and an absolutely
   positioned panel is clipped by that scroll container, so the list simply
   never appeared and the field looked like a plain text box. Fixed takes it
   out of every ancestor's clipping context; areas.js sets left/top/width from
   the input's own rect on each open. */
.area-picker-panel {
  position: fixed; z-index: 4000;
  max-height: 260px; overflow-y: auto; background: var(--panel);
  border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-md); padding: 4px;
}
.area-picker-group {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--paper-dim); padding: 8px 10px 4px; position: sticky; top: 0; background: var(--panel);
}
.area-picker-opt { padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 13.5px; }
.area-picker-opt:hover, .area-picker-opt.active { background: var(--ink); }
.area-picker-other-opt { border-top: 1px solid var(--border); margin-top: 4px; color: var(--brass); font-weight: 600; }
.area-picker-empty { padding: 10px; font-size: 12.5px; color: var(--paper-dim); font-style: italic; }
@media (max-width: 720px) {
  /* Taller list on a phone: the on-screen keyboard already eats the viewport,
     so a short panel would show barely two options. */
  .area-picker-panel { max-height: 46vh; }
  .area-picker-opt { padding: 11px 10px; font-size: 14px; }
}
@media (max-width: 720px) {
  .webfilter-row { gap: 5px; }
  .webfilter-row button { flex: 1 1 auto; min-width: 0; }
}
.mock-score-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
/* Grid items must be able to shrink below their content width so the wide Rank Score
   tables scroll INSIDE each card instead of stretching the card past the screen. */
.mock-score-grid > div { min-width: 0; }
/* Revenue & growth: the breakdown panel beside the Monthly trend stretches to the full
   height of the left column (monthly chart + quarterly drill-down stacked together). */
.trend-side > .drill-panel { flex: 1; }
/* Chart maximize: a small control on every chart, and the full-screen overlay it opens. */
.chart-host { position: relative; }
.chart-max-btn {
  position: absolute; top: 4px; right: 4px; z-index: 4;
  width: 26px; height: 26px; padding: 0; line-height: 1; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--panel); color: var(--paper-dim);
  border: 1px solid var(--border); border-radius: 7px; cursor: pointer;
  box-shadow: var(--shadow-sm); opacity: 0.45; transition: opacity .15s ease, color .15s ease, border-color .15s ease;
}
.chart-host:hover .chart-max-btn { opacity: 1; }
.chart-max-btn:hover { color: var(--paper); border-color: var(--brass); }
#chartMaxOverlay {
  position: fixed; inset: 0; z-index: 2400; padding: 18px;
  background: rgba(15, 23, 42, 0.55);
  display: flex; align-items: center; justify-content: center;
}
#chartMaxOverlay .cmax-panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-md); width: min(1400px, 100%); max-height: 100%;
  display: flex; flex-direction: column; overflow: hidden;
}
#chartMaxOverlay .cmax-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
/* The chart is scaled to fit, so the body never scrolls — it just centres the stage. */
#chartMaxOverlay .cmax-body {
  padding: 16px; flex: 1; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
#chartMaxOverlay .cmax-stage { position: relative; }
#chartMaxOverlay .cmax-fit { position: absolute; top: 0; left: 0; }
#chartMaxOverlay .cmax-fit, #chartMaxOverlay .cmax-fit * { overflow: visible !important; }
/* The maximized copy is a static picture — nothing inside it should look clickable. */
#chartMaxOverlay .cmax-body [style*="cursor:pointer"] { cursor: default !important; }
@media (max-width: 640px) {
  #chartMaxOverlay { padding: 8px; }
  #chartMaxOverlay .cmax-body { padding: 10px 8px; }
  .chart-max-btn { opacity: 1; }
}
.offer-card { transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease; }
.offer-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #16A34A55; }
.dash-row { display: flex; justify-content: space-between; align-items: center; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 11px 14px; margin-bottom: 8px; box-shadow: var(--shadow-sm); }
.dash-row-click { transition: border-color .12s, box-shadow .12s, transform .12s; }
.dash-row-click:hover { border-color: var(--brass); box-shadow: 0 2px 8px rgba(0,0,0,.10); transform: translateY(-1px); }
.dash-row-click:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.dash-row-name { font-size: 14px; font-weight: 600; }
.dash-row-sub { font-size: 12.5px; color: var(--paper-dim); margin-top: 2px; }
.legend-row { display: flex; gap: 18px; margin-bottom: 18px; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--paper-dim); font-weight: 500; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* ---------- Seating ---------- */
.occupancy-track { height: 5px; background: var(--panel-hover); border-radius: 3px; margin-bottom: 12px; overflow: hidden; }
.occupancy-fill { height: 100%; background: var(--brass); border-radius: 3px; transition: width 0.3s ease; }
.seat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 8px; }
.seat-card {
  background: var(--panel); border: 1px solid var(--border); border-left: 3px solid #CBD5E1;
  border-radius: 8px; padding: 8px 9px; text-align: left; color: var(--paper);
  min-height: 64px; display: flex; flex-direction: column; gap: 4px; width: 100%;
  box-shadow: var(--shadow-sm); transition: border-color 0.15s ease;
}
.seat-card:hover { border-color: var(--brass); }
.seat-call-number { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; color: var(--paper-dim); margin-bottom: 2px; }
.seat-shift-row { display: flex; align-items: center; gap: 5px; font-size: 11px; }
.seat-shift-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.seat-shift-tag { font-family: 'IBM Plex Mono', monospace; font-size: 9.5px; color: var(--paper-dim); width: 16px; flex-shrink: 0; }
.seat-shift-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; font-weight: 600; }

/* ---------- Modals ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; overflow-y: auto;
}
.modal { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; width: 100%; max-width: 420px; margin: auto; box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.modal-title { font-size: 16.5px; font-weight: 700; letter-spacing: -0.2px; }
.modal-body { padding: 16px 18px 18px; }
.modal-line { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 6px; }
.modal-line-label { color: var(--paper-dim); }
.modal-actions { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Forms ---------- */
.label { display: block; font-size: 12px; color: var(--paper-dim); margin-bottom: 6px; margin-top: 12px; font-weight: 600; }
.input {
  width: 100%; background: #FFFFFF; border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 11px; color: var(--paper); font-size: 13.5px;
  transition: border-color 0.15s ease;
}
.input:hover { border-color: #CBD5E1; }
.input[readonly] { background: var(--panel-hover); }
.btn-primary {
  display: inline-flex; align-items: center; gap: 6px; background: var(--brass); color: #FFFFFF;
  border: none; border-radius: 8px; padding: 9px 18px; font-size: 13.5px; font-weight: 700;
  box-shadow: var(--shadow-sm); transition: background 0.15s ease;
}
.btn-primary:hover { background: #15803D; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-rust { background: #FFFFFF; color: var(--rust); border: 1px solid #FCA5A5; border-radius: 8px; padding: 9px 16px; font-size: 13.5px; font-weight: 600; }
.btn-rust:hover { background: var(--rust-bg); }
.icon-btn { background: transparent; border: none; color: var(--paper-dim); font-size: 18px; line-height: 1; }
.icon-btn-danger { background: transparent; border: none; color: var(--rust); font-size: 13px; font-weight: 600; }

/* ---------- Members ---------- */
.members-top-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; flex-wrap: wrap; gap: 10px; }
.search-wrap { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; flex: 1; max-width: 340px; box-shadow: var(--shadow-sm); }
.search-input { background: transparent; border: none; color: var(--paper); font-size: 13.5px; width: 100%; }
.member-list { display: flex; flex-direction: column; gap: 6px; }
.member-card { display: flex; justify-content: space-between; align-items: center; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 7px 13px; flex-wrap: wrap; gap: 8px; box-shadow: var(--shadow-sm); transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.member-card:hover { border-color: #86EFAC; box-shadow: var(--shadow-md); }
.member-name { font-size: 14px; font-weight: 700; margin-bottom: 1px; letter-spacing: -0.2px; }
.member-meta { display: flex; gap: 11px; font-size: 11px; color: var(--paper-dim); flex-wrap: wrap; align-items: center; }
.member-right { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.member-right .btn-ghost-small, .member-right .icon-btn-danger { padding: 3px 8px; font-size: 11px; }
.member-due { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--paper-dim); font-weight: 500; }
/* Desktop / laptop: keep every member card to a tight TWO-LINE info block (name row + meta row),
   never letting the identity or meta wrap onto extra lines. Mobile keeps its stacked layout. */
@media (min-width: 641px) {
  .member-card { flex-wrap: nowrap; align-items: center; }
  .member-card > div:first-child { flex: 1 1 auto; min-width: 0; }
  .member-name-row { flex-wrap: nowrap !important; overflow: hidden; }
  .member-name-row > div, .member-name-row > span { white-space: nowrap; }
  .member-name { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .member-meta { flex-wrap: nowrap; overflow: hidden; white-space: nowrap; }
  .member-right { flex: 0 0 auto; justify-content: flex-end; max-width: 44%; }
}
.pill { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.pill-sage { background: #FAE8FF; color: #A21CAF; }
.pill-amber { background: #FEF3C7; color: #B45309; }
.pill-rust { background: #FEE2E2; color: #B91C1C; }
.pill-brass { background: #DCFCE7; color: #15803D; }

/* ---------- Feedback ---------- */
.error-banner { display: flex; align-items: center; gap: 8px; background: var(--rust-bg); color: var(--rust-text); padding: 8px 24px; font-size: 13px; border-bottom: 1px solid #FCA5A5; }
/* Legacy hidden toast element (kept in the DOM; superseded by .toast-card). */
.toast { display: none; }

/* ---------- Notification popup cards ---------- */
#toastHost {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 1200; display: flex; flex-direction: column; gap: 10px;
  width: min(94vw, 400px); pointer-events: none;
}
.toast-card {
  pointer-events: auto; background: var(--panel, #fff);
  border: 1px solid var(--border, #E5E7EB); border-left: 4px solid var(--brass, #B45309);
  border-radius: 12px; box-shadow: 0 12px 34px rgba(15, 23, 42, 0.18);
  padding: 12px 14px; opacity: 0; transform: translateY(-10px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.toast-card.show { opacity: 1; transform: translateY(0); }
.toast-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.toast-card-title { font-weight: 800; font-size: 13.5px; letter-spacing: 0.2px; color: var(--ink, #111827); }
.toast-card-x { border: none; background: transparent; font-size: 20px; line-height: 1; cursor: pointer; color: var(--paper-dim, #9CA3AF); padding: 0 2px; }
.toast-card-x:hover { color: var(--ink, #111827); }
.toast-card-body { font-size: 13px; line-height: 1.5; color: var(--paper, #374151); }
.toast-success { border-left-color: #C026D3; }
.toast-success .toast-card-title { color: #A21CAF; }
.toast-error { border-left-color: #DC2626; }
.toast-error .toast-card-title { color: #B91C1C; }
.toast-info { border-left-color: var(--brass, #B45309); }

/* ---------- Data tables ---------- */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left; font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; letter-spacing: 0.6px;
  text-transform: uppercase; color: var(--paper-dim); border-bottom: 1px solid var(--border); padding: 9px 10px;
  background: var(--panel-hover); position: sticky; top: 0; font-weight: 600;
}
.data-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); color: var(--paper); vertical-align: top; }
.data-table tr:hover td { background: #F8FAFC; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; flex: 1; min-width: 0; background: var(--panel); box-shadow: var(--shadow-sm); }
.table-scroll-inner { max-height: 60vh; overflow-y: auto; }
.confirm-list { background: var(--panel-hover); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-top: 10px; font-size: 13px; color: var(--paper-dim); }
.confirm-list b { color: var(--paper); }

/* ---------- Sidebar layout (Users / Admin / Overview) ---------- */
.db-layout { display: flex; gap: 20px; align-items: flex-start; }
.db-sidebar { width: 190px; flex-shrink: 0; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 8px; box-shadow: var(--shadow-sm); }
.db-sidebar-item {
  display: block; width: 100%; text-align: left; background: transparent; border: none;
  color: var(--paper-dim); padding: 10px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 600; margin-bottom: 3px;
  transition: background 0.15s ease, color 0.15s ease;
}
.db-sidebar-item:hover { background: var(--panel-hover); color: var(--paper); }
.db-sidebar-item.active { background: #F0FDF4; color: var(--brass); }
.db-sidebar-item.sub { padding: 8px 12px 8px 26px; font-size: 12.5px; }
.db-sidebar-item .count { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--paper-dim); float: right; }
.db-content { flex: 1; min-width: 0; }

/* ---------- Overview hero (per reference landing page) ---------- */
.hero {
  background: linear-gradient(135deg, #F0FDF4 0%, #F7F9FC 70%);
  border: 1px solid var(--border); border-radius: 16px; padding: 40px 36px; margin-bottom: 30px;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid #86EFAC; background: #DCFCE7;
  color: #15803D; padding: 5px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600; margin-bottom: 18px;
}
.hero-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brass); }
.hero-title { font-size: 40px; font-weight: 800; letter-spacing: -1px; line-height: 1.12; margin: 0 0 14px; }
.hero-title span { color: var(--brass); }
.hero-sub { font-size: 16px; color: var(--paper-dim); line-height: 1.65; max-width: 640px; margin: 0 0 22px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 36px; align-items: center; }
.hero-ticks { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 24px; font-size: 13px; font-weight: 600; color: var(--paper-dim); }
.hero-ticks span { display: inline-flex; align-items: center; gap: 6px; }
.hero-media { position: relative; }
.hero-media img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 20px;
  box-shadow: 0 20px 45px rgba(22, 163, 74, 0.18); display: block;
}
.float-card {
  position: absolute; bottom: -18px; left: -18px; background: #FFFFFF; border: 1px solid var(--border);
  border-radius: 14px; padding: 12px 16px; box-shadow: var(--shadow-md);
  display: flex; align-items: center; gap: 12px;
}
.float-card-num {
  width: 46px; height: 46px; border-radius: 50%; background: #DCFCE7; color: var(--brass);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 17px;
}
.section-intro { text-align: center; max-width: 620px; margin: 0 auto 26px; }
.section-intro h2 { font-size: 31px; font-weight: 800; letter-spacing: -0.7px; margin: 0 0 8px; }
.section-intro p { font-size: 15px; color: var(--paper-dim); line-height: 1.6; margin: 0; }
@media (max-width: 760px) {
  .hero-title { font-size: 30px; }
  .hero { padding: 28px 22px; }
  .hero-grid { grid-template-columns: 1fr; }
  .float-card { left: 10px; bottom: 10px; }
}

/* ---------- Terms box (enrolment form) ---------- */
.terms-box {
  max-height: 240px; overflow-y: auto; background: var(--panel-hover); border: 1px solid var(--border);
  border-radius: 10px; padding: 4px 16px 12px; font-size: 12.5px; color: var(--paper-dim); line-height: 1.55;
}
.terms-box h3 { font-size: 14px; color: var(--paper); margin: 12px 0 4px; font-weight: 700; }
.terms-box h4 { font-size: 12px; color: var(--brass); margin: 12px 0 4px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; }
.terms-box p { margin: 6px 0; }
.terms-box ul { margin: 6px 0; padding-left: 18px; }
.terms-box li { margin-bottom: 3px; }
.terms-box b { color: var(--paper); }

/* ---------- Seat booking modal blocks ---------- */
.shift-block { background: var(--panel-hover); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.shift-block-title { font-size: 14px; font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.fullday-note { font-size: 12px; color: var(--paper-dim); font-style: italic; margin-top: 8px; }

/* ---------- Overview: testimonials & gallery ---------- */
.quote-card {
  background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--brass);
  border-radius: 12px; padding: 16px 18px; box-shadow: var(--shadow-sm);
}
.quote-text { font-size: 13.5px; line-height: 1.65; color: var(--paper); font-style: italic; }
.quote-who { margin-top: 10px; font-size: 12px; color: var(--brass); font-weight: 700; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.gallery-grid img { width: 100%; height: 150px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); display: block; box-shadow: var(--shadow-sm); }
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 26px; }

/* ---------- Overview: welcome collage (2×2) + value cards ---------- */
.welcome-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 30px; align-items: center; max-width: 1080px; }
.value-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.collage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.collage-grid img {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block;
  border-radius: 12px; border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.collage-grid img:hover { transform: scale(1.02); box-shadow: var(--shadow-md); }

/* ---------- Floating Enquiry button (opens the enquiry popup) ---------- */
.wa-float {
  position: fixed; z-index: 500;
  right: calc(18px + env(safe-area-inset-right, 0px));
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  min-height: 54px; border-radius: 999px; padding: 0 20px 0 15px;
  border: none; cursor: pointer;
  background: #25D366; display: flex; align-items: center; justify-content: center; gap: 9px;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.wa-float:hover { transform: scale(1.05); box-shadow: 0 8px 26px rgba(37, 211, 102, 0.55); }
.wa-float-label { color: #fff; font-weight: 700; font-size: 15px; font-family: inherit; letter-spacing: 0.2px; }

/* ---------- Responsive (tablet & mobile) ---------- */
@media (max-width: 900px) {
  .welcome-grid { grid-template-columns: 1fr; }
  /* Owner console: in column mode the content panel must STRETCH to the screen
     width. The base rule's align-items:flex-start otherwise makes .db-content
     shrink-wrap to its widest child (stat grid / table), pushing the whole
     page wider than the phone screen — the right-edge cut-off seen on mobile. */
  .db-layout { flex-direction: column; align-items: stretch; }
  .db-content { width: 100%; max-width: 100%; }
  .db-sidebar { width: 100%; display: flex; gap: 6px; flex-wrap: wrap; position: static !important; }
  .db-sidebar-item { margin-bottom: 0; width: auto; flex: 0 1 auto; }
  .db-sidebar-item .count { float: none; margin-left: 6px; }
  .db-sidebar-item.sub { padding: 8px 12px; }
  /* Wide tables (Database views, payment history) keep their real column widths
     and scroll horizontally inside .table-wrap instead of squishing to fit. */
  .data-table { min-width: max-content; max-width: none; }
  /* Tablets: lift the Enquiry button clear of any bottom system/browser bar. */
  .wa-float { bottom: calc(30px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 640px) {
  header { padding: 10px 14px; gap: 10px; }
  .brand-sub { display: none; }
  .brand-logo { width: 36px; height: 36px; }
  .header-right { width: 100%; justify-content: space-between; }
  nav { overflow-x: auto; max-width: 100%; }
  .nav-btn { padding: 8px 12px; white-space: nowrap; }
  .view-pad { padding: 14px 12px 80px; }
  .hero { padding: 22px 16px; }
  .hero-title { font-size: 27px; }
  .hero-sub { font-size: 14.5px; }
  .hero-actions .btn-primary, .hero-actions .btn-ghost-small { flex: 1 1 auto; justify-content: center; text-align: center; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  /* Quick-nav cards: force a clean 2x2 on phones (grid overrides the flex flow;
     min-width:0 defeats the .stat-card inline min-width so cells size evenly). */
  .quicknav-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .quicknav-row .stat-card { min-width: 0 !important; }
  .stat-value { font-size: 22px; }
  .section-header-label { font-size: 17px; }
  .section-intro h2 { font-size: 24px; }
  .value-cards { grid-template-columns: 1fr; }
  .dash-cols { grid-template-columns: 1fr; gap: 14px; }
  /* Mock-test Rank Score cards: stack one below another on phones. */
  .mock-score-grid { grid-template-columns: 1fr; gap: 14px; }
  .member-card { flex-direction: column; align-items: flex-start; }
  .member-right { width: 100%; justify-content: flex-start; }
  .members-top-row .search-wrap { max-width: 100%; }
  .modal { max-width: 100%; max-height: 92vh; overflow-y: auto; }
  .modal-actions .btn-primary, .modal-actions .btn-rust, .modal-actions .btn-ghost-small { flex: 1 1 auto; justify-content: center; text-align: center; }
  .data-table { font-size: 12px; }
  .data-table th, .data-table td { padding: 7px 8px; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid img { height: 120px; }
  .video-grid { grid-template-columns: repeat(2, 1fr); }
  .seat-grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
  /* Phones: lift the Enquiry button well clear of the mobile browser's bottom
     toolbar/URL bar. env(safe-area-inset-bottom) is 0 in a normal browser tab
     (only non-zero in installed/standalone mode), so we add a fixed lift too. */
  .wa-float {
    right: calc(14px + env(safe-area-inset-right, 0px));
    bottom: calc(78px + env(safe-area-inset-bottom, 0px));
    min-height: 50px; padding: 0 16px 0 12px;
  }
  .wa-float-label { font-size: 14px; }
  .toast { max-width: calc(100vw - 24px); text-align: center; }
}
/* Phones: the Enquiries and Staff & access tables become stacked "cards" so
   they fit the screen with no horizontal scrolling. Each cell shows its column
   name (from data-label) beside the value; the actions row spans full width. */
@media (max-width: 640px) {
  .enq-table, .staff-table { min-width: 0 !important; max-width: none; width: 100%; }
  .enq-table thead, .staff-table thead { display: none; }
  .enq-table tbody, .staff-table tbody,
  .enq-table tr, .staff-table tr,
  .enq-table td, .staff-table td { display: block; width: 100%; }
  .enq-table tr, .staff-table tr {
    border: 1px solid var(--border); border-radius: 10px;
    margin: 0 0 10px; padding: 4px 2px; background: var(--panel);
  }
  .enq-table tr:hover td, .staff-table tr:hover td { background: transparent; }
  .enq-table td, .staff-table td {
    border: none; padding: 7px 12px; white-space: normal;
    display: flex; gap: 12px; align-items: center; justify-content: space-between; text-align: right;
  }
  .enq-table td::before, .staff-table td::before {
    content: attr(data-label); flex: 0 0 40%; text-align: left;
    font-size: 11px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--paper-dim);
  }
  .staff-table td[data-label="Role"] select { width: auto; max-width: 60%; }
  .enq-table td.actions-cell, .staff-table td.actions-cell {
    flex-wrap: wrap; justify-content: flex-start; gap: 8px; text-align: left;
    border-top: 1px dashed var(--border); margin-top: 2px; padding-top: 10px; white-space: normal;
  }
  .enq-table td.actions-cell::before, .staff-table td.actions-cell::before { display: none; }
  .enq-table td.actions-cell .btn-ghost-small, .enq-table td.actions-cell .icon-btn-danger,
  .staff-table td.actions-cell .btn-ghost-small, .staff-table td.actions-cell .icon-btn-danger {
    flex: 1 1 auto; justify-content: center; text-align: center;
  }
  .enq-table td[colspan], .staff-table td[colspan] { text-align: center; }
  .enq-table td[colspan]::before, .staff-table td[colspan]::before { display: none; }
}
/* Receipt: in-page print fallback (the portal receipt opens its own print
   window, but this hides everything except the receipt if a user prints the tab). */
@media print {
  body * { visibility: hidden; }
  .receipt-modal, .receipt-modal * { visibility: visible; }
  .receipt-modal .no-print { display: none !important; }
  .modal-overlay { position: static; background: none; padding: 0; }
  .receipt-modal { box-shadow: none; border: none; max-width: 100%; }
}
/* Very small phones — keep the Enquiry button and forms comfortable */
@media (max-width: 420px) {
  .wa-float { min-height: 46px; padding: 0 14px 0 11px; bottom: calc(74px + env(safe-area-inset-bottom, 0px)); }
  .wa-float svg { width: 22px; height: 22px; }
  .wa-float-label { font-size: 13px; }
  .modal { padding: 16px 14px; }
  .db-content { padding: 0; }
}

/* ---------- Operation › Staff — employee registry ----------
   Upper half is a two-column split: the employee list (click a row for salary
   detail) beside role & access. Both panels scroll independently so the search
   and full table below stay reachable however long the team gets. */
.staff-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.staff-panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; box-shadow: var(--shadow-sm); min-width: 0;
}
.emp-list-scroll { max-height: 330px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding-right: 2px; }

/* One clickable employee row */
.emp-list-row {
  all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px 10px; border-radius: 9px; border: 1px solid transparent;
}
.emp-list-row:hover, .emp-list-row:focus-visible { background: var(--bg); border-color: var(--border); }
.emp-list-row:focus-visible { outline: 2px solid var(--accent, #16A34A); outline-offset: 1px; }
.emp-list-code { font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; color: var(--paper-dim); white-space: nowrap; }
.emp-list-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.emp-list-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.emp-list-sub { font-size: 11.5px; color: var(--paper-dim); }
.emp-list-right { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.emp-list-paid { font-size: 12.5px; font-weight: 600; color: var(--paper-dim); min-width: 62px; text-align: right; }

/* One role / access row */
.emp-access-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto auto;
  align-items: center; gap: 7px; padding: 7px 8px; border-radius: 9px;
}
.emp-access-row:hover { background: var(--bg); }

@media (max-width: 900px) {
  .staff-split { grid-template-columns: 1fr; gap: 12px; }
  .emp-list-scroll { max-height: 260px; }
  .emp-access-row { grid-template-columns: 1fr; gap: 5px; }
}
