/* ============================================================
   TRV RESTAURANT — OS MONITORING HUB (PHP)
   Theme: "Bento Box" — Dark mode, electric blue + magenta neon
   ============================================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-base: #0a0a12;
  --bg-surface: #14141f;
  --bg-surface-2: #1b1b2c;
  --border-light: #26263a;
  --border-med: #34344f;

  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --primary-light: #60a5fa;
  --primary-soft: rgba(59,130,246,.14);
  --primary-glow: rgba(59,130,246,.35);

  --gold: #ec4899;
  --gold-dark: #db2777;
  --gold-light: #f9a8d4;
  --gold-soft: rgba(236,72,153,.14);

  --accent-teal: #2dd4bf;
  --accent-rose: #f43f5e;
  --accent-green: #22c55e;

  --text-primary: #f4f4f9;
  --text-secondary: #a6a6c2;
  --text-muted: #6c6c88;

  --gray-100: #1c1c2c;
  --gray-200: #26263a;

  --shadow-sm: 0 2px 10px rgba(0,0,0,.35);
  --shadow-md: 0 10px 28px rgba(0,0,0,.45);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.55), 0 0 50px rgba(59,130,246,.08);
  --glow-blue: 0 0 0 1px var(--primary), 0 8px 30px rgba(59,130,246,.35);
  --glow-pink: 0 0 0 1px var(--gold), 0 8px 30px rgba(236,72,153,.3);

  --tint-blue: rgba(59,130,246,.14);
  --tint-pink: rgba(236,72,153,.10);
  --hero-grad: linear-gradient(120deg, #0f1730, #171025 55%, #200f28);
  --table-head-bg: #171726;
  --table-head-fg: var(--primary-light);
  --glass-bg: rgba(20,20,31,.85);
  --glass-bg-2: rgba(20,20,31,.6);
  --overlay-scrim: rgba(6,6,12,.92);
  --overlay-scrim-fg: #f4f4f9;

  --r-sm: 8px; --r-md: 14px; --r-lg: 20px; --r-xl: 26px;
  --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

[data-theme="light"] {
  --bg-base: #f5f6fb;
  --bg-surface: #ffffff;
  --bg-surface-2: #fbfbfe;
  --border-light: #e5e7f2;
  --border-med: #d3d6e6;

  --primary: #6d28d9;
  --primary-dark: #4c1d95;
  --primary-light: #8b5cf6;
  --primary-soft: #f1ecfe;
  --primary-glow: rgba(109, 40, 217, .18);

  --gold: #b8860f;
  --gold-dark: #8a6508;
  --gold-light: #a9760d;
  --gold-soft: #fbf3de;

  --accent-teal: #0d9488;
  --accent-rose: #be123c;
  --accent-green: #059669;

  --text-primary: #1e1b2e;
  --text-secondary: #5b5470;
  --text-muted: #938da7;

  --gray-100: #f1f1f8;
  --gray-200: #e7e6f2;

  --shadow-sm: 0 2px 8px rgba(40,30,80,.07), 0 1px 2px rgba(40,30,80,.05);
  --shadow-md: 0 8px 22px rgba(40,30,80,.10), 0 1px 3px rgba(40,30,80,.06);
  --shadow-lg: 0 18px 42px rgba(40,30,80,.14), 0 4px 10px rgba(40,30,80,.06);
  --glow-blue: 0 0 0 1px var(--primary), 0 8px 24px rgba(109,40,217,.20);
  --glow-pink: 0 0 0 1px var(--gold), 0 8px 24px rgba(184,134,15,.20);

  --tint-blue: rgba(109,40,217,.06);
  --tint-pink: rgba(184,134,15,.06);
  --hero-grad: linear-gradient(120deg, var(--primary-dark), var(--primary) 100%);
  --table-head-bg: var(--primary-soft);
  --table-head-fg: var(--primary-dark);
  --glass-bg: rgba(255,255,255,.78);
  --glass-bg-2: rgba(255,255,255,.6);
  --overlay-scrim: rgba(30,27,46,.85);
  --overlay-scrim-fg: #ffffff;
}

body {
  background:
    radial-gradient(circle at 12% -10%, var(--tint-blue), transparent 42%),
    radial-gradient(circle at 88% 0%, var(--tint-pink), transparent 40%),
    var(--bg-base);
  font-family: var(--font);
  color: var(--text-primary);
  height: 100vh; overflow: hidden;
  font-size: .875rem; font-weight: 500;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-med); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-light); }

/* ============================================================ SHELL */
/* Row layout: a fixed-width left sidebar (.topnav) beside the
   scrolling main content pane (.main). */
.shell { display: flex; flex-direction: row; height: 100vh; width: 100%; }

/* Left sidebar (module tabs) */
.topnav {
  display: flex; flex-direction: column; align-items: stretch; gap: 4px;
  padding: 18px 12px;
  background: var(--glass-bg); backdrop-filter: blur(10px);
  border-right: 1px solid var(--border-light); border-bottom: none;
  flex-shrink: 0; z-index: 20;
  position: relative; /* no longer sticky — it's a full-height column now */
  width: 264px; height: 100vh; overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin;
}
/* Violet gradient accent bar down the right edge of the sidebar, at 40% opacity */
.topnav::before {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, #8b5cf6, #a855f7, #c084fc);
  opacity: .4; pointer-events: none;
}

.sb-brand {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
  padding: 0 6px 16px; margin-bottom: 8px; border-right: none;
  border-bottom: 1px solid var(--border-light);
}
.sb-logo {
  width: 40px; height: 40px; border-radius: 11px; object-fit: contain;
  box-shadow: 0 0 0 1px var(--border-med), 0 4px 14px rgba(59,130,246,.2);
  flex-shrink: 0; background: #fff; padding: 3px;
}
.sb-brand-name { font-weight: 800; font-size: .84rem; color: var(--text-primary); letter-spacing: -.1px; line-height: 1.25; }
.sb-brand-sub {
  font-size: .6rem; font-weight: 700; letter-spacing: .3px;
  background: linear-gradient(90deg, var(--primary-light), var(--gold-light));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.sb-section {
  display: block; font-size: .64rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-muted); margin: 14px 8px 6px; flex-shrink: 0;
}

