/* ============================================================
   AQUINAS COLLEGE IMS V2 — DESIGN SYSTEM
   Comprehensive stylesheet for all wireframes
   ============================================================ */

/* ============================================================
   1. CSS CUSTOM PROPERTIES (BRAND TOKENS)
   ============================================================ */
:root {
  /* Brand — Aquinas Forest Green */
  --aq-green-50:  #ecf6ef;
  --aq-green-100: #cfe6d5;
  --aq-green-200: #a3cdaf;
  --aq-green-300: #6fae82;
  --aq-green-400: #408b58;
  --aq-green-500: #1f5430;
  --aq-green-600: #1a552e;
  --aq-green-700: #144424;
  --aq-green-800: #0f3a1f;
  --aq-green-900: #07291a;

  /* Brand — Heritage Gold */
  --aq-gold-50:  #fdf9e1;
  --aq-gold-100: #f9efa7;
  --aq-gold-200: #f1e26a;
  --aq-gold-300: #e8d544;
  --aq-gold-400: #d5be03;
  --aq-gold-500: #b8a402;
  --aq-gold-600: #8f7f01;

  /* Accents */
  --aq-coral:    #d6481b;
  --aq-saffron:  #f0a51f;
  --aq-sky:      #1d6fb8;
  --aq-claret:   #8b1d3f;

  /* Semantic */
  --color-success:    #2d7a45;
  --color-success-bg: #ecf6ef;
  --color-warning:    #b87708;
  --color-warning-bg: #fef5db;
  --color-error:      #b42332;
  --color-error-bg:   #fde8eb;
  --color-info:       #1d6fb8;
  --color-info-bg:    #e3effa;

  /* Neutrals */
  --neutral-0:   #ffffff;
  --neutral-50:  #fafaf9;
  --neutral-100: #f5f5f4;
  --neutral-200: #e7e5e4;
  --neutral-300: #d6d3d1;
  --neutral-400: #a8a29e;
  --neutral-500: #78716c;
  --neutral-600: #57534e;
  --neutral-700: #44403c;
  --neutral-800: #292524;
  --neutral-900: #1c1917;

  /* Surface tokens */
  --bg-base:       #ffffff;
  --bg-subtle:     #fafaf9;
  --bg-muted:      #f5f5f4;
  --bg-sidebar:    #1a552e;
  --surface-card:  #ffffff;
  --border-default:#e7e5e4;
  --border-strong: #d6d3d1;
  --text-primary:  #18181b;
  --text-secondary:#57534e;
  --text-muted:    #78716c;
  --text-onPrimary:#ffffff;

  /* Action */
  --primary:        #1a552e;
  --primary-hover:  #144424;
  --primary-active: #0f3a1f;
  --primary-text:   #ffffff;
  --secondary:      #d5be03;
  --focus-ring:     0 0 0 3px rgba(26,85,46,.35);

  /* Typography — Inter across the entire web app.
     Fraunces is reserved for the marketing website and is NOT used here. */
  --font-display: "Inter", system-ui, sans-serif;
  --font-body:    "Inter", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", monospace;

  /* Spacing (4pt grid) */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  24px;
  --space-6:  32px;
  --space-7:  48px;
  --space-8:  64px;
  --space-9:  96px;

  /* Radii */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   20px;
  --radius-pill: 9999px;

  /* Elevation */
  --shadow-xs: 0 1px 2px rgba(15,58,31,0.06);
  --shadow-sm: 0 2px 4px rgba(15,58,31,0.08), 0 1px 2px rgba(15,58,31,0.04);
  --shadow-md: 0 6px 16px rgba(15,58,31,0.10), 0 2px 4px rgba(15,58,31,0.06);
  --shadow-lg: 0 16px 40px rgba(15,58,31,0.14), 0 4px 8px rgba(15,58,31,0.06);

  /* Motion */
  --ease-out:       cubic-bezier(0.16,1,0.3,1);
  --duration-fast:  120ms;
  --duration-base:  200ms;
  --duration-slow:  320ms;
}

/* ----------------------------------------------------------------
   DARK MODE — inspired by CM admin console + brighter Aquinas green
   Primary accent is a luminous green (not gold) to keep the brand
   recognizable while meeting contrast on near-black surfaces.
   ----------------------------------------------------------------- */
html.dark {
  color-scheme: dark;

  /* Brand accent — bright luminous Aquinas green for dark surfaces */
  --aq-green-accent:      #3bd47d;
  --aq-green-accent-soft: #2fb96b;
  --aq-green-accent-glow: rgba(59, 212, 125, 0.25);

  /* Surfaces — near-black, layered greys matching CM shell */
  --bg-base:        #07090c;
  --bg-subtle:      #0b0f14;
  --bg-muted:       #111418;
  --bg-sidebar:     #0b0f14;
  --surface-card:   #111418;
  --surface-raised: #161a20;

  /* Borders & dividers */
  --border-default: rgba(255, 255, 255, 0.08);
  --border-strong:  rgba(255, 255, 255, 0.14);

  /* Text */
  --text-primary:   #f4f4f5;
  --text-secondary: #bababf;
  --text-muted:     #8a8b92;
  --text-onPrimary: #07090c;

  /* Actions — bright green replaces gold */
  --primary:        #3bd47d;
  --primary-hover:  #2fb96b;
  --primary-active: #26a45d;
  --primary-text:   #07090c;
  --secondary:      #a3f3c4;
  --focus-ring:     0 0 0 3px rgba(59, 212, 125, 0.35);

  /* Semantic */
  --color-success:    #3bd47d;
  --color-success-bg: rgba(59, 212, 125, 0.12);
  --color-warning:    #f4b740;
  --color-warning-bg: rgba(244, 183, 64, 0.12);
  --color-error:      #f06779;
  --color-error-bg:   rgba(240, 103, 121, 0.12);
  --color-info:       #5aa7ff;
  --color-info-bg:    rgba(90, 167, 255, 0.12);

  /* Dark-mode component tokens */
  --row-hover-dark:   rgba(255, 255, 255, 0.06);
  --row-stripe-dark:  rgba(255, 255, 255, 0.035);

  /* Surface-tinted accent bg variants */
  --aq-green-50:  rgba(59, 212, 125, 0.15);
  --aq-gold-50:   rgba(213, 190, 3, 0.15);
  --aq-coral-50:  rgba(214, 72, 27, 0.15);
  --aq-sky-50:    rgba(29, 111, 184, 0.15);
  --aq-claret-50: rgba(139, 29, 63, 0.15);

  /* Elevation — deeper shadows on black */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.6), 0 6px 12px rgba(0, 0, 0, 0.35);
}

/* ----------------------------------------------------------------
   GLOBAL SCROLLBAR — themed, narrow, branded hover
   ----------------------------------------------------------------- */
* { scrollbar-width: thin; scrollbar-color: var(--neutral-300) transparent; }
html.dark * { scrollbar-color: rgba(255, 255, 255, 0.18) transparent; }

*::-webkit-scrollbar        { width: 10px; height: 10px; }
*::-webkit-scrollbar-track  { background: transparent; }
*::-webkit-scrollbar-thumb  {
  background: var(--neutral-300);
  border-radius: 6px;
  border: 2px solid var(--bg-base);
  transition: background var(--duration-base) var(--ease-out);
}
*::-webkit-scrollbar-thumb:hover { background: var(--primary); }

html.dark *::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border: 2px solid var(--bg-base);
}
html.dark *::-webkit-scrollbar-thumb:hover { background: var(--aq-green-accent); }
html.dark *::-webkit-scrollbar-corner { background: transparent; }

/* ============================================================
   2. RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  height: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.5;
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover { text-decoration: underline; }

img, svg { display: block; max-width: 100%; }

button { cursor: pointer; border: none; background: none; font-family: inherit; }

select, input, textarea {
  font-family: inherit;
  font-size: inherit;
}

ul, ol { list-style: none; }

h1,h2,h3,h4,h5,h6 {
  font-family: var(--font-display);
  line-height: 1.2;
  font-weight: 700;
  color: var(--text-primary);
}

/* ============================================================
   3. APP SHELL
   ============================================================ */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: var(--bg-subtle);
}

.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ============================================================
   4. SIDEBAR
   ============================================================ */
.sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width var(--duration-slow) var(--ease-out),
              min-width var(--duration-slow) var(--ease-out);
  position: relative;
  z-index: 100;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

.sidebar.collapsed {
  width: 64px;
  min-width: 64px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-4);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  min-height: 72px;
  overflow: hidden;
}

.sidebar-logo-mark {
  width: 36px;
  height: 36px;
  min-width: 36px;
  background: var(--aq-gold-400);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--aq-green-800);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.sidebar-logo-text {
  overflow: hidden;
  white-space: nowrap;
}

.sidebar-logo-text .brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: #ffffff;
  line-height: 1.2;
}

.sidebar-logo-text .brand-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar.collapsed .sidebar-logo-text { display: none; }

.sidebar-nav {
  flex: 1;
  padding: var(--space-4) 0;
}

.sidebar-nav-group {
  margin-bottom: var(--space-3);
}

.sidebar-nav-group-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.35);
  padding: var(--space-2) var(--space-4);
  white-space: nowrap;
  overflow: hidden;
}

