/* ══════════════════════════════════════
   IRIR Admin — Stylesheet
══════════════════════════════════════ */

/* ── FONT FOUNDATION ── */
/* Noto Sans Myanmar — self-hosted via jsDelivr (fallback if Google Fonts blocked) */
@font-face {
  font-family: 'Noto Sans Myanmar';
  font-style: normal;
  font-weight: 400;
  src: url('https://cdn.jsdelivr.net/npm/@fontsource/noto-sans-myanmar@4.5.0/files/noto-sans-myanmar-myanmar-400-normal.woff2') format('woff2'),
       url('https://cdn.jsdelivr.net/npm/@fontsource/noto-sans-myanmar@4.5.0/files/noto-sans-myanmar-myanmar-400-normal.woff') format('woff');
}
@font-face {
  font-family: 'Noto Sans Myanmar';
  font-style: normal;
  font-weight: 700;
  src: url('https://cdn.jsdelivr.net/npm/@fontsource/noto-sans-myanmar@4.5.0/files/noto-sans-myanmar-myanmar-700-normal.woff2') format('woff2'),
       url('https://cdn.jsdelivr.net/npm/@fontsource/noto-sans-myanmar@4.5.0/files/noto-sans-myanmar-myanmar-700-normal.woff') format('woff');
}