.sb-nav {
  display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 0;
  overflow-y: auto; overflow-x: hidden; scrollbar-width: none; flex: 1; min-height: 0;
}
.sb-nav::-webkit-scrollbar { display: none; }
.sb-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-sm);
  cursor: pointer; color: var(--text-secondary); font-weight: 600; font-size: .8rem;
  white-space: nowrap; flex-shrink: 0; transition: background .15s, color .15s; text-decoration: none;
  width: 100%;
}
.sb-item:hover { background: var(--primary-soft); color: var(--primary-light); }
.sb-item.active { background: linear-gradient(120deg, var(--primary), var(--gold) 150%); color: #fff; box-shadow: var(--glow-blue); }
.sb-item-icon { font-size: 1rem; width: 1.2em; text-align: center; flex-shrink: 0; }
.sb-item-label { overflow: hidden; text-overflow: ellipsis; }
.sb-badge {
  background: var(--gold-soft); color: var(--gold-light); font-size: .64rem; font-weight: 800;
  padding: 1px 7px; border-radius: 20px; border: 1px solid rgba(236,72,153,.35);
  margin-left: auto; flex-shrink: 0;
}
.sb-item.active .sb-badge { background: rgba(255,255,255,.22); color: #fff; border-color: transparent; }

/* "TRV Modules" grouped entry — Kitchen/Dining/Survey/Cafe/Cashier expand
   in place as an indented accordion, right under the trigger row, instead
   of a horizontal-bar flyout menu. */
.sb-group { position: relative; flex-shrink: 0; display: flex; flex-direction: column; }
.sb-group-trigger { gap: 8px; }
.sb-caret { font-size: .65rem; margin-left: auto; transition: transform .15s; color: var(--text-secondary); flex-shrink: 0; }
.sb-group-trigger.active .sb-caret { color: #fff; }
.sb-group-trigger.open .sb-caret { transform: rotate(180deg); }
.sb-group-trigger.has-active-child:not(.open) {
  background: var(--primary-soft); color: var(--primary-light);
}
.sb-dropdown {
  display: none; position: static; z-index: auto;
  min-width: 0; width: 100%; padding: 4px 0 2px; border-radius: 0;
  background: transparent; backdrop-filter: none;
  border: none; box-shadow: none;
  flex-direction: column; gap: 2px;
  margin-left: 14px; padding-left: 12px; border-left: 2px solid var(--border-light);
}
.sb-group-trigger.open + .sb-dropdown { display: flex; }
.sb-dropdown-item { width: 100%; justify-content: flex-start; font-size: .77rem; }
.sb-dropdown-item .sb-badge { margin-left: auto; }
.sb-dropdown-empty { padding: 10px 12px; font-size: .75rem; color: var(--text-secondary); line-height: 1.4; }

/* ---- Dashboard redesign (better viewing) ---- */
/* Lives in .topbar (structurally outside the scrolling .dash-inner), so it
   stays fixed in place and can never overflow or overlap dashboard content
   the way a sticky-inside-a-scroll-pane element could. */
.topbar-jumpnav {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0;
  overflow-x: auto; scrollbar-width: none; padding: 0 4px;
}
.topbar-jumpnav::-webkit-scrollbar { display: none; }
.topbar-jumpnav-group {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
  border: 1px solid var(--border-light); border-radius: 999px; padding: 4px 6px 4px 12px;
}
.topbar-jumpnav-label {
  font-size: .66rem; font-weight: 800; letter-spacing: .04em; color: var(--text-muted);
  flex-shrink: 0; white-space: nowrap;
}
.topbar-jumpnav a {
  flex-shrink: 0; font-size: .7rem; font-weight: 700; color: var(--text-secondary); text-decoration: none;
  padding: 5px 10px; border-radius: 999px; background: var(--gray-100); border: 1px solid var(--border-light);
  white-space: nowrap; transition: background .15s, color .15s;
}
.topbar-jumpnav a:hover { background: var(--primary-soft); color: var(--primary-light); }
@media (max-width: 860px) { .topbar-jumpnav { display: none; } }

.dash-group { margin-bottom: 26px; scroll-margin-top: 16px; }
.dash-group-label {
  font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-muted); margin: 0 0 10px 2px;
}
.dash-grid { display: grid; gap: 16px; }
.dash-grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.dash-grid-kpi { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.rpt-card { transition: box-shadow .15s; }
.rpt-card:hover { box-shadow: var(--shadow-md, 0 8px 20px rgba(0,0,0,.08)); }
.rpt-kpi-card { background: var(--bg-surface); border: 1px solid var(--border-light); border-radius: var(--r-md); overflow: hidden; }

.dash-filter-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  background: linear-gradient(150deg, var(--bg-surface), var(--bg-surface-2));
  border: 1px solid var(--border-light); border-radius: var(--r-md);
  padding: 12px 16px; margin: 2px 0 18px; box-shadow: var(--shadow-sm);
}
.dash-filter-bar::before {
  content: "⏷ Filter"; font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--primary-light); flex-shrink: 0; padding-right: 10px; margin-right: 2px;
  border-right: 1px solid var(--border-med);
}
.dash-filter-bar > .rpt-btn-ghost { margin-left: auto; flex-shrink: 0; }
@media (max-width: 700px) {
  .dash-filter-bar { padding: 10px 12px; }
  .dash-filter-bar::before { border-right: none; padding-right: 0; width: 100%; }
  .dash-filter-bar > .rpt-btn-ghost { margin-left: 0; }
}

.sb-footer, .topnav-account {
  display: flex; flex-direction: column; align-items: stretch; gap: 2px; flex-shrink: 0;
  margin-left: 0; margin-top: auto; padding-top: 10px; border: none;
  border-top: 1px solid var(--border-light);
}
.sb-home {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-sm);
  border: none; background: transparent; cursor: pointer; color: var(--text-secondary); font-weight: 700; font-size: .8rem;
  white-space: nowrap; text-decoration: none; width: 100%;
}
.sb-home:hover { background: var(--gold-soft); color: var(--gold-light); }