.sidebar.collapsed .sidebar-nav-group-label {
  opacity: 0;
  height: 0;
  padding: 0;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  color: rgba(255,255,255,0.75);
  font-size: 14px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all var(--duration-base) var(--ease-out);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-decoration: none;
  position: relative;
}

.sidebar-nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: #ffffff;
  text-decoration: none;
}

.sidebar-nav-item.active {
  background: rgba(255,255,255,0.12);
  color: #ffffff;
  border-left-color: var(--aq-gold-400);
  font-weight: 600;
}

.sidebar-nav-item .icon {
  width: 18px;
  height: 18px;
  min-width: 18px;
  stroke-width: 1.75;
  flex-shrink: 0;
}

.sidebar-nav-item .nav-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar.collapsed .nav-label { display: none; }

.sidebar-footer {
  padding: var(--space-4);
  border-top: 1px solid rgba(255,255,255,0.1);
  overflow: hidden;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  overflow: hidden;
}

.sidebar-user .avatar {
  flex-shrink: 0;
}

.sidebar-user-info {
  overflow: hidden;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
}

.sidebar.collapsed .sidebar-user-info { display: none; }

/* Legacy chevron sidebar toggle — hidden (replaced by topbar hamburger) */
.sidebar-toggle { display: none !important; }

/* Unused historic rule retained for specificity */
.sidebar-toggle-legacy {
  position: absolute;
  top: 20px;
  right: -14px;
  width: 28px;
  height: 28px;
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  color: var(--text-secondary);
  transition: all var(--duration-base) var(--ease-out);
  z-index: 101;
}

.sidebar-toggle:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.sidebar-toggle .icon {
  width: 14px;
  height: 14px;
  stroke-width: 2;
  transition: transform var(--duration-base) var(--ease-out);
}

.sidebar.collapsed .sidebar-toggle .icon {
  transform: rotate(180deg);
}

/* ============================================================
   5. TOP BAR
   ============================================================ */
.topbar {
  height: 60px;
  background: var(--surface-card);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  padding: 0 var(--space-5);
  gap: var(--space-4);
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex: 1;
}

.topbar-mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
}

.topbar-mobile-toggle:hover {
  background: var(--bg-muted);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.breadcrumb-item {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.breadcrumb-item.current {
  color: var(--text-primary);
  font-weight: 600;
}

.breadcrumb-sep {
  color: var(--text-muted);
  width: 14px;
  height: 14px;
  stroke-width: 2;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.topbar-action-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  background: transparent;
  transition: all var(--duration-base) var(--ease-out);
  position: relative;
}

.topbar-action-btn:hover {
  background: var(--bg-muted);
  color: var(--text-primary);
}

.topbar-action-btn .icon {
  width: 18px;
  height: 18px;
  stroke-width: 1.75;
}

.notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  background: var(--aq-coral);
  border-radius: var(--radius-pill);
  border: 2px solid var(--surface-card);
}

.topbar-divider {
  width: 1px;
  height: 24px;
  background: var(--border-default);
}

/* ============================================================
   6. PAGE LAYOUT
   ============================================================ */
.page {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-5) var(--space-6);
  background: var(--bg-subtle);
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-5);
  gap: var(--space-4);
}

.page-title-block {}

.page-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.page-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

/* ============================================================
   7. CARDS
   ============================================================ */
.card {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-default);
  gap: var(--space-3);
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.card-body {
  padding: var(--space-5);
}

.card-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border-default);
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
}

/* ============================================================
   8. DATA TABLES
   ============================================================ */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  background: var(--surface-card);
  box-shadow: var(--shadow-xs);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table thead {
  background: var(--bg-muted);
  border-bottom: 1px solid var(--border-strong);
}

.data-table th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.data-table th.sortable {
  cursor: pointer;
  user-select: none;
}

.data-table th.sortable:hover {
  color: var(--text-primary);
}

.data-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-default);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: var(--bg-subtle);
}

.data-table tbody tr:nth-child(even) {
  background: rgba(0,0,0,0.015);
}

.data-table tbody tr:nth-child(even):hover {
  background: var(--bg-subtle);
}

.table-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Select all checkbox column */
.data-table .col-check {
  width: 40px;
  padding-left: var(--space-4);
}

/* ============================================================
   9. BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 8px var(--space-4);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  transition: all var(--duration-base) var(--ease-out);
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid transparent;
  font-family: var(--font-body);
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.btn .icon {
  width: 16px;
  height: 16px;
  stroke-width: 2;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-secondary {
  background: var(--secondary);
  color: var(--aq-green-800);
  border-color: var(--secondary);
}

.btn-secondary:hover {
  background: var(--aq-gold-500);
  border-color: var(--aq-gold-500);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-strong);
}

.btn-ghost:hover {
  background: var(--bg-muted);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-danger {
  background: var(--color-error-bg);
  color: var(--color-error);
  border-color: var(--color-error);
}

.btn-danger:hover {
  background: var(--color-error);
  color: white;
}

.btn-success {
  background: var(--color-success-bg);
  color: var(--color-success);
  border-color: var(--color-success);
}

.btn-success:hover {
  background: var(--color-success);
  color: white;
}

.btn-info {
  background: var(--color-info-bg);
  color: var(--color-info);
  border-color: var(--color-info);
}

.btn-info:hover {
  background: var(--color-info);
  color: white;
}

.btn-sm {
  padding: 5px var(--space-3);
  font-size: 12px;
}

.btn-sm .icon {
  width: 14px;
  height: 14px;
}

.btn-icon {
  padding: 8px;
  width: 36px;
  height: 36px;
}

.btn-icon.btn-sm {
  width: 30px;
  height: 30px;
  padding: 4px;
}

/* ============================================================
   10. BADGES / CHIPS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}

.badge-success {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.badge-warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.badge-error {
  background: var(--color-error-bg);
  color: var(--color-error);
}

.badge-info {
  background: var(--color-info-bg);
  color: var(--color-info);
}

.badge-neutral {
  background: var(--neutral-100);
  color: var(--neutral-600);
}

.badge-primary {
  background: var(--aq-green-50);
  color: var(--aq-green-600);
}

.badge-gold {
  background: var(--aq-gold-50);
  color: var(--aq-gold-600);
}

/* ============================================================
   11. FORMS
   ============================================================ */
.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.form-label.required::after {
  content: " *";
  color: var(--color-error);
}

.form-control {
  width: 100%;
  padding: 9px var(--space-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-body);
  transition: all var(--duration-base) var(--ease-out);
  appearance: none;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
}

.form-control::placeholder {
  color: var(--text-muted);
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.form-hint.error {
  color: var(--color-error);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.form-row.cols-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.form-row.cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* ============================================================
   12. TABS
   ============================================================ */
.tabs {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.tab-list {
  display: flex;
  border-bottom: 1px solid var(--border-default);
  background: var(--bg-muted);
  overflow-x: auto;
  scrollbar-width: none;
}

.tab-list::-webkit-scrollbar { display: none; }

.tab {
  padding: var(--space-3) var(--space-5);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--duration-base) var(--ease-out);
  background: transparent;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.tab:hover {
  color: var(--text-primary);
  background: rgba(0,0,0,0.04);
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: var(--surface-card);
  font-weight: 600;
}

.tab-panel {
  display: none;
  padding: var(--space-5);
}

.tab-panel.active {
  display: block;
}

/* ============================================================
   13. STAT CARDS
   ============================================================ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.stat-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.stat-grid.cols-5 { grid-template-columns: repeat(5, 1fr); }

.stat-card {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
  opacity: 0.6;
}

.stat-card.accent-gold::before { background: var(--aq-gold-400); }
.stat-card.accent-coral::before { background: var(--aq-coral); }
.stat-card.accent-sky::before { background: var(--aq-sky); }
.stat-card.accent-success::before { background: var(--color-success); }
.stat-card.accent-warning::before { background: var(--color-warning); }

.stat-icon-wrap {
  width: 40px;
  height: 40px;
  background: var(--aq-green-50);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  margin-bottom: var(--space-2);
}

.stat-icon-wrap .icon {
  width: 20px;
  height: 20px;
  stroke-width: 1.75;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-trend {
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.stat-trend.up   { color: var(--color-success); }
.stat-trend.down { color: var(--color-error); }

/* ============================================================
   14. QUICK TILE GRID
   ============================================================ */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.tile {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-4);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--duration-base) var(--ease-out);
  box-shadow: var(--shadow-xs);
}

.tile:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
  transform: translateY(-2px);
  text-decoration: none;
}