/* ── CRITICAL: html-level theme class set by head script before body exists ── */
/* This prevents any white flash on page load when dark mode is saved */
html.theme-dark  { background-color: #111820; color-scheme: dark; }
html.theme-light { background-color: #F0F2F5; color-scheme: light; }

/* ── Smooth theme transitions (but NOT on first load — avoids flash) ── */
body.theme-transition,
body.theme-transition *,
body.theme-transition *::before,
body.theme-transition *::after {
  transition: background-color .25s ease, border-color .25s ease, color .15s ease !important;
}

/* ── DOF mobile grid ── */
@media (max-width: 600px) {
  .dof-top-grid  { grid-template-columns: 1fr !important; }
  .dof-meta-grid { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 400px) {
  .dof-meta-grid { grid-template-columns: 1fr !important; }
}

/* ── STAFF PROFILE ── */
.form-label { font-size:11px; font-weight:700; letter-spacing:.6px; text-transform:uppercase; color:var(--ink3); display:block; margin-bottom:5px; }
.form-input {
  width:100%; background:var(--surface); border:1.5px solid var(--line);
  border-radius:var(--r); padding:10px 13px; font-size:13px;
  font-family:'Plus Jakarta Sans','Pyidaungsu', 'Noto Sans Myanmar', 'Myanmar Text',sans-serif;
  color:var(--ink); outline:none; transition:border-color .2s, box-shadow .2s;
}
.form-input:focus { border-color:var(--crimson); background:var(--white); box-shadow:0 0 0 3px rgba(139,26,46,0.10); }
.form-input::placeholder { color:#C5CBD6; }
#staffProfilePhotoWrap:hover .photo-overlay { opacity:1 !important; }

/* ── SCHEDULE ROW ── */
.schedule-row {
  display:grid; grid-template-columns:1fr 1fr 120px 120px 36px;
  gap:8px; align-items:center;
  background:var(--surface); border:1px solid var(--line);
  border-radius:8px; padding:10px 12px;
}
.schedule-row select, .schedule-row input[type=time] {
  background:var(--white); border:1px solid var(--line); border-radius:var(--r);
  padding:7px 10px; font-size:12px; color:var(--ink); outline:none;
  font-family:'Plus Jakarta Sans',sans-serif; width:100%;
}
.schedule-row select:focus, .schedule-row input[type=time]:focus { border-color:var(--crimson); }
.schedule-row-del {
  background:none; border:1px solid rgba(139,26,46,.2); border-radius:var(--r);
  color:var(--crimson); cursor:pointer; padding:6px; display:flex; align-items:center; justify-content:center;
  transition:all .15s;
}
.schedule-row-del:hover { background:var(--crimson-light); }

/* ── CHRONICLE READER OVERLAY ── */
#chronicleReaderOverlay {
  position: fixed; inset: 0; z-index: 200;
  background: #111820;
  display: none; flex-direction: column;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
#chronicleReaderOverlay.open { display: flex; }
.chr-reader-topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  height: 52px;
  background: rgba(17,24,32,0.94);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
}
.chr-reader-back {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; padding: 6px 14px; cursor: pointer;
  transition: all .15s;
}
.chr-reader-back:hover { color: #fff; background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); }
.chr-reader-section-label {
  font-size: 11px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; color: rgba(255,255,255,0.3);
}
.chr-reader-body {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; padding: 48px 24px 80px;
}
.chr-reader-inner { width: 100%; max-width: 720px; }
.chr-reader-img {
  width: 100%; border-radius: 16px; overflow: hidden;
  margin-bottom: 36px; max-height: 420px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}
.chr-reader-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chr-reader-meta {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px; flex-wrap: wrap;
}
.chr-reader-title {
  font-family: 'Libre Baskerville', serif;
  font-size: 28px; font-weight: 700; color: #fff;
  line-height: 1.3; margin-bottom: 20px;
}
.chr-reader-author {
  font-size: 13px; color: rgba(255,255,255,0.35);
  margin-bottom: 32px; padding-bottom: 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.chr-reader-author strong { color: rgba(255,255,255,0.6); }
.chr-reader-content {
  font-size: 15px; line-height: 1.85;
  color: rgba(255,255,255,0.72);
  white-space: pre-wrap; word-break: break-word;
}
.chr-reader-event-info {
  margin-top: 32px; padding: 18px 20px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.chr-reader-event-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: rgba(255,255,255,0.5);
}
.chr-reader-event-row svg { flex-shrink: 0; opacity: .5; }


/* ── DOCUMENT OFFICE: Dept dropdown locked state (Staff role) ── */
#dof-dept:disabled {
  border-color: var(--line) !important;
  background: var(--surface) !important;
  cursor: not-allowed !important;
}
#dof-dept:disabled + .dof-dept-role-info,
.dof-dept-role-info { font-size: 11px; color: var(--ink3); display: flex; align-items: center; gap: 5px; margin-top: 5px; }
#dof-role-badge { transition: background .2s, color .2s; }

/* ── PRINT STYLES ── */
@media print {
  @page {
    size: A4 portrait;
    margin: 22mm 28mm;
    /* Suppress browser-injected URL and title headers/footers */
    margin-header: 0; margin-footer: 0;
  }
  html, body {
    width: 210mm !important;
    margin: 0 !important; padding: 0 !important;
    background: #fff !important;
    height: auto !important;
    overflow: visible !important;
  }
  body * { visibility: hidden !important; }
  #printArea, #printArea * { visibility: visible !important; }
  #printArea {
    position: absolute !important;
    top: 0 !important; left: 0 !important;
    width: 100% !important;
    margin: 0 !important; padding: 0 !important;
    font-family: 'Times New Roman', Times, serif !important;
    color: #000 !important; background: #fff !important;
    font-size: 12pt !important; line-height: 1.6 !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    height: auto !important;
  }
  /* Hide everything else so no blank second page */
  #appShell, #loginScreen { display: none !important; }
  /* Suppress browser URL/title in header and footer (Chrome/Edge support) */
  head, header, footer { display: none !important; }
  a[href]::after { content: none !important; }
}
#printArea { display: none; }


/* ════════════════════════════════════════════════════
   DESIGN TOKENS — Eye-Benefit Palette
   • Dark mode: warm-tinted deep navy — reduces harshness
   • Light mode: warm off-white — reduces glare vs pure white
   • Crimson accent kept muted, never over-saturated
   • All text contrast ratios ≥ 4.5:1 (WCAG AA)
   ════════════════════════════════════════════════════ */
:root {
  /* ── Brand palette ── */
  --crimson:       #8B1A2E;   /* muted, deep — not glaring */
  --crimson-mid:   #A8223A;
  --crimson-light: #F4EAED;   /* warm blush tint */
  --gold:          #8A6E28;
  --gold-light:    #FAF4E2;
  --green:         #1A5438;
  --green-light:   #E4F3EC;
  --blue:          #1D3760;
  --blue-light:    #E6EDF8;
  --r:             7px;       /* slightly rounder for friendliness */

  /* ── LIGHT THEME (default) — warm off-white, easy on eyes ── */
  --ink:           #1C1F26;   /* warm near-black, not pure #000 */
  --ink2:          #3D4554;
  --ink3:          #6E7A8A;
  --line:          #E2E6EC;   /* warm-gray borders */
  --surface:       #EFF1F5;   /* warm-gray surface */
  --white:         #FAFBFC;   /* warm off-white, not blinding */
  --bg:            #F0F2F5;
}

/* ── DARK THEME: warm deep navy — rests the eyes ── */
body.theme-dark {
  --ink:     #E8EDF4;   /* warm soft white — not pure #FFF */
  --ink2:    #B0BCCC;
  --ink3:    #6E8099;
  --line:    rgba(255,255,255,0.08);
  --surface: #16202E;   /* warm dark navy */
  --white:   #1E2C3F;   /* card bg — distinct but not jarring */
  --bg:      #111820;   /* page bg — deep warm navy */
  /* --blue is used inline (style="color:var(--blue)") by admin-students.js
     for the cohort/year sub-row labels (e.g. "FINAL PART 2 THEORY").
     The :root value (#1D3760) is a dark navy meant for light backgrounds;
     left unset here it's nearly invisible against the dark theme background.
     This was the actual root cause of the low-contrast sub-row labels. */
  --blue:    #FFFFFF;
  /* Same bug as --blue above: --green (#1A5438) is a deep muted green tuned
     for light backgrounds. It was never overridden for dark mode, so anything
     using var(--green) directly (.text-green, .stat-delta, attendance %
     figures, .pipeline-dot.done) is low-contrast against the dark navy bg.
     Only .b-green had a separate dark-mode fix — this covers the rest. */
  --green:   #62C98E;
  /* Same bug as --blue/--green above: --crimson (#8B1A2E) is a deep, muted
     red tuned for light backgrounds. It's used directly as text color in
     many places (.gpa-big, .profile-id, .tab.active, .scard-prog-label,
     .text-crimson, etc.) and was never overridden for dark mode, so that
     text is low-contrast against the dark navy bg. Brightened here. */
  --crimson: #E8536E;
  background-color: #111820;
}

/* ── LIGHT THEME explicit class ── */
body.theme-light {
  --ink:     #1C1F26;
  --ink2:    #3D4554;
  --ink3:    #6E7A8A;
  --line:    #E2E6EC;
  --surface: #EFF1F5;
  --white:   #FAFBFC;
  --bg:      #F0F2F5;
  background-color: #F0F2F5;
  background-image: none;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Plus Jakarta Sans', 'Pyidaungsu', 'Noto Sans Myanmar', 'Myanmar Text', sans-serif;
  /* Default dark: warm deep navy with very subtle pattern */
  background-color: #111820;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='900' viewBox='0 0 900 900'%3E%3Cg stroke='%238B1A2E' stroke-width='1' fill='none' opacity='0.022'%3E%3Ccircle cx='80' cy='80' r='18'/%3E%3Ccircle cx='80' cy='80' r='10'/%3E%3Cpath d='M80 62 Q80 30 110 30 Q140 30 140 60 L140 110 Q140 150 110 165 Q80 180 70 210'/%3E%3Cpolyline points='200,120 230,120 245,90 255,150 270,80 285,160 300,120 340,120'/%3E%3Cpath d='M400 60 Q415 90 400 120 Q385 150 400 180 Q415 210 400 240'/%3E%3Cpath d='M420 60 Q405 90 420 120 Q435 150 420 180 Q405 210 420 240'/%3E%3Cpolygon points='560,50 520,70 560,90 600,70'/%3E%3Ccircle cx='350' cy='460' r='20'/%3E%3Ccircle cx='350' cy='460' r='8'/%3E%3Ccircle cx='820' cy='700' r='40'/%3E%3Ccircle cx='820' cy='700' r='22'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 900px 900px;
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  transition: background-color .3s, color .3s;
}

/* ── MYANMAR TEXT CLASS ──────────────────────────────────────────────────── */
/* Apply .my-text to any element that displays Myanmar script.
   Noto Sans Myanmar has full OpenType shaping — correct stacking and combining. */
.my-text,
input.my-text,
textarea.my-text {
  font-family: 'Pyidaungsu', 'Noto Sans Myanmar', 'Myanmar Text', sans-serif !important;
}

/* DM Sans handles Latin; Noto Sans Myanmar activates for Myanmar codepoints automatically. */
body, input, select, textarea, td, th, span, div, p, strong, button, label {
  font-family: 'Plus Jakarta Sans', 'Pyidaungsu', 'Noto Sans Myanmar', 'Myanmar Text', sans-serif;
}/* ══════════════════════════════════════════════════════
   LOGIN SCREEN — always light, never inherits dark tokens
   ══════════════════════════════════════════════════════ */
#loginScreen {
  position: fixed; inset: 0; z-index: 100;
  display: flex; background: #FFFFFF;
  transition: opacity .4s, visibility .4s;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  /* Force all CSS variables back to light values inside login */
  --ink:     #0D1420;
  --ink2:    #374151;
  --ink3:    #6B7280;
  --line:    #E5E7EB;
  --surface: #F3F4F6;
  --white:   #FFFFFF;
}
#loginScreen.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.login-left {
  width: 420px; flex-shrink: 0; background: var(--ink);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 52px 48px; position: relative; overflow: hidden;
}
.login-left::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 30% 20%, rgba(139,26,46,0.35) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 80%, rgba(154,123,47,0.15) 0%, transparent 50%);
  pointer-events: none;
}
.login-left::after {
  content: ''; position: absolute; top: -80px; right: -80px;
  width: 320px; height: 320px;
  border: 1.5px solid rgba(255,255,255,0.06); border-radius: 50%;
  pointer-events: none;
}
.login-crest { margin-bottom: auto; position: relative; z-index: 1; }
/* ── IRIR SVG LOGO (replaces UM2 crest ring) ── */
.crest-ring {
  width: 80px; height: 80px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 28px;
  /* no border/circle — the SVG is the logo */
  background: none; border: none; border-radius: 0;
  box-shadow: none; backdrop-filter: none;
}
.crest-ring img.irir-logo-svg {
  width: 80px; height: 80px;
  object-fit: contain;
  display: block;
}
/* On mobile where login-left shows as a row, size down slightly */
@media (max-width: 600px) {
  .crest-ring { width: 52px; height: 52px; margin-bottom: 0; }
  .crest-ring img.irir-logo-svg { width: 52px; height: 52px; }
}
/* Hide the old text abbr — replaced by SVG img */
.crest-abbr { display: none; }
.login-institution {
  font-family: 'Libre Baskerville', serif;
  font-size: 11px; letter-spacing: 3px; text-transform: uppercase;
  color: rgba(255,255,255,0.35); margin-bottom: 10px;
}
.login-tagline {
  font-family: 'Libre Baskerville', serif;
  font-size: 26px; color: #fff; line-height: 1.25;
}
.login-tagline em { font-style: normal; color: rgba(255,255,255,0.4); }
.login-footer-txt { font-size: 11px; color: rgba(255,255,255,0.22); line-height: 1.7; position: relative; z-index: 1; }
.login-right {
  flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px;
  background-color: var(--white);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='900' viewBox='0 0 900 900'%3E%3Cg stroke='%238B1A2E' stroke-width='1' fill='none' opacity='0.04'%3E%3Ccircle cx='80' cy='80' r='18'/%3E%3Ccircle cx='80' cy='80' r='10'/%3E%3Cpath d='M80 62 Q80 30 110 30 Q140 30 140 60 L140 110 Q140 150 110 165 Q80 180 70 210'/%3E%3Cpolyline points='200,120 230,120 245,90 255,150 270,80 285,160 300,120 340,120'/%3E%3Cpath d='M400 60 Q415 90 400 120 Q385 150 400 180 Q415 210 400 240'/%3E%3Cpath d='M420 60 Q405 90 420 120 Q435 150 420 180 Q405 210 420 240'/%3E%3Cpolygon points='560,50 520,70 560,90 600,70'/%3E%3Cline x1='560' y1='90' x2='560' y2='120'/%3E%3Crect x='700' y='100' width='10' height='40' rx='3'/%3E%3Cellipse cx='100' cy='250' rx='25' ry='10' transform='rotate(-30 100 250)'/%3E%3Cline x1='800' y1='40' x2='800' y2='160'/%3E%3Ccircle cx='800' cy='42' r='8'/%3E%3Cellipse cx='200' cy='340' rx='35' ry='12'/%3E%3Cellipse cx='200' cy='340' rx='35' ry='12' transform='rotate(60 200 340)'/%3E%3Cellipse cx='200' cy='340' rx='35' ry='12' transform='rotate(120 200 340)'/%3E%3Ccircle cx='200' cy='340' r='5'/%3E%3Crect x='438' y='310' width='8' height='40' rx='2'/%3E%3Crect x='422' y='326' width='40' height='8' rx='2'/%3E%3Cpolyline points='700,320 730,320 745,290 755,350 770,270 785,360 800,320 840,320'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat; background-size: 900px 900px;
}
.login-form-wrap {
  width: 100%; max-width: 380px;
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 16px;
  padding: 36px 32px;
  box-shadow: 0 8px 40px rgba(13,27,42,0.12), 0 1px 4px rgba(13,27,42,0.06);
}
.login-form-wrap h2 { font-family: 'Libre Baskerville', serif; font-size: 22px; color: #0D1420; margin-bottom: 4px; }
.login-form-wrap p { font-size: 13px; color: #374151; margin-bottom: 28px; }

/* Label — always dark on white card */
.login-label {
  font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
  color: #374151; display: block; margin-bottom: 6px;
}

/* Input — strong visible border, dark text */
.login-input {
  width: 100%;
  background: #FFFFFF;
  border: 1.5px solid #9CA3AF;
  border-radius: var(--r); padding: 11px 14px; font-size: 14px;
  font-family: 'Plus Jakarta Sans', 'Pyidaungsu', 'Noto Sans Myanmar', 'Myanmar Text', sans-serif;
  color: #0D1420; outline: none; margin-bottom: 14px;
  transition: border-color .2s, box-shadow .2s;
}
.login-input::placeholder { color: #9CA3AF; }
.login-input:focus {
  border-color: var(--crimson);
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(139,26,46,0.10);
}

/* Role buttons — fully hardcoded, never affected by dark mode tokens */
.login-role-row { display: flex; gap: 8px; margin-bottom: 20px; }
.login-role-btn {
  flex: 1; padding: 11px 8px; border-radius: var(--r);
  border: 2px solid #D1D5DB;
  background: #F9FAFB;
  font-size: 13px; font-weight: 600;
  font-family: 'Plus Jakarta Sans', 'Pyidaungsu', 'Noto Sans Myanmar', 'Myanmar Text', sans-serif;
  cursor: pointer; color: #374151; transition: all .15s; text-align: center;
}
.login-role-btn:hover:not(.sel) {
  border-color: #9CA3AF; color: #0D1420; background: #F3F4F6;
}
.login-role-btn.sel {
  background: #8B1A2E;
  border-color: #8B1A2E;
  color: #FFFFFF !important;
  font-weight: 700;
}

/* Primary login button — hardcoded crimson, always visible */
.login-btn {
  width: 100%;
  background: #8B1A2E;
  color: #FFFFFF !important;
  border: none; border-radius: var(--r);
  padding: 13px; font-size: 14px; font-weight: 700;
  font-family: 'Plus Jakarta Sans', 'Pyidaungsu', 'Noto Sans Myanmar', 'Myanmar Text', sans-serif;
  cursor: pointer; transition: background .15s, box-shadow .15s, transform .1s;
  box-shadow: 0 2px 8px rgba(139,26,46,0.30); margin-top: 4px;
  letter-spacing: .02em;
}
.login-btn:hover { background: #B82038; box-shadow: 0 4px 16px rgba(139,26,46,0.35); transform: translateY(-1px); }
.login-btn:active { transform: translateY(0); box-shadow: 0 1px 4px rgba(139,26,46,0.25); }
.login-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

/* Error message */
.login-err {
  font-size: 12px; font-weight: 500; color: #7F1D1D;
  text-align: center; margin-top: 10px; display: none;
  background: #FEE2E2; border: 1px solid #FECACA;
  border-radius: var(--r); padding: 9px 12px;
}

/* ── APP SHELL ── */
#appShell { display: none; }
#appShell.visible { display: flex; min-height: 100vh; }

/* ── TOPBAR ── */
.topbar {
  position: fixed; top: 0; left: 256px; right: 0; z-index: 50;
  height: 56px; background: rgba(17,24,32,0.97);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex; align-items: center; padding: 0 28px; gap: 14px;
  backdrop-filter: blur(12px);
}
body.theme-light .topbar {
  background: rgba(255,255,255,0.97);
  border-bottom: 1px solid var(--line);
}
.topbar-logo { font-family: 'Libre Baskerville', serif; font-size: 15px; color: rgba(255,255,255,0.85); letter-spacing: .02em; flex: 1; }
body.theme-light .topbar-logo { color: var(--ink); }
.topbar-logo span { color: #C8A96E; }
.topbar-role { font-size: 11px; color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.05); padding: 4px 10px; border-radius: var(--r); font-family: monospace; letter-spacing: .04em; border: 1px solid rgba(255,255,255,0.07); }
body.theme-light .topbar-role { color: var(--ink3); background: var(--surface); border-color: var(--line); }
.sync-badge { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #6EE7B7; }
.sync-dot { width: 7px; height: 7px; background: #6EE7B7; border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }
.topbar-user { width: 32px; height: 32px; background: var(--crimson); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; color: #fff; cursor: pointer; flex-shrink: 0; }
.logout-btn { font-size: 12px; color: rgba(255,255,255,.45); background: none; border: 1px solid rgba(255,255,255,.12); border-radius: var(--r); padding: 5px 12px; cursor: pointer; font-family: 'Plus Jakarta Sans', sans-serif; transition: all .15s; }
.logout-btn:hover { color: #fff; border-color: rgba(255,255,255,.35); }
body.theme-light .logout-btn { color: var(--ink3); border-color: var(--line); }
body.theme-light .logout-btn:hover { color: var(--ink); border-color: var(--crimson); }
.theme-toggle-btn { background: none; border: 1px solid rgba(255,255,255,.12); border-radius: var(--r); padding: 5px 8px; cursor: pointer; color: rgba(255,255,255,.4); transition: all .15s; display: flex; align-items: center; }
.theme-toggle-btn:hover { color: #fff; border-color: rgba(255,255,255,.35); }
body.theme-light .theme-toggle-btn { color: var(--ink3); border-color: var(--line); }
body.theme-light .theme-toggle-btn:hover { color: var(--ink); border-color: var(--crimson); }

/* ── SIDEBAR ── */
.sidebar {
  width: 256px; flex-shrink: 0;
  background: rgba(14,20,30,0.99);
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 60;
  overflow-y: auto; overflow-x: hidden;
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }
body.theme-light .sidebar { background: var(--white); border-right: 1px solid var(--line); }

/* Sidebar brand */
.sb-brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: center; gap: 12px; flex-shrink: 0;
}
body.theme-light .sb-brand { border-bottom-color: var(--line); }
.sb-brand-text { display: flex; flex-direction: column; gap: 1px; }
.sb-brand-name { font-family: 'Libre Baskerville', serif; font-size: 13px; font-weight: 700; color: rgba(255,255,255,0.92); letter-spacing: .3px; }
body.theme-light .sb-brand-name { color: var(--ink); }
.sb-brand-sub { font-size: 10px; color: rgba(255,255,255,0.28); letter-spacing: .5px; text-transform: uppercase; }
body.theme-light .sb-brand-sub { color: var(--ink3); }

/* Sidebar user card */
.sb-user {
  margin: 14px 12px;
  padding: 12px 14px;
  background: rgba(139,26,46,0.12);
  border: 1px solid rgba(139,26,46,0.22);
  border-radius: 10px;
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
body.theme-light .sb-user { background: var(--crimson-light); border-color: rgba(139,26,46,0.18); }
.sb-user-avatar {
  width: 34px; height: 34px; border-radius: 8px;
  background: rgba(139,26,46,0.35); border: 1.5px solid rgba(139,26,46,0.45);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Libre Baskerville', serif; font-size: 13px;
  color: rgba(255,255,255,0.88); flex-shrink: 0; overflow: hidden;
}
.sb-user-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
.sb-user-info { flex: 1; min-width: 0; }
.sb-user-name { font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.88); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.theme-light .sb-user-name { color: var(--ink); }
.sb-user-role { font-size: 10px; color: rgba(255,255,255,0.32); font-family: monospace; letter-spacing: .05em; margin-top: 1px; text-transform: uppercase; }
body.theme-light .sb-user-role { color: var(--ink3); }

/* Sidebar nav section label */
.sidebar-section {
  padding: 14px 20px 5px;
  font-size: 9px; font-weight: 700; letter-spacing: 1.8px; text-transform: uppercase;
  color: rgba(255,255,255,0.2); flex-shrink: 0;
}
body.theme-light .sidebar-section { color: var(--ink3); opacity: .7; }

/* Sidebar nav items */
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px 9px 16px; margin: 1px 8px;
  cursor: pointer; font-size: 13px; font-weight: 500;
  color: rgba(255,255,255,0.42);
  transition: all .15s;
  border-radius: 8px; border: 1px solid transparent;
  user-select: none;
}
.nav-item:hover { color: rgba(255,255,255,0.75); background: rgba(255,255,255,0.05); }
.nav-item.active { color: rgba(255,255,255,0.92); background: rgba(139,26,46,0.2); border-color: rgba(139,26,46,0.28); }
body.theme-light .nav-item { color: var(--ink3); }
body.theme-light .nav-item:hover { color: var(--ink); background: rgba(13,27,42,0.04); }
body.theme-light .nav-item.active { color: var(--crimson); background: var(--crimson-light); border-color: rgba(139,26,46,0.18); }
.nav-icon { font-size: 14px; width: 18px; text-align: center; flex-shrink: 0; color: rgba(255,255,255,0.28); transition: color .15s; }
.nav-item:hover .nav-icon { color: rgba(255,255,255,0.55); }
.nav-item.active .nav-icon { color: #e05470; }
body.theme-light .nav-icon { color: var(--ink3); }
body.theme-light .nav-item:hover .nav-icon { color: var(--ink2); }
body.theme-light .nav-item.active .nav-icon { color: var(--crimson); }
.nav-badge { margin-left: auto; background: var(--crimson); color: #fff; font-size: 10px; padding: 1px 7px; border-radius: 99px; font-weight: 700; }
#ep-minPass::-webkit-slider-thumb { -webkit-appearance:none; width:18px; height:18px; border-radius:50%; background:var(--crimson); border:2px solid #fff; box-shadow:0 1px 4px rgba(0,0,0,.25); cursor:pointer; margin-top:0; }
#ep-minPass::-moz-range-thumb { width:16px; height:16px; border-radius:50%; background:var(--crimson); border:2px solid #fff; box-shadow:0 1px 4px rgba(0,0,0,.25); cursor:pointer; }
#ep-minPass::-webkit-slider-runnable-track { background:transparent; height:6px; }
#ep-minPass::-moz-range-track { background:transparent; height:6px; }

/* Sidebar footer */
.sb-sidebar-footer {
  padding: 12px 12px 18px;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0; margin-top: auto;
}
body.theme-light .sb-sidebar-footer { border-top-color: var(--line); }
.btn-signout {
  width: 100%; padding: 9px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: rgba(255,255,255,0.38);
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: all .15s;
}
.btn-signout:hover { background: rgba(139,26,46,0.15); border-color: rgba(139,26,46,0.25); color: rgba(255,255,255,0.7); }
body.theme-light .btn-signout { color: var(--ink3); background: var(--surface); border-color: var(--line); }
body.theme-light .btn-signout:hover { background: var(--crimson-light); border-color: rgba(139,26,46,0.2); color: var(--crimson); }
.staff-only { display: none; }

/* ── MAIN ── */
.main {
  margin-left: 256px;
  margin-top: 56px;
  padding: 32px 32px 80px;
  min-height: calc(100vh - 56px);
  background: transparent;
  flex: 1;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
body.theme-light .main { background: var(--surface); }
.view { display:none; animation:fadeUp .2s ease; }
.view.active { display:block; }
@keyframes fadeUp { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:none} }

/* ── PAGE HEADER ── */
.page-header { margin-bottom:24px; display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
.page-title { font-family:'Libre Baskerville',serif; font-size:22px; color:var(--ink); line-height:1.15; }
.page-sub { font-size:12px; color:var(--ink3); margin-top:4px; }
.page-actions { display:flex; gap:8px; align-items:center; flex-shrink:0; }

/* ── CARDS ── */
.card { background:var(--white); border:1px solid var(--line); border-radius:10px; padding:20px; box-shadow:0 1px 4px rgba(13,27,42,.04); }
.card+.card { margin-top:16px; }
.card-title { font-size:10px; font-weight:700; letter-spacing:1.6px; text-transform:uppercase; color:var(--ink3); margin-bottom:14px; }

/* ── STAT GRID ── */
.stat-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:20px; }
.stat-card { background:var(--white); border:1px solid var(--line); border-radius:10px; padding:18px; position:relative; overflow:hidden; }
.stat-card::after { content:''; position:absolute; left:0; top:0; bottom:0; width:3px; background:var(--crimson); }
.stat-value { font-family:'Libre Baskerville',serif; font-size:32px; color:var(--ink); line-height:1; }
.stat-label { font-size:11px; color:var(--ink3); margin-top:4px; font-weight:600; letter-spacing:.5px; text-transform:uppercase; }
.stat-delta { font-size:11px; color:var(--green); margin-top:8px; }

/* ── TABLE ── */
.table-wrap { overflow-x:auto; }
table { width:100%; border-collapse:collapse; font-size:13px; }
thead tr { border-bottom:2px solid var(--line); }
th { padding:9px 14px; text-align:left; font-size:10px; font-weight:700; letter-spacing:1.4px; text-transform:uppercase; color:var(--ink3); white-space:nowrap; }
td { padding:11px 14px; border-bottom:1px solid var(--line); vertical-align:middle; color:var(--ink); }
tbody tr:last-child td { border-bottom:none; }
tbody tr:hover td { background:var(--surface); }

/* ── BADGES ── */
.badge { display:inline-block; padding:2px 9px; border-radius:4px; font-size:10px; font-weight:700; letter-spacing:.4px; text-transform:uppercase; }
.b-green  { background:var(--green-light);  color:var(--green); }
.b-gold   { background:var(--gold-light);   color:var(--gold); }
.b-red    { background:var(--crimson-light); color:var(--crimson); }
.b-blue   { background:var(--blue-light);   color:var(--blue); }
.b-muted  { background:var(--surface);      color:var(--ink3); border:1px solid var(--line); }

/* ── BUTTONS ── */
.btn { display:inline-flex; align-items:center; gap:6px; padding:8px 16px; border-radius:var(--r); font-size:13px; font-weight:500; cursor:pointer; border:none; transition:all .15s; font-family:'Plus Jakarta Sans','Pyidaungsu', 'Noto Sans Myanmar', 'Myanmar Text',sans-serif; text-decoration:none; }
.btn-primary { background:var(--crimson); color:#fff; }
.btn-primary:hover { background:var(--crimson-mid); }
.btn-outline { background:transparent; border:1px solid var(--line); color:var(--ink2); }
.btn-outline:hover { border-color:var(--crimson); color:var(--crimson); }
.btn-ghost { background:transparent; color:var(--ink3); }
.btn-ghost:hover { color:var(--crimson); }
.btn-danger { background:transparent; border:1px solid rgba(139,26,46,.25); color:var(--crimson); }
.btn-danger:hover { background:var(--crimson-light); }
.btn-success { background:var(--green); color:#fff; }
.btn-success:hover { background:#24784a; }
.btn-sm { padding:5px 11px; font-size:12px; }

/* ── FORMS ── */
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.form-group { display:flex; flex-direction:column; gap:5px; }
.form-group.full { grid-column:1/-1; }
label { font-size:11px; font-weight:600; letter-spacing:.6px; color:var(--ink3); text-transform:uppercase; }
input, select, textarea { background:var(--surface); border:1px solid var(--line); border-radius:var(--r); color:var(--ink); font-family:'Plus Jakarta Sans','Pyidaungsu', 'Noto Sans Myanmar', 'Myanmar Text',sans-serif; font-size:13px; padding:9px 12px; outline:none; transition:border .15s; }
input:focus, select:focus, textarea:focus { border-color:var(--crimson); background:var(--white); }
input[readonly] { color:var(--ink2); cursor:default; }
.form-actions { display:flex; gap:10px; margin-top:18px; }

/* ── SEARCH ROW ── */
.search-row { display:flex; gap:10px; margin-bottom:16px; align-items:center; flex-wrap:wrap; }
.search-input { flex:1; max-width:320px; }

/* ── UPLOAD ZONE ── */
.upload-zone { border:2px dashed var(--line); border-radius:10px; padding:36px; text-align:center; cursor:pointer; transition:all .2s; background:var(--surface); }
.upload-zone:hover, .upload-zone.drag { border-color:var(--crimson); background:var(--crimson-light); }
.upload-icon { font-size:2.5rem; margin-bottom:10px; }
.upload-label { font-size:14px; color:var(--ink); margin-bottom:4px; font-weight:500; }
.upload-sub { font-size:12px; color:var(--ink3); }


/* ── PROFESSIONAL SVG ICONS ── */
.spin { animation: spin .7s linear infinite; transform-origin: center; }
.nav-svg, .ui-icon { width:16px; height:16px; stroke:currentColor; stroke-width:1.9; fill:none; stroke-linecap:round; stroke-linejoin:round; flex-shrink:0; }
/* Settings slider circles need a white fill so the crossing line is hidden */
#i-settings circle { fill: var(--white, #fff); }
.nav-icon { width:18px; height:18px; display:inline-flex; align-items:center; justify-content:center; color:currentColor; }
.btn .ui-icon { width:14px; height:14px; }
.upload-icon { display:inline-flex; width:44px; height:44px; align-items:center; justify-content:center; margin-bottom:10px; color:var(--crimson); }
.upload-icon .ui-icon { width:36px; height:36px; }

/* ── PROFILE ── */
.profile-banner { background:var(--white); border:1px solid var(--line); border-radius:10px; padding:24px 28px; margin-bottom:20px; display:flex; gap:20px; align-items:flex-start; position:relative; overflow:hidden; }
.profile-banner::after { content:''; position:absolute; left:0; top:0; bottom:0; width:4px; background:var(--crimson); }
.profile-avatar { width:64px; height:64px; background:var(--crimson-light); border-radius:var(--r); display:flex; align-items:center; justify-content:center; font-family:'Libre Baskerville',serif; font-size:26px; color:var(--crimson); flex-shrink:0; overflow:hidden; }
.profile-avatar img { width:100%; height:100%; object-fit:cover; border-radius:var(--r); display:block; pointer-events:none; user-select:none; -webkit-user-select:none; -webkit-touch-callout:none; }
.profile-name { font-family:'Libre Baskerville',serif; font-size:20px; color:var(--ink); }
.profile-id { font-size:12px; color:var(--crimson); font-family:monospace; margin-top:3px; letter-spacing:.04em; }
.profile-meta { display:flex; gap:18px; margin-top:10px; flex-wrap:wrap; }
.pmi { font-size:12px; color:var(--ink3); display:flex; align-items:center; gap:4px; }
.gpa-big { font-family:'Libre Baskerville',serif; font-size:40px; color:var(--crimson); line-height:1; }
.gpa-lbl { font-size:10px; font-weight:700; letter-spacing:1.4px; text-transform:uppercase; color:var(--ink3); display:block; margin-bottom:2px; }
.gpa-den { font-size:12px; color:var(--ink3); }

/* ── GPA BAR ── */
.gpa-bar-track { height:4px; background:var(--surface); border-radius:99px; overflow:hidden; border:1px solid var(--line); margin:6px 0; }
.gpa-bar-fill { height:100%; background:linear-gradient(90deg,var(--crimson),var(--gold)); border-radius:99px; width:0; transition:width 1.2s cubic-bezier(.4,0,.2,1); }

/* ── TABS ── */
.tabs { display:flex; gap:2px; border-bottom:2px solid var(--line); margin-bottom:18px; }
.tab { padding:9px 18px; font-size:13px; cursor:pointer; color:var(--ink3); border-bottom:2px solid transparent; margin-bottom:-2px; transition:all .15s; }
.tab:hover { color:var(--ink); }
.tab.active { color:var(--crimson); border-bottom-color:var(--crimson); font-weight:500; }
.tab-panel { display:none; }
.tab-panel.active { display:block; animation:fadeUp .2s ease; }

/* ── PIPELINE ── */
.pipeline { display:flex; align-items:center; margin:20px 0; }
.pipeline-step { flex:1; text-align:center; position:relative; }
.pipeline-step::after { content:''; position:absolute; top:17px; left:50%; width:100%; height:2px; background:var(--line); z-index:0; }
.pipeline-step:last-child::after { display:none; }
.pipeline-dot { width:34px; height:34px; border-radius:50%; display:flex; align-items:center; justify-content:center; margin:0 auto 8px; font-size:13px; position:relative; z-index:1; border:2px solid var(--line); background:var(--surface); }
.pipeline-dot.done { background:var(--green); border-color:var(--green); color:#fff; }
.pipeline-dot.active { background:var(--gold); border-color:var(--gold); color:#fff; animation:pulse 1.5s infinite; }
.pipeline-label { font-size:11px; color:var(--ink3); line-height:1.4; }
.pipeline-label strong { display:block; color:var(--ink); font-size:12px; }

/* ── MODAL ── */
.modal-overlay { display:none; position:fixed; inset:0; background:rgba(13,27,42,.55); z-index:500; align-items:center; justify-content:center; overflow-y:auto; -webkit-overflow-scrolling:touch; padding:16px 0; }
.modal-overlay.open { display:flex; }
.modal { background:var(--white); border:1px solid var(--line); border-radius:12px; padding:28px; width:600px; max-width:95vw; max-height:90vh; overflow-y:auto; animation:fadeUp .2s ease; box-shadow:0 16px 48px rgba(13,27,42,.18); }
.modal-lg { width:800px; }
.modal-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; }
.modal-title { font-family:'Libre Baskerville',serif; font-size:18px; color:var(--ink); }
.modal-close { cursor:pointer; color:var(--ink3); font-size:18px; background:none; border:none; padding:4px 8px; border-radius:var(--r); transition:background .15s; }
.modal-close:hover { background:var(--surface); color:var(--ink); }

/* ── TOAST ── */
/* Background is hardcoded dark so it's always readable in both light and dark mode.
   var(--ink) was used before but in dark mode --ink becomes near-white, making the
   toast invisible (white box + white text). #1C2736 is a deep navy that works everywhere. */
.notif-toast { position:fixed; bottom:24px; right:24px; background:#1C2736 !important; border:1px solid rgba(255,255,255,.12) !important; border-radius:10px; padding:14px 18px; max-width:340px; z-index:9999; animation:toastIn .3s ease; box-shadow:0 8px 32px rgba(0,0,0,.45); border-left:4px solid #8B1A2E !important; }
@keyframes toastIn { from{opacity:0;transform:translateY(16px)} to{opacity:1;transform:none} }
.notif-title { font-size:12px; font-weight:600; color:#F9FAFB !important; margin-bottom:3px; }
.notif-body { font-size:12px; color:rgba(249,250,251,0.72) !important; }

/* ── STEP LIST ── */
.step-list { display:flex; flex-direction:column; gap:12px; }
.step-item { display:flex; gap:14px; align-items:flex-start; background:var(--white); border-radius:8px; padding:16px; border:1px solid var(--line); border-left:4px solid var(--crimson); }
.step-num { width:28px; height:28px; border-radius:50%; background:var(--crimson); color:#fff; font-weight:700; font-size:13px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.step-content h4 { font-size:14px; font-weight:600; margin-bottom:4px; color:var(--ink); }
.step-content p { font-size:12px; color:var(--ink3); line-height:1.6; }
.step-content code { background:var(--surface); border:1px solid var(--line); padding:2px 6px; border-radius:4px; font-size:11px; color:var(--crimson); font-family:monospace; }

/* ── CODE BLOCK ── */
.code-block { background:var(--ink); border-radius:8px; padding:16px; font-family:monospace; font-size:11.5px; color:#A8DADC; overflow-x:auto; white-space:pre; line-height:1.7; border:1px solid rgba(255,255,255,.08); }
.code-comment { color:#6B7280; }
.code-key { color:#C8A96E; }

/* ── BULK RESULT TABLE ── */
.bulk-result { margin-top:12px; }
.bulk-row-ok td { background:rgba(26,92,58,.04); }
.bulk-row-err td { background:rgba(139,26,46,.06); }
.bulk-progress { background:var(--surface); border-radius:99px; height:8px; overflow:hidden; margin:8px 0; }
.bulk-progress-bar { height:100%; background:linear-gradient(90deg,var(--crimson),var(--gold)); width:0; transition:width .4s; border-radius:99px; }

/* ── INFO BOX ── */
.info-box { background:var(--blue-light); border:1px solid rgba(30,58,110,.2); border-radius:var(--r); padding:12px 16px; font-size:12px; color:var(--blue); margin-bottom:14px; }
.warn-box { background:var(--gold-light); border:1px solid rgba(154,123,47,.3); border-radius:var(--r); padding:12px 16px; font-size:12px; color:var(--gold); margin-bottom:14px; }

/* ── UPLOAD OVERLAY ── */
.upload-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(13,27,42,.65);
  z-index: 9998;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 18px;
}
.upload-overlay.active { display: flex; }
.upload-overlay-box {
  background: var(--white);
  border-radius: 12px;
  padding: 32px 40px;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0,0,0,.28);
  min-width: 300px;
}
.upload-spinner {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: transparent;
  border: 3px solid var(--line);
  border-top-color: var(--crimson);
  border-right-color: var(--crimson);
  animation: spin .7s cubic-bezier(.4,0,.2,1) infinite;
  margin: 0 auto 18px;
  position: relative;
}
.upload-spinner::after {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-bottom-color: var(--gold);
  animation: spin 1.4s cubic-bezier(.4,0,.2,1) infinite reverse;
}
@keyframes spin { to { transform: rotate(360deg); } }
.upload-overlay-title { font-family:'Libre Baskerville',serif; font-size:16px; font-weight:700; color:var(--ink); margin-bottom:6px; letter-spacing:.01em; }
.upload-overlay-sub { font-size:12px; color:var(--ink3); }
.upload-overlay-progress { width:100%; background:var(--surface); border-radius:99px; height:6px; overflow:hidden; margin-top:14px; border:1px solid var(--line); }
.upload-overlay-bar { height:100%; background:linear-gradient(90deg,var(--crimson),var(--gold)); border-radius:99px; width:0; transition:width .3s; }
.divider { border:none; border-top:1px solid var(--line); margin:16px 0; }
.text-muted { color:var(--ink3); font-size:12px; }
.text-mono { font-family:monospace; font-size:12px; letter-spacing:.04em; }
.text-crimson { color:var(--crimson); }
.text-green { color:var(--green); }
.text-gold { color:var(--gold); }

/* ── PASSWORD FIELD ── */
.pw-wrap { position:relative; display:flex; align-items:center; }
.pw-wrap input { flex:1; padding-right:38px; font-family:monospace; letter-spacing:.06em; }
.pw-eye { position:absolute; right:10px; background:none; border:none; cursor:pointer; color:var(--ink3); padding:0; display:flex; align-items:center; transition:color .15s; }
.pw-eye:hover { color:var(--crimson); }
.pw-eye svg { width:16px; height:16px; stroke:currentColor; stroke-width:1.9; fill:none; stroke-linecap:round; stroke-linejoin:round; }
.warn-box.pw-warn { border-color:rgba(154,123,47,.4); }
.info-box.pw-info { border-color:rgba(30,58,110,.25); }
.mt-4 { margin-top:16px; }
.mt-2 { margin-top:8px; }
.flex { display:flex; align-items:center; }
.gap-2 { gap:8px; }
.gap-3 { gap:12px; }
.ml-auto { margin-left:auto; }
.grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.sis-panel { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.sis-flow { background:var(--white); border:1px solid var(--line); border-radius:10px; padding:18px; }
.sis-flow-title { font-size:11px; font-weight:700; letter-spacing:1px; text-transform:uppercase; color:var(--ink3); margin-bottom:12px; }
.sis-item { display:flex; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid var(--line); font-size:13px; color:var(--ink2); }
.sis-item:last-child { border-bottom:none; }
.sis-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }

/* ── DEGREE LEVEL TOKENS ── */
:root {
  --bach:#1E3A6E; --bach-light:#EBF0F8;
  --mast:#4A2080; --mast-light:#F0EBF8;
  --phd:#8B1A2E;  --phd-light:#F7EEF0;
}

/* ── DEGREE STACK (journey tab) ── */
.degree-stack-row{display:flex;align-items:center;gap:14px;padding:14px 16px;border-radius:var(--r);border:1px solid var(--line);background:var(--white);position:relative;overflow:hidden;margin-bottom:10px;cursor:pointer;transition:background .12s}
.degree-stack-row:hover{background:var(--surface)}
.degree-stack-row.active{background:var(--surface);box-shadow:inset 0 0 0 1.5px rgba(0,0,0,.08)}
.ds-pip{position:absolute;left:0;top:0;bottom:0;width:4px}
.ds-pip.bach{background:var(--bach)}
.ds-pip.mast{background:var(--mast)}
.ds-pip.phd {background:var(--phd)}
.ds-icon{width:40px;height:40px;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:18px;flex-shrink:0}
.ds-icon.bach{background:var(--bach-light)}
.ds-icon.mast{background:var(--mast-light)}
.ds-icon.phd {background:var(--phd-light)}
.ds-info{flex:1;min-width:0}
.ds-lvl{font-size:9px;font-weight:700;letter-spacing:1px;text-transform:uppercase;margin-bottom:2px}
.ds-lvl.bach{color:var(--bach)}
.ds-lvl.mast{color:var(--mast)}
.ds-lvl.phd {color:var(--phd)}
.ds-name{font-size:13px;font-weight:600;color:var(--ink)}
.ds-meta{font-size:11px;color:var(--ink3);margin-top:2px}
.ds-gpa{text-align:right;flex-shrink:0}
.ds-gpa-val{font-family:'Libre Baskerville',serif;font-size:20px;color:var(--ink);line-height:1}
.ds-gpa-den{font-size:10px;color:var(--ink3)}
.b-bach{background:var(--bach-light);color:var(--bach)}
.b-mast{background:var(--mast-light);color:var(--mast)}
.b-phd {background:var(--phd-light); color:var(--phd)}

/* ── ADD ENROLLMENT MODAL ── */
#newEnrollmentModal .info-box{margin-bottom:14px}

/* ── MOBILE HAMBURGER BUTTON ── */
.mob-menu-btn {
  display:none; background:none; border:none; cursor:pointer;
  color:rgba(255,255,255,.7); padding:6px; margin-right:4px;
  border-radius:var(--r); transition:background .15s;
}
body.theme-light .mob-menu-btn { color:var(--ink2); }
.mob-menu-btn:hover { background:rgba(255,255,255,.08); }
.mob-menu-btn svg { width:20px; height:20px; stroke:currentColor; stroke-width:2; fill:none; stroke-linecap:round; }
.sidebar-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,.45); z-index:55; }
.sidebar-overlay.open { display:block; }

/* ── DOCUMENT OFFICE SPECIFIC ── */
.doc-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; margin-bottom:20px; }
.doc-card {
  background:var(--white); border:1px solid var(--line); border-radius:10px;
  padding:20px; cursor:pointer; transition:all .2s; position:relative; overflow:hidden;
  display:flex; flex-direction:column; gap:10px;
}
.doc-card:hover { border-color:var(--crimson); box-shadow:0 4px 20px rgba(139,26,46,.10); transform:translateY(-2px); }
.doc-card::before { content:''; position:absolute; left:0; top:0; bottom:0; width:4px; background:var(--crimson); }
.doc-card-icon { width:44px; height:44px; background:var(--crimson-light); border-radius:10px; display:flex; align-items:center; justify-content:center; }
.doc-card-icon svg { width:22px; height:22px; stroke:var(--crimson); stroke-width:1.9; fill:none; stroke-linecap:round; stroke-linejoin:round; }
.doc-card-name { font-size:14px; font-weight:600; color:var(--ink); }
.doc-card-desc { font-size:11px; color:var(--ink3); line-height:1.5; }
.doc-card-badge { display:inline-block; font-size:9px; font-weight:700; letter-spacing:.6px; text-transform:uppercase; padding:2px 8px; border-radius:3px; margin-top:auto; }

.doc-preview-modal .modal { max-width:680px; }
.doc-letterhead { display:flex; align-items:center; gap:16px; border-bottom:2.5px solid var(--crimson); padding-bottom:14px; margin-bottom:20px; }
.doc-letterhead-logo { background:var(--crimson); color:#fff; font-family:'Libre Baskerville',serif; font-weight:700; font-size:14px; padding:8px 14px; border-radius:6px; flex-shrink:0; }
.doc-letterhead-info { line-height:1.6; }
.doc-letterhead-uni { font-size:9px; letter-spacing:1.5px; text-transform:uppercase; color:var(--ink3); }
.doc-letterhead-name { font-family:'Libre Baskerville',serif; font-size:15px; color:var(--crimson); font-weight:700; }
.doc-letterhead-sub { font-size:10px; color:var(--ink3); }
.doc-body { font-size:13px; line-height:1.9; color:var(--ink); margin-bottom:20px; }
.doc-sig-row { display:flex; justify-content:space-between; margin-top:40px; }
.doc-sig { text-align:center; width:180px; }
.doc-sig-stamp { width:56px; height:56px; border:1.5px dashed var(--line); border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:8px; color:var(--ink3); margin:0 auto 8px; }
.doc-sig-line { border-top:1px solid var(--ink); padding-top:6px; font-size:11px; color:var(--ink2); }
.doc-print-bar { display:flex; gap:10px; margin-top:20px; border-top:1px solid var(--line); padding-top:18px; }

/* ── MY PROFILE CARD ── */
.profile-hero-card {
  background:var(--white); border:1px solid var(--line); border-radius:12px;
  padding:28px; margin-bottom:20px; display:flex; gap:24px; align-items:flex-start;
  position:relative; overflow:hidden;
}
.profile-hero-card::after { content:''; position:absolute; left:0; top:0; bottom:0; width:4px; background:var(--crimson); }
.profile-info-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.profile-info-item { background:var(--surface); border:1px solid var(--line); border-radius:var(--r); padding:12px 14px; }
.profile-info-label { font-size:9px; font-weight:700; letter-spacing:1px; text-transform:uppercase; color:var(--ink3); margin-bottom:4px; }
.profile-info-value { font-size:13px; color:var(--ink); font-weight:500; }

/* ── MOBILE BOTTOM NAV (admin) ── */
.mob-bottom-nav {
  display:none !important; position:fixed; bottom:0; left:0; right:0; z-index:50;
  height:56px; background:rgba(14,20,30,.98); border-top:1px solid rgba(255,255,255,.07);
  justify-content:space-around; align-items:center;
}
body.theme-light .mob-bottom-nav { background:var(--white); border-top-color:var(--line); }
.mob-nav-btn {
  flex:1; display:flex; flex-direction:column; align-items:center; gap:3px;
  background:none; border:none; cursor:pointer; padding:6px 0;
  color:rgba(255,255,255,.35); font-size:9px; font-weight:600; letter-spacing:.5px; text-transform:uppercase;
  transition:color .15s;
}
body.theme-light .mob-nav-btn { color:var(--ink3); }
.mob-nav-btn.active, .mob-nav-btn:hover { color:var(--crimson); }
.mob-nav-btn svg { width:20px; height:20px; stroke:currentColor; stroke-width:1.9; fill:none; stroke-linecap:round; stroke-linejoin:round; }

@media (max-width:900px) {
  #appShell.visible { display:block; }
  .topbar { left:0; }
  .sidebar { transform:translateX(-100%); transition:transform .25s ease; z-index:58; }
  .sidebar.mob-open { transform:translateX(0); }
  .main { margin-left:0 !important; padding: 76px 14px 72px; overflow-x:hidden; }
  .stat-grid { grid-template-columns:1fr 1fr; }
  .sis-panel { grid-template-columns:1fr; }
  .form-grid { grid-template-columns:1fr; }
  .doc-grid { grid-template-columns:1fr 1fr; }
  .profile-hero-card { flex-direction:column; gap:16px; }
  .profile-info-grid { grid-template-columns:1fr; }
  .mob-menu-btn { display:flex; align-items:center; justify-content:center; }
  .mob-bottom-nav { display:flex !important; }
  .sync-badge { display:none; }
  /* Profile page: stack columns */
  .profile-2col-grid { display:block !important; }
  #view-myProfile > div[style*="grid-template-columns:260px"] { display:block !important; }
  #view-myProfile > div[style*="grid-template-columns:260px"] > div:first-child { margin-bottom:16px; }
  /* Timetable slot rows: stack on mobile */
  #myTimetableList > div[style*="grid-template-columns"] { display:flex !important; flex-direction:column; gap:6px; padding:12px; }
  /* Tab bar for timetable tabs */
  .tt-tab-bar { overflow-x:auto; -webkit-overflow-scrolling:touch; }
}
@media (max-width:480px) {
  .doc-grid { grid-template-columns:1fr; }
  .stat-grid { grid-template-columns:1fr 1fr; }
  /* Modal: full screen bottom sheet on mobile */
  .modal-overlay { align-items:flex-end !important; padding:0 !important; }
  .modal {
    padding:20px 16px 32px;
    border-radius:20px 20px 0 0 !important;
    width:100vw !important; max-width:100vw !important;
    max-height:92vh; overflow-y:auto;
    -webkit-overflow-scrolling:touch;
  }
  .doc-sig-row { flex-direction:column; align-items:center; gap:20px; }
  /* Login: stack on mobile */
  #loginScreen { flex-direction:column; overflow-y:auto; }
  .login-left { width:100%; min-height:auto; padding:28px 24px 24px; flex-direction:row; align-items:center; justify-content:space-between; }
  .login-crest { margin-bottom:0; }
  .login-tagline { font-size:18px; }
  .login-footer-txt { display:none; }
  .login-right { padding:20px 16px 40px; align-items:flex-start; }
  .login-form-wrap { padding:24px 20px; border-radius:14px; }
  /* Bigger tap targets */
  .login-input { padding:14px; font-size:16px; margin-bottom:12px; }
  .login-btn { padding:15px; font-size:16px; }
  .login-role-btn { padding:12px 8px; font-size:13px; }
  /* Form inputs: prevent zoom on iOS */
  .form-input, select, input, textarea { font-size:16px !important; }
  /* Timetable slot card on small phones */
  #myTimetableList > div { padding:12px !important; }
  .tt-ay-combo { flex-wrap:wrap; }
  .tt-ay-combo select, .tt-ay-combo input { min-width:0; }
}

/* ════════════════════════════════════════════════════════════
   MOBILE-FIRST RESPONSIVE IMPROVEMENTS  (injected patch)
   ════════════════════════════════════════════════════════════ */

/* ── Base smoothness ── */
html { scroll-behavior: smooth; }
* { -webkit-tap-highlight-color: transparent; }
button, [onclick] { cursor: pointer; }

/* ── Topbar: tighter on mobile, always readable ── */
.topbar { padding: 0 16px; gap: 10px; }
.topbar-logo { font-size: 14px; }

/* ── Page header: wrap gracefully ── */
.page-header {
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.page-header-left { flex: 1; min-width: 0; }
.page-actions { flex-wrap: wrap; gap: 6px; }
.page-title { font-size: 20px; }

/* ── Stat cards: always show value clearly ── */
.stat-value { font-size: 28px; }
.stat-card { padding: 14px 16px; }

/* ── Cards: consistent padding ── */
.card { padding: 18px 16px; }

/* ── Buttons: comfortable tap targets ── */
.btn { min-height: 38px; padding: 8px 16px; border-radius: 8px; }
.btn-sm { min-height: 32px; padding: 6px 12px; }

/* ── Forms: full-width selects & inputs everywhere ── */
input, select, textarea { width: 100%; box-sizing: border-box; min-height: 42px; }
.form-actions { flex-wrap: wrap; gap: 8px; }
.form-actions .btn { flex: 1; justify-content: center; }

/* ── Search row: stack on narrow ── */
.search-row { flex-wrap: wrap; gap: 8px; }
.search-input { max-width: 100%; }

/* ── Tables: card-style on very small screens ── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 8px; }
table { min-width: 520px; }

/* ── Toast: mobile safe ── */
.notif-toast { bottom: 16px; right: 12px; left: 12px; max-width: 100%; }

/* ── Tabs: scrollable ── */
.tabs {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; gap: 0;
}
.tabs::-webkit-scrollbar { display: none; }
.tab { white-space: nowrap; padding: 10px 16px; font-size: 13px; min-height: 42px; }

/* ── Login page: always scrollable ── */
#loginScreen { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.login-input { min-height: 48px; font-size: 16px; }
.login-btn   { min-height: 48px; font-size: 15px; }
.login-role-btn { min-height: 44px; font-size: 13px; }

/* ── Modals: always scrollable ── */
.modal-overlay { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.modal {
  width: min(600px, 95vw);
  max-height: 90dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.modal-header { position: sticky; top: 0; background: var(--white); z-index: 2; padding-bottom: 14px; margin-bottom: 0; }

/* ── Profile photo card: centered always ── */
#staffProfilePhotoWrap { touch-action: manipulation; }

/* ── Timetable slot cards: always readable ── */
.tt-slot-card { flex-wrap: wrap; gap: 10px; }
.tt-slot-actions { width: auto; }

/* ── Sidebar: smoother open/close ── */
.sidebar { transition: transform .22s cubic-bezier(.4,0,.2,1); }
.sidebar-overlay { transition: opacity .22s; }

/* ── Accordion-style collapse for mobile panels ── */
.mob-collapsible-header {
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; user-select: none; padding: 4px 0;
}
.mob-collapsible-header svg { transition: transform .2s; flex-shrink: 0; }
.mob-collapsible-header.collapsed svg { transform: rotate(-90deg); }
.mob-collapsible-body { overflow: hidden; transition: max-height .25s ease; }

/* ══════════════════════════════════════════════
   ≤ 900px  (tablet + mobile)
   ══════════════════════════════════════════════ */
@media (max-width: 900px) {

  /* Layout */
  body { font-size: 14px; }
  .main { padding: 72px 12px 72px; }

  /* Page header */
  .page-header { margin-bottom: 16px; }
  .page-title { font-size: 18px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; justify-content: center; }

  /* Stat grid: 2 cols */
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-value { font-size: 26px; }

  /* Doc grid: 2 cols */
  .doc-grid { grid-template-columns: 1fr 1fr; }

  /* Table wrapper: always scroll horizontally */
  .table-wrap { margin: 0 -12px; padding: 0 12px; }

  /* Search row full width */
  .search-row { gap: 8px; }
  .search-row .search-input { flex: 1 1 100%; max-width: 100%; }
  .search-row .btn { flex: 1; }

  /* Cards: tighter */
  .card { padding: 14px 12px; }
  .card-title { font-size: 9px; margin-bottom: 10px; }

  /* Profile 2-col → single col */
  .profile-2col-grid,
  #view-myProfile > div[style*="grid-template-columns:260px"] {
    display: block !important;
  }
  #view-myProfile > div[style*="grid-template-columns:260px"] > div:first-child {
    margin-bottom: 12px;
  }

  /* Profile hero card */
  .profile-hero-card { flex-direction: column; gap: 12px; padding: 16px; }
  .profile-meta { gap: 10px; }

  /* Timetable slot: full-width action row */
  .tt-slot-actions { width: 100%; justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }
  .tt-slot-card { padding: 12px; }
  .tt-slot-meta { gap: 4px; }

  /* Modals */
  .modal { padding: 20px 14px 28px; }
  .modal-lg { width: 95vw; }

  /* Timetable tab bar scrollable */
  .tt-tab-bar { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tt-tab-bar::-webkit-scrollbar { display: none; }
  .tt-tab { padding: 10px 14px; font-size: 12px; }

  /* Toast: above bottom nav */
  .notif-toast { bottom: 68px; }

  /* Form grid: always single column on tablet */
  .form-grid { grid-template-columns: 1fr; }

  /* Topbar */
  .topbar { padding: 0 12px; }
  .topbar-role, .sync-badge { display: none; }
  .logout-btn { padding: 5px 10px; font-size: 11px; }
}

/* ══════════════════════════════════════════════
   ≤ 600px  (phones)
   ══════════════════════════════════════════════ */
@media (max-width: 600px) {

  /* Layout */
  .main { padding: 68px 10px 80px; }
  .page-header { gap: 10px; }
  .page-title { font-size: 17px; }
  .page-sub { font-size: 11px; }

  /* Stat grid: 2 cols, compact */
  .stat-grid { gap: 8px; }
  .stat-card { padding: 12px; }
  .stat-value { font-size: 24px; }
  .stat-label { font-size: 10px; }

  /* Doc grid: single col */
  .doc-grid { grid-template-columns: 1fr; }

  /* Table: scrollable, preserve min-width */
  .table-wrap { border: 1px solid var(--line); border-radius: 8px; }

  /* Cards */
  .card { padding: 12px 10px; border-radius: 8px; }

  /* Modal → bottom sheet */
  .modal-overlay { align-items: flex-end !important; padding: 0 !important; }
  .modal {
    border-radius: 18px 18px 0 0 !important;
    width: 100vw !important; max-width: 100vw !important;
    max-height: 92dvh; padding: 0 14px 32px;
  }
  .modal-header {
    padding: 16px 0 12px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 16px;
  }
  .modal-title { font-size: 16px; }
  .form-actions .btn { min-height: 46px; font-size: 14px; }

  /* Login: stacked */
  #loginScreen { flex-direction: column; }
  .login-left {
    width: 100%; padding: 20px 16px;
    flex-direction: row; align-items: center;
    justify-content: flex-start; gap: 14px;
    min-height: auto;
  }
  .login-crest { margin-bottom: 0; }
  .login-institution { display: none; }
  .login-tagline { font-size: 16px; line-height: 1.2; }
  .login-footer-txt { display: none; }
  .crest-ring { width: 44px; height: 44px; margin-bottom: 0; }
  .crest-abbr { font-size: 14px; }
  .login-right { padding: 16px 16px 40px; align-items: stretch; }
  .login-form-wrap {
    padding: 20px 16px;
    border-radius: 14px;
    width: 100%;
    max-width: 100%;
  }
  .login-form-wrap h2 { font-size: 18px; margin-bottom: 2px; }
  .login-form-wrap p { font-size: 12px; margin-bottom: 20px; }
  .login-role-row { gap: 6px; }

  /* Prevent iOS zoom on focus */
  input, select, textarea, .form-input, .login-input { font-size: 16px !important; }

  /* Timetable slot: stacked */
  .tt-slot-card { flex-direction: column; gap: 8px; }
  .tt-slot-day-badge { width: auto; align-self: flex-start; }
  .tt-slot-actions { padding-top: 8px; }

  /* Form buttons: full width */
  .form-actions { flex-direction: column; }
  .form-actions .btn { width: 100%; min-height: 46px; font-size: 14px; }

  /* Academic year combo: wrap */
  .tt-ay-combo { flex-wrap: wrap; }
  .tt-ay-combo select, .tt-ay-combo input { min-width: 0; flex: 1; }
  .tt-ay-toggle { flex: 0 0 auto; }

  /* Profile photo card: comfortable */
  #staffProfilePhotoWrap { width: 80px !important; height: 80px !important; }

  /* Pipeline: scrollable */
  .pipeline { overflow-x: auto; -webkit-overflow-scrolling: touch; gap: 0; }
  .pipeline-step { min-width: 80px; }

  /* Doc sig row: stack */
  .doc-sig-row { flex-direction: column; align-items: center; gap: 16px; }

  /* Step list */
  .step-item { padding: 12px; gap: 10px; }

  /* Tabs: scrollable + full height tap */
  .tab { min-height: 40px; font-size: 12px; padding: 8px 14px; }

  /* Topbar */
  .topbar-logo { font-size: 13px; }
  .logout-btn { font-size: 11px; padding: 4px 8px; }
  .theme-toggle-btn { padding: 4px 6px; }
}

/* ══════════════════════════════════════════════
   ≤ 380px  (very small phones)
   ══════════════════════════════════════════════ */
@media (max-width: 380px) {
  .main { padding: 64px 8px 76px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .stat-card { padding: 10px 8px; }
  .stat-value { font-size: 20px; }
  .card { padding: 10px 8px; }
  .page-title { font-size: 16px; }
  .btn { min-height: 40px; font-size: 12px; padding: 6px 10px; }
  .tab { padding: 8px 10px; font-size: 11px; }
}
/* ── Modal: always single-col form grid ── */
.modal .form-grid { grid-template-columns: 1fr; }
.modal .form-group.full { grid-column: 1/-1; }

/* ══════════════════════════════════════════
   DOCUMENT OFFICE GRID
   ══════════════════════════════════════════ */
.doc-office-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  align-items: stretch;
}
.doc-office-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.doc-office-btn {
  margin-top: auto;
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 6px;
}
@media (max-width: 900px) {
  .doc-office-grid { grid-template-columns: 1fr; }
  .doc-office-btn { align-self: stretch; justify-content: center; min-height: 44px; }
}

/* ══════════════════════════════════════════
   STUDENT FILTERS — stack on mobile
   ══════════════════════════════════════════ */
.student-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.student-filter-row .search-input { flex: 1 1 100%; }
.student-filter-row select { flex: 1 1 calc(33% - 8px); min-width: 0; }
@media (max-width: 600px) {
  .student-filter-row select { flex: 1 1 100%; width: 100% !important; }
}

/* ══════════════════════════════════════════
   STUDENT TABLE CHECKBOX — tighter on mobile
   ══════════════════════════════════════════ */
@media (max-width: 900px) {
  #studentTable th:first-child,
  #studentTable td:first-child { width: 28px !important; padding: 6px 4px !important; }
  #studentTable input[type=checkbox] { width: 14px; height: 14px; }
}

/* ══════════════════════════════════════════
   STUDENT CARD LIST — replaces table on mobile
   ══════════════════════════════════════════ */
@media (max-width: 700px) {
  /* Hide the desktop table entirely */
  #view-students .table-wrap { display: none !important; }
  /* Show the mobile card list */
  #studentCardList { display: block !important; }
}
@media (min-width: 701px) {
  #studentCardList { display: none !important; }
}

/* Card list container */
#studentCardList { margin-top: 0; }

/* Program group header */
.scard-prog-header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; margin-bottom: 4px;
  background: rgba(139,26,46,0.07);
  border: 1px solid rgba(139,26,46,0.15);
  border-radius: 8px; cursor: pointer;
  user-select: none;
}
.scard-prog-header .scard-chevron { flex-shrink: 0; transition: transform .2s; }
.scard-prog-header.open .scard-chevron { transform: rotate(180deg); }
.scard-prog-label { font-size: 11px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--crimson); flex: 1; }
.scard-prog-count { font-size: 11px; color: var(--ink3); }

/* Year sub-header */
.scard-year-header {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px 7px 24px; margin-bottom: 3px;
  background: rgba(30,58,110,0.04);
  border: 1px solid rgba(30,58,110,0.08);
  border-radius: 6px; cursor: pointer;
  user-select: none;
}
.scard-year-header .scard-chevron { flex-shrink: 0; transition: transform .2s; }
.scard-year-header.open .scard-chevron { transform: rotate(180deg); }
.scard-year-label { font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--blue); flex: 1; }
.scard-year-count { font-size: 11px; color: var(--ink3); }

/* Individual student card */
.scard {
  background: var(--white); border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 14px; margin-bottom: 6px; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  display: flex; align-items: center; gap: 12px;
}
.scard:active { border-color: var(--crimson); box-shadow: 0 2px 8px rgba(139,26,46,.1); }
.scard-avatar {
  width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0;
  background: var(--crimson-light); display: flex; align-items: center; justify-content: center;
  font-family: 'Libre Baskerville', serif; font-size: 13px; font-weight: 700; color: var(--crimson);
  overflow: hidden;
}
.scard-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.scard-body { flex: 1; min-width: 0; }
.scard-name { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scard-id { font-size: 11px; font-family: monospace; color: var(--crimson); margin-top: 1px; }
.scard-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.scard-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.scard-gpa { font-size: 15px; font-weight: 700; }
.scard-gpa-den { font-size: 9px; color: var(--ink3); }

/* ── Responsive table: on tiny screens, use card layout ── */
@media (max-width: 520px) {
  .mob-table-scroll { overflow-x: auto; }
  .mob-table-scroll table { min-width: 480px; }
}

/* ── Search row selects: override inline widths on mobile ── */
@media (max-width: 600px) {
  .search-row { flex-wrap: wrap; }
  .search-row select[style*="width"] { width: 100% !important; flex: 1 1 calc(50% - 4px); min-width: 0; }
  .search-row .search-input { flex: 1 1 100%; }
}

/* ── Touch-action optimization ── */
button, .btn, .nav-item, .tab, .mob-nav-btn, .login-role-btn, .tt-tab {
  touch-action: manipulation;
}

/* ── Active states for tap feedback ── */
.btn:active { opacity: .82; transform: scale(.98); }
.nav-item:active { background: rgba(139,26,46,.15) !important; }
.mob-nav-btn:active { opacity: .7; }
.login-role-btn:active { opacity: .8; }
.tt-tab:active { opacity: .8; }

/* ── Sidebar overlay: smooth ── */
.sidebar-overlay {
  opacity: 0; transition: opacity .22s;
  background: rgba(0,0,0,.5);
}
.sidebar-overlay.open { opacity: 1; }

/* ── Timetable modal: form fields full width ── */
#timetableModal .form-grid { grid-template-columns: 1fr; }
#timetableModal .form-group { grid-column: 1/-1; }

/* ── Schedule cards: prevent overflow ── */
#bookedScheduleGrid > div { word-break: break-word; }

/* ── Upload zone: mobile friendly ── */
.upload-zone { padding: 24px 16px; }

/* ── Info box: break long URLs ── */
.info-box { word-break: break-word; }

/* ══════════════════════════════════════════
   OUR CHRONICLES
   ══════════════════════════════════════════ */

/* Chronicle card */
.chronicle-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .18s, transform .18s;
  cursor: default;
}
.chronicle-card:hover {
  box-shadow: 0 6px 24px rgba(13,27,42,.09);
  transform: translateY(-2px);
}

/* Image area */
.chronicle-card-img {
  width: 100%; height: 160px;
  object-fit: cover;
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink3); flex-shrink: 0;
}
.chronicle-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chronicle-card-img-placeholder {
  width: 100%; height: 160px;
  background: linear-gradient(135deg, rgba(139,26,46,.06) 0%, rgba(30,58,110,.06) 100%);
  display: flex; align-items: center; justify-content: center;
}

/* Card body */
.chronicle-card-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.chronicle-card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chronicle-card-date { font-size: 11px; color: var(--ink3); font-family: monospace; }
.chronicle-card-title { font-family: 'Libre Baskerville', serif; font-size: 15px; font-weight: 700; color: var(--ink); line-height: 1.35; }
.chronicle-card-body-text { font-size: 12px; color: var(--ink3); line-height: 1.6; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.chronicle-card-author { font-size: 11px; color: var(--ink3); margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); }
.chronicle-card-author strong { color: var(--ink2); }

/* Event info strip */
.chronicle-event-strip {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 11px; color: var(--ink2);
  padding: 6px 10px; background: var(--blue-light); border-radius: 6px;
}

/* Type badge */
.chronicle-badge {
  font-size: 9px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase;
  padding: 2px 8px; border-radius: 4px; display: inline-block;
}
.chronicle-badge-news         { background: var(--crimson-light); color: var(--crimson); }
.chronicle-badge-event        { background: var(--blue-light);    color: var(--blue); }
.chronicle-badge-announcement { background: var(--gold-light);    color: var(--gold); }
.chronicle-badge-article      { background: var(--green-light);   color: var(--green); }
.chronicle-badge-pending      { background: rgba(154,123,47,.15); color: var(--gold); }

/* ── Dashboard chronicles grid ── */
.dash-chronicle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px,100%), 1fr));
  gap: 16px;
}
@media (max-width: 640px) {
  .dash-chronicle-grid {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 12px;
    padding-bottom: 8px;
    /* negative margin trick so cards touch screen edge */
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
  }
  .dash-chronicle-grid .chronicle-card {
    flex: 0 0 76vw;
    max-width: 300px;
    scroll-snap-align: start;
  }
}

/* Card admin actions */
.chronicle-card-actions { display: flex; gap: 6px; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--surface); }

/* Unpublished overlay */
.chronicle-card.unpublished { opacity: .65; }
.chronicle-card.unpublished .chronicle-card-body::before {
  content: 'DRAFT'; font-size: 9px; font-weight: 800; letter-spacing: 1px;
  color: var(--ink3); background: var(--surface); border: 1px solid var(--line);
  border-radius: 4px; padding: 1px 7px; display: inline-block; margin-bottom: 2px;
}

/* IRIR footer */
.irir-footer {
  margin-top: 48px;
  padding: 18px 0 4px;
  border-top: 2px solid var(--crimson);
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--ink3);
}
.irir-footer-dot { color: var(--ink3); }
.irir-footer-brand { color: var(--crimson); font-weight: 700; letter-spacing: .3px; }
body.theme-light .irir-footer { border-top-color: var(--crimson); }

/* ── Code blocks: horizontal scroll ── */
.code-block {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  white-space: pre; font-size: 12px;
}

/* ── Topbar: show only essentials on mobile ── */
@media (max-width: 600px) {
  .topbar-logo em { display: none; }
}



/* ═══════════════════════════════════════════════════════════════
   DARK MODE — explicit overrides for hardcoded whites & contrast
   ═══════════════════════════════════════════════════════════════ */
body.theme-dark .card,
body.theme-dark .stat-card,
body.theme-dark .modal,
body.theme-dark .scard,
body.theme-dark .doc-card,
body.theme-dark .sis-flow,
body.theme-dark .degree-stack-row,
body.theme-dark .tt-slot-card,
body.theme-dark .step-item,
body.theme-dark .profile-hero-card,
body.theme-dark .profile-banner,
body.theme-dark .profile-info-item,
body.theme-dark .chronicle-card,
body.theme-dark .upload-overlay-box {
  background: #1E2C3F;   /* warm navy card */
  border-color: rgba(255,255,255,0.07);
}

body.theme-dark tbody tr:hover td {
  background: rgba(255,255,255,0.035);
}

body.theme-dark thead tr {
  border-bottom-color: rgba(255,255,255,0.08);
}

body.theme-dark td {
  border-bottom-color: rgba(255,255,255,0.05);
}

body.theme-dark .modal-header {
  background: #1E2C3F;
  border-bottom-color: rgba(255,255,255,0.07);
}

body.theme-dark #tt-course-dropdown {
  background: #1E2C3F;
  border-color: var(--crimson);
}

body.theme-dark .tt-course-opt {
  border-bottom-color: rgba(255,255,255,0.05);
}

body.theme-dark .divider {
  border-top-color: rgba(255,255,255,0.07);
}

body.theme-dark .chronicle-card-author {
  border-top-color: rgba(255,255,255,0.07);
}

body.theme-dark .chronicle-card-actions {
  background: #16202E;
  border-top-color: rgba(255,255,255,0.07);
}

/* Login form stays always-light — override already handles variables inside #loginScreen */
body.theme-dark .info-box {
  background: rgba(29,55,96,0.28);
  border-color: rgba(29,55,96,0.50);
  color: #8ABADF;
}

body.theme-dark .warn-box {
  background: rgba(138,110,40,0.22);
  border-color: rgba(138,110,40,0.40);
  color: #C9A048;
}

body.theme-dark .doc-card-icon {
  background: rgba(139,26,46,0.20);
}

body.theme-dark .scard-avatar {
  background: rgba(139,26,46,0.20);
}

body.theme-dark .gpa-bar-track {
  background: rgba(255,255,255,0.06);
}

body.theme-dark .chr-event-strip,
body.theme-dark .chronicle-event-strip {
  background: rgba(29,55,96,0.22);
}

body.theme-dark .badge.b-muted {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.11);
}

body.theme-dark .btn-outline {
  border-color: rgba(255,255,255,0.14);
  color: var(--ink2);
}

body.theme-dark .btn-outline:hover {
  border-color: var(--crimson);
  color: var(--crimson);
}

body.theme-dark .tabs,
body.theme-dark .tt-tab-bar {
  border-bottom-color: rgba(255,255,255,0.08);
}

body.theme-dark .upload-zone {
  background: #16202E;
  border-color: rgba(255,255,255,0.10);
}

body.theme-dark .upload-zone:hover,
body.theme-dark .upload-zone.drag {
  background: rgba(139,26,46,0.10);
  border-color: var(--crimson);
}

body.theme-dark .pipeline-dot {
  background: #1E2C3F;
  border-color: rgba(255,255,255,0.11);
}

body.theme-dark .pipeline-step::after {
  background: rgba(255,255,255,0.07);
}

body.theme-dark .code-block {
  background: #111820;
  border-color: rgba(255,255,255,0.06);
}

body.theme-dark .schedule-row {
  background: #1E2C3F;
  border-color: rgba(255,255,255,0.07);
}

body.theme-dark .tt-day-pill {
  background: #1E2C3F;
  border-color: rgba(255,255,255,0.10);
}

body.theme-dark .tt-qtime {
  background: #1E2C3F;
  border-color: rgba(255,255,255,0.10);
}

body.theme-dark .tt-ay-toggle {
  background: #1E2C3F;
  border-color: rgba(255,255,255,0.10);
}

body.theme-dark .tt-course-mode-toggle {
  border-color: rgba(255,255,255,0.10);
}

body.theme-dark .tt-cmode-btn {
  background: #1E2C3F;
}

body.theme-dark .scard-prog-header {
  background: rgba(139,26,46,0.09);
  border-color: rgba(139,26,46,0.16);
}

body.theme-dark .scard-year-header {
  background: rgba(29,55,96,0.09);
  border-color: rgba(29,55,96,0.14);
}

body.theme-dark .ds-icon.bach { background: rgba(29,55,96,0.24); }
body.theme-dark .ds-icon.mast { background: rgba(74,32,128,0.20); }
body.theme-dark .ds-icon.phd  { background: rgba(139,26,46,0.20); }

/* ─── Badge variants in dark: desaturated, warm, readable ─── */
body.theme-dark .b-green  { background: rgba(26,84,56,0.25);   color: #62C98E; }
body.theme-dark .b-gold   { background: rgba(138,110,40,0.22); color: #CEAA52; }
body.theme-dark .b-red    { background: rgba(139,26,46,0.22);  color: #D97080; }
body.theme-dark .b-blue   { background: rgba(29,55,96,0.25);   color: #7EB8E4; }
body.theme-dark .chronicle-badge-news         { background: rgba(139,26,46,0.22); color: #D97080; }
body.theme-dark .chronicle-badge-event        { background: rgba(29,55,96,0.25);  color: #7EB8E4; }
body.theme-dark .chronicle-badge-announcement { background: rgba(138,110,40,0.22); color: #CEAA52; }
body.theme-dark .chronicle-badge-article      { background: rgba(26,84,56,0.25);  color: #62C98E; }
body.theme-dark .chronicle-badge-pending      { background: rgba(138,110,40,0.15); color: #CEAA52; }

/* ── Table headers in dark ── */
body.theme-dark th { color: #6E8099; }

/* ── Profile info items: slightly deeper surface ── */
body.theme-dark .profile-info-item { background: #16202E; }

/* ── Placeholder: readable but subtle ── */
body.theme-dark .form-input::placeholder,
body.theme-dark input::placeholder,
body.theme-dark textarea::placeholder { color: rgba(110,128,153,0.55); }

/* ── DOF dept disabled ── */
body.theme-dark #dof-dept:disabled {
  background: #16202E !important;
  color: #6E8099 !important;
}

  .tt-tab-bar {
    display:flex; gap:0; border-bottom:2px solid var(--line);
    margin:0 0 0; overflow-x:auto; -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
  }
  .tt-tab-bar::-webkit-scrollbar { display:none; }
  .tt-tab {
    padding:10px 20px; font-size:13px; font-weight:600; cursor:pointer;
    border-bottom:2px solid transparent; margin-bottom:-2px;
    color:var(--ink3); white-space:nowrap; transition:all .15s;
    background:none; border-top:none; border-left:none; border-right:none;
    font-family:'Plus Jakarta Sans',sans-serif;
  }
  .tt-tab.active { color:var(--crimson); border-bottom-color:var(--crimson); }
  .tt-tab:hover:not(.active) { color:var(--ink2); }
  .tt-tab-panel { display:none; padding:20px 0 0; }
  .tt-tab-panel.active { display:block; }
  .tt-slot-card {
    background:var(--white); border:1px solid var(--line); border-radius:10px;
    padding:14px 16px; display:flex; align-items:flex-start; gap:14px;
    transition:box-shadow .15s;
  }
  .tt-slot-card:hover { box-shadow:0 4px 16px rgba(13,27,42,.08); }
  .tt-slot-day-badge {
    background:var(--crimson); color:#fff; border-radius:6px;
    padding:6px 10px; font-size:11px; font-weight:700; letter-spacing:.5px;
    text-align:center; min-width:44px; flex-shrink:0;
  }
  .tt-slot-body { flex:1; min-width:0; }
  .tt-slot-course { font-size:14px; font-weight:600; color:var(--ink); margin-bottom:2px; }
  .tt-slot-topic { font-size:12px; color:var(--ink2); font-style:italic; margin-bottom:4px; }
  .tt-slot-meta { display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
  .tt-slot-badge { font-size:10px; font-weight:600; border-radius:3px; padding:2px 7px; }
  .tt-slot-time { font-size:11px; font-family:monospace; color:var(--ink3); }
  .tt-slot-actions { display:flex; gap:6px; flex-shrink:0; }
  @media(max-width:600px){
    .tt-slot-card { flex-wrap:wrap; }
    .tt-slot-actions { width:100%; justify-content:flex-end; margin-top:4px; }
  }


/* ── COURSE SEARCH TYPEAHEAD ── */
.tt-search-wrap { position:relative; }
.tt-search-wrap input { width:100%; }
#tt-course-dropdown {
  position:absolute; top:100%; left:0; right:0; z-index:999;
  background:var(--white); border:1.5px solid var(--crimson);
  border-top:none; border-radius:0 0 var(--r) var(--r);
  max-height:220px; overflow-y:auto; display:none;
  box-shadow:0 8px 24px rgba(0,0,0,.12);
}
.tt-course-opt {
  padding:10px 13px; font-size:13px; cursor:pointer; color:var(--ink);
  border-bottom:1px solid var(--line); transition:background .1s;
  line-height:1.35;
}
.tt-course-opt:last-child { border-bottom:none; }
.tt-course-opt:hover, .tt-course-opt.active { background:var(--crimson-light); color:var(--crimson); }
.tt-course-opt em { font-style:normal; font-weight:700; color:var(--crimson); }

/* ── ACADEMIC YEAR COMBO ── */
.tt-ay-combo { display:flex; gap:6px; align-items:stretch; }
.tt-ay-combo select { flex:1; }
.tt-ay-combo input  { flex:1; display:none; }
.tt-ay-toggle {
  background:var(--surface); border:1.5px solid var(--line); border-radius:var(--r);
  padding:0 10px; font-size:11px; font-weight:600; color:var(--ink3);
  cursor:pointer; white-space:nowrap; transition:all .15s;
}
.tt-ay-toggle:hover { border-color:var(--crimson); color:var(--crimson); }

/* ── DAY PILL SELECTOR ── */
.tt-day-pills {
  display:flex; gap:6px; flex-wrap:wrap;
}
.tt-day-pill {
  flex:1; min-width:44px; padding:10px 6px; border-radius:8px;
  border:1.5px solid var(--line); background:var(--surface);
  font-size:12px; font-weight:600; color:var(--ink2);
  cursor:pointer; text-align:center; transition:all .15s;
  font-family:'Plus Jakarta Sans',sans-serif; line-height:1;
}
.tt-day-pill:hover { border-color:var(--crimson); color:var(--crimson); background:var(--crimson-light); }
.tt-day-pill.selected { border-color:var(--crimson); background:var(--crimson); color:#fff; }
.tt-day-pill.auto-hint { border-color:var(--gold); }

/* ── TIME QUICK-PICKS ── */
.tt-time-section { display:flex; gap:12px; flex-wrap:wrap; }
.tt-time-col { flex:1; min-width:120px; }
.tt-time-label { font-size:11px; font-weight:700; letter-spacing:.6px; color:var(--ink3); text-transform:uppercase; margin-bottom:6px; display:block; }
.tt-time-input-row { display:flex; gap:6px; align-items:center; }
.tt-time-input-row input[type=time] {
  flex:1; background:var(--surface); border:1.5px solid var(--line);
  border-radius:var(--r); padding:10px 10px; font-size:14px;
  color:var(--ink); outline:none; transition:border .15s;
  font-family:'Plus Jakarta Sans',sans-serif; min-width:0;
}
.tt-time-input-row input[type=time]:focus { border-color:var(--crimson); background:var(--white); }
.tt-quick-times { display:flex; flex-wrap:wrap; gap:4px; margin-top:6px; }
.tt-qtime {
  padding:5px 9px; border-radius:5px; border:1.5px solid var(--line);
  background:var(--surface); font-size:11px; font-weight:600;
  color:var(--ink2); cursor:pointer; transition:all .12s;
  font-family:'Plus Jakarta Sans',sans-serif; white-space:nowrap;
}
.tt-qtime:hover { border-color:var(--crimson); color:var(--crimson); background:var(--crimson-light); }
.tt-qtime.selected { border-color:var(--crimson); background:var(--crimson); color:#fff; }

/* ── COURSE MODE TOGGLE ── */
.tt-course-mode-toggle {
  display:flex; gap:0; border:1.5px solid var(--line); border-radius:var(--r); overflow:hidden; margin-bottom:8px;
}
.tt-cmode-btn {
  flex:1; padding:8px 12px; background:var(--surface); border:none;
  font-size:12px; font-weight:600; color:var(--ink3); cursor:pointer;
  transition:all .15s; font-family:'Plus Jakarta Sans',sans-serif;
}
.tt-cmode-btn:first-child { border-right:1.5px solid var(--line); }
.tt-cmode-btn.active { background:var(--crimson); color:#fff; }

@media(max-width:600px){
  .tt-day-pills { gap:4px; }
  .tt-day-pill { font-size:11px; padding:10px 4px; min-width:38px; }
  .tt-time-section { flex-direction:column; gap:10px; }
}

/* ══════════════════════════════════════════════════════
   PDF DOCUMENTS VIEW — filter toolbar, group headers,
   signature modal, clear history button
   ══════════════════════════════════════════════════════ */

/* ── Filter toolbar ── */
.doc-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.doc-filter-bar .form-input {
  height: 34px;
  padding: 6px 10px;
  font-size: 13px;
}
.doc-filter-bar input[type="text"] { width: 200px; }
.doc-filter-bar select            { width: 140px; }

/* ── Group header rows ── */
.doc-group-header td {
  padding: 8px 12px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--ink3) !important;
  background: var(--surface) !important;
  border-top: 2px solid var(--line);
}
body.theme-dark .doc-group-header td {
  background: rgba(255,255,255,0.04) !important;
  border-top-color: rgba(255,255,255,0.07);
}

/* ── Clear history button ── */
.btn-danger-outline {
  color: var(--crimson) !important;
  border-color: rgba(139,26,46,.35) !important;
  background: transparent;
  font-size: 12px;
}
.btn-danger-outline:hover {
  background: var(--crimson-light) !important;
  border-color: var(--crimson) !important;
}
body.theme-dark .btn-danger-outline {
  color: #D97080 !important;
  border-color: rgba(217,112,128,.35) !important;
}
body.theme-dark .btn-danger-outline:hover {
  background: rgba(139,26,46,.18) !important;
  border-color: #D97080 !important;
}

/* ── Sign modal — simplified (no draw pad) ── */
#docSignModal .modal-box { max-width: 480px; }

.sign-notice {
  background: var(--crimson-light);
  border: 1px solid rgba(139,26,46,.2);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 12px;
  color: var(--crimson);
  line-height: 1.6;
  margin-bottom: 20px;
}
body.theme-dark .sign-notice {
  background: rgba(139,26,46,.12);
  border-color: rgba(217,112,128,.2);
  color: #D97080;
}

.sign-typed-note {
  padding: 10px 0 4px;
  font-size: 12px;
  color: var(--ink3);
  line-height: 1.6;
}

/* ── Sealing state on submit button ── */
#sigSubmitBtn[disabled] {
  opacity: .85;
  cursor: wait;
}

/* ── Signature block in table ── */
.sig-count-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--ink3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 2px 8px;
}

/* ── Responsive: stack toolbar on small screens ── */
@media (max-width: 700px) {
  .doc-filter-bar { gap: 8px; }
  .doc-filter-bar input[type="text"],
  .doc-filter-bar select { width: 100%; }
  .doc-filter-bar .btn-danger-outline { width: 100%; margin-left: 0 !important; }
}

/* ── Dark mode table group header ── */
body.theme-dark tr.doc-group-header { background: rgba(255,255,255,0.03); }

/* ══════════════════════════════════════════════════════════════════
   UNIVERSITY PORTAL PROFESSIONAL DESIGN OVERHAUL
   ══════════════════════════════════════════════════════════════════ */

/* ── MODAL BOX HEADER/FOOTER ── */
.modal-box {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  width: 600px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 64px rgba(13,27,42,.22);
  animation: fadeUp .2s ease;
}
body.theme-dark .modal-box {
  background: #1E2C3F;
  border-color: rgba(255,255,255,0.07);
}
.modal-header {
  padding: 18px 24px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
body.theme-dark .modal-header {
  border-bottom-color: rgba(255,255,255,0.07);
}
.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--surface);
}
body.theme-dark .modal-footer {
  border-top-color: rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.02);
}

/* ── REFINED TABLE HEADER ── */
thead tr {
  background: transparent;
}
th {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--ink3);
  padding: 10px 14px;
  white-space: nowrap;
  border-bottom: 1.5px solid var(--line);
}
body.theme-light th {
  color: #4B5563;
  background: #F7F8FA;
  border-bottom-color: #DDE1E8;
}

/* ── STUDENT TABLE PROGRAM-GROUP ROW ── */
/* These rows are generated dynamically by JS as <tr> with specific inline background/color.
   We target them via the data attribute injected by admin-students.js */
tr.prog-group-row td,
tr[data-prog-group] td {
  background: var(--surface) !important;
  border-bottom: 1.5px solid var(--line) !important;
  padding: 10px 14px !important;
}
body.theme-dark tr.prog-group-row td,
body.theme-dark tr[data-prog-group] td {
  background: rgba(255,255,255,0.035) !important;
  border-bottom-color: rgba(255,255,255,0.07) !important;
}

/* Tighten the cohort sub-group rows (e.g., FINAL PART 2 CLINICAL) */
tr.cohort-group-row td,
tr[data-cohort-group] td {
  background: transparent !important;
  border-bottom: 1px solid var(--line) !important;
  padding: 8px 14px 8px 32px !important;
  color: var(--ink2) !important;
}
body.theme-dark tr.cohort-group-row td,
body.theme-dark tr[data-cohort-group] td {
  color: #B0BCCC !important;
}

/* ── PROFESSIONAL FONT COLORS: COHORT LABELS ── */
/* The student table cohort group labels use teal/cyan which looks amateurish.
   Override with proper ink hierarchy. */
.cohort-label, .prog-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink2) !important;  /* Was teal — now proper secondary ink */
}
body.theme-dark .cohort-label,
body.theme-dark .prog-label {
  color: #FFFFFF !important;
}

/* Program ID badge (e.g. "1001") — remove red, use ink */
.prog-id-badge {
  font-family: monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink) !important;
}
body.theme-dark .prog-id-badge {
  color: #FFFFFF !important;
}

/* ── REMOVE EMOJI FROM BUTTONS — via SVG replacements ── */
/* Assign Cohort and Cohort Report buttons use emoji; hide and use ::before text */
button[onclick*="openBulkCohortModal"] {
  position: relative;
}
button[onclick*="openCohortReportModal"] {
  position: relative;
}

/* ── PROGRAM GROUP ROW: inline-style override for dynamic JS rows ── */
/* admin-students.js renders these with inline color: #2D7BE5 (blue) or #8B1A2E (crimson)
   for the cohort sub-headers. We fix the colours at the class level. */

/* Year-level sub-header color overrides */
[style*="color: #2D7BE5"],
[style*="color:#2D7BE5"] {
  color: var(--ink2) !important;
}
[style*="color: rgb(45, 123, 229)"] {
  color: var(--ink2) !important;
}

/* ── TOPBAR: more institution-grade appearance ── */
.topbar-logo {
  font-family: 'Libre Baskerville', serif;
  font-size: 14px;
  letter-spacing: 0.02em;
}
body.theme-light .topbar {
  box-shadow: 0 1px 0 var(--line);
}

/* ── SIDEBAR brand: stronger visual identity ── */
.sb-brand-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.sb-brand-sub {
  font-size: 9.5px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  opacity: 0.6;
}
body.theme-light .sb-brand-name { color: #1C1F26; }
body.theme-light .sb-brand-sub  { color: #6E7A8A; opacity: 1; }

/* ── PAGE TITLE: serif for authority ── */
.page-title {
  font-family: 'Libre Baskerville', serif;
  font-size: 20px;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.01em;
}
body.theme-light .page-title { color: #0F1624; }
body.theme-dark  .page-title { color: #EDF2FA; }

.page-sub {
  font-size: 12px;
  color: var(--ink3);
  margin-top: 3px;
  letter-spacing: 0.02em;
}
body.theme-light .page-sub { color: #6B7280; }

/* ── CARD TITLE: refined label ── */
.card-title {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink3);
  margin-bottom: 14px;
}
body.theme-light .card-title { color: #7B8494; }

/* ── TABLE: professional ink hierarchy ── */
td {
  color: var(--ink);
  font-size: 13px;
}
body.theme-light td { color: #1C1F26; }
body.theme-dark  td { color: #CBD5E1; }

/* secondary cells (id, dates, codes) */
td .text-mono,
td code,
.cell-id { 
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 11.5px;
  color: var(--ink2);
  letter-spacing: 0.03em;
}
body.theme-light .cell-id { color: #3D4554; }
body.theme-dark  .cell-id { color: #7B93B5; }

/* ── CHECKBOXES: cleaner appearance ── */
input[type=checkbox] {
  width: 15px !important;
  height: 15px !important;
  accent-color: var(--crimson);
  cursor: pointer;
  min-height: 15px !important;
}

/* ── NAV ITEMS: crisper active state ── */
body.theme-light .nav-item { 
  color: #4B5563;
  font-size: 12.5px;
}
body.theme-light .nav-item:hover {
  color: #1C1F26;
  background: rgba(0,0,0,0.04);
}
body.theme-light .nav-item.active {
  color: #8B1A2E;
  background: #F8EFF1;
  border-color: rgba(139,26,46,0.2);
  font-weight: 600;
}
body.theme-light .nav-icon { color: #9CA3AF; }
body.theme-light .nav-item:hover .nav-icon  { color: #4B5563; }
body.theme-light .nav-item.active .nav-icon { color: #8B1A2E; }

/* ── SIDEBAR SECTION LABEL ── */
body.theme-light .sidebar-section {
  color: #9CA3AF;
  font-size: 8.5px;
  letter-spacing: 2px;
  opacity: 1;
}

/* ── STUDENT TABLE INLINE-STYLE GROUP HEADERS ── */
/* JS-rendered program group rows (the "1001 — 8 students · 4 years" row) */
/* These use inline font-weight:700; we augment their appearance */
tbody tr td[colspan] {
  padding: 10px 14px !important;
}

/* Fix the dynamic chevron character — JS renders a ▾ or v text.
   We target the surrounding <span> or <td> that contains the program group info */
tbody tr td[colspan] span[style*="color:#8B1A2E"],
tbody tr td[colspan] span[style*="color: #8B1A2E"],
tbody tr td[colspan] span[style*="color:rgb(139"] {
  color: var(--ink) !important;
  font-weight: 700 !important;
}

/* The "FINAL PART 2 CLINICAL" cohort sub-header teal text */
tbody tr td[colspan] span[style*="color:#2D7BE5"],
tbody tr td[colspan] span[style*="color: #2D7BE5"],
tbody tr td[colspan] span[style*="teal"],
tbody tr td[colspan] span[style*="#0891B2"],
tbody tr td[colspan] span[style*="#2563EB"] {
  color: var(--ink2) !important;
}
body.theme-dark tbody tr td[colspan] span[style*="color:#2D7BE5"],
body.theme-dark tbody tr td[colspan] span[style*="teal"],
body.theme-dark tbody tr td[colspan] span[style*="#0891B2"] {
  color: #8ABADF !important;
}

/* Chevron arrow fix — rendered in red (#8B1A2E) inline */
/* Replace bright red with subdued authority tone */
tbody tr td[colspan] span[style*="color:#8B1A2E"] {
  color: var(--crimson) !important;
  opacity: 0.75;
}

/* ── STAT CARDS: numbers should command attention ── */
.stat-value {
  font-family: 'Libre Baskerville', serif;
  font-weight: 400;
  font-size: 30px;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1;
}
body.theme-light .stat-value { color: #0F1624; }
body.theme-dark  .stat-value { color: #EDF2FA; }

.stat-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--ink3);
  margin-top: 5px;
}
body.theme-light .stat-label { color: #6B7280; }

/* ── BADGE REFINEMENTS ── */
.badge {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
}

/* ── FORM INPUTS: polish ── */
body.theme-light input:not([type=checkbox]):not([type=radio]),
body.theme-light select,
body.theme-light textarea {
  background: #FFFFFF;
  border-color: #D1D5DB;
  color: #1C1F26;
}
body.theme-light input:focus,
body.theme-light select:focus,
body.theme-light textarea:focus {
  border-color: #8B1A2E;
  box-shadow: 0 0 0 3px rgba(139,26,46,0.08);
}
body.theme-dark input:not([type=checkbox]):not([type=radio]),
body.theme-dark select,
body.theme-dark textarea {
  background: #16202E;
  border-color: rgba(255,255,255,0.10);
  color: #CBD5E1;
}
body.theme-dark input:focus,
body.theme-dark select:focus,
body.theme-dark textarea:focus {
  border-color: rgba(139,26,46,0.65);
  background: #1E2C3F;
}

/* ── LABEL: better contrast ── */
label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--ink3);
}
body.theme-light label { color: #6B7280; }
body.theme-dark  label { color: #7B93B5; }

/* ── BUTTON REFINEMENTS ── */
.btn {
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: 7px;
}
.btn-primary {
  background: #8B1A2E;
  color: #fff;
  box-shadow: 0 1px 3px rgba(139,26,46,0.25);
}
.btn-primary:hover {
  background: #A8223A;
  box-shadow: 0 2px 8px rgba(139,26,46,0.30);
}
body.theme-light .btn-outline {
  border-color: #D1D5DB;
  color: #374151;
  background: #FFFFFF;
}
body.theme-light .btn-outline:hover {
  border-color: #8B1A2E;
  color: #8B1A2E;
  background: #FBF2F3;
}

/* ── PROFILE BANNER ── */
body.theme-light .profile-banner {
  background: #FFFFFF;
  border-color: #E5E7EB;
}
.profile-name {
  font-family: 'Libre Baskerville', serif;
  font-size: 20px;
  color: var(--ink);
  font-weight: 700;
}
body.theme-light .profile-name { color: #0F1624; }
body.theme-dark  .profile-name { color: #EDF2FA; }

/* ── SEARCH INPUT ── */
body.theme-light .search-input,
body.theme-light input[type=text],
body.theme-light input[type=email],
body.theme-light input[type=search] {
  background: #FFFFFF;
  border-color: #D1D5DB;
  color: #1C1F26;
}
body.theme-light input::placeholder { color: #9CA3AF; }

/* ── SYNC BADGE: less neon ── */
.sync-badge { 
  font-size: 11px;
  color: #10B981;
  letter-spacing: 0.03em;
}
.sync-dot {
  background: #10B981;
}

/* ── LOGOUT BTN ── */
body.theme-dark .logout-btn {
  color: rgba(203,213,225,0.5);
  border-color: rgba(255,255,255,0.09);
}
body.theme-dark .logout-btn:hover {
  color: #CBD5E1;
  border-color: rgba(255,255,255,0.22);
}

/* ── TOPBAR USER AVATAR ── */
.topbar-user {
  background: var(--crimson);
  font-weight: 700;
  font-family: 'Libre Baskerville', serif;
  font-size: 11px;
  letter-spacing: 0.04em;
}

/* ── TABS: more authoritative ── */
.tab {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink3);
  padding: 10px 18px;
  letter-spacing: 0.02em;
}
.tab.active {
  color: var(--crimson);
  font-weight: 600;
  border-bottom-color: var(--crimson);
}
body.theme-light .tab         { color: #6B7280; }
body.theme-light .tab:hover   { color: #1C1F26; }
body.theme-light .tab.active  { color: #8B1A2E; border-bottom-color: #8B1A2E; }

/* ── MODAL TITLE ── */
.modal-title {
  font-family: 'Libre Baskerville', serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}
body.theme-light .modal-title { color: #0F1624; }
body.theme-dark  .modal-title { color: #EDF2FA; }

/* ── MODAL CLOSE BTN ── */
.modal-close {
  font-size: 16px;
  color: var(--ink3);
  background: none;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .15s;
}
.modal-close:hover {
  background: var(--surface);
  color: var(--ink);
}

/* ── NOTIF TOAST: fully hardcoded — immune to light/dark theme ── */
/* ALL colors hardcoded so toast always appears as a dark pill regardless of theme. */
.notif-toast {
  background: #1C2736 !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  border-left: 3px solid #8B1A2E !important;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,.35), 0 2px 8px rgba(0,0,0,.2);
}
.notif-title {
  font-size: 12px;
  font-weight: 600;
  color: #F9FAFB !important;
  letter-spacing: 0.01em;
}
.notif-body {
  font-size: 11.5px;
  color: rgba(249,250,251,0.72) !important;
  line-height: 1.5;
}

/* ── UPLOAD OVERLAY ── */
.upload-overlay-title {
  font-family: 'Libre Baskerville', serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* ── INFO / WARN BOX ── */
body.theme-light .info-box {
  background: #EFF6FF;
  border-color: rgba(29,55,96,0.18);
  color: #1D3760;
}
body.theme-light .warn-box {
  background: #FFFBEB;
  border-color: rgba(138,110,40,0.25);
  color: #78580A;
}

/* ── DARK THEME TABLE ROWS ── */
body.theme-dark tbody tr:hover td {
  background: rgba(255,255,255,0.03);
}
body.theme-dark td {
  border-bottom-color: rgba(255,255,255,0.045);
}

/* ── TBODY ALTERNATE: subtle stripe (optional) ── */
/* Only for light mode — gives a premium register feel */
body.theme-light tbody tr:nth-child(even) td {
  background: #FAFBFC;
}
body.theme-light tbody tr:hover td {
  background: #F3F4F6 !important;
}
/* Group-header rows (e.g. program header in courses table) set their own
   crimson background inline and must stay legible on hover — don't let the
   generic light-mode hover rule flatten them to light gray under white text. */
body.theme-light tbody tr.group-header-program:hover td {
  background: var(--crimson, #b91c1c) !important;
}

/* ── PROGRAM GROUP ROW override: correct the teal/blue cohort labels ──
   The student JS renders cohort sub-rows with a colored dot and label.
   We intercept to ensure proper colour hierarchy. */

/* Any td inside a group-header-style row with colspan */
table tbody tr td[colspan="14"],
table tbody tr td[colspan="13"],
table tbody tr td[colspan="12"],
table tbody tr td[colspan="11"],
table tbody tr td[colspan="10"] {
  padding: 0 !important;
}

/* ── SCROLLBAR: subtle, professional ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(139,26,46,0.18);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(139,26,46,0.32); }
body.theme-dark ::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.10);
}
body.theme-dark ::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.18);
}

/* ── FOCUS RINGS: accessible and clean ── */
:focus-visible {
  outline: 2px solid rgba(139,26,46,0.5);
  outline-offset: 2px;
}

/* ── SIDEBAR footer sign-out: subtle ── */
body.theme-light .btn-signout {
  background: #F9FAFB;
  border-color: #E5E7EB;
  color: #6B7280;
  font-size: 12.5px;
}
body.theme-light .btn-signout:hover {
  background: #FBF2F3;
  border-color: rgba(139,26,46,0.2);
  color: #8B1A2E;
}

/* ── SIDEBAR light mode: tighter, cleaner ── */
body.theme-light .sidebar {
  background: #FFFFFF;
  border-right: 1px solid #E5E7EB;
  box-shadow: 2px 0 12px rgba(0,0,0,0.04);
}
body.theme-light .sb-brand {
  border-bottom-color: #F3F4F6;
  background: #FAFAFA;
}

/* ── STAT CARD left stripe ── */
.stat-card::after {
  width: 3px;
  border-radius: 0 2px 2px 0;
}

/* ── DOC CARDS ── */
body.theme-light .doc-card {
  background: #FFFFFF;
  border-color: #E5E7EB;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
body.theme-light .doc-card:hover {
  border-color: #8B1A2E;
  box-shadow: 0 4px 18px rgba(139,26,46,0.09);
}

/* ── CARD light mode ── */
body.theme-light .card {
  background: #FFFFFF;
  border-color: #E5E7EB;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* ── LOGIN SCREEN: typographic polish ── */
.login-tagline {
  font-family: 'Libre Baskerville', serif;
  font-size: 25px;
  color: #fff;
  line-height: 1.28;
  letter-spacing: -0.01em;
}
.login-institution {
  font-size: 10px;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  margin-bottom: 10px;
  font-weight: 500;
}


/* ── LOGIN THEME TOGGLE BUTTON (replaces inline styles) ── */
.login-theme-toggle {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.65);
  transition: background .15s, border-color .15s, color .15s;
  width: 34px;
  height: 34px;
}
.login-theme-toggle:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.32);
  color: #fff;
}

/* ── PROFESSIONAL TABLE COLOUR OVERRIDES for dynamic JS content ──
   JS in admin-students.js renders group rows with hardcoded inline colors.
   We use broad attribute selectors to correct them. */

/* The program-level rows use a colored number like "1001" in red inline */
/* Soften to dark ink with subtle crimson for the ID number */
tbody tr td b[style],
tbody tr td strong[style] {
  color: var(--ink) !important;
}

/* Cohort sub-header labels (FINAL PART 2 CLINICAL, etc.) rendered with teal/blue */
/* We can only cascade over inline styles using !important */
tbody tr[style*="background"] td {
  /* Program group row backgrounds from JS: standardize */
}

/* The dark mode program group rows — make them look intentional */
body.theme-dark tbody tr td[colspan] {
  background: rgba(255,255,255,0.025) !important;
  border-bottom: 1px solid rgba(255,255,255,0.06) !important;
}

body.theme-light tbody tr td[colspan] {
  background: #F7F8FA !important;
  border-bottom: 1.5px solid #E5E7EB !important;
}

/* Exception: program group-header rows (courses table) render their own
   crimson background + white text inline (see renderCoursesTable() in
   admin-courses.js). The generic td[colspan] rule above was overriding
   that background to near-white while the text stayed white — making the
   row unreadable. Restore the crimson background here, at higher
   specificity, for this specific row type only. */
body.theme-light tbody tr.group-header-program td[colspan] {
  background: var(--crimson, #8B1A2E) !important;
  border-bottom: none !important;
}
body.theme-light tbody tr.group-header-program:hover td[colspan] {
  background: var(--crimson, #8B1A2E) !important;
}


/* ══════════════════════════════════════════════════════════════════
   STUDENT TABLE GROUP ROW VISIBILITY FIX
   The JS renders year-level sub-headers with inline color:var(--blue)
   which is #1D3760 — near-invisible in dark mode. Override with a
   readable colour for both themes.
   ══════════════════════════════════════════════════════════════════ */

/* ── Year-level header rows (e.g. FINAL PART 2 CLINICAL, M-3, FOUNDATION YEAR) ──
   These are <tr class="stu-year-header"> with inline stroke and color on the SVG/span.
   We target the row directly and force child text colours. */

tr.stu-year-header {
  background: rgba(30,58,110,0.06) !important;
}
tr.stu-year-header td {
  border-bottom: 1px solid rgba(255,255,255,0.05) !important;
}

/* The label span has inline color:var(--blue) — override for dark mode */
body.theme-dark tr.stu-year-header span[style*="color:var(--blue)"],
body.theme-dark tr.stu-year-header span[style*="color: var(--blue)"],
body.theme-dark tr.stu-year-header [style*="color:var(--blue)"] {
  color: #FFFFFF !important;   /* was #7EB8E4 — this !important was silently overriding the --blue:#FFFFFF fix */
}

/* The SVG chevron stroke is also var(--blue) inline */
body.theme-dark tr.stu-year-header svg[style*="stroke:var(--blue)"],
body.theme-dark tr.stu-year-header svg[style*="stroke: var(--blue)"] {
  stroke: #FFFFFF !important;
}

/* ── Program-level header rows (e.g. 1001, 1002) ──
   These are <tr class="stu-prog-header"> — already somewhat visible but
   the crimson is too saturated. Tone it down slightly. */
tr.stu-prog-header {
  background: rgba(139,26,46,0.07) !important;
  border-top: 1.5px solid rgba(139,26,46,0.18) !important;
}
tr.stu-prog-header td {
  border-bottom: none !important;
}

/* Program label text — readable in both modes */
body.theme-dark tr.stu-prog-header span[style*="color:var(--crimson)"],
body.theme-dark tr.stu-prog-header span[style*="color: var(--crimson)"] {
  color: #FFFFFF !important;   /* was #E8788A (light crimson) — now white per request */
}

/* Student count secondary text inside group rows */
body.theme-dark tr.stu-year-header span[style*="color:var(--ink3)"],
body.theme-dark tr.stu-year-header span[style*="color: var(--ink3)"],
body.theme-dark tr.stu-prog-header span[style*="color:var(--ink3)"],
body.theme-dark tr.stu-prog-header span[style*="color: var(--ink3)"] {
  color: #6E8099 !important;
}

/* ── Light mode: year header subtle but legible ── */
body.theme-light tr.stu-year-header {
  background: #F0F4FB !important;
}
body.theme-light tr.stu-year-header span[style*="color:var(--blue)"],
body.theme-light tr.stu-year-header span[style*="color: var(--blue)"],
body.theme-light tr.stu-year-header [style*="color:var(--blue)"] {
  color: #1D3760 !important;
}
body.theme-light tr.stu-year-header svg[style*="stroke:var(--blue)"],
body.theme-light tr.stu-year-header svg[style*="stroke: var(--blue)"] {
  stroke: #1D3760 !important;
}

/* ══════════════════════════════════════════════════════════════════
   MOBILE MODAL FIX — Close button no longer hidden behind bottom nav
   ══════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .modal-overlay {
    padding-bottom: 64px !important;
    align-items: flex-start !important;
    padding-top: 16px !important;
  }
  .modal-box,
  .modal {
    max-height: calc(100dvh - 140px) !important;
  }
}

@media (max-width: 480px) {
  .modal-overlay {
    padding-bottom: 72px !important;
    align-items: flex-end !important;
    padding-top: 0 !important;
  }
  .modal-box,
  .modal {
    max-height: calc(100dvh - 80px) !important;
    border-radius: 20px 20px 0 0 !important;
  }
}


/* ── TOAST/NOTIFICATION HARD-FORCE FIX ──
   Catches any toast/notification element regardless of exact class name,
   to guarantee dark-pill styling + readable contrast no matter what
   markup/class is actually rendered. Placed last + uses attribute
   selectors for max specificity/priority over earlier rules. */
[class*="toast"],
[class*="notif"] {
  background: #1C2736 !important;
  color: #F9FAFB !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  border-left: 3px solid #8B1A2E !important;
}

[class*="toast"] *,
[class*="notif"] * {
  color: inherit !important;
}

[class*="toast"] [class*="title"],
[class*="notif"] [class*="title"] {
  color: #F9FAFB !important;
}

[class*="toast"] [class*="body"],
[class*="notif"] [class*="body"] {
  color: rgba(249,250,251,0.78) !important;
}

/* (Previous guess-based fix removed — root cause was the unset --blue
   CSS variable in dark mode, fixed directly in the body.theme-dark
   block near the top of this file. See that comment for details.) */

/* ══════════════════════════════════════════════════════════════
   ADMIN MARK BOOK — Course-first IS-style preview
   ══════════════════════════════════════════════════════════════ */
.amb-is-list { border: 1px solid var(--line); background: var(--white); overflow: hidden; border-radius: var(--r); }
.amb-is-course { border-bottom: 1px solid var(--line); }
.amb-is-course:last-child { border-bottom: 0; }
.amb-is-head {
  width:100%; border:0; color:inherit; font:inherit; text-align:left;
  display: grid; grid-template-columns: minmax(0,1fr) auto 24px;
  gap: 12px; align-items: center; padding: 12px 16px; background: var(--surface); cursor: pointer;
}
.amb-is-head:focus-visible { outline: 2px solid rgba(120,128,140,.35); outline-offset: -2px; }
.amb-is-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.amb-is-modified,
.amb-is-meta { font-size: 10.5px; color: var(--ink3); text-align: right; line-height: 1.45; }
.amb-is-chevron { color: var(--ink3); transition: transform .18s; }
.amb-is-course:not(.is-open) .amb-is-chevron { transform: rotate(180deg); }
.amb-is-body { padding: 0 14px 14px 20px; }
.amb-is-row {
  display: grid; grid-template-columns: minmax(160px,25%) minmax(0,1fr) minmax(140px,19%) 42px;
  gap: 18px; align-items: start; padding: 14px 8px; border-bottom: 1px solid var(--line);
}
.amb-is-row:last-child { border-bottom: 0; }
.amb-is-label { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.amb-is-value { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; color: var(--ink); }
.amb-is-sub { margin-top: 3px; font-size: 10.5px; color: var(--ink3); }
.amb-is-notes {
  margin-top: 7px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px; line-height: 1.5; color: var(--ink2); white-space: normal; overflow-wrap: anywhere;
}
.amb-is-actions { text-align: right; }
.amb-is-empty { text-align: center; padding: 32px; color: var(--ink3); font-size: 13px; }
body:not(.theme-light) .amb-is-list { background: rgba(0,0,0,.12); border-color: rgba(255,255,255,.1); }
body:not(.theme-light) .amb-is-head { background: rgba(255,255,255,.035); }
body:not(.theme-light) .amb-is-course,
body:not(.theme-light) .amb-is-row { border-color: rgba(255,255,255,.08); }
body:not(.theme-light) .amb-is-title,
body:not(.theme-light) .amb-is-label,
body:not(.theme-light) .amb-is-value { color: rgba(255,255,255,.86); }
body:not(.theme-light) .amb-is-notes { color: rgba(255,255,255,.68); }
body:not(.theme-light) .amb-is-modified,
body:not(.theme-light) .amb-is-meta,
body:not(.theme-light) .amb-is-sub { color: rgba(255,255,255,.38); }
@media (max-width: 760px) {
  .amb-is-head { grid-template-columns: 1fr 20px; }
  .amb-is-modified { display: none; }
  .amb-is-row { grid-template-columns: 1fr; gap: 5px; }
  .amb-is-meta { text-align: left; }
  .amb-is-actions { text-align: left; }
}



/* ══════════════════════════════════════════════════════════════
   IRIR V12 — Faculty view recovery + solid Course Catalogue text
   ══════════════════════════════════════════════════════════════ */

/* Course Catalogue: Year and Grading Type must stay fully legible in light mode.
   Dynamic rows use badge variants whose previous blue/gray text was too pale. */
body.theme-light #coursesBody td:nth-child(3),
body.theme-light #coursesBody td:nth-child(7) {
  color: #1D2939 !important;
  opacity: 1 !important;
}

body.theme-light #coursesBody td:nth-child(3) .badge,
body.theme-light #coursesBody td:nth-child(7) .badge {
  color: #1D2939 !important;
  font-weight: 800 !important;
  opacity: 1 !important;
  -webkit-text-fill-color: #1D2939 !important;
}

/* Keep the pill background subtle, but make the label itself solid. */
body.theme-light #coursesBody td:nth-child(3) .b-blue,
body.theme-light #coursesBody td:nth-child(7) .b-blue {
  background: #E8EEF6 !important;
  border: 1px solid #C8D2E1 !important;
}

body.theme-light #coursesBody td:nth-child(7) .b-green {
  background: #E7F3EC !important;
  border: 1px solid #BDD8C9 !important;
}

/* Assessment / grading text that is rendered without a badge should also be solid. */
body.theme-light #coursesBody td:nth-child(6),
body.theme-light #coursesBody td:nth-child(7) {
  color: #344054 !important;
  font-weight: 500;
}

/* Do not let inherited muted utility styles fade these two columns. */
body.theme-light #coursesBody td:nth-child(3) .text-muted,
body.theme-light #coursesBody td:nth-child(7) .text-muted,
body.theme-light #coursesBody td:nth-child(3)[class*="text-muted"],
body.theme-light #coursesBody td:nth-child(7)[class*="text-muted"] {
  color: #344054 !important;
  opacity: 1 !important;
}


/* ══════════════════════════════════════════════════════════════
   IRIR V13 — Students registry: white, flat, solid typography
   The Students register is intentionally kept light even if the rest of
   the staff portal is using dark mode. No tinted program/year bands.
   ══════════════════════════════════════════════════════════════ */

/* White workspace while Students is the active view. Sidebar is untouched. */
body.irir-students-white .main {
  background: #FFFFFF !important;
}
body.irir-students-white #view-students {
  background: #FFFFFF !important;
  color: #101828 !important;
}
body.irir-students-white #view-students .page-title {
  color: #101828 !important;
}
body.irir-students-white #view-students .page-sub {
  color: #475467 !important;
  opacity: 1 !important;
}

/* Filters: white controls, neutral borders, solid text. */
body.irir-students-white #view-students .student-filter-row,
body.irir-students-white #view-students .search-row {
  background: #FFFFFF !important;
}
body.irir-students-white #view-students input:not([type="checkbox"]):not([type="radio"]),
body.irir-students-white #view-students select {
  background: #FFFFFF !important;
  color: #101828 !important;
  -webkit-text-fill-color: #101828 !important;
  border-color: #D0D5DD !important;
  box-shadow: none !important;
  opacity: 1 !important;
}
body.irir-students-white #view-students input::placeholder {
  color: #98A2B3 !important;
  opacity: 1 !important;
}

/* Remove the outer card/box treatment from the student register. */
body.irir-students-white #studentRecordTableCard,
body.irir-students-white #studentTableWrapCompact {
  background: #FFFFFF !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
body.irir-students-white #studentTable {
  background: #FFFFFF !important;
  border-collapse: collapse !important;
}
body.irir-students-white #studentTable thead,
body.irir-students-white #studentTable thead tr,
body.irir-students-white #studentTable thead th {
  background: #FFFFFF !important;
}
body.irir-students-white #studentTable thead tr {
  border-bottom: 1px solid #D0D5DD !important;
}
body.irir-students-white #studentTable th {
  color: #475467 !important;
  -webkit-text-fill-color: #475467 !important;
  opacity: 1 !important;
  font-weight: 800 !important;
}

/* Every register row uses white background. Only separators create hierarchy. */
body.irir-students-white #studentTable tbody tr,
body.irir-students-white #studentTable tbody tr td,
body.irir-students-white #studentTable tbody tr td[colspan],
body.irir-students-white #studentTable tr.stu-prog-header,
body.irir-students-white #studentTable tr.stu-prog-header td,
body.irir-students-white #studentTable tr.stu-prog-header td[colspan],
body.irir-students-white #studentTable tr.stu-year-header,
body.irir-students-white #studentTable tr.stu-year-header td,
body.irir-students-white #studentTable tr.stu-year-header td[colspan] {
  background: #FFFFFF !important;
  background-color: #FFFFFF !important;
  box-shadow: none !important;
}
body.irir-students-white #studentTable tbody td {
  color: #101828 !important;
  -webkit-text-fill-color: #101828 !important;
  border-bottom: 1px solid #EAECF0 !important;
  opacity: 1 !important;
}
body.irir-students-white #studentTable tbody tr:hover td,
body.irir-students-white #studentTable tbody tr:hover td[colspan] {
  background: #FFFFFF !important;
}

/* Program rows: no colored strip/box, just a stronger separator. */
body.irir-students-white #studentTable tr.stu-prog-header {
  border-top: 1px solid #98A2B3 !important;
  border-bottom: 0 !important;
}
body.irir-students-white #studentTable tr.stu-prog-header td {
  border-bottom: 1px solid #EAECF0 !important;
}
body.irir-students-white #studentTable tr.stu-prog-header span:first-of-type,
body.irir-students-white #studentTable tr.stu-prog-header span[style*="color:var(--crimson)"],
body.irir-students-white #studentTable tr.stu-prog-header span[style*="color: var(--crimson)"] {
  color: #101828 !important;
  -webkit-text-fill-color: #101828 !important;
  opacity: 1 !important;
  font-weight: 800 !important;
}
body.irir-students-white #studentTable tr.stu-prog-header svg {
  stroke: #344054 !important;
  opacity: 1 !important;
}

/* Academic-year rows: flat white and solid charcoal text. */
body.irir-students-white #studentTable tr.stu-year-header {
  border: 0 !important;
}
body.irir-students-white #studentTable tr.stu-year-header td {
  border-bottom: 1px solid #EAECF0 !important;
}
body.irir-students-white #studentTable tr.stu-year-header span:first-of-type,
body.irir-students-white #studentTable tr.stu-year-header span[style*="color:var(--blue)"],
body.irir-students-white #studentTable tr.stu-year-header span[style*="color: var(--blue)"] {
  color: #101828 !important;
  -webkit-text-fill-color: #101828 !important;
  opacity: 1 !important;
  font-weight: 800 !important;
}
body.irir-students-white #studentTable tr.stu-year-header svg {
  stroke: #344054 !important;
  opacity: 1 !important;
}

/* Counts stay secondary but fully readable, never faded/transparent. */
body.irir-students-white #studentTable tr.stu-prog-header span[style*="color:var(--ink3)"],
body.irir-students-white #studentTable tr.stu-prog-header span[style*="color: var(--ink3)"],
body.irir-students-white #studentTable tr.stu-year-header span[style*="color:var(--ink3)"],
body.irir-students-white #studentTable tr.stu-year-header span[style*="color: var(--ink3)"] {
  color: #475467 !important;
  -webkit-text-fill-color: #475467 !important;
  opacity: 1 !important;
  font-weight: 500 !important;
}

/* Student data itself: solid dark text. */
body.irir-students-white #studentTable .irir-record-name,
body.irir-students-white #studentTable .irir-record-name strong,
body.irir-students-white #studentTable .text-mono,
body.irir-students-white #studentTable td:not(.irir-record-actions) {
  color: #101828 !important;
  opacity: 1 !important;
}
body.irir-students-white #studentTable .irir-record-name .my-text,
body.irir-students-white #studentTable .text-muted {
  color: #475467 !important;
  opacity: 1 !important;
}

/* Checkbox surfaces should not inherit dark-theme fills. */
body.irir-students-white #view-students input[type="checkbox"] {
  background: #FFFFFF !important;
  color-scheme: light !important;
  accent-color: #9F1D35;
}

/* Mobile student list: same flat white register language, not cards/boxes. */
body.irir-students-white #studentCardList,
body.irir-students-white #studentCardList .scard,
body.irir-students-white #studentCardList .scard-prog-header,
body.irir-students-white #studentCardList .scard-year-header {
  background: #FFFFFF !important;
  box-shadow: none !important;
}
body.irir-students-white #studentCardList .scard,
body.irir-students-white #studentCardList .scard-prog-header,
body.irir-students-white #studentCardList .scard-year-header {
  border-left: 0 !important;
  border-right: 0 !important;
  border-top: 0 !important;
  border-radius: 0 !important;
  border-bottom: 1px solid #EAECF0 !important;
}
body.irir-students-white #studentCardList .scard-prog-label,
body.irir-students-white #studentCardList .scard-year-label,
body.irir-students-white #studentCardList .scard-name,
body.irir-students-white #studentCardList .scard-id {
  color: #101828 !important;
  -webkit-text-fill-color: #101828 !important;
  opacity: 1 !important;
}
body.irir-students-white #studentCardList .scard-prog-count,
body.irir-students-white #studentCardList .scard-year-count,
body.irir-students-white #studentCardList .scard-meta {
  color: #475467 !important;
  opacity: 1 !important;
}