/* ============================================================ MAIN */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; min-height: 0; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 14px 26px;
  background: var(--glass-bg-2); border-bottom: 1px solid var(--border-light);
  position: sticky; top: 0; z-index: 15; flex-shrink: 0; /* stays pinned above the scrolling dashboard content */
}
/* Violet gradient accent bar across the very top of this bar too, at 40% opacity */
.topbar::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, #8b5cf6, #a855f7, #c084fc);
  opacity: .4; pointer-events: none;
}
.topbar-title h2 { font-size: 1.05rem; font-weight: 800; color: var(--text-primary); }
.topbar-title p { font-size: .72rem; color: var(--text-muted); }

/* ============================================================ DASHBOARD */
.dash-inner { padding: 24px 28px; overflow-y: auto; flex: 1; }
.hero {
  display: flex; align-items: center; gap: 18px; padding: 28px 30px; border-radius: var(--r-lg);
  background: var(--hero-grad);
  border: 1px solid var(--border-light);
  color: #fff; margin-bottom: 24px; box-shadow: var(--shadow-lg); position: relative; overflow: hidden;
}
.hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 85% 20%, var(--tint-pink), transparent 45%),
              radial-gradient(circle at 10% 90%, var(--tint-blue), transparent 45%);
}
.hero-icon { font-size: 2.2rem; filter: drop-shadow(0 0 14px rgba(255,255,255,.35)); position: relative; }
.hero-eyebrow { font-size: .7rem; font-weight: 800; letter-spacing: .16em; opacity: .8; text-transform: uppercase; position: relative; }
.hero-h1 { font-size: 1.65rem; font-weight: 800; letter-spacing: -.01em; position: relative; }
.hero-h1 em {
  font-style: normal;
  background: linear-gradient(90deg, var(--primary-light), var(--gold-light));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { font-size: .78rem; color: var(--text-secondary); margin-top: 3px; position: relative; }

.section-head { display: flex; align-items: center; gap: 12px; margin: 8px 0 14px; }
.section-head h3 { font-size: .92rem; font-weight: 800; color: var(--text-primary); white-space: nowrap; }
.section-line { flex: 1; height: 1px; background: linear-gradient(90deg, var(--border-med), transparent); }

/* ---- Bento grid: one featured tile, the rest fill in around it ---- */
.stats-row {
  display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 132px;
  grid-auto-flow: dense; gap: 14px; margin-bottom: 28px; perspective: 900px;
}
.stat-card {
  background: linear-gradient(150deg, var(--bg-surface), var(--bg-surface-2));
  border: 1px solid var(--border-light); border-radius: var(--r-md);
  padding: 16px; cursor: pointer; display: flex; flex-direction: column;
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s, border-color .25s;
  transform-style: preserve-3d; position: relative; overflow: hidden;
}
.stat-card:hover {
  transform: perspective(800px) rotateX(3deg) rotateY(-4deg) translateY(-4px);
  box-shadow: var(--glow-blue); border-color: var(--primary);
}
.stat-card:nth-child(4n+2):hover, .stat-card:nth-child(4n+4):hover { box-shadow: var(--glow-pink); border-color: var(--gold); }
.stat-card:first-child { grid-column: span 2; grid-row: span 2; }
.stat-card:first-child .stat-icon { font-size: 2.4rem; }
.stat-card:first-child .stat-num { font-size: 2.6rem; }
.stat-card:first-child .stat-label { font-size: .95rem; }
.stat-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.stat-icon { font-size: 1.4rem; filter: drop-shadow(0 0 10px var(--primary-glow)); }
.stat-arrow { color: var(--gold-light); font-weight: 800; }
.stat-num { font-size: 1.6rem; font-weight: 800; color: var(--text-primary); }
.stat-label { font-size: .8rem; font-weight: 700; margin-top: 2px; color: var(--text-primary); }
.stat-sub { font-size: .68rem; color: var(--text-muted); margin: 3px 0 10px; }
.stat-footer { display: flex; justify-content: space-between; font-size: .68rem; color: var(--gold-light); font-weight: 700;
  border-top: 1px dashed var(--border-med); padding-top: 8px; margin-top: auto; }

/* Reports */
.rpt-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px;
  background: var(--bg-surface); border: 1px solid var(--border-light); border-radius: var(--r-md); padding: 12px 16px; }
.rpt-ctrl-label { font-size: .72rem; font-weight: 700; color: var(--text-secondary); }
.rpt-date-input, .rpt-area-sel {
  border: 1px solid var(--border-med); border-radius: var(--r-sm); padding: 6px 10px; font-size: .78rem; color: var(--text-primary);
  background: var(--gray-100);
}
.rpt-btn {
  border: none; border-radius: var(--r-sm); padding: 7px 14px; font-size: .78rem; font-weight: 700; cursor: pointer;
  background: linear-gradient(120deg, var(--primary), var(--primary-dark)); color: #fff;
}
.rpt-btn:hover { filter: brightness(1.15); box-shadow: var(--glow-blue); }
.rpt-btn-ghost { background: var(--gray-100); color: var(--text-secondary); box-shadow: none; }
.rpt-btn-ghost:hover { background: var(--gray-200); filter: none; box-shadow: none; }
.rpt-btn-excel { background: linear-gradient(120deg, var(--gold), var(--gold-dark)); color: #fff; }

.rpt-card { background: var(--bg-surface); border: 1px solid var(--border-light); border-radius: var(--r-md);
  box-shadow: var(--shadow-sm); overflow: hidden; }
.rpt-card-hd { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--border-light); }
.rpt-card-hd h4 { font-size: .85rem; font-weight: 800; flex: 1; color: var(--text-primary); }
.rpt-card-badge { font-size: .68rem; font-weight: 700; color: var(--primary-light); background: var(--primary-soft);
  padding: 3px 10px; border-radius: 20px; }