.tile-icon {
  width: 40px;
  height: 40px;
  background: var(--aq-green-50);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.tile-icon .icon {
  width: 20px;
  height: 20px;
  stroke-width: 1.75;
}

.tile-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.tile-desc {
  font-size: 11px;
  color: var(--text-muted);
}

/* ============================================================
   15. MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-base) var(--ease-out);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--surface-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(10px);
  transition: transform var(--duration-slow) var(--ease-out);
}

.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}

.modal-lg { max-width: 720px; }
.modal-xl { max-width: 900px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5);
  border-bottom: 1px solid var(--border-default);
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-display);
}

.modal-body {
  padding: var(--space-5);
}

.modal-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  background: var(--bg-subtle);
}

/* ============================================================
   16. ALERTS
   ============================================================ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-4);
  border-radius: var(--radius-md);
  font-size: 14px;
  margin-bottom: var(--space-4);
  border: 1px solid transparent;
}

.alert .icon {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  flex-shrink: 0;
  margin-top: 1px;
}

.alert-title {
  font-weight: 600;
  margin-bottom: 2px;
}

.alert-success {
  background: var(--color-success-bg);
  color: var(--color-success);
  border-color: rgba(45,122,69,0.25);
}

.alert-warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
  border-color: rgba(184,119,8,0.25);
}

.alert-error {
  background: var(--color-error-bg);
  color: var(--color-error);
  border-color: rgba(180,35,50,0.25);
}

.alert-info {
  background: var(--color-info-bg);
  color: var(--color-info);
  border-color: rgba(29,111,184,0.25);
}

/* ============================================================
   17. PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border-default);
  justify-content: space-between;
}

.pagination-info {
  font-size: 13px;
  color: var(--text-muted);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.page-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-base) var(--ease-out);
  border: 1px solid transparent;
}

.page-btn:hover {
  background: var(--bg-muted);
  color: var(--text-primary);
}

.page-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.page-btn .icon {
  width: 14px;
  height: 14px;
  stroke-width: 2;
}

/* ============================================================
   18. BREADCRUMB
   ============================================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.breadcrumb-item {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.breadcrumb-item:last-child {
  color: var(--text-primary);
  font-weight: 600;
}

.breadcrumb-item a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumb-item a:hover {
  color: var(--primary);
}

/* ============================================================
   19. SEARCH BAR
   ============================================================ */
.search-bar {
  position: relative;
  display: flex;
  align-items: center;
}

.search-bar .search-icon {
  position: absolute;
  left: var(--space-3);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  stroke-width: 2;
  pointer-events: none;
}

.search-bar .form-control {
  padding-left: 36px;
  min-width: 220px;
}

/* ============================================================
   20. AVATAR
   ============================================================ */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 12px;
  color: white;
  background: var(--primary);
  overflow: hidden;
  flex-shrink: 0;
}

.avatar-sm  { width: 28px; height: 28px; font-size: 11px; }
.avatar-md  { width: 36px; height: 36px; font-size: 13px; }
.avatar-lg  { width: 48px; height: 48px; font-size: 16px; }
.avatar-xl  { width: 64px; height: 64px; font-size: 22px; }

.avatar-gold     { background: var(--aq-gold-400); color: var(--aq-green-800); }
.avatar-sky      { background: var(--aq-sky); }
.avatar-coral    { background: var(--aq-coral); }
.avatar-saffron  { background: var(--aq-saffron); color: var(--aq-green-800); }

/* ============================================================
   21. TOGGLE / SWITCH
   ============================================================ */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.toggle {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--neutral-300);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background var(--duration-base) var(--ease-out);
}

.toggle-track::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: var(--radius-pill);
  top: 3px;
  left: 3px;
  transition: transform var(--duration-base) var(--ease-out);
  box-shadow: var(--shadow-xs);
}

.toggle input:checked + .toggle-track {
  background: var(--primary);
}

.toggle input:checked + .toggle-track::after {
  transform: translateX(18px);
}

.toggle-label {
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
}

/* ============================================================
   22. STEPPER
   ============================================================ */
.stepper {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: var(--space-6);
  overflow-x: auto;
  scrollbar-width: none;
}

.stepper::-webkit-scrollbar { display: none; }

.step {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 100px;
}

.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  background: var(--neutral-200);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  transition: all var(--duration-base) var(--ease-out);
}

.step-connector {
  flex: 1;
  height: 2px;
  background: var(--neutral-200);
  transition: background var(--duration-base) var(--ease-out);
}

.step-label-wrap {
  display: none;
}

.step-row {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin-bottom: var(--space-6);
}

.step-full {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  gap: var(--space-2);
  position: relative;
}

.step-full:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 16px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--neutral-200);
  z-index: 0;
}

.step-full.complete::after { background: var(--primary); }

.step-full .step-indicator { z-index: 1; }

.step-full.complete .step-indicator {
  background: var(--primary);
  color: white;
}

.step-full.active .step-indicator {
  background: var(--primary);
  color: white;
  box-shadow: 0 0 0 4px rgba(26,85,46,0.2);
}

.step-full .step-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
}

.step-full.active .step-name, .step-full.complete .step-name {
  color: var(--primary);
  font-weight: 600;
}

/* ============================================================
   23. PROGRESS BAR
   ============================================================ */
.progress {
  width: 100%;
  height: 8px;
  background: var(--neutral-200);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-pill);
  transition: width var(--duration-slow) var(--ease-out);
}

.progress-bar.gold   { background: var(--aq-gold-400); }
.progress-bar.coral  { background: var(--aq-coral); }
.progress-bar.sky    { background: var(--aq-sky); }

/* ============================================================
   24. EMPTY STATE
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-9) var(--space-6);
  text-align: center;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  background: var(--bg-muted);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

.empty-state-icon .icon {
  width: 32px;
  height: 32px;
  stroke-width: 1.5;
}

.empty-state-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.empty-state-desc {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 360px;
  margin-bottom: var(--space-4);
}

/* ============================================================
   25. CHART PLACEHOLDER
   ============================================================ */
.chart-placeholder {
  background: var(--bg-subtle);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-5);
  position: relative;
  overflow: hidden;
}

.chart-placeholder-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Simulated CSS bar chart */
.css-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 80px;
  padding: 0 var(--space-2);
}

.css-bar {
  flex: 1;
  background: var(--aq-green-200);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: height var(--duration-slow) var(--ease-out);
  min-width: 12px;
}

.css-bar:nth-child(1)  { height: 45%; }
.css-bar:nth-child(2)  { height: 65%; }
.css-bar:nth-child(3)  { height: 55%; }
.css-bar:nth-child(4)  { height: 80%; }
.css-bar:nth-child(5)  { height: 70%; }
.css-bar:nth-child(6)  { height: 90%; }
.css-bar:nth-child(7)  { height: 75%; }
.css-bar:nth-child(8)  { height: 60%; }
.css-bar:nth-child(9)  { height: 85%; }
.css-bar:nth-child(10) { height: 72%; }
.css-bar:nth-child(11) { height: 88%; }
.css-bar:nth-child(12) { height: 95%; }

.css-bar.highlight { background: var(--primary); }

/* Simulated line chart */
.css-line-chart {
  width: 100%;
  height: 80px;
  position: relative;
}

.css-line-chart svg {
  width: 100%;
  height: 100%;
}

/* ============================================================
   26. TIMELINE
   ============================================================ */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline-item {
  display: flex;
  gap: var(--space-4);
  position: relative;
  padding-bottom: var(--space-4);
}

.timeline-item:not(:last-child) .timeline-dot::after {
  content: "";
  position: absolute;
  top: 24px;
  left: 11px;
  width: 2px;
  height: calc(100% - 12px);
  background: var(--border-default);
}

.timeline-dot {
  position: relative;
  flex-shrink: 0;
}

.timeline-dot-inner {
  width: 24px;
  height: 24px;
  background: var(--aq-green-50);
  border: 2px solid var(--primary);
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
}

.timeline-dot-inner .icon {
  width: 12px;
  height: 12px;
  color: var(--primary);
  stroke-width: 2.5;
}

.timeline-content {
  flex: 1;
  padding-top: 2px;
}

.timeline-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.timeline-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============================================================
   27. FILTER BAR
   ============================================================ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
}

.filter-bar .form-control {
  min-width: 140px;
  max-width: 200px;
}

.filter-bar .search-bar .form-control {
  min-width: 220px;
}

.filter-bar-divider {
  width: 1px;
  height: 24px;
  background: var(--border-default);
}

.filter-spacer { flex: 1; }

/* ============================================================
   28. DETAIL PANEL / PROFILE
   ============================================================ */
.detail-panel {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-top: var(--space-5);
  overflow: hidden;
}

.detail-panel-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5);
  border-bottom: 1px solid var(--border-default);
  background: linear-gradient(135deg, var(--aq-green-700) 0%, var(--aq-green-600) 100%);
  color: white;
}

.detail-panel-header .avatar { background: rgba(255,255,255,0.2); }

.detail-panel-header .panel-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: white;
}

.detail-panel-header .panel-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
}

.detail-panel-header .panel-badges {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

/* ============================================================
   29. CLASSROOM CARDS
   ============================================================ */
.room-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

.room-card {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.room-card.in-use { border-color: var(--color-warning); }
.room-card.maintenance { border-color: var(--color-error); }

.room-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.room-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================================
   30. DRAG-DROP ZONE
   ============================================================ */
.drop-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-7) var(--space-5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  text-align: center;
  transition: all var(--duration-base) var(--ease-out);
  cursor: pointer;
  background: var(--bg-subtle);
}

.drop-zone:hover {
  border-color: var(--primary);
  background: var(--aq-green-50);
}

.drop-zone-icon {
  width: 48px;
  height: 48px;
  background: var(--bg-muted);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.drop-zone-icon .icon {
  width: 24px;
  height: 24px;
  stroke-width: 1.5;
}

.drop-zone-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.drop-zone-sub {
  font-size: 13px;
  color: var(--text-muted);
}

/* ============================================================
   31. WIREFRAME ANNOTATIONS
   ============================================================ */
.wf-annotation {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  background: rgba(255,255,255,0.9);
  border: 1px dashed var(--neutral-400);
  border-radius: var(--radius-sm);
  padding: 2px var(--space-2);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  z-index: 10;
  pointer-events: none;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-default);
}

/* ============================================================
   32. ROLE / PERMISSION CARDS
   ============================================================ */
.role-card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

.role-card {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-xs);
}