/* ══════════════════════════════════════════════════════════════
   IRIR V14 — GLOBAL WHITE THEME + SOLID TYPOGRAPHY
   Applies to every IRIR admin section, including navigation, tables,
   forms, cards, modals, schedules, document office and community views.
   ══════════════════════════════════════════════════════════════ */

:root,
html.theme-light,
html.theme-dark,
body,
body.theme-light,
body.theme-dark {
  --ink: #101828 !important;
  --ink2: #344054 !important;
  --ink3: #667085 !important;
  --line: #D0D5DD !important;
  --surface: #FFFFFF !important;
  --surface2: #FFFFFF !important;
  --white: #FFFFFF !important;
  --bg: #FFFFFF !important;
  --crimson: #9F1D35 !important;
  --crimson-mid: #86172C !important;
  --crimson-light: #FFFFFF !important;
  --green: #067647 !important;
  --green-light: #FFFFFF !important;
  --blue: #175CD3 !important;
  --blue-light: #FFFFFF !important;
  --gold: #8A5A00 !important;
  --gold-light: #FFFFFF !important;
  background: #FFFFFF !important;
  background-image: none !important;
  color: #101828 !important;
  color-scheme: light !important;
}

html, body { background:#FFFFFF !important; }

/* Stable UI font. This avoids broken/partial Latin webfont rendering while
   retaining Noto Sans Myanmar for Myanmar glyph shaping. */
body,
button,
input,
select,
textarea,
table,
th,
td,
label,
span,
div,
p,
a,
strong,
b,
small,
option,
.topbar-logo,
.sb-brand-name,
.page-title,
.profile-name,
.profile-avatar,
.sb-user-avatar,
.stat-value,
.chr-reader-title {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial,
               "Noto Sans Myanmar", "Myanmar Text", sans-serif !important;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Myanmar text gets the dedicated shaping font first. */
.my-text,
[lang="my"],
:lang(my),
input.my-text,
textarea.my-text {
  font-family: "Noto Sans Myanmar", "Myanmar Text", -apple-system,
               BlinkMacSystemFont, "Segoe UI", Arial, sans-serif !important;
  font-synthesis: none;
  line-height: 1.55;
}

/* Keep code/reference values monospaced and unaffected by the UI font reset. */
code, pre, .text-mono,
input[style*="font-family:monospace"],
span[style*="font-family:monospace"],
div[style*="font-family:monospace"] {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
               "Liberation Mono", "Courier New", monospace !important;
}

/* The dark/light switch is intentionally removed: IRIR is white globally. */
.theme-toggle-btn { display:none !important; }

/* Global shell */
#appShell,
.main,
.view,
body.theme-dark .main,
body.theme-light .main {
  background:#FFFFFF !important;
  background-image:none !important;
  color:#101828 !important;
}

/* Top bar */
.topbar,
body.theme-dark .topbar,
body.theme-light .topbar {
  background:#FFFFFF !important;
  border-bottom:1px solid #EAECF0 !important;
  box-shadow:none !important;
  backdrop-filter:none !important;
}
.topbar-logo { color:#101828 !important; font-weight:700 !important; }
.topbar-role {
  color:#475467 !important;
  background:#FFFFFF !important;
  border:1px solid #D0D5DD !important;
  opacity:1 !important;
}
.sync-badge { color:#067647 !important; font-weight:600 !important; opacity:1 !important; }
.sync-dot { background:#12B76A !important; }
.logout-btn,
body.theme-dark .logout-btn,
body.theme-light .logout-btn {
  color:#475467 !important;
  background:#FFFFFF !important;
  border:1px solid #D0D5DD !important;
  opacity:1 !important;
}
.logout-btn:hover { color:#101828 !important; border-color:#9F1D35 !important; background:#FFFFFF !important; }

/* Sidebar: white, flat and high contrast. */
.sidebar,
body.theme-dark .sidebar,
body.theme-light .sidebar {
  background:#FFFFFF !important;
  border-right:1px solid #EAECF0 !important;
  color:#101828 !important;
}
.sb-brand { border-bottom:1px solid #EAECF0 !important; background:#FFFFFF !important; }
.sb-brand-name { color:#101828 !important; font-weight:700 !important; }
.sb-brand-sub { color:#667085 !important; opacity:1 !important; }
.sb-user,
body.theme-dark .sb-user,
body.theme-light .sb-user {
  background:#FFFFFF !important;
  border:1px solid #D0D5DD !important;
  box-shadow:none !important;
}
.sb-user-name { color:#101828 !important; opacity:1 !important; }
.sb-user-role { color:#667085 !important; opacity:1 !important; }
.sb-user-avatar { background:#9F1D35 !important; border-color:#9F1D35 !important; color:#FFFFFF !important; }
.sidebar-section,
body.theme-dark .sidebar-section,
body.theme-light .sidebar-section {
  color:#667085 !important;
  opacity:1 !important;
}
.nav-item,
body.theme-dark .nav-item,
body.theme-light .nav-item {
  color:#344054 !important;
  background:#FFFFFF !important;
  border-color:transparent !important;
  opacity:1 !important;
}
.nav-item:hover,
body.theme-dark .nav-item:hover,
body.theme-light .nav-item:hover {
  color:#101828 !important;
  background:#F9FAFB !important;
  border-color:#EAECF0 !important;
}
.nav-item.active,
body.theme-dark .nav-item.active,
body.theme-light .nav-item.active {
  color:#9F1D35 !important;
  background:#FFFFFF !important;
  border-color:#EAECF0 !important;
  box-shadow:inset 3px 0 0 #9F1D35 !important;
  font-weight:700 !important;
}
.nav-icon,
.nav-item:hover .nav-icon,
.nav-item.active .nav-icon,
body.theme-dark .nav-icon,
body.theme-light .nav-icon {
  color:#475467 !important;
  opacity:1 !important;
}
.nav-item.active .nav-icon { color:#9F1D35 !important; }
.sb-sidebar-footer { border-top:1px solid #EAECF0 !important; background:#FFFFFF !important; }
.btn-signout,
body.theme-light .btn-signout,
body.theme-dark .btn-signout {
  background:#FFFFFF !important; color:#475467 !important; border-color:#D0D5DD !important;
}

/* Main content typography */
.page-title,
.card-title,
.form-label,
label,
th,
strong,
b { opacity:1 !important; }
.page-title { color:#101828 !important; font-weight:750 !important; }
.page-sub,
.text-muted,
.stat-label,
.card-sub,
.form-help { color:#667085 !important; opacity:1 !important; }

/* Cards and panels */
.card,
.stat-card,
.profile-banner,
.profile-hero-card,
.profile-info-item,
.schedule-row,
.scard,
.scard-prog-header,
.scard-year-header,
.amb-is-list,
.amb-is-head,
.amb-is-course,
.amb-is-row,
.tt-slot-card,
.tt-tab-panel,
.tt-filter-bar,
.code-block,
.upload-zone,
.search-row,
.student-filter-row,
.dof-section,
.dof-card {
  background:#FFFFFF !important;
  color:#101828 !important;
  border-color:#EAECF0 !important;
  box-shadow:none !important;
}

/* Forms */
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea,
.form-input,
.schedule-row select,
.schedule-row input[type=time] {
  background:#FFFFFF !important;
  color:#101828 !important;
  -webkit-text-fill-color:#101828 !important;
  border-color:#D0D5DD !important;
  opacity:1 !important;
  box-shadow:none !important;
}
input::placeholder,
textarea::placeholder { color:#98A2B3 !important; opacity:1 !important; }
select option { background:#FFFFFF !important; color:#101828 !important; }
input:disabled,
select:disabled,
textarea:disabled,
.form-input:disabled,
input[readonly] {
  background:#F9FAFB !important;
  color:#475467 !important;
  -webkit-text-fill-color:#475467 !important;
  opacity:1 !important;
}
input:focus,
select:focus,
textarea:focus,
.form-input:focus {
  background:#FFFFFF !important;
  border-color:#9F1D35 !important;
  box-shadow:0 0 0 3px rgba(159,29,53,.09) !important;
}

/* Tables: no dark bands, no faded rows. */
.table-wrap,
table,
thead,
tbody,
tfoot,
tr,
th,
td,
body.theme-dark table,
body.theme-dark thead,
body.theme-dark tbody,
body.theme-dark tr,
body.theme-dark th,
body.theme-dark td {
  background:#FFFFFF !important;
  background-color:#FFFFFF !important;
}
thead tr { border-bottom:1px solid #D0D5DD !important; }
th {
  color:#475467 !important;
  -webkit-text-fill-color:#475467 !important;
  font-weight:800 !important;
  opacity:1 !important;
}
td {
  color:#101828 !important;
  -webkit-text-fill-color:#101828 !important;
  border-bottom:1px solid #EAECF0 !important;
  opacity:1 !important;
}
tbody tr:nth-child(even) td { background:#FFFFFF !important; }
tbody tr:hover td { background:#F9FAFB !important; }
tbody tr td[colspan] { background:#FFFFFF !important; border-bottom:1px solid #EAECF0 !important; }

/* Student grouping rows remain flat white globally. */
tr.stu-prog-header,
tr.stu-year-header,
tr.stu-prog-header td,
tr.stu-year-header td,
tr.stu-prog-header td[colspan],
tr.stu-year-header td[colspan] {
  background:#FFFFFF !important;
  background-color:#FFFFFF !important;
  box-shadow:none !important;
}
tr.stu-prog-header { border-top:1px solid #98A2B3 !important; }
tr.stu-year-header { border-top:0 !important; }
tr.stu-prog-header span,
tr.stu-year-header span { opacity:1 !important; }
tr.stu-prog-header span:first-of-type,
tr.stu-year-header span:first-of-type { color:#101828 !important; -webkit-text-fill-color:#101828 !important; }
tr.stu-prog-header span[style*="var(--ink3)"],
tr.stu-year-header span[style*="var(--ink3)"] { color:#475467 !important; -webkit-text-fill-color:#475467 !important; }
tr.stu-prog-header svg,
tr.stu-year-header svg { stroke:#344054 !important; }

/* Buttons */
.btn { opacity:1 !important; }
.btn-outline,
.btn-ghost {
  background:#FFFFFF !important;
  color:#344054 !important;
  border-color:#D0D5DD !important;
}
.btn-outline:hover,
.btn-ghost:hover { background:#F9FAFB !important; color:#101828 !important; border-color:#98A2B3 !important; }
.btn-primary { background:#9F1D35 !important; color:#FFFFFF !important; }
.btn-danger { background:#FFFFFF !important; color:#B42318 !important; border-color:#F1A7A0 !important; }

/* Tabs */
.tabs,
.tt-tab-bar { background:#FFFFFF !important; border-color:#EAECF0 !important; }
.tab,
.tt-tab,
.tt-cmode-btn {
  background:#FFFFFF !important;
  color:#475467 !important;
  border-color:#EAECF0 !important;
  opacity:1 !important;
}
.tab.active,
.tt-tab.active,
.tt-cmode-btn.active {
  background:#FFFFFF !important;
  color:#9F1D35 !important;
  border-color:#9F1D35 !important;
  box-shadow:inset 0 -2px 0 #9F1D35 !important;
  font-weight:700 !important;
}

/* Badges: white surfaces + strong text. */
.badge,
.b-blue,.b-green,.b-gold,.b-red,.b-muted,
body.theme-dark .b-blue,body.theme-dark .b-green,body.theme-dark .b-gold,body.theme-dark .b-red,body.theme-dark .b-muted {
  background:#FFFFFF !important;
  opacity:1 !important;
  box-shadow:none !important;
}
.b-blue { color:#175CD3 !important; border:1px solid #84ADFF !important; }
.b-green { color:#067647 !important; border:1px solid #75E0A7 !important; }
.b-gold { color:#8A5A00 !important; border:1px solid #FEC84B !important; }
.b-red { color:#B42318 !important; border:1px solid #FDA29B !important; }
.b-muted { color:#344054 !important; border:1px solid #D0D5DD !important; }

/* Solid utility colors. */
.text-crimson { color:#9F1D35 !important; opacity:1 !important; }
.text-green { color:#067647 !important; opacity:1 !important; }
.text-gold { color:#8A5A00 !important; opacity:1 !important; }
[style*="color:var(--ink3)"], [style*="color: var(--ink3)"] { opacity:1 !important; }

/* Modals / overlays */
.modal,
.modal-box,
.modal-content,
.modal-header,
.modal-body,
.modal-footer {
  background:#FFFFFF !important;
  color:#101828 !important;
  border-color:#EAECF0 !important;
}
.modal-overlay { background:rgba(16,24,40,.28) !important; }

/* Quill / rich text editor */
.ql-toolbar,
.ql-container,
.ql-editor,
.ql-snow .ql-picker-options {
  background:#FFFFFF !important;
  color:#101828 !important;
  border-color:#D0D5DD !important;
}
.ql-editor.ql-blank::before { color:#98A2B3 !important; opacity:1 !important; }

/* Chronicle reader is white as part of the global theme. */
#chronicleReaderOverlay { background:#FFFFFF !important; color:#101828 !important; }
.chr-reader-topbar { background:#FFFFFF !important; border-bottom:1px solid #EAECF0 !important; backdrop-filter:none !important; }
.chr-reader-back { background:#FFFFFF !important; color:#344054 !important; border-color:#D0D5DD !important; }
.chr-reader-back:hover { background:#F9FAFB !important; color:#101828 !important; border-color:#98A2B3 !important; }
.chr-reader-section-label { color:#667085 !important; opacity:1 !important; }
.chr-reader-title { color:#101828 !important; }
.chr-reader-author { color:#667085 !important; border-bottom-color:#EAECF0 !important; }
.chr-reader-author strong { color:#344054 !important; }
.chr-reader-content { color:#344054 !important; opacity:1 !important; }
.chr-reader-event-info { background:#FFFFFF !important; border-color:#D0D5DD !important; }
.chr-reader-event-row { color:#475467 !important; opacity:1 !important; }

/* Mobile navigation */
.mob-bottom-nav,
body.theme-dark .mob-bottom-nav,
body.theme-light .mob-bottom-nav {
  background:#FFFFFF !important;
  border-top:1px solid #EAECF0 !important;
}
.mob-nav-btn { color:#667085 !important; background:#FFFFFF !important; }
.mob-nav-btn.active { color:#9F1D35 !important; background:#FFFFFF !important; }

/* Toasts and upload overlays stay white with solid text. */
.notif-toast,
#toastContainer > *,
.upload-overlay-box,
#uploadOverlay .upload-overlay-box,
#dataLoadOverlay .upload-overlay-box {
  background:#FFFFFF !important;
  color:#101828 !important;
  border-color:#D0D5DD !important;
  opacity:1 !important;
}
.notif-title,.upload-overlay-title { color:#101828 !important; opacity:1 !important; }
.notif-body,.upload-overlay-sub { color:#475467 !important; opacity:1 !important; }

/* Remove legacy dark-theme backgrounds from common dynamic surfaces. */
body.theme-dark .card,
body.theme-dark .stat-card,
body.theme-dark .profile-hero-card,
body.theme-dark .profile-banner,
body.theme-dark .profile-info-item,
body.theme-dark .modal,
body.theme-dark .modal-box,
body.theme-dark .schedule-row,
body.theme-dark .amb-is-list,
body.theme-dark .amb-is-head,
body.theme-dark #tt-course-dropdown,
body.theme-dark .tt-cmode-btn {
  background:#FFFFFF !important;
  color:#101828 !important;
  border-color:#EAECF0 !important;
}

/* Preserve print documents exactly as printable white documents. */
@media print {
  html, body, #printArea, #printArea * { background:#FFFFFF !important; color:#000000 !important; }
}


/* ═══════════════════════════════════════════════════════════════
   IRIR V16 — solid example / placeholder text on white surfaces
   Visual-only. No workflow, QR, signing, or document logic changes.
   ═══════════════════════════════════════════════════════════════ */
input::placeholder,
textarea::placeholder,
.form-input::placeholder,
.login-input::placeholder,
.search-input::placeholder {
  color:#475467 !important;
  opacity:1 !important;
  font-weight:500 !important;
  filter:none !important;
  text-shadow:none !important;
}

/* Document Office helper/example copy should stay readable on the white ERP surface. */
#view-docOffice .form-label,
#view-docOffice label {
  opacity:1 !important;
}
#view-docOffice .form-label span,
#view-docOffice [style*="color:var(--ink3)"] {
  color:#475467 !important;
  opacity:1 !important;
}

/* ═══════════════════════════════════════════════════════════════
   IRIR V18 — examples/placeholders are intentionally muted
   Actual entered values remain solid/dark. Visual-only change.
   ═══════════════════════════════════════════════════════════════ */
input::placeholder,
textarea::placeholder,
.form-input::placeholder,
.login-input::placeholder,
.search-input::placeholder,
#view-docOffice input::placeholder,
#view-docOffice textarea::placeholder {
  color:#98A2B3 !important;
  opacity:1 !important;
  font-weight:400 !important;
  filter:none !important;
  text-shadow:none !important;
}

/* Optional/example guidance is secondary text, not primary solid text. */
#view-docOffice .form-label > span[style*="font-weight:400"],
#view-docOffice label > span[style*="font-weight:400"] {
  color:#667085 !important;
  font-weight:400 !important;
  opacity:1 !important;
}

/* User-entered / selected values stay solid and clearly distinct from examples. */
#view-docOffice input:not([type="checkbox"]):not([type="radio"]),
#view-docOffice select,
#view-docOffice textarea,
#view-docOffice .ql-editor {
  color:#101828 !important;
}


/* ═══════════════════════════════════════════════════════════════
   IRIR V20 — Safari placeholder text-fill correction
   Keep example text visibly muted while actual entered values stay dark.
   Safari honors -webkit-text-fill-color inherited from the input itself,
   so placeholder pseudo-elements must override it explicitly.
   Visual-only. No QR, signing, seal, or document workflow changes.
   ═══════════════════════════════════════════════════════════════ */
input::placeholder,
textarea::placeholder,
.form-input::placeholder,
.login-input::placeholder,
.search-input::placeholder,
#view-docOffice input::placeholder,
#view-docOffice textarea::placeholder,
input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder,
.form-input::-webkit-input-placeholder,
.login-input::-webkit-input-placeholder,
.search-input::-webkit-input-placeholder,
#view-docOffice input::-webkit-input-placeholder,
#view-docOffice textarea::-webkit-input-placeholder {
  color:#98A2B3 !important;
  -webkit-text-fill-color:#98A2B3 !important;
  opacity:1 !important;
  font-weight:400 !important;
  filter:none !important;
  text-shadow:none !important;
}