.rpt-kpi-row { display: grid; gap: 10px; padding: 16px 18px; }
.rpt-kpi { text-align: center; padding: 10px; background: var(--gray-100); border-radius: var(--r-sm); border: 1px solid var(--border-light); }
.rpt-kpi-val { font-size: 1.15rem; font-weight: 800; color: var(--text-primary); }
.rpt-kpi-lbl { font-size: .65rem; color: var(--text-muted); font-weight: 700; margin-top: 2px; }

.rpt-tabs { display: flex; gap: 4px; margin-top: 14px; flex-wrap: wrap; }
.rpt-tab { border: 1px solid var(--border-light); border-bottom: none; background: var(--gray-100);
  padding: 9px 16px; border-radius: var(--r-sm) var(--r-sm) 0 0; font-size: .76rem; font-weight: 700;
  color: var(--text-secondary); cursor: pointer; }
.rpt-tab.active { background: var(--bg-surface); color: var(--primary-light); border-color: var(--border-light); }
.rpt-card-body { padding: 16px 18px; overflow-x: auto; }
.rpt-tab-panel table { width: 100%; border-collapse: collapse; font-size: .76rem; }
.rpt-tab-panel th { text-align: left; background: var(--primary-soft); color: var(--primary-light); padding: 8px 10px;
  font-weight: 800; white-space: nowrap; border-bottom: 2px solid var(--border-med); }
.rpt-tab-panel td { padding: 7px 10px; border-bottom: 1px solid var(--border-light); white-space: nowrap; color: var(--text-secondary); }
.rpt-tab-panel tr:hover td { background: var(--gray-100); }
.rpt-loading { text-align: center; padding: 30px; color: var(--text-muted); }

/* ============================================================ TABLE VIEW */
.tv-wrap { padding: 20px 26px; height: 100%; display: flex; flex-direction: column; }
.tbl-card { background: var(--bg-surface); border: 1px solid var(--border-light); border-radius: var(--r-md);
  box-shadow: var(--shadow-sm); flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.toolbar { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap; }
.search-box { display: flex; align-items: center; gap: 8px; background: var(--gray-100); border: 1px solid var(--border-light); border-radius: 20px;
  padding: 7px 14px; flex: 1; min-width: 180px; }
.search-box svg { color: var(--text-muted); }
.search-box input { border: none; background: transparent; outline: none; font-size: .8rem; flex: 1; color: var(--text-primary); }
.toolbar-filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
  padding-left: 14px; margin-left: 2px; border-left: 1px solid var(--border-med);
}
@media (max-width: 860px) {
  .toolbar-filters { padding-left: 0; margin-left: 0; border-left: none; border-top: 1px dashed var(--border-med);
    padding-top: 10px; margin-top: 4px; width: 100%; }
}
.flt-group {
  display: flex; flex-direction: row; align-items: center; gap: 8px;
}
.flt-label {
  font-size: .66rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  color: var(--text-muted); flex-shrink: 0;
}
/* Progressive enhancement: once a value other than the blank "All" option
   is chosen, tint the box and its label so an applied filter is visible
   at a glance. Browsers without :has() simply keep the neutral look. */
.flt-group:has(select.flt-sel option:checked:not([value=""])) .flt-label { color: var(--primary-light); }
.flt-sel {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  border: 1px solid var(--border-light); background-color: var(--bg-surface);
  border-radius: var(--r-sm); min-width: 132px;
  padding: 9px 30px 9px 14px; font-size: .8rem;
  font-weight: 600; color: var(--text-primary); cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-secondary) 50%),
    linear-gradient(135deg, var(--text-secondary) 50%, transparent 50%);
  background-position: calc(100% - 15px) center, calc(100% - 10px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.flt-sel:hover { border-color: var(--border-med); }
.flt-sel:focus { outline: none; border-color: var(--primary-light); box-shadow: var(--glow-blue); }
.flt-group:has(select.flt-sel option:checked:not([value=""])) .flt-sel {
  border-color: var(--primary); background-color: var(--primary-soft);
}
.flt-sel:focus { outline: none; }
.clear-filter-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--gray-100); border: 1px solid var(--border-light); color: var(--accent-rose);
  font-size: .72rem; font-weight: 700; cursor: pointer; padding: 7px 13px; border-radius: 999px;
  transition: background .15s, border-color .15s;
}
.clear-filter-btn:hover { background: var(--gray-200); border-color: var(--accent-rose); }
.link-tab { border: 1px solid var(--border-light); background: var(--gray-100); color: var(--text-secondary);
  border-radius: 999px; padding: 6px 16px; font-size: .76rem; font-weight: 700; cursor: pointer; }