.role-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.role-icon {
  width: 36px;
  height: 36px;
  background: var(--aq-green-50);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.role-icon .icon { width: 18px; height: 18px; stroke-width: 1.75; }

.role-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.role-user-count {
  font-size: 11px;
  color: var(--text-muted);
}

.role-perms {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.role-perm-item {
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.role-perm-item::before {
  content: "";
  width: 4px;
  height: 4px;
  background: var(--primary);
  border-radius: var(--radius-pill);
  flex-shrink: 0;
}

/* ============================================================
   33. INLINE EDIT CONTROLS
   ============================================================ */
.inline-select {
  padding: 3px var(--space-2);
  font-size: 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-base);
  color: var(--text-primary);
  cursor: pointer;
}

/* ============================================================
   34. KPI CARDS (reports)
   ============================================================ */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

/* ============================================================
   35. QUICK REPORT CARDS
   ============================================================ */
.quick-report-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

.quick-report-card {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.quick-report-icon {
  width: 40px;
  height: 40px;
  background: var(--aq-green-50);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.quick-report-icon .icon { width: 20px; height: 20px; stroke-width: 1.75; }

.quick-report-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.quick-report-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.quick-report-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: auto;
}

/* ============================================================
   36. CHARTS GRID (2x2)
   ============================================================ */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

/* ============================================================
   37. WIDGETS
   ============================================================ */
.widget-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.birthday-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.birthday-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
}

.birthday-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.birthday-date {
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================================
   38. TIMETABLE
   ============================================================ */
.timetable {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.timetable th {
  background: var(--bg-muted);
  padding: var(--space-2) var(--space-3);
  text-align: center;
  font-weight: 600;
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}

.timetable td {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-default);
  text-align: center;
  font-size: 11px;
  color: var(--text-secondary);
}

.timetable td.class-slot {
  background: var(--aq-green-50);
  color: var(--primary);
  font-weight: 600;
}

/* ============================================================
   39. HUB PAGE (legacy — kept for visual demos only)
   ============================================================ */
.hub-page {
  min-height: 100vh;
  background: var(--bg-subtle);
  padding: var(--space-7) var(--space-5);
}

.hub-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto var(--space-7);
}

.hub-logo {
  width: 72px;
  height: 72px;
  background: var(--primary);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-4);
  box-shadow: var(--shadow-md);
}

.hub-logo-mark {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 900;
  color: var(--aq-gold-400);
}

.hub-title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.hub-sub {
  font-size: 16px;
  color: var(--text-muted);
}

.hub-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.hub-meta-item {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-muted);
  padding: 2px var(--space-3);
  border-radius: var(--radius-pill);
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  max-width: 1200px;
  margin: 0 auto;
}

.hub-card {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  box-shadow: var(--shadow-sm);
  transition: all var(--duration-base) var(--ease-out);
  text-decoration: none;
  color: inherit;
}

.hub-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
  transform: translateY(-3px);
  text-decoration: none;
}

.hub-card-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.hub-card-icon {
  width: 48px;
  height: 48px;
  background: var(--aq-green-50);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.hub-card-icon .icon {
  width: 24px;
  height: 24px;
  stroke-width: 1.75;
}

.hub-card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.hub-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.hub-footer {
  text-align: center;
  margin-top: var(--space-7);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border-default);
  font-size: 13px;
  color: var(--text-muted);
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* ============================================================
   40. DARK MODE TOGGLE (hub)
   ============================================================ */
.dark-mode-toggle {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--duration-base) var(--ease-out);
}

.dark-mode-toggle:hover {
  background: var(--bg-muted);
  color: var(--text-primary);
}

.dark-mode-toggle .icon {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

/* ============================================================
   41. UTILITY CLASSES
   ============================================================ */
.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end  { justify-content: flex-end; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.min-w-0 { min-width: 0; }
.w-full { width: 100%; }

.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }

.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }

.text-sm    { font-size: 12px; }
.text-base  { font-size: 14px; }
.text-lg    { font-size: 16px; }
.text-xl    { font-size: 20px; }
.text-muted { color: var(--text-muted); }
.text-primary-color { color: var(--primary); }
.font-mono  { font-family: var(--font-mono); }
.font-bold  { font-weight: 700; }
.font-600   { font-weight: 600; }
.text-right { text-align: right; }
.text-center { text-align: center; }

.relative { position: relative; }
.overflow-hidden { overflow: hidden; }

.divider {
  height: 1px;
  background: var(--border-default);
  margin: var(--space-4) 0;
}

.icon {
  display: inline-block;
  flex-shrink: 0;
}

.lkr { font-family: var(--font-mono); }

/* ============================================================
   42. RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .tile-grid { grid-template-columns: repeat(3, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .role-card-grid { grid-template-columns: repeat(3, 1fr); }
  .kpi-row { grid-template-columns: repeat(3, 1fr); }
  .hub-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  body { overflow: auto; }
  .app-shell { flex-direction: column; overflow: auto; }
  .sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    height: 100vh;
    z-index: 200;
    transition: left var(--duration-slow) var(--ease-out);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.mobile-open { left: 0; }
  .sidebar.collapsed { left: -64px; }
  .main-area { height: 100vh; }
  .topbar-mobile-toggle { display: flex; }
  .sidebar-toggle { display: none; }
  .page { padding: var(--space-4); }
  .tile-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .form-row.cols-3 { grid-template-columns: 1fr; }
  .room-grid { grid-template-columns: 1fr 1fr; }
  .charts-grid { grid-template-columns: 1fr; }
  .role-card-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .quick-report-grid { grid-template-columns: repeat(2, 1fr); }
  .hub-grid { grid-template-columns: repeat(2, 1fr); }
  .widget-row { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar .form-control { max-width: 100%; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .tile-grid { grid-template-columns: repeat(2, 1fr); }
  .hub-grid { grid-template-columns: 1fr 1fr; }
  .quick-report-grid { grid-template-columns: 1fr; }
  .role-card-grid { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   43. LOGIN PAGE (index.html)
   ============================================================ */
.login-body { overflow: auto; }

.login-page {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  min-height: 100vh;
  background: var(--bg-base);
}

/* LEFT — brand panel */
.login-brand {
  position: relative;
  background: linear-gradient(155deg, var(--aq-green-800) 0%, var(--primary) 55%, var(--aq-green-600) 100%);
  color: #fff;
  padding: var(--space-7) var(--space-7);
  display: flex;
  align-items: stretch;
  overflow: hidden;
  isolation: isolate;
}

.login-brand::before,
.login-brand::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  z-index: -1;
  filter: blur(2px);
  opacity: 0.25;
}

.login-brand::before {
  width: 360px; height: 360px;
  background: var(--aq-gold-400);
  top: -120px; right: -120px;
}

.login-brand::after {
  width: 480px; height: 480px;
  background: var(--aq-green-400);
  bottom: -180px; left: -180px;
}

.login-brand-inner {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.login-brand-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.login-brand-logo-mark {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
  color: var(--aq-gold-400);
  letter-spacing: -0.02em;
}

.login-brand-logo-img {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.25);
  padding: 6px;
  object-fit: contain;
}

.login-brand-name {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.login-brand-sub {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.login-brand-hero {
  margin-top: var(--space-4);
}

.login-brand-title {
  font-size: 40px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
}

.login-brand-tagline {
  font-size: 16px;
  line-height: 1.55;
  color: rgba(255,255,255,0.82);
  max-width: 440px;
}

.login-brand-highlights {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
}

.login-brand-highlights li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 14px;
  color: rgba(255,255,255,0.9);
}

.login-brand-highlights li .icon {
  width: 18px;
  height: 18px;
  color: var(--aq-gold-400);
  stroke-width: 2;
}

.login-brand-footer {
  margin-top: auto;
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.login-meta-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  padding: 2px var(--space-3);
  border-radius: var(--radius-pill);
}

/* RIGHT — form panel */
.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-7) var(--space-5);
  background: var(--bg-subtle);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-md);
}

.login-header {
  margin-bottom: var(--space-5);
}

.login-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin-bottom: var(--space-2);
}

.login-sub {
  font-size: 14px;
  color: var(--text-muted);
}

.login-form .form-group { margin-bottom: var(--space-4); }

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input-icon {
  position: absolute;
  left: var(--space-3);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  stroke-width: 2;
  pointer-events: none;
}

.login-input.form-control {
  padding-left: 38px;
  padding-right: 38px;
  height: 44px;
}

.login-password-toggle {
  position: absolute;
  right: 6px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: all var(--duration-fast) var(--ease-out);
}

.login-password-toggle:hover {
  color: var(--text-primary);
  background: var(--bg-muted);
}

.login-password-toggle .icon {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.login-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.login-forgot {
  font-size: 12px;
  font-weight: 500;
  color: var(--primary);
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}

.login-check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}

.login-check input {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
}

.login-submit.btn {
  width: 100%;
  height: 44px;
  font-size: 14px;
  font-weight: 600;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-5) 0;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-default);
}

.login-sso.btn {
  width: 100%;
  height: 44px;
  font-size: 14px;
  font-weight: 500;
}

.login-footer {
  margin-top: var(--space-5);
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

.login-footer a {
  color: var(--primary);
  font-weight: 500;
}

.login-footer-legal {
  margin-top: var(--space-2);
  font-size: 11px;
  color: var(--text-muted);
}

/* Dark mode adjustments */
html.dark .login-brand {
  background: linear-gradient(155deg, #0d2214 0%, #16502c 55%, #1f6d3d 100%);
}

/* Responsive */
@media (max-width: 960px) {
  .login-page { grid-template-columns: 1fr; }
  .login-brand { padding: var(--space-6); min-height: 320px; }
  .login-brand-title { font-size: 30px; }
  .login-brand-highlights { display: none; }
  .login-brand-footer { display: none; }
}

@media (max-width: 480px) {
  .login-panel { padding: var(--space-4); }
  .login-card { padding: var(--space-5); border-radius: var(--radius-lg); }
  .login-brand { padding: var(--space-5); }
  .login-brand-title { font-size: 26px; }
}

/* ============================================================
   SHELL UPGRADES (V2) — hamburger toggle, notif dropdown,
   profile popover, logo image, dark-mode contrast fixes.
   ============================================================ */

/* Real logo image in sidebar — replaces the "A" mark */
.sidebar-logo-img {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: var(--radius-md);
  background: var(--aq-gold-400);
  padding: 4px;
  object-fit: contain;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
html.dark .sidebar-logo-img {
  background: var(--aq-green-accent);
  box-shadow: 0 2px 10px var(--aq-green-accent-glow);
}

/* Hamburger toggle button (inside topbar, visible always) */
.topbar-sidebar-toggle {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--duration-base) var(--ease-out),
              color var(--duration-base) var(--ease-out);
  flex-shrink: 0;
}
.topbar-sidebar-toggle:hover {
  background: var(--bg-muted);
  color: var(--text-primary);
}
.topbar-sidebar-toggle .icon {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}
html.dark .topbar-sidebar-toggle:hover {
  background: rgba(59, 212, 125, 0.12);
  color: var(--aq-green-accent);
}

/* Notification dropdown */
.notif-wrapper,
.profile-wrapper { position: relative; }

.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 380px;
  max-width: calc(100vw - 32px);
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  display: none;
  overflow: hidden;
  animation: popIn var(--duration-base) var(--ease-out);
}
.notif-dropdown.open { display: block; }

.notif-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-4);
  border-bottom: 1px solid var(--border-default);
}
.notif-dropdown-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
}
.notif-dropdown-mark {
  font-size: 12px;
  color: var(--primary);
  font-weight: 500;
  background: none;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}
.notif-dropdown-mark:hover { background: var(--bg-muted); }

.notif-dropdown-list {
  max-height: 360px;
  overflow-y: auto;
}
.notif-dropdown-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-default);
  cursor: pointer;
  transition: background var(--duration-fast);
}
.notif-dropdown-item:hover { background: var(--bg-muted); }
.notif-dropdown-item.unread { background: rgba(59,212,125,0.04); }
html.dark .notif-dropdown-item.unread { background: rgba(59,212,125,0.08); }
.notif-dropdown-item:last-child { border-bottom: 0; }

.notif-dropdown-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: var(--radius-md);
  background: var(--color-info-bg);
  color: var(--color-info);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.notif-dropdown-icon.success { background: var(--color-success-bg); color: var(--color-success); }
.notif-dropdown-icon.warning { background: var(--color-warning-bg); color: var(--color-warning); }
.notif-dropdown-icon.danger  { background: var(--color-error-bg);   color: var(--color-error);   }
.notif-dropdown-icon .icon { width: 16px; height: 16px; }

.notif-dropdown-body { flex: 1; min-width: 0; }
.notif-dropdown-msg {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 2px;
}
.notif-dropdown-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.notif-dropdown-footer {
  display: block;
  text-align: center;
  padding: var(--space-3);
  font-size: 12px;
  font-weight: 500;
  color: var(--primary);
  border-top: 1px solid var(--border-default);
  background: var(--bg-subtle);
}
.notif-dropdown-footer:hover { background: var(--bg-muted); text-decoration: none; }

/* Profile popover */
.profile-trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 4px 4px 4px 10px;
  border-radius: var(--radius-pill);
  background: transparent;
  cursor: pointer;
  color: var(--text-primary);
  transition: background var(--duration-base) var(--ease-out);
}
.profile-trigger:hover { background: var(--bg-muted); }
.profile-trigger .avatar { width: 32px; height: 32px; font-size: 12px; }
.profile-trigger-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.profile-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 200;
  display: none;
  animation: popIn var(--duration-base) var(--ease-out);
}
.profile-popover.open { display: block; }

.profile-popover-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-default);
  background: var(--bg-subtle);
}
.profile-popover-header .avatar {
  width: 44px;
  height: 44px;
  font-size: 16px;
}
.profile-popover-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
}
.profile-popover-email {
  font-size: 12px;
  color: var(--text-muted);
}

.profile-popover-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: var(--space-3) var(--space-4) var(--space-2) var(--space-4);
}
.profile-role-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: var(--color-success-bg);
  color: var(--color-success);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.profile-popover-menu { padding: var(--space-2); border-top: 1px solid var(--border-default); }
.profile-popover-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--duration-fast);
  width: 100%;
  text-align: left;
  background: none;
  text-decoration: none;
}
.profile-popover-item:hover { background: var(--bg-muted); text-decoration: none; }
.profile-popover-item .icon { width: 16px; height: 16px; color: var(--text-muted); }
.profile-popover-item.danger { color: var(--color-error); }
.profile-popover-item.danger .icon { color: var(--color-error); }

@keyframes popIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Single sign-on button — neutral institutional styling */
.btn-sso {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  width: 100%;
  min-height: 44px;
  padding: 10px 16px;
  background: var(--surface-card);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  transition: box-shadow var(--duration-base) var(--ease-out),
              background var(--duration-base) var(--ease-out);
}
.btn-sso:hover {
  background: var(--surface-elevated, var(--surface-card));
  box-shadow: var(--shadow-xs);
}
.btn-sso:active { background: var(--bg-hover, var(--surface-card)); }
.btn-sso .sso-icon { display: inline-flex; color: var(--text-secondary); }

/* Wireframe-only banner above the login form to make demo intent explicit */
.login-demo-banner {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  padding: 10px 12px;
  background: var(--surface-elevated, rgba(0,0,0,0.04));
  color: var(--text-secondary);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-md);
  font-size: 12px;
  line-height: 1.4;
}
.login-demo-banner .icon {
  width: 14px;
  height: 14px;
  flex: none;
  margin-top: 2px;
}
html.dark .login-demo-banner {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.12);
}

/* ============================================================
   CHART UTILITIES (Chart.js canvases)
   ============================================================ */
.chart-card {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.chart-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.chart-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}
.chart-card-sub {
  font-size: 12px;
  color: var(--text-muted);
}
.chart-canvas-wrap {
  position: relative;
  width: 100%;
  height: 240px;
}

/* Quick links card (dashboard) */
.quick-links-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}
.quick-link-tile {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  transition: transform var(--duration-base) var(--ease-out),
              border-color var(--duration-base) var(--ease-out),
              background var(--duration-base) var(--ease-out);
}
.quick-link-tile:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  background: var(--surface-card);
  text-decoration: none;
}
.quick-link-tile .icon-box {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-success-bg);
  color: var(--color-success);
  flex-shrink: 0;
}
.quick-link-tile .icon-box .icon { width: 18px; height: 18px; }
.quick-link-tile-title { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.quick-link-tile-sub   { font-size: 11px; color: var(--text-muted); }

/* ============================================================
   DARK-MODE CONTRAST FIXES — applied globally
   ============================================================ */
html.dark .stat-card,
html.dark .card,
html.dark .chart-card,
html.dark .data-table,
html.dark .modal,
html.dark .filter-bar {
  background: var(--surface-card);
  border-color: var(--border-default);
}
html.dark .btn-primary {
  background: var(--primary);
  color: var(--primary-text);
  border-color: transparent;
}
html.dark .btn-primary:hover { background: var(--primary-hover); }
html.dark .btn-outline {
  border-color: var(--border-strong);
  color: var(--text-primary);
  background: transparent;
}
html.dark .btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(59, 212, 125, 0.08);
}
html.dark .btn-ghost { color: var(--text-secondary); }
html.dark .btn-ghost:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }
html.dark .btn-secondary {
  background: rgba(213, 190, 3, 0.15);
  color: #d5be03;
  border-color: rgba(213, 190, 3, 0.30);
}
html.dark .btn-secondary:hover {
  background: rgba(213, 190, 3, 0.22);
}
html.dark .btn-danger {
  background: rgba(240, 103, 121, 0.18);
  color: #f06779;
  border-color: rgba(240, 103, 121, 0.30);
}
html.dark .btn-danger:hover {
  background: rgba(240, 103, 121, 0.25);
}
html.dark .btn-success {
  background: rgba(59, 212, 125, 0.15);
  color: #3bd47d;
  border-color: rgba(59, 212, 125, 0.28);
}
html.dark .btn-success:hover {
  background: rgba(59, 212, 125, 0.22);
}
html.dark .btn-info {
  background: rgba(90, 167, 255, 0.15);
  color: #5aa7ff;
  border-color: rgba(90, 167, 255, 0.28);
}
html.dark .btn-info:hover {
  background: rgba(90, 167, 255, 0.22);
}
html.dark .btn-outline:hover {
  border-color: #3bd47d;
  color: #3bd47d;
  background: rgba(59, 212, 125, 0.08);
}