.link-tab.active { background: var(--primary); color: #fff; border-color: transparent; }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.rec-chip { font-size: .72rem; color: var(--text-muted); background: var(--gray-100); padding: 6px 12px; border-radius: 20px; border: 1px solid var(--border-light); }
.rec-chip strong { color: var(--primary-light); }

.btn { border: none; border-radius: var(--r-sm); padding: 8px 16px; font-size: .78rem; font-weight: 700; cursor: pointer; }
.btn-primary { background: linear-gradient(120deg, var(--primary), var(--primary-dark)); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { filter: brightness(1.15); box-shadow: var(--glow-blue); }
.btn-gold { background: linear-gradient(120deg, var(--gold), var(--gold-dark)); color: #fff; }
.btn-gold:hover { filter: brightness(1.1); box-shadow: var(--glow-pink); }
.btn-ghost { background: var(--gray-100); color: var(--text-secondary); border: 1px solid var(--border-light); }
.btn-ghost:hover { background: var(--gray-200); }
.btn-success { background: var(--accent-green); color: #fff; }
.btn-danger { background: var(--accent-rose); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: .7rem; }

.tbl-wrap { flex: 1; overflow: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: .76rem; }
table.data-table th { position: sticky; top: 0; background: var(--table-head-bg); color: var(--table-head-fg);
  text-align: left; padding: 9px 12px; font-weight: 800; white-space: nowrap; z-index: 2; border-bottom: 2px solid var(--border-med); }
table.data-table td { padding: 8px 12px; border-bottom: 1px solid var(--border-light); white-space: nowrap; color: var(--text-secondary); }
table.data-table tr:hover td { background: var(--gray-100); color: var(--text-primary); }
table.data-table th:last-child, table.data-table td:last-child { text-align: center; }
table.data-table td.row-actions { vertical-align: middle; }
.row-actions { display: flex; gap: 6px; white-space: nowrap; max-width: none; justify-content: center; align-items: center; }
.icon-btn { border: 1px solid var(--border-light); background: var(--gray-100); border-radius: 6px; width: 26px; height: 26px; cursor: pointer; font-size: .75rem; }
.icon-btn.edit:hover { background: var(--primary-soft); border-color: var(--primary); }
.icon-btn.del:hover { background: rgba(244,63,94,.14); border-color: var(--accent-rose); }
/* Card view (Sep 2026): same buttons as the table's row-actions, but with
   a visible text label next to the icon — the table stays icon-only since
   its column is narrow, but a card has room to spell the action out. */
.icon-btn-labeled { width: auto; height: auto; display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; font-size: .8rem; font-weight: 600; color: var(--text-primary); }
.icon-btn-labeled span { font-size: .8rem; }
.empty-row td { text-align: center; padding: 40px; color: var(--text-muted); }

.pg-bar { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 12px; border-top: 1px solid var(--border-light); }
.pg-btn { border: 1px solid var(--border-med); background: var(--gray-100); border-radius: var(--r-sm); padding: 5px 11px; font-size: .74rem;
  cursor: pointer; font-weight: 700; color: var(--text-secondary); }
.pg-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pg-btn:disabled { opacity: .4; cursor: default; }

/* ============================================================ MODAL */
.modal-bg { position: fixed; inset: 0; background: rgba(4,4,10,.7); display: none; align-items: center; justify-content: center;
  z-index: 100; backdrop-filter: blur(3px); }
.modal-bg.visible { display: flex; }
.modal { background: var(--bg-surface); border: 1px solid var(--border-light); border-radius: var(--r-lg); width: 95%; max-width: 1240px; max-height: 92vh; display: flex;
  flex-direction: column; box-shadow: var(--shadow-lg); position: relative; overflow: hidden; }
.modal-hd { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border-light);
  background: linear-gradient(120deg, var(--tint-blue), var(--tint-pink)); }
.modal-hd-icon { font-size: 1.4rem; }
.modal-hd h3 { font-size: 1rem; font-weight: 800; color: var(--text-primary); flex: 1; }
.modal-hd h3 small { display: block; font-size: .68rem; font-weight: 600; color: var(--text-muted); }
.modal-close { border: 1px solid var(--border-light); background: var(--gray-100); color: var(--text-secondary); border-radius: 8px; width: 30px; height: 30px; cursor: pointer; }
.modal-body { padding: 20px 22px; overflow-y: auto; flex: 1; }
.val-banner { display: none; background: rgba(244,63,94,.12); border: 1px solid rgba(244,63,94,.4); color: var(--accent-rose); font-size: .76rem;
  font-weight: 700; padding: 9px 14px; border-radius: var(--r-sm); margin-bottom: 14px; }
.val-banner.visible { display: block; }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 18px; }
@media (min-width: 1000px) {
  .form-grid { grid-template-columns: repeat(4, 1fr); gap: 16px 22px; }
}
.fsec { grid-column: 1 / -1; font-size: .72rem; font-weight: 800; color: var(--gold-light); text-transform: uppercase;
  letter-spacing: .06em; margin-top: 10px; padding-bottom: 4px; border-bottom: 1px solid var(--border-light); }
.fsec:first-child { margin-top: 0; }
.fg { display: flex; flex-direction: column; gap: 5px; }
.fg.wide { grid-column: span 2; }
.fg.full { grid-column: 1 / -1; }
.fg label { font-size: .72rem; font-weight: 700; color: var(--text-secondary); }
.fg input, .fg select, .fg textarea {
  border: 1px solid var(--border-med); border-radius: var(--r-sm); padding: 8px 10px; font-size: .8rem;
  font-family: inherit; color: var(--text-primary); background: var(--gray-100);
}
.fg input:focus, .fg select:focus, .fg textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.fg.has-error input, .fg.has-error select { border-color: var(--accent-rose); background: rgba(244,63,94,.08); }
.field-hint { font-size: .65rem; color: var(--text-muted); font-weight: 500; }
.fg input:disabled, .fg select:disabled, .fg textarea:disabled, .ssel-input:disabled {
  opacity: .55; cursor: not-allowed; background: var(--bg-inset, rgba(255,255,255,.03));
}
/* Auto-derived fields (e.g. BU Name, looked up from the Responsible Person's
   contact record) — visually distinct from a normal editable input so it's
   clear the value isn't meant to be typed in by hand. */
.fg input.readonly-field { background: var(--bg-inset, rgba(255,255,255,.05)); color: var(--text-secondary, var(--text-primary)); cursor: default; }

/* ============================================================ SEARCHABLE SELECT ("type to search" combobox) */
.ssel { position: relative; }
.ssel-input { width: 100%; box-sizing: border-box; cursor: text; }
.ssel-menu { display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 60;
  max-height: 220px; overflow-y: auto; background: var(--bg-surface); border: 1px solid var(--border-med);
  border-radius: var(--r-sm); box-shadow: var(--shadow-md); padding: 4px; }
.ssel.open .ssel-menu { display: block; }
.ssel-item { padding: 7px 9px; font-size: .8rem; color: var(--text-primary); cursor: pointer; border-radius: 6px; }
.ssel-item:hover, .ssel-item.active { background: var(--primary-soft); color: var(--primary-light); }
.ssel-item.sel { font-weight: 800; }
.ssel-empty { padding: 7px 9px; font-size: .76rem; color: var(--text-muted); }

/* Label row that also carries a small "＋ add new value" button */
.fg-label-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.fg-add-btn { border: none; background: var(--primary-soft); color: var(--primary-light); width: 18px; height: 18px;
  line-height: 16px; border-radius: 50%; font-size: .74rem; font-weight: 800; cursor: pointer; padding: 0; flex-shrink: 0; }
.fg-add-btn:hover { background: var(--primary); color: #fff; }
.consent-readout { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  background: var(--gray-100); border: 1px solid var(--border-light); border-radius: var(--r-sm); padding: 12px 14px; }
.consent-pill { font-size: .72rem; font-weight: 800; padding: 4px 10px; border-radius: 20px; }
.consent-pill.yes { background: rgba(34,197,94,.14); color: var(--accent-green); }
.consent-pill.no { background: rgba(244,63,94,.14); color: var(--accent-rose); }
.consent-channels, .consent-code { font-size: .74rem; color: var(--text-secondary); font-weight: 600; }
.consent-code { width: 100%; color: var(--text-muted); font-weight: 500; }
.rating-row { display: flex; gap: 6px; flex-wrap: wrap; }
.rating-row label { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .68rem; font-weight: 700;
  border: 1.5px solid var(--border-med); border-radius: var(--r-sm); padding: 7px 4px; cursor: pointer; flex: 1; min-width: 46px;
  transition: all .12s; color: var(--text-secondary); background: var(--gray-100); }
.rating-row label .rp-emoji { font-size: 1.3rem; line-height: 1; }
.rating-row input { width: auto; position: absolute; opacity: 0; pointer-events: none; }
.rating-row label:hover { border-color: var(--primary-light); background: var(--primary-soft); }
.rating-row label.picked { background: linear-gradient(135deg, var(--gold-soft), var(--gray-100)); border-color: var(--gold); color: var(--gold-light); box-shadow: 0 2px 12px rgba(236,72,153,.25); }

/* ============================================================ TOPBAR USER MENU */
.topbar-user { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.tb-user-chip { display: flex; align-items: center; gap: 8px; background: var(--gray-100); border: 1px solid var(--border-light); border-radius: 20px; padding: 6px 12px 6px 6px; }
.tb-user-avatar { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--gold));
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 800; }
.tb-user-name { font-size: .74rem; font-weight: 700; color: var(--text-primary); }
.tb-user-role { font-size: .62rem; color: var(--gold-light); font-weight: 800; text-transform: uppercase; }
.tb-link { font-size: .74rem; font-weight: 700; color: var(--primary-light); text-decoration: none; padding: 6px 10px; border-radius: var(--r-sm); }
.tb-link:hover { background: var(--primary-soft); }

/* ============================================================ PENDING SURVEY BADGE / SUBNAV */
.subnav { display: flex; gap: 8px; padding: 0 0 12px; }
.subnav-btn { border: 1px solid var(--border-med); background: var(--gray-100); padding: 8px 16px; border-radius: 20px; font-size: .78rem;
  font-weight: 700; color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; gap: 6px; }
.subnav-btn.active { background: linear-gradient(120deg, var(--primary), var(--gold) 150%); color: #fff; border-color: transparent; box-shadow: var(--glow-blue); }
.subnav-badge { background: var(--accent-rose); color: #fff; font-size: .65rem; font-weight: 800; padding: 1px 7px; border-radius: 10px; }
.subnav-btn.active .subnav-badge { background: rgba(255,255,255,.3); }

/* ============================================================ ADMIN / QR PAGES */
.page-wrap { padding: 24px 28px; overflow-y: auto; height: 100vh; }
.page-hd { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.page-hd h2 { font-size: 1.2rem; font-weight: 800; color: var(--text-primary); flex: 1; }
.qr-box { text-align: center; background: var(--bg-surface); border: 1px solid var(--border-light); border-radius: var(--r-md); padding: 24px; }
.qr-box img { border-radius: var(--r-sm); border: 6px solid #fff; box-shadow: var(--shadow-md); }
.module-chip { display: inline-block; background: var(--primary-soft); color: var(--primary-light); font-size: .68rem; font-weight: 700;
  padding: 2px 9px; border-radius: 12px; margin: 2px; }
.role-chip { font-size: .68rem; font-weight: 800; padding: 3px 10px; border-radius: 12px; text-transform: uppercase; }
.role-chip.admin { background: var(--gold-soft); color: var(--gold-light); }
.role-chip.user { background: var(--primary-soft); color: var(--primary-light); }
.role-chip.superadmin { background: linear-gradient(120deg, #7c3aed, #c9971f); color: #fff; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.status-dot.on { background: var(--accent-green); box-shadow: 0 0 8px rgba(34,197,94,.6); } .status-dot.off { background: var(--accent-rose); }
.checkbox-row { display: flex; flex-wrap: wrap; gap: 10px; }
.checkbox-row label { display: flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; background: var(--gray-100);
  border: 1px solid var(--border-light); padding: 7px 12px; border-radius: var(--r-sm); cursor: pointer; color: var(--text-secondary); }
.checkbox-row input { width: auto; }

.modal-ft { display: flex; align-items: center; justify-content: space-between; padding: 14px 22px;
  border-top: 1px solid var(--border-light); }
.req-legend { font-size: .68rem; color: var(--text-muted); }
.modal-ft-right { display: flex; gap: 10px; }

.saving-overlay { position: absolute; inset: 0; background: var(--overlay-scrim); display: none; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; z-index: 5; }
.saving-overlay.visible { display: flex; }
.spinner { width: 34px; height: 34px; border: 3px solid rgba(255,255,255,.25); border-top-color: var(--primary-light); border-radius: 50%;
  animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.saving-label { font-weight: 800; color: var(--overlay-scrim-fg); }
.saving-sub { font-size: .72rem; color: var(--overlay-scrim-fg); opacity: .7; }

/* ============================================================ CONFIRM */
.confirm-bg { position: fixed; inset: 0; background: rgba(4,4,10,.7); display: none; align-items: center; justify-content: center; z-index: 110; }
.confirm-bg.visible { display: flex; }
.confirm-box { background: var(--bg-surface); border: 1px solid var(--border-light); border-radius: var(--r-lg); padding: 28px; width: 92%; max-width: 380px; text-align: center;
  box-shadow: var(--shadow-lg); }
.confirm-icon-ring { width: 56px; height: 56px; border-radius: 50%; background: rgba(244,63,94,.14); display: flex; align-items: center;
  justify-content: center; font-size: 1.5rem; margin: 0 auto 14px; }
.confirm-box h3 { font-size: 1rem; font-weight: 800; margin-bottom: 8px; color: var(--text-primary); }
.confirm-box p { font-size: .8rem; color: var(--text-muted); margin-bottom: 18px; }
.confirm-actions { display: flex; gap: 10px; justify-content: center; }

/* ============================================================ TOAST */
#toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: linear-gradient(120deg, var(--primary-dark), var(--gold-dark));
  color: #fff; padding: 11px 22px; border-radius: 30px; font-size: .8rem; font-weight: 700; opacity: 0; pointer-events: none;
  transition: all .25s; z-index: 200; box-shadow: var(--shadow-lg); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================================ THEME TOGGLE */
#theme-toggle { font-size: .95rem; padding: 8px 10px; }

/* ============================================================ DROPDOWN LIST ADMIN */
.dd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.dd-card { background: var(--bg-surface); border: 1px solid var(--border-light); border-radius: var(--r-md);
  padding: 14px 16px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 10px; }
.dd-card-hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dd-card-hd h4 { font-size: .82rem; font-weight: 800; color: var(--text-primary); }
.dd-card-count { font-size: .64rem; font-weight: 700; color: var(--primary-light); background: var(--primary-soft);
  padding: 2px 8px; border-radius: 20px; }
.dd-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 26px; }
.dd-chip { display: flex; align-items: center; gap: 6px; background: var(--gray-100); border: 1px solid var(--border-light);
  color: var(--text-secondary); font-size: .72rem; font-weight: 600; padding: 4px 6px 4px 10px; border-radius: 20px; }
.dd-chip button { border: none; background: none; color: var(--accent-rose); cursor: pointer; font-size: .8rem;
  width: 16px; height: 16px; line-height: 1; border-radius: 50%; }
.dd-chip button:hover { background: rgba(244,63,94,.18); }
.dd-chip-empty { font-size: .72rem; color: var(--text-muted); font-style: italic; }
.dd-add-row { display: flex; gap: 6px; }
.dd-add-row input { flex: 1; border: 1px solid var(--border-med); border-radius: var(--r-sm); padding: 7px 10px;
  font-size: .76rem; background: var(--gray-100); color: var(--text-primary); }
.dd-add-row button { border: none; border-radius: var(--r-sm); padding: 7px 12px; font-size: .76rem; font-weight: 700;
  cursor: pointer; background: linear-gradient(120deg, var(--primary), var(--primary-dark)); color: #fff; }
.dd-add-row button:hover { filter: brightness(1.15); }
.dd-area-del { border: none; background: none; color: var(--text-muted); cursor: pointer; font-size: .72rem; font-weight: 700; }
.dd-area-del:hover { color: var(--accent-rose); }
@media (max-width: 900px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .stat-card:first-child { grid-column: span 2; grid-row: span 1; }
  .form-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .stats-row { grid-template-columns: 1fr; }
  .stat-card:first-child { grid-column: span 1; }
  .form-grid { grid-template-columns: 1fr; }
  .sb-brand-sub { display: none; }
}

/* ---- Sidebar → horizontal top bar on narrow / mobile screens ---- */
@media (max-width: 860px) {
  .shell { flex-direction: column; height: 100vh; }
  .topnav {
    flex-direction: row; align-items: center; gap: 10px;
    width: 100%; height: auto; max-height: none; overflow: visible;
    padding: 8px 12px;
    border-right: none; border-bottom: 1px solid var(--border-light);
    position: sticky; top: 0;
  }
  .topnav::before { top: 0; left: 0; right: 0; bottom: auto; width: auto; height: 4px; background: linear-gradient(90deg, #8b5cf6, #a855f7, #c084fc); }
  .sb-brand { padding: 0 16px 0 0; margin: 0 2px 0 0; border-bottom: none; border-right: 1px solid var(--border-light); }
  .sb-section { display: none; }
  .sb-nav {
    flex-direction: row; align-items: center; overflow-x: auto; overflow-y: hidden;
    flex: 1; min-width: 0;
  }
  .sb-item { width: auto; }
  .sb-group { flex-shrink: 0; }
  .sb-dropdown {
    display: none; position: fixed; z-index: 40;
    min-width: 200px; width: auto; padding: 6px; border-radius: var(--r-md);
    background: var(--card-bg, var(--glass-bg)); backdrop-filter: blur(10px);
    border: 1px solid var(--border-light); box-shadow: var(--shadow-md, 0 12px 28px rgba(0,0,0,.16));
    margin-left: 0; padding-left: 6px; border-left: none;
  }
  .sb-group-trigger.open + .sb-dropdown { display: flex; }
  .sb-footer, .topnav-account { flex-direction: row; align-items: center; margin-top: 0; margin-left: auto; padding-top: 0; border-top: none; }
  .sb-item.sb-home, .topnav-account .sb-item, .sb-home { width: auto; }
}

/* ============================================================
   AUTH SPLIT-SCREEN (Login / Sign Up / Forgot / Reset Password)
   Shared by login.php, signup.php, forgot_password.php,
   reset_password.php — one visual system, one place to tweak it.
   ============================================================ */
.auth-shell {
  min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr;
  background: var(--bg-base);
}
.auth-visual {
  position: relative; overflow: hidden; display: flex; flex-direction: column;
  justify-content: center; padding: 60px 56px;
  background: linear-gradient(155deg, var(--primary-dark), var(--primary) 55%, var(--gold-dark) 130%);
  color: #fff;
}
.auth-visual-glow { position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background: radial-gradient(circle at 20% 20%, rgba(255,255,255,.16), transparent 45%),
              radial-gradient(circle at 85% 80%, rgba(255,255,255,.12), transparent 50%); }
.auth-visual-content { position: relative; z-index: 1; max-width: 440px; }
.auth-visual-badge { display: inline-flex; align-items: center; gap: 8px; font-size: .7rem; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.3);
  border-radius: 999px; padding: 6px 14px; margin-bottom: 22px; }
.auth-visual h1 { font-size: 1.9rem; font-weight: 800; line-height: 1.25; margin: 0 0 14px; letter-spacing: -.3px; }
.auth-visual p.lead { font-size: .95rem; opacity: .9; line-height: 1.6; margin: 0 0 30px; }
.auth-feature-list { display: flex; flex-direction: column; gap: 16px; }
.auth-feature { display: flex; gap: 14px; align-items: flex-start; }
.auth-feature-icon { flex: none; width: 38px; height: 38px; border-radius: 12px; background: rgba(255,255,255,.16);
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem; border: 1px solid rgba(255,255,255,.25); }
.auth-feature-text strong { display: block; font-size: .85rem; font-weight: 700; margin-bottom: 2px; }
.auth-feature-text span { font-size: .78rem; opacity: .85; line-height: 1.45; }
.auth-orbits { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.auth-orbit { position: absolute; border: 1px dashed rgba(255,255,255,.18); border-radius: 50%; }
.auth-orbit.o1 { width: 340px; height: 340px; top: -90px; right: -110px; }
.auth-orbit.o2 { width: 220px; height: 220px; bottom: -60px; left: -60px; }
.auth-orbit-dot { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.55);
  box-shadow: 0 0 14px rgba(255,255,255,.6); animation: authOrbitSpin 14s linear infinite; }
@keyframes authOrbitSpin { from { transform: rotate(0deg) translateX(170px) rotate(0deg); } to { transform: rotate(360deg) translateX(170px) rotate(-360deg); } }

.auth-form-side { display: flex; align-items: center; justify-content: center; padding: 32px; position: relative; }
.auth-theme-toggle { position: absolute; top: 18px; right: 18px; }
.auth-form-wrap { width: 100%; max-width: 380px; }
.auth-form-logo { width: 120px; max-width: 60%; height: auto; display: block; margin: 0 auto 18px; }
.auth-form-title { font-size: 1.35rem; font-weight: 800; letter-spacing: -.2px; text-align: center; color: var(--text-primary); margin-bottom: 4px; }
.auth-form-sub { font-size: .78rem; color: var(--text-muted); text-align: center; margin-bottom: 26px; font-weight: 600; }
.auth-form-wrap .fg { text-align: left; margin-bottom: 14px; }
.auth-form-wrap label { font-size: .72rem; font-weight: 700; color: var(--text-secondary); display: block; margin-bottom: 5px; }
.auth-form-wrap input, .auth-form-wrap select { width: 100%; border: 1px solid var(--border-med); border-radius: var(--r-sm); padding: 10px 12px;
  font-size: .85rem; background: var(--gray-100); color: var(--text-primary); }
.auth-form-wrap input:focus, .auth-form-wrap select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.auth-submit-btn { width: 100%; margin-top: 8px; padding: 12px; font-weight: 800; letter-spacing: .01em; }
.auth-error, .auth-notice { border-radius: var(--r-sm); padding: 9px 12px; font-size: .76rem; font-weight: 700; margin-bottom: 14px; }
.auth-error { background: rgba(244,63,94,.12); border: 1px solid rgba(244,63,94,.35); color: var(--accent-rose); }
.auth-notice { background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.35); color: var(--accent-green, #22c55e); }
.auth-links { margin-top: 20px; text-align: center; font-size: .78rem; color: var(--text-muted); display: flex; flex-direction: column; gap: 8px; }
.auth-links a { color: var(--primary-light); text-decoration: none; font-weight: 700; }
.auth-links a:hover { text-decoration: underline; }

@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
}

/* ================================================================
   RECORD CARD VIEW (Sep 2026) — alternate to the dense data table,
   one card per record. Styled after a "Request #N" approval-card
   reference layout: header with code/name/submitted date + status
   badge, a compact label/value grid, and full-width remark blocks
   for longer free-text fields.
   ================================================================ */
.record-cards { display: flex; flex-direction: column; gap: 14px; }
.record-card { background: var(--bg-surface); border: 1px solid var(--border-light); border-radius: var(--r-md);
  padding: 18px 22px; box-shadow: var(--shadow-sm); }
.record-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  flex-wrap: wrap; margin: -18px -22px 14px; padding: 14px 22px 12px; border-bottom: 1px solid var(--border-light);
  background: rgba(124,58,237,.08); border-radius: var(--r-md) var(--r-md) 0 0; }
.rc-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.rc-title strong { font-size: .95rem; color: var(--text-primary); }
.rc-name { font-size: .85rem; color: var(--text-secondary); }
.rc-submitted { font-size: .74rem; color: var(--text-muted); }
.rc-badge { display: inline-flex; align-items: center; padding: 4px 14px; border-radius: 20px;
  font-size: .68rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; color: #fff; white-space: nowrap; }
.rc-badge-green  { background: #059669; }
.rc-badge-blue   { background: #2563eb; }
.rc-badge-orange { background: #d97706; }
.rc-badge-red    { background: #be123c; }
.rc-badge-purple { background: #9333ea; }
.rc-badge-gray   { background: #64748b; }
.record-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px 22px; }
.rc-field { min-width: 0; }
.rc-label { font-size: .66rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 3px; }
.rc-value { font-size: .83rem; color: var(--text-primary); font-weight: 600; word-break: break-word; }
.rc-remark-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.rc-remark-box { border-radius: 10px; padding: 12px 14px; border: 1px solid transparent; }
.rc-remark-issue { background: rgba(190,18,55,.06); border-color: rgba(190,18,55,.16); }
.rc-remark-solution { background: rgba(5,150,105,.07); border-color: rgba(5,150,105,.18); }
.rc-remark-plain { background: var(--gray-100); border-color: var(--border-light); margin-top: 14px; }
.rc-remark-text { font-size: .82rem; color: var(--text-secondary); font-style: italic; margin-top: 3px; white-space: pre-wrap; word-break: break-word; }
.record-card-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-light); }
.rc-empty { text-align: center; padding: 40px 20px; color: var(--text-muted); font-size: .85rem; }
@media (max-width: 640px) { .rc-remark-pair { grid-template-columns: 1fr; } }