html.dark .sidebar-nav-item.active {
  background: rgba(59, 212, 125, 0.12);
  border-left-color: var(--aq-green-accent);
  color: var(--aq-green-accent);
}
html.dark .sidebar-nav-item.active .icon { color: var(--aq-green-accent); }
html.dark .sidebar-logo-mark {
  background: var(--aq-green-accent);
  color: var(--bg-base);
  box-shadow: 0 2px 10px var(--aq-green-accent-glow);
}
html.dark .tab.active {
  color: var(--aq-green-accent);
  border-bottom-color: var(--aq-green-accent);
}
html.dark .badge-success {
  background: rgba(59, 212, 125, 0.18);
  color: #3bd47d;
}
html.dark .badge-warning {
  background: rgba(244, 183, 64, 0.18);
  color: #f4b740;
}
html.dark .badge-error {
  background: rgba(240, 103, 121, 0.18);
  color: #f06779;
}
html.dark .badge-info {
  background: rgba(90, 167, 255, 0.18);
  color: #5aa7ff;
}
html.dark .badge-neutral {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}
html.dark .badge-primary {
  background: rgba(59, 212, 125, 0.18);
  color: #3bd47d;
}
html.dark .badge-gold {
  background: rgba(213, 190, 3, 0.18);
  color: #d5be03;
}
html.dark .status-dot.active,
html.dark .status-pill.success {
  background: rgba(59, 212, 125, 0.18);
  color: var(--aq-green-accent);
}

/* Empty-state page padding */
.page-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* ============================================================
   KPI GRID (used by class-assignment, audit, announcements)
   ============================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
}
.kpi-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.kpi-icon {
  width: 44px; height: 44px;
  min-width: 44px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-info-bg);
  color: var(--color-info);
  flex-shrink: 0;
}
.kpi-icon .icon { width: 20px; height: 20px; }
.kpi-body { flex: 1; min-width: 0; }
.kpi-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  margin-bottom: 2px;
}
.kpi-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-display);
  line-height: 1.1;
}
.kpi-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
html.dark .kpi-card { background: var(--surface-card); }

/* Table row hover/stripe dark overrides */
html.dark .data-table tbody tr:hover { background: var(--row-hover-dark); }
html.dark .data-table tbody tr:nth-child(even) { background: var(--row-stripe-dark); }

/* Selected / highlighted rows */
html.dark .data-table tbody tr.selected { background: rgba(59, 212, 125, 0.08); }
html.dark .data-table tbody tr.highlighted { background: rgba(90, 167, 255, 0.08); }

/* Alert component dark overrides */
html.dark .alert.alert-info    { background: var(--color-info-bg);    border-color: var(--color-info);    color: var(--color-info); }
html.dark .alert.alert-success { background: var(--color-success-bg); border-color: var(--color-success); color: var(--color-success); }
html.dark .alert.alert-warning { background: var(--color-warning-bg); border-color: var(--color-warning); color: var(--color-warning); }
html.dark .alert.alert-error   { background: var(--color-error-bg);   border-color: var(--color-error);   color: var(--color-error); }

/* Banner / callout dark overrides */
html.dark .banner       { background: var(--surface-raised); border-color: var(--border-default); color: var(--text-primary); }
html.dark .callout      { background: var(--surface-raised); border-color: var(--border-default); }
html.dark .empty-state  { background: var(--surface-card);   border-color: var(--border-default); color: var(--text-secondary); }
html.dark .skeleton     { background: linear-gradient(90deg, var(--bg-muted) 25%, var(--surface-raised) 50%, var(--bg-muted) 75%); background-size: 200% 100%; }

/* Topbar hover states */
html.dark .topbar-action-btn:hover { background: rgba(255, 255, 255, 0.06); }



/* ============================================================
   POLISH LAYER — Animations, Micro-interactions, Visual Clarity
   All additions are purely additive. No existing selectors modified
   except the sidebar nav active indicator (side-stripe → tint+icon).
   ============================================================ */

/* ----------------------------------------------------------
   Keyframes
   ---------------------------------------------------------- */

@keyframes aq-shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

@keyframes aq-fade-in-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes aq-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes aq-slide-in-right {
  from {
    transform: translateX(calc(100% + 24px));
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes aq-float-y {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-7px); }
}

@keyframes aq-pulse-ring {
  0%   { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2.4); opacity: 0; }
}

@keyframes aq-spin {
  to { transform: rotate(360deg); }
}

@keyframes aq-ripple {
  to {
    transform: translate(-50%, -50%) scale(20);
    opacity: 0;
  }
}

@keyframes aq-count-reveal {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ----------------------------------------------------------
   Skeleton shimmer (was defined but missing animation)
   ---------------------------------------------------------- */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-muted) 25%,
    var(--border-default) 50%,
    var(--bg-muted) 75%
  ) !important;
  background-size: 400% 100% !important;
  animation: aq-shimmer 1.6s ease-in-out infinite !important;
  border-radius: var(--radius-sm);
}

html.dark .skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-muted) 25%,
    var(--surface-raised) 50%,
    var(--bg-muted) 75%
  ) !important;
  background-size: 400% 100% !important;
}

/* ----------------------------------------------------------
   Page entry — utility classes applied via JS on DOMContentLoaded
   ---------------------------------------------------------- */
.aq-animate-in {
  animation: aq-fade-in-up var(--duration-slow) var(--ease-out) both;
}

.aq-animate-fade {
  animation: aq-fade-in var(--duration-slow) var(--ease-out) both;
}

/* ----------------------------------------------------------
   Button — active press feedback, loading state, ripple
   ---------------------------------------------------------- */
.btn {
  overflow: hidden;
  position: relative;
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
  transition-duration: var(--duration-fast);
}

.btn.loading {
  pointer-events: none;
  cursor: default;
}

.btn.loading > * {
  opacity: 0;
}

.btn.loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: white;
  border-radius: var(--radius-pill);
  animation: aq-spin 0.7s linear infinite;
}

.btn-ghost.loading::after,
.btn-secondary.loading::after {
  border-color: rgba(0,0,0,0.15);
  border-top-color: var(--text-secondary);
}

/* Ripple element injected by JS */
.aq-btn-ripple {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.3);
  transform: translate(-50%, -50%) scale(0);
  animation: aq-ripple 0.55s var(--ease-out) forwards;
  pointer-events: none;
}

.btn-ghost .aq-btn-ripple,
.btn-secondary .aq-btn-ripple {
  background: rgba(26,85,46,0.15);
}

/* ----------------------------------------------------------
   Stat card hover lift (existing cards gain interactive feel)
   ---------------------------------------------------------- */
.stat-card {
  transition: transform var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out);
  cursor: default;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Stat value entrance */
.stat-value {
  animation: aq-count-reveal var(--duration-slow) var(--ease-out) both;
  animation-delay: 150ms;
}

/* ----------------------------------------------------------
   KPI card hover lift
   ---------------------------------------------------------- */
.kpi-card {
  transition: transform var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out),
              border-color var(--duration-base) var(--ease-out);
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--aq-green-200);
}

html.dark .kpi-card:hover {
  border-color: rgba(59,212,125,0.25);
}

/* KPI value entrance */
.kpi-value {
  animation: aq-count-reveal var(--duration-slow) var(--ease-out) both;
  animation-delay: 120ms;
}

/* ----------------------------------------------------------
   Tile hover lift
   ---------------------------------------------------------- */
.tile {
  transition: transform var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out),
              border-color var(--duration-base) var(--ease-out);
}

.tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: var(--primary);
  text-decoration: none;
}

/* ----------------------------------------------------------
   Tab panel fade-in on activation
   ---------------------------------------------------------- */
.tab-panel.active {
  animation: aq-fade-in var(--duration-base) var(--ease-out) both;
}

/* ----------------------------------------------------------
   Sidebar nav item — remove side-stripe, use icon colour + tint
   The existing border-left active stripe violates the no-side-stripe rule.
   Replace with stronger bg tint and gold icon on active.
   ---------------------------------------------------------- */
.sidebar-nav-item {
  border-left-width: 0 !important;
  padding-left: calc(var(--space-4) + 3px); /* compensate for removed 3px border */
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-right: var(--space-3);
}

.sidebar-nav-item.active {
  border-left-color: transparent !important;
  background: rgba(255,255,255,0.14);
}

.sidebar-nav-item.active .icon {
  color: var(--aq-gold-300);
}

.sidebar-nav-item:hover:not(.active) {
  background: rgba(255,255,255,0.07);
}

/* ----------------------------------------------------------
   Empty state — subtle floating icon
   ---------------------------------------------------------- */
.empty-state-icon {
  animation: aq-float-y 3.2s ease-in-out infinite;
}

/* ----------------------------------------------------------
   Notification dot — pulse ring
   ---------------------------------------------------------- */
.notif-dot::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--aq-coral);
  animation: aq-pulse-ring 2s ease-out infinite;
}

/* ----------------------------------------------------------
   Page header entry
   ---------------------------------------------------------- */
.page-header {
  animation: aq-fade-in-up var(--duration-slow) var(--ease-out) both;
}

/* ----------------------------------------------------------
   Form focus glow — refined for both modes
   ---------------------------------------------------------- */
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,85,46,0.12), 0 1px 2px rgba(15,58,31,0.06);
  outline: none;
}

html.dark .form-control:focus {
  border-color: var(--aq-green-accent);
  box-shadow: 0 0 0 3px var(--aq-green-accent-glow);
}

/* ----------------------------------------------------------
   Toast / snackbar slide-in
   ---------------------------------------------------------- */
.toast,
.snackbar,
[role="alert"].toast-container > * {
  animation: aq-slide-in-right var(--duration-slow) var(--ease-out) both;
}

/* ----------------------------------------------------------
   Topbar — crisper separation
   ---------------------------------------------------------- */
.topbar {
  box-shadow: 0 1px 0 var(--border-default), var(--shadow-xs);
}

/* ----------------------------------------------------------
   Sidebar logo mark — subtle pulse on hover
   ---------------------------------------------------------- */
.sidebar-logo-mark {
  transition: transform var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out);
}

.sidebar-logo:hover .sidebar-logo-mark {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* ----------------------------------------------------------
   Toggle switch — improved thumb shadow
   ---------------------------------------------------------- */
.toggle-track::after {
  box-shadow: 0 1px 4px rgba(0,0,0,0.25), 0 1px 2px rgba(0,0,0,0.15);
  transition: transform var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out);
}

.toggle input:checked + .toggle-track::after {
  box-shadow: 0 1px 6px rgba(0,0,0,0.3);
}

/* ----------------------------------------------------------
   Progress bar — entrance animation
   ---------------------------------------------------------- */
@keyframes aq-grow-width {
  from { width: 0 !important; }
  to   { /* width set inline */ }
}

.progress-bar {
  animation: none; /* width is set inline; transition handles the rest */
}

/* ----------------------------------------------------------
   Table row — smooth hover transition
   ---------------------------------------------------------- */
.data-table tbody tr {
  transition: background var(--duration-fast) var(--ease-out);
}

/* ----------------------------------------------------------
   Page scrollable region — smooth scroll
   ---------------------------------------------------------- */
.page {
  scroll-behavior: smooth;
}

/* ----------------------------------------------------------
   Modal — exit scale (JS removes .open, CSS animates out)
   ---------------------------------------------------------- */
.modal-overlay:not(.open) .modal {
  transform: scale(0.96) translateY(6px);
}

/* ----------------------------------------------------------
   Card link hover
   ---------------------------------------------------------- */
a.card:hover,
.card[role="button"]:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ----------------------------------------------------------
   Accessibility: Reduced motion — disable ALL non-essential motion
   ---------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .empty-state-icon,
  .notif-dot::after,
  .skeleton {
    animation: none !important;
  }
}

/* ============================================================
   STUDENT PORTAL — INNER PAGE DARK MODE OVERRIDES
   Overrides hardcoded hex colors in per-page inline <style>
   blocks. html.dark specificity (0,2,1) beats inline (0,1,0).
   ============================================================ */

/* ── Structural shell ── */
html.dark .sidebar { background: var(--bg-sidebar); }
html.dark .topbar {
  background: var(--bg-muted);
  border-bottom-color: var(--border-default);
}
html.dark .page-title { color: var(--text-primary); }
html.dark .content-scroll { background: var(--bg-base); }
html.dark .section-hd h2,
html.dark .section-hd h3 { color: var(--text-primary); }
html.dark .section-hd a { color: var(--aq-green-accent); }

/* ── Cards & surfaces ── */
html.dark .course-card,
html.dark .summary-card,
html.dark .table-card,
html.dark .form-card,
html.dark .section-card,
html.dark .pay-method-card,
html.dark .tips-card,
html.dark .info-banner,
html.dark .schedule-item,
html.dark .outstanding-box,
html.dark .bank-details,
html.dark .receipt-doc,
html.dark .navigator-panel,
html.dark .question-panel,
html.dark .past-student-banner,
html.dark .lifecycle-section {
  background: var(--surface-card);
  border-color: var(--border-default);
}

/* ── Quick action buttons ── */
html.dark .quick-action-btn {
  background: var(--surface-card);
  color: var(--text-primary);
  border-color: var(--border-default);
}
html.dark .qa-icon {
  background: var(--bg-muted);
  color: var(--aq-green-accent);
}

/* ── Primary text on light-locked elements ── */
html.dark .course-name,
html.dark .course-title,
html.dark .course-subtitle,
html.dark .detail-label,
html.dark .summary-label,
html.dark .bank-key,
html.dark .pay-method-title,
html.dark .outstanding-label,
html.dark .slip-step-label,
html.dark .notif-title,
html.dark .question-heading,
html.dark .question-text,
html.dark .option-text,
html.dark .results-heading,
html.dark .form-label,
html.dark .pwd-req-title,
html.dark .timeline-desc,
html.dark .navigator-title,
html.dark .nav-summary,
html.dark .section-card-header h3,
html.dark .tips-card h3,
html.dark .week-label,
html.dark .receipt-college-name,
html.dark .receipt-title,
html.dark .apt-cell-value,
html.dark .activity-text,
html.dark .schedule-info .class-name,
html.dark .lsc-hint,
html.dark .lifecycle-section-hd h3,
html.dark .day-date,
html.dark .tt-class-name { color: var(--text-primary); }

/* ── Secondary / muted text ── */
html.dark .course-meta,
html.dark .detail-value,
html.dark .summary-value,
html.dark .bank-val,
html.dark .pay-method-sub,
html.dark .slip-step-meta,
html.dark .notif-time,
html.dark .results-sub,
html.dark .results-notice,
html.dark .photo-upload-text,
html.dark .photo-requirements,
html.dark .receipt-college-sub,
html.dark .receipt-qr-text,
html.dark .week-sub,
html.dark .tt-class-meta,
html.dark .unread-count,
html.dark .schedule-info .class-meta,
html.dark .progress-label-row,
html.dark .tip-text,
html.dark .pwd-req-item,
html.dark .drag-zone-text,
html.dark .day-name,
html.dark .notif-section-label { color: var(--text-secondary); }

/* ── Tables ── */
html.dark .pay-table thead tr,
html.dark .exam-table thead tr,
html.dark .grades-table thead tr,
html.dark .academic-table thead tr {
  background: var(--bg-muted);
  border-bottom-color: var(--border-default);
}
html.dark .pay-table th,
html.dark .exam-table th,
html.dark .grades-table th,
html.dark .academic-table th {
  color: var(--text-muted);
  border-color: var(--border-default);
}
html.dark .pay-table td,
html.dark .exam-table td,
html.dark .grades-table td,
html.dark .academic-table td {
  color: var(--text-primary);
  border-color: var(--border-default);
}
html.dark .pay-table tr:hover td,
html.dark .exam-table tr:hover td,
html.dark .grades-table tr:hover td,
html.dark .academic-table tr:hover td { background: var(--row-hover-dark); }

/* ── Tabs ── */
html.dark .tab-btn { color: var(--text-secondary); border-color: transparent; }
html.dark .tab-btn.active { color: var(--aq-green-accent); border-color: var(--aq-green-accent); }
html.dark .tab-bar { border-color: var(--border-default); }
html.dark .card-tab { color: var(--text-secondary); }
html.dark .card-tab.active { color: var(--aq-green-accent); border-color: var(--aq-green-accent); }

/* ── Timetable ── */
html.dark .tt-wrapper {
  background: var(--surface-card);
  border-color: var(--border-default);
}
html.dark .tt-header-cell {
  background: var(--bg-muted);
  border-color: var(--border-default);
  color: var(--text-primary);
}
html.dark .week-nav {
  background: var(--surface-card);
  border-color: var(--border-default);
}
html.dark .week-nav-btn { color: var(--text-secondary); }
html.dark .week-nav-btn:hover { background: var(--bg-muted); color: var(--text-primary); }

/* ── Form inputs ── */
html.dark .form-input {
  background: var(--bg-muted);
  border-color: var(--border-default);
  color: var(--text-primary);
}
html.dark .form-input:focus {
  border-color: var(--aq-green-accent);
  background: var(--surface-card);
}
html.dark .readonly {
  background: var(--bg-subtle);
  color: var(--text-muted);
}

/* ── Progress bars ── */
html.dark .progress-bar-wrap,
html.dark .pbar,
html.dark .question-progress-bar { background: var(--border-default); }

/* ── Status switch buttons (dashboard) ── */
html.dark .status-switch-btn {
  background: var(--surface-card);
  color: var(--text-secondary);
  border-color: var(--border-default);
}
html.dark .status-switch-btn:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

/* ── Notifications ── */
html.dark .notif-item { border-color: var(--border-default); }
html.dark .notif-item.unread { background: rgba(59,212,125,0.06); }
html.dark .btn-mark-all,
html.dark .btn-mark-read { color: var(--aq-green-accent); }

/* ── Profile timeline ── */
html.dark .timeline::before { background: var(--border-default); }
html.dark .timeline-dot.done { background: var(--color-success); }
html.dark .timeline-dot.current { background: var(--aq-green-accent); }
html.dark .drag-zone {
  border-color: var(--border-default);
  background: var(--bg-muted);
}
html.dark .drag-zone:hover { border-color: var(--aq-green-accent); }

/* ── Exam navigator ── */
html.dark .unattempted {
  background: var(--bg-muted);
  color: var(--text-muted);
  border-color: var(--border-default);
}
html.dark .option-item {
  background: var(--surface-card);
  border-color: var(--border-default);
}
html.dark .option-item:hover { background: var(--bg-muted); }
html.dark .option-item.selected {
  background: rgba(59,212,125,0.08);
  border-color: var(--aq-green-accent);
}
html.dark .option-letter-badge {
  background: var(--bg-muted);
  color: var(--text-secondary);
}

/* ── Activity feed ── */
html.dark .activity-item { border-bottom-color: var(--border-default); }

/* ── Section card header ── */
html.dark .section-card-header {
  background: var(--bg-muted);
  border-color: var(--border-default);
}

/* ── Tab bar (profile has explicit white background) ── */
html.dark .tab-bar { background: var(--surface-card); border-color: var(--border-default); }
html.dark .tab-btn.active {
  color: var(--aq-green-accent);
  border-bottom-color: var(--aq-green-accent);
  border-color: var(--aq-green-accent);
}

/* ── Alert / info banners ── */
html.dark .alert-banner {
  background: var(--color-warning-bg);
  border-color: var(--color-warning);
  color: var(--color-warning);
}
html.dark .alert-banner strong { color: var(--color-warning); }
html.dark .alert-banner .alert-action { color: var(--aq-green-accent); }
html.dark .info-banner {
  background: rgba(59, 212, 125, 0.08);
  border-color: rgba(59, 212, 125, 0.2);
}
html.dark .info-banner-text { color: var(--aq-green-accent); }
html.dark .info-banner-icon { color: var(--aq-green-accent); }

/* ── Notification items ── */
html.dark .notif-item {
  background: var(--surface-card);
  border-color: var(--border-default);
}
html.dark .notif-item.unread {
  background: rgba(59, 212, 125, 0.05);
  border-color: rgba(59, 212, 125, 0.18);
}
html.dark .notif-item.read { background: var(--bg-muted); }
html.dark .notif-dot.read { background: var(--border-strong); }

/* ── Notification icon variants ── */
html.dark .notif-icon.green { background: rgba(59, 212, 125, 0.12); color: var(--aq-green-accent); }
html.dark .notif-icon.gold  { background: rgba(213, 190, 3, 0.12);  color: #d5be03; }
html.dark .notif-icon.blue  { background: rgba(90, 167, 255, 0.12); color: #5aa7ff; }
html.dark .notif-icon.gray  { background: var(--bg-muted);          color: var(--text-muted); }
html.dark .notif-icon.orange { background: rgba(214, 72, 27, 0.12); color: #f4845f; }

/* ── Notification action buttons ── */
html.dark .btn-mark-all {
  background: var(--surface-card);
  border-color: var(--border-default);
  color: var(--text-secondary);
}
html.dark .btn-mark-read {
  background: var(--bg-muted);
  border-color: var(--border-default);
  color: var(--text-secondary);
}

/* ── #ecf6ef (aq-green-50) light tint → dark accent tint ── */
html.dark .course-icon,
html.dark .schedule-day-badge,
html.dark .qa-icon,
html.dark .summary-icon.green,
html.dark .pay-method-icon.green,
html.dark .notif-icon.green {
  background: rgba(59, 212, 125, 0.12);
  color: var(--aq-green-accent);
}
html.dark .badge-active,
html.dark .badge-confirmed,
html.dark .section-badge,
html.dark .course-badge-active,
html.dark .badge-pass {
  background: rgba(59, 212, 125, 0.12);
  color: var(--aq-green-accent);
}
html.dark .outstanding-box {
  background: rgba(59, 212, 125, 0.08);
  border-color: rgba(59, 212, 125, 0.2);
}
html.dark .slip-step-dot.done {
  background: rgba(59, 212, 125, 0.15);
  border-color: var(--aq-green-accent);
}
html.dark .tt-class-card.green {
  background: rgba(59, 212, 125, 0.10);
  border-left-color: var(--aq-green-accent);
}
html.dark .tt-header-cell.today {
  background: rgba(59, 212, 125, 0.10) !important;
}
html.dark .legend-dot.green {
  background: rgba(59, 212, 125, 0.12);
  border-left-color: var(--aq-green-accent);
}
html.dark .option-item:hover  { background: rgba(59, 212, 125, 0.06) !important; border-color: var(--aq-green-accent) !important; }
html.dark .option-item.selected { background: rgba(59, 212, 125, 0.10) !important; border-color: var(--aq-green-accent) !important; }
html.dark .lifecycle-status-card.state-ACTIVE {
  background: rgba(59, 212, 125, 0.06);
  border-color: rgba(59, 212, 125, 0.25);
}
html.dark .photo-upload-area:hover { background: rgba(59, 212, 125, 0.08); border-color: var(--aq-green-accent); }
html.dark .timeline-badge.tb-active {
  background: rgba(59, 212, 125, 0.12);
  color: var(--aq-green-accent);
  border-color: rgba(59, 212, 125, 0.3);
}
html.dark .schedule-day-badge .day,
html.dark .schedule-day-badge .date { color: var(--aq-green-accent); }

/* ── Page-specific buttons ── */
/* Primary dark-green buttons → bright accent in dark */
html.dark .btn-details,
html.dark .btn-cert,
html.dark .btn-save,
html.dark .btn-upload-photo {
  background: var(--primary);
  color: var(--primary-text);
}
/* Light receipt / ghost buttons */
html.dark .btn-receipt {
  background: var(--bg-muted);
  color: var(--aq-green-accent);
  border-color: var(--border-default);
}
/* Outline contact button */
html.dark .btn-contact {
  background: transparent;
  border-color: var(--aq-green-accent);
  color: var(--aq-green-accent);
}
/* Transcript cert download */
html.dark .btn-outline {
  border-color: var(--border-strong);
  color: var(--text-primary);
  background: transparent;
}

/* ── Inline-style element overrides (!important required to beat specificity 1,0,0) ── */
/* Dashboard warning alert */
html.dark .alert {
  background: var(--color-warning-bg) !important;
  border-color: var(--color-warning) !important;
  color: var(--color-warning) !important;
}
/* Exams past-student info notice */
html.dark .past-student-notice {
  background: var(--color-info-bg) !important;
  border-color: var(--color-info) !important;
}
html.dark .past-student-notice span { color: var(--color-info) !important; }
html.dark .past-student-notice i    { color: var(--color-info) !important; }
/* Timetable: corner header cell and break/lunch slots */
html.dark .tt-header-cell { background: var(--bg-muted) !important; border-color: var(--border-default) !important; }
html.dark .tt-slot        { background: var(--bg-muted) !important; }

/* Apply for New Course modal */
html.dark .reapply-modal-card {
    background: var(--bg-card) !important;
}
html.dark .reapply-modal-card > div:first-child { border-bottom-color: var(--border-default) !important; }
html.dark .reapply-modal-card > div:last-child  { border-top-color:    var(--border-default) !important; }
html.dark .reapply-modal-card div,
html.dark .reapply-modal-card label { color: var(--text-primary) !important; }
html.dark .reapply-modal-card select,
html.dark .reapply-modal-card input,
html.dark .reapply-modal-card textarea {
    background: var(--bg-muted) !important;
    border-color: var(--border-default) !important;
    color: var(--text-primary) !important;
    color-scheme: dark;
}
html.dark .reapply-modal-card button[style*="background:white"] {
    background: var(--bg-muted) !important;
    border-color: var(--border-default) !important;
    color: var(--text-primary) !important;
}
/* preserve green submit button */
html.dark .reapply-modal-card button[style*="background:#1a552e"] {
    background: #1a552e !important;
    color: white !important;
}

/* Course level progression card — override inline background:white */
html.dark .progression-card {
    background: rgba(59, 212, 125, 0.06) !important;
    border-color: var(--border-default) !important;
}
html.dark .prog-step-circle.future { background: var(--bg-muted) !important; color: var(--text-muted) !important; }
html.dark .prog-connector          { background: var(--border-default) !important; }
html.dark .prog-connector.done     { background: var(--aq-green-accent) !important; }
