/* ================================================================
   CatSU Enrollment — Authenticated Application Layer
   ----------------------------------------------------------------
   Loaded after flat-theme.css, before landing.css.

   Scope: every authenticated surface (student, staff, admin).
   The landing page keeps landing.css and is excluded explicitly.
   The Certificate of Enrollment document (.coe-*) is never styled
   here; it must keep its printable appearance.

   Design notes
   - Warm paper canvas instead of blue-grey, so long forms read like
     a document rather than a dashboard.
   - Hairlines and one elevation level: no gradient bars, no glows.
   - Sora for headings, Plus Jakarta Sans for text, tabular figures
     for every number that can be compared.
   ================================================================ */

/* ----------------------------------------------------------------
   1. TOKENS
   ---------------------------------------------------------------- */
:root {
  /* Canvas */
  --bg: #f4f3ee;
  --bg-subtle: #faf9f5;
  --surface: #ffffff;
  --surface-2: #f8f7f2;
  --surface-3: #eeede6;
  --surface-hover: #f3f2ec;

  /* Hairlines */
  --line: #e2dfd5;
  --line-strong: #cbc6b8;
  --line-faint: #edebe4;

  /* Ink */
  --ink: #111820;
  --ink-2: #37414c;
  --muted: #6b737d;
  --muted-light: #98a0a8;

  /* Institutional blue */
  --blue: #14608f;
  --blue-dark: #0f4c73;
  --blue-strong: #0b3a59;
  --accent-soft: #eaf1f6;
  --accent-soft-2: #d7e5ef;
  --navy: #0e1a28;

  /* Seal gold, used only for document-grade accents */
  --seal: #a9761b;
  --seal-soft: #fbf3e2;
  --seal-border: #ecd9b0;

  /* Elevation */
  --flat-shadow: 0 1px 2px rgba(17, 24, 32, 0.04);
  --flat-shadow-md: 0 10px 24px -18px rgba(17, 24, 32, 0.24);
  --flat-shadow-lg: 0 30px 60px -30px rgba(17, 24, 32, 0.32);

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;

  /* Status surfaces */
  --success: #0f6d5c;
  --success-bg: #eef7f3;
  --success-border: #bfe0d5;
  --danger: #b42318;
  --danger-bg: #fdf3f1;
  --danger-border: #f0c9c2;
  --warning: #96590a;
  --warning-bg: #fdf7e9;
  --warning-border: #ecd9a8;

  --ring: 0 0 0 3px rgba(20, 96, 143, 0.18);
  --overlay-bg: rgba(14, 26, 40, 0.55);

  /* Layout */
  --app-gutter: clamp(16px, 3vw, 40px);
  --app-max: 1180px;
  --app-bar: 64px;
  --app-rail: 252px;
}

/* ----------------------------------------------------------------
   2. TOKENS — DARK
   ---------------------------------------------------------------- */
[data-theme="dark"] {
  --bg: #0c1014;
  --bg-subtle: #10151a;
  --surface: #151b21;
  --surface-2: #1a2128;
  --surface-3: #222b33;
  --surface-hover: #1d242b;

  --line: #29323b;
  --line-strong: #3b4650;
  --line-faint: #202830;

  --ink: #ece9e1;
  --ink-2: #c6ccd3;
  --muted: #939ca6;
  --muted-light: #6d7883;

  --blue: #6fb6dc;
  --blue-dark: #94cbe8;
  --blue-strong: #b9dcf0;
  --accent-soft: #162a38;
  --accent-soft-2: #1d3a4d;
  --navy: #ece9e1;

  --seal: #d9a75a;
  --seal-soft: #2a2214;
  --seal-border: #4a3b1f;

  --flat-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  --flat-shadow-md: 0 12px 26px -18px rgba(0, 0, 0, 0.7);
  --flat-shadow-lg: 0 32px 64px -30px rgba(0, 0, 0, 0.8);

  --success: #57c7ac;
  --success-bg: #0e2622;
  --success-border: #1f4a42;
  --danger: #f08574;
  --danger-bg: #2a1613;
  --danger-border: #4d2a24;
  --warning: #e0ab5c;
  --warning-bg: #2a2110;
  --warning-border: #4a3a1a;

  --ring: 0 0 0 3px rgba(111, 182, 220, 0.3);
  --overlay-bg: rgba(0, 0, 0, 0.66);
}

/* ----------------------------------------------------------------
   2b. TOKENS — CERTIFICATE OF ENROLLMENT (PINNED)
   The COE is a fixed white-paper artifact, so it must look identical in
   both themes. A few of its rules borrow theme tokens (--navy for the
   title and letterhead, --success for the scholarship row) that flip to
   light values in dark mode, which would make dark text on white turn
   pale and unreadable. The document's own stylesheet is left untouched;
   we simply pin those tokens to their light values for the subtree.
   ---------------------------------------------------------------- */
.coe-document {
  --navy: #0e1a28;
  --success: #0f6d5c;
  --success-bg: #eef7f3;
  --success-border: #bfe0d5;
}

/* ----------------------------------------------------------------
   3. BASE
   ---------------------------------------------------------------- */
body {
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.006em;
}

.app-shell {
  background: var(--bg);
}

.app-shell:not(.is-landing) #main-content {
  min-height: calc(100vh - var(--app-bar));
  background: var(--bg);
}

/* Headings use the display face, but never inside the Certificate of
   Enrollment document: that layout is a fixed print artifact with its own
   serif type and navy/charcoal colors that must stay identical in dark mode. */
.app-shell:not(.is-landing) :is(h1, h2, h3):not(.coe-document *) {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  color: var(--ink);
}

.app-shell:not(.is-landing) .muted {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.app-shell:not(.is-landing) :is(.admin-stat-value, .capacity-metric-value,
  .sf-target-units, .sf-grades-units, .sf-detail-units, .detail-info-value--accent) {
  font-variant-numeric: tabular-nums;
}

/* One focus treatment for the whole authenticated app. */
.app-shell:not(.is-landing) :is(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 6px;
  box-shadow: none;
}

/* ----------------------------------------------------------------
   4. TOPBAR
   ---------------------------------------------------------------- */
.app-shell:not(.is-landing) .topbar {
  height: var(--app-bar);
  padding: 0 var(--app-gutter);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}

/* The old gradient hairline is what made the bar look templated. */
.app-shell:not(.is-landing) .topbar::after {
  display: none;
}

.app-shell:not(.is-landing) .brand {
  gap: 10px;
  color: var(--ink);
}

.app-shell:not(.is-landing) .brand:hover { color: var(--ink); }

.app-shell:not(.is-landing) .brand-logo {
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

.app-shell:not(.is-landing) .brand strong {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.app-shell:not(.is-landing) .brand small {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.app-shell:not(.is-landing) .topbar-meta { gap: 6px; }

.app-shell:not(.is-landing) #session-label {
  min-width: 0;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  box-shadow: none;
  max-width: 34ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-shell:not(.is-landing) #session-label:empty { display: none; }

.app-shell:not(.is-landing) .portal-link {
  background: transparent;
  box-shadow: none;
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.app-shell:not(.is-landing) .portal-link:hover {
  background: var(--surface-2);
  color: var(--blue);
  box-shadow: none;
}

.app-shell:not(.is-landing) .theme-toggle {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.app-shell:not(.is-landing) .theme-toggle:hover {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--ink);
  transform: none;
}

.app-shell:not(.is-landing) .topbar-meta .button {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
}

/* ----------------------------------------------------------------
   5. BUTTONS
   ---------------------------------------------------------------- */
.app-shell:not(.is-landing) .button,
.modal-content .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: var(--surface-2);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  box-shadow: none;
  transition: background-color 140ms var(--ease-out), border-color 140ms var(--ease-out),
    color 140ms var(--ease-out), transform 140ms var(--ease-out);
}

.app-shell:not(.is-landing) .button:active,
.modal-content .button:active { transform: translateY(1px); }

.app-shell:not(.is-landing) .button:disabled,
.modal-content .button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* Primary = solid institutional navy. */
.app-shell:not(.is-landing) .button:where(:not(.button-gold):not(.button-light):not(.button-ghost):not(.button-danger):not(.button-reject):not(.button-outline):not(.button-primary)),
.app-shell:not(.is-landing) .button-primary,
.modal-content .button:not(.button-light):not(.button-outline):not(.button-danger) {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

[data-theme="dark"] .app-shell:not(.is-landing) .button:where(:not(.button-gold):not(.button-light):not(.button-ghost):not(.button-danger):not(.button-reject):not(.button-outline):not(.button-primary)),
[data-theme="dark"] .app-shell:not(.is-landing) .button-primary,
[data-theme="dark"] .modal-content .button:not(.button-light):not(.button-outline):not(.button-danger) {
  background: var(--ink);
  border-color: var(--ink);
  color: #0c1014;
}

.app-shell:not(.is-landing) .button:where(:not(.button-gold):not(.button-light):not(.button-ghost):not(.button-danger):not(.button-reject):not(.button-outline):not(.button-primary)):hover,
.app-shell:not(.is-landing) .button-primary:hover,
.modal-content .button:not(.button-light):not(.button-outline):not(.button-danger):hover {
  background: #1b2c3f;
  border-color: #1b2c3f;
  color: #fff;
  transform: none;
}

.app-shell:not(.is-landing) .button-light,
.modal-content .button-light {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink-2);
}

.app-shell:not(.is-landing) .button-light:hover,
.modal-content .button-light:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
  color: var(--ink);
}

.app-shell:not(.is-landing) .button-ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}

.app-shell:not(.is-landing) .button-ghost:hover {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--line);
}

.app-shell:not(.is-landing) .button-outline {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink-2);
}

.app-shell:not(.is-landing) .button-outline:hover {
  background: var(--accent-soft);
  border-color: var(--accent-soft-2);
  color: var(--blue-dark);
}

.app-shell:not(.is-landing) .button-gold {
  background: var(--seal);
  border-color: var(--seal);
  color: #fff;
}

.app-shell:not(.is-landing) .button-gold:hover {
  background: #8f6316;
  border-color: #8f6316;
  color: #fff;
}

.app-shell:not(.is-landing) .button-danger,
.app-shell:not(.is-landing) .button-reject,
.modal-content .button-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.app-shell:not(.is-landing) .button-danger:hover,
.app-shell:not(.is-landing) .button-reject:hover {
  background: #982015;
  border-color: #982015;
}

.app-shell:not(.is-landing) .button-lg {
  min-height: 46px;
  padding: 0 22px;
  font-size: 14.5px;
}

.app-shell:not(.is-landing) .button-sm,
.app-shell:not(.is-landing) .btn-sm {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12.5px;
}

/* "Next semester enrollment" is the one forward-looking action on the
   student results screen, so it carries a quiet accent tint instead of
   the solid navy used by submission actions. */
.app-shell:not(.is-landing) .app-next-btn {
  background: var(--accent-soft);
  border-color: var(--accent-soft-2);
  color: var(--blue-dark);
}

.app-shell:not(.is-landing) .app-next-btn:hover {
  background: var(--accent-soft-2);
  border-color: var(--blue);
  color: var(--blue-dark);
}

/* ----------------------------------------------------------------
   6. FORM CONTROLS
   ---------------------------------------------------------------- */
.app-shell:not(.is-landing) :is(input[type="text"], input[type="search"], input[type="email"],
  input[type="password"], input[type="date"], input[type="datetime-local"], input[type="number"],
  select, textarea),
.app-shell:not(.is-landing) .input,
.modal-content :is(input, select, textarea) {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 13.5px;
  box-shadow: none;
  transition: border-color 140ms var(--ease-out), box-shadow 140ms var(--ease-out);
}

.app-shell:not(.is-landing) :is(input, select, textarea):focus,
.app-shell:not(.is-landing) .input:focus,
.modal-content :is(input, select, textarea):focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: var(--ring);
}

.app-shell:not(.is-landing) :is(input, textarea)::placeholder { color: var(--muted-light); }

.app-shell:not(.is-landing) label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink-2);
}

/* Search field with a leading icon. */
.app-search {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.app-search i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--muted-light);
  pointer-events: none;
}

/* Scoped to out-specify the generic input rule (section 6) so the leading
   icon never sits on top of the placeholder text. */
.app-shell:not(.is-landing) .app-search input[type="search"] {
  min-width: 0;
  height: 38px;
  padding-left: 34px;
  font-size: 13px;
}

/* ----------------------------------------------------------------
   7. PAGE HEADER
   ---------------------------------------------------------------- */
.app-page {
  width: 100%;
  max-width: var(--app-max);
  margin: 0 auto;
  padding: 28px var(--app-gutter) 56px;
}

.app-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.app-eyebrow {
  margin: 0 0 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.app-page-head h1 {
  margin: 0;
  font-size: clamp(24px, 2.4vw, 30px);
  font-weight: 600;
  line-height: 1.15;
}

.app-page-head p {
  margin: 6px 0 0;
  max-width: 68ch;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
}

.app-page-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ----------------------------------------------------------------
   8. SHARED SURFACES
   ---------------------------------------------------------------- */
.app-shell:not(.is-landing) .panel,
.app-shell:not(.is-landing) .admin-section,
.app-shell:not(.is-landing) .sf-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: none;
}

.app-shell:not(.is-landing) :is(.admin-section, .sf-section) {
  padding: 22px clamp(16px, 2vw, 26px);
  margin-bottom: 18px;
}

.app-shell:not(.is-landing) .admin-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.app-shell:not(.is-landing) .admin-section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.app-shell:not(.is-landing) .admin-section-title i {
  width: 16px;
  color: var(--blue);
  font-size: 14px;
  text-align: center;
}

/* Section eyebrow used above tables and lists. */
.app-shell:not(.is-landing) .sf-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 0 0 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line-faint);
}

.app-shell:not(.is-landing) .sf-section-header h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.app-shell:not(.is-landing) .sf-section-sub {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}

/* ----------------------------------------------------------------
   9. STATUS PILLS
   ---------------------------------------------------------------- */
.app-shell:not(.is-landing) .stage-pill,
.app-shell:not(.is-landing) .tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.app-shell:not(.is-landing) .stage-pill[data-stage="Pending_Adviser"] {
  background: var(--accent-soft);
  border-color: var(--accent-soft-2);
  color: var(--blue-dark);
}

.app-shell:not(.is-landing) .stage-pill[data-stage="Pending_Chairperson"] {
  background: var(--warning-bg);
  border-color: var(--warning-border);
  color: var(--warning);
}

.app-shell:not(.is-landing) .stage-pill[data-stage="Pending_College_Registrar"] {
  background: #f3edfb;
  border-color: #e2d4f5;
  color: #6b3fa8;
}

.app-shell:not(.is-landing) .stage-pill[data-stage="Enrolled_COE_Ready"] {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success);
}

.app-shell:not(.is-landing) .stage-pill[data-stage="Rejected"] {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger);
}

[data-theme="dark"] .app-shell:not(.is-landing) .stage-pill[data-stage="Pending_College_Registrar"] {
  background: #241a33;
  border-color: #3b2c52;
  color: #c3a4ee;
}

/* ----------------------------------------------------------------
   10. NOTICES / TOASTS / LOADERS
   ---------------------------------------------------------------- */
.app-shell:not(.is-landing) .notice,
.modal-content .notice {
  display: flex;
  gap: 8px;
  padding: 11px 14px;
  margin-bottom: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--accent-soft-2);
  background: var(--accent-soft);
  color: var(--blue-strong);
  font-size: 13px;
  line-height: 1.5;
}

.app-shell:not(.is-landing) .notice.error,
.modal-content .notice.error {
  border-color: var(--danger-border);
  background: var(--danger-bg);
  color: var(--danger);
}

.app-shell:not(.is-landing) .notice.success {
  border-color: var(--success-border);
  background: var(--success-bg);
  color: var(--success);
}

#toast-container {
  position: fixed;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  top: auto !important;
  right: 16px !important;
  bottom: calc(16px + env(safe-area-inset-bottom)) !important;
  left: auto !important;
}

.app-toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 260px;
  max-width: 380px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--flat-shadow-lg);
  font-size: 13px;
  line-height: 1.45;
  pointer-events: auto;
  animation: appToastIn 180ms var(--ease-out);
}

.app-toast i { margin-top: 2px; font-size: 14px; }
.app-toast--success i { color: var(--success); }
.app-toast--error i { color: var(--danger); }
.app-toast--info i { color: var(--blue); }

@keyframes appToastIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.app-shell:not(.is-landing) .spinner {
  width: 26px;
  height: 26px;
  border-width: 2px;
  border-color: var(--line-strong);
  border-top-color: var(--blue);
}

/* ----------------------------------------------------------------
   11. MODALS
   ---------------------------------------------------------------- */
.modal-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--overlay-bg);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.modal-content {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--flat-shadow-lg);
  color: var(--ink);
  padding: 26px 26px 22px;
  max-width: 460px;
  width: 100%;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}

.modal-content h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink) !important;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

/* ----------------------------------------------------------------
   12. EMPTY / ERROR STATES
   ---------------------------------------------------------------- */
.app-shell:not(.is-landing) .admin-empty,
.app-shell:not(.is-landing) .sf-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 44px 24px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  color: var(--muted);
}

.app-shell:not(.is-landing) .admin-empty strong {
  font-size: 14px;
  color: var(--ink);
}

.app-shell:not(.is-landing) .admin-empty p {
  margin: 0;
  max-width: 46ch;
  font-size: 12.5px;
  line-height: 1.55;
}

.app-shell:not(.is-landing) .admin-empty-icon,
.app-shell:not(.is-landing) .sf-empty-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 4px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 16px;
  box-shadow: none;
}

.app-shell:not(.is-landing) .sf-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 50vh;
  color: var(--muted);
  font-size: 13px;
}

/* ----------------------------------------------------------------
   13. MOBILE BOTTOM NAVIGATION
   ---------------------------------------------------------------- */
.app-mobile-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 140;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 2px;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}

.app-mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 52px;
  padding: 4px 2px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
}

.app-mobile-nav-item i { font-size: 17px; }

.app-mobile-nav-item.active {
  background: var(--accent-soft);
  color: var(--blue-dark);
}

[data-theme="dark"] .app-mobile-nav-item.active {
  background: var(--accent-soft);
  color: var(--blue);
}

.app-mobile-nav-item .nav-badge {
  position: absolute;
  margin: -22px 0 0 24px;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 15px;
  text-align: center;
}

/* ----------------------------------------------------------------
   14. STUDENT FLOW — SHELL
   ---------------------------------------------------------------- */
.app-shell:not(.is-landing) .sf-flow {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--app-bar));
  background: var(--bg);
  animation: appFadeIn 220ms var(--ease-out);
}

@keyframes appFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Page header: a document title block, not a coloured banner. */
.app-shell:not(.is-landing) .sf-header {
  position: static;
  background: var(--surface);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  padding: 22px var(--app-gutter) 20px;
}

.app-shell:not(.is-landing) .sf-header::after {
  display: none;
}

.app-shell:not(.is-landing) .sf-header-content {
  max-width: var(--app-max);
  margin: 0 auto;
  align-items: flex-end;
  gap: 24px;
}

.app-shell:not(.is-landing) .sf-header-left {
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.app-shell:not(.is-landing) .sf-header h1 {
  color: var(--ink) !important;
  font-size: clamp(22px, 2.3vw, 27px);
  font-weight: 600;
  line-height: 1.15;
}

.app-shell:not(.is-landing) .sf-header-sub {
  margin-top: 4px;
  color: var(--muted) !important;
  font-size: 13px;
  opacity: 1;
}

.app-shell:not(.is-landing) .sf-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.app-shell:not(.is-landing) .sf-header-actions .button {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink-2);
  min-height: 38px;
  padding: 0 13px;
  font-size: 12.5px;
  box-shadow: none;
}

.app-shell:not(.is-landing) .sf-header-actions .button:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
  color: var(--ink);
  transform: none;
}

/* Primary document actions stay visually dominant. */
.app-shell:not(.is-landing) .sf-header-actions .button-gold,
.app-shell:not(.is-landing) .sf-header-actions .button-primary {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.app-shell:not(.is-landing) .sf-header-actions .button-gold:hover,
.app-shell:not(.is-landing) .sf-header-actions .button-primary:hover {
  background: #1b2c3f;
  border-color: #1b2c3f;
  color: #fff;
}

/* Step rail */
.app-shell:not(.is-landing) .sf-step-indicator {
  gap: 0;
  padding: 0;
  flex-shrink: 0;
}

.app-shell:not(.is-landing) .sf-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  box-shadow: none;
  animation: none;
}

.app-shell:not(.is-landing) .sf-step-num.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  box-shadow: none;
  animation: none;
}

[data-theme="dark"] .app-shell:not(.is-landing) .sf-step-num.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #0c1014;
}

.app-shell:not(.is-landing) .sf-step-num.completed {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success);
  box-shadow: none;
}

.app-shell:not(.is-landing) .sf-step-line {
  width: 30px;
  height: 1px;
  margin: 0 5px;
  background: var(--line-strong);
}

.app-shell:not(.is-landing) .sf-step-line.completed { background: var(--success-border); }

/* Body */
.app-shell:not(.is-landing) .sf-body {
  width: 100%;
  max-width: var(--app-max);
  margin: 0 auto;
  padding: 24px var(--app-gutter) 56px;
  flex: 1;
}

.app-shell:not(.is-landing) .sf-section {
  margin-bottom: 16px;
  opacity: 1;
  transform: none;
  animation: none;
}

.app-shell:not(.is-landing) #coe-render-area {
  background: transparent;
  margin: 0;
  padding: 0;
  min-height: 0;
}

/* ----------------------------------------------------------------
   15. STUDENT — IDENTITY & TERM BANNERS
   ---------------------------------------------------------------- */
.app-shell:not(.is-landing) .sf-info-banner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: none;
  margin-bottom: 16px;
  overflow: visible;
}

.app-shell:not(.is-landing) .sf-info-banner::before {
  display: none;
}

.app-shell:not(.is-landing) .sf-info-banner:hover {
  box-shadow: none;
  transform: none;
}

.app-shell:not(.is-landing) .sf-info-avatar {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft-2);
  color: var(--blue-dark);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  box-shadow: none;
}

.app-shell:not(.is-landing) .sf-info-avatar::after {
  display: none;
}

.app-shell:not(.is-landing) .sf-info-details { min-width: 0; }

.app-shell:not(.is-landing) .sf-info-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.015em;
}

.app-shell:not(.is-landing) .sf-info-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.app-shell:not(.is-landing) .sf-info-tag {
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  box-shadow: none;
}

.app-shell:not(.is-landing) .sf-info-badges {
  display: flex;
  gap: 0;
  margin-left: auto;
  border-left: 1px solid var(--line);
}

.app-shell:not(.is-landing) .sf-info-badge {
  min-width: 104px;
  padding: 2px 20px;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}

.app-shell:not(.is-landing) .sf-info-badge:last-child {
  border-right: 0;
  padding-right: 0;
}

.app-shell:not(.is-landing) .sf-info-badge:hover {
  background: transparent;
  box-shadow: none;
}

.app-shell:not(.is-landing) .sf-info-badge small {
  display: block;
  margin-bottom: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.app-shell:not(.is-landing) .sf-info-badge strong {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.app-shell:not(.is-landing) .sf-text-good { color: var(--success) !important; }
.app-shell:not(.is-landing) .sf-text-warn { color: var(--warning) !important; }

.app-shell:not(.is-landing) .sf-honor-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--seal-border);
  background: var(--seal-soft);
  color: var(--seal);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.app-shell:not(.is-landing) .sf-honor-badge i { font-size: 10px; }

/* Term banner */
.app-shell:not(.is-landing) .sf-target-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--seal);
  border-radius: var(--radius-lg);
  box-shadow: none;
  margin-bottom: 16px;
}

.app-shell:not(.is-landing) .sf-target-banner:hover {
  box-shadow: none;
  border-color: var(--line);
  border-left-color: var(--seal);
}

.app-shell:not(.is-landing) .sf-target-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--seal-soft);
  border: 1px solid var(--seal-border);
  color: var(--seal);
  box-shadow: none;
}

.app-shell:not(.is-landing) .sf-target-icon svg { width: 18px; height: 18px; }

.app-shell:not(.is-landing) .sf-target-info h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.app-shell:not(.is-landing) .sf-target-info p {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

/* ----------------------------------------------------------------
   16. STUDENT — GRADE SUMMARY & TABLES
   ---------------------------------------------------------------- */
.app-shell:not(.is-landing) .sf-grade-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 12px 16px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  box-shadow: none;
  font-size: 12px;
  color: var(--ink-2);
}

.app-shell:not(.is-landing) .sf-grade-dist {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
}

.app-shell:not(.is-landing) .sf-grade-dist-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  box-shadow: none;
}

.app-shell:not(.is-landing) .sf-grades-section {
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: none;
  overflow: hidden;
}

.app-shell:not(.is-landing) .sf-grades-section:hover { box-shadow: none; }

.app-shell:not(.is-landing) .sf-grades-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line-faint);
  cursor: pointer;
}

.app-shell:not(.is-landing) .sf-grades-section.collapsed .sf-grades-header {
  border-bottom-color: transparent;
}

.app-shell:not(.is-landing) .sf-grades-header h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.app-shell:not(.is-landing) .sf-grades-chevron {
  transition: transform 160ms var(--ease-out);
  color: var(--muted);
}

.app-shell:not(.is-landing) .sf-grades-section.collapsed .sf-grades-chevron {
  transform: rotate(-90deg);
}

.app-shell:not(.is-landing) .sf-grades-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.app-shell:not(.is-landing) .sf-grades-meta strong { color: var(--ink-2); }

.app-shell:not(.is-landing) .sf-grades-section.collapsed .sf-grades-table-wrap {
  display: none;
}

.app-shell:not(.is-landing) .sf-target-table-wrap,
.app-shell:not(.is-landing) .sf-grades-table-wrap,
.app-shell:not(.is-landing) .sf-detail-table-wrap,
.app-shell:not(.is-landing) .adviser-students-table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: none;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.app-shell:not(.is-landing) .sf-target-table-wrap:hover,
.app-shell:not(.is-landing) .sf-grades-table-wrap:hover {
  box-shadow: none;
}

.app-shell:not(.is-landing) :is(.sf-target-table, .sf-grades-table, .sf-detail-table, .adviser-students-table, .detail-grades-table) {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.app-shell:not(.is-landing) :is(.sf-target-table, .sf-grades-table, .sf-detail-table, .adviser-students-table, .detail-grades-table) th {
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
}

.app-shell:not(.is-landing) :is(.sf-target-table, .sf-grades-table, .sf-detail-table, .adviser-students-table, .detail-grades-table) td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-faint);
  color: var(--ink-2);
  vertical-align: middle;
}

.app-shell:not(.is-landing) :is(.sf-target-table, .sf-grades-table, .sf-detail-table, .adviser-students-table, .detail-grades-table) tbody tr:hover {
  background: var(--surface-2);
}

.app-shell:not(.is-landing) :is(.sf-target-table, .sf-grades-table, .sf-detail-table, .adviser-students-table, .detail-grades-table) tr:last-child td {
  border-bottom: none;
}

.app-shell:not(.is-landing) .sf-target-code,
.app-shell:not(.is-landing) .sf-grades-code,
.app-shell:not(.is-landing) .sf-detail-code {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.app-shell:not(.is-landing) :is(.sf-target-units, .sf-grades-units, .sf-detail-units) {
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.app-shell:not(.is-landing) .sf-category-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  box-shadow: none;
}

.app-shell:not(.is-landing) .sf-target-prereq {
  color: var(--muted);
  font-size: 12px;
}

.app-shell:not(.is-landing) .sf-target-table tfoot td {
  background: var(--surface-2);
  border-top: 1px solid var(--line);
  border-bottom: none;
  font-weight: 700;
}

.app-shell:not(.is-landing) .sf-target-total-label {
  text-align: right;
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.app-shell:not(.is-landing) .sf-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  margin-bottom: 12px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.app-shell:not(.is-landing) .sf-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-light);
  pointer-events: none;
}

/* Scoped through the wrapper to out-specify the generic input rule so the
   left padding reserved for the search icon is preserved. */
.app-shell:not(.is-landing) .sf-search-wrap .sf-search-input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 12px 0 36px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--ink);
  font-size: 13px;
  box-shadow: none;
}

.app-shell:not(.is-landing) .sf-search-wrap .sf-search-input:focus {
  border-color: var(--blue);
  box-shadow: var(--ring);
}

.app-shell:not(.is-landing) .sf-search-count {
  flex-shrink: 0;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  box-shadow: none;
  font-variant-numeric: tabular-nums;
}

/* ----------------------------------------------------------------
   17. STUDENT — BLOCK SELECTION & DETAIL
   ---------------------------------------------------------------- */
.app-shell:not(.is-landing) .sf-block-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.app-shell:not(.is-landing) .sf-block-list-card {
  display: flex;
  flex-direction: column;
  padding: 18px 20px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: none;
  cursor: pointer;
  animation: none;
  opacity: 1;
  transform: none;
  transition: border-color 140ms var(--ease-out), background 140ms var(--ease-out);
}

.app-shell:not(.is-landing) .sf-block-list-card:hover {
  border-color: var(--line-strong);
  box-shadow: none;
  transform: none;
}

.app-shell:not(.is-landing) .sf-block-list-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-shell:not(.is-landing) .sf-block-list-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: none;
  flex-shrink: 0;
}

.app-shell:not(.is-landing) .sf-block-list-info h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.app-shell:not(.is-landing) .sf-block-list-info p {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.app-shell:not(.is-landing) .sf-block-list-slots {
  margin-left: auto;
  display: flex;
  align-items: baseline;
  gap: 3px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.app-shell:not(.is-landing) .sf-block-list-slots-num {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
}

.app-shell:not(.is-landing) .sf-block-list-slots-label {
  font-size: 11px;
  color: var(--muted);
}

.app-shell:not(.is-landing) .sf-block-list-bar {
  height: 4px;
  margin: 14px 0 12px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
  box-shadow: none;
}

.app-shell:not(.is-landing) .sf-block-list-bar-fill {
  height: 100%;
  border-radius: inherit;
  box-shadow: none;
}

.app-shell:not(.is-landing) :is(.sf-slots-good) { background: var(--success); }
.app-shell:not(.is-landing) :is(.sf-slots-low) { background: var(--warning); }
.app-shell:not(.is-landing) :is(.sf-slots-critical) { background: var(--danger); }

.app-shell:not(.is-landing) .sf-block-list-dot.sf-slots-good { background: var(--success); }
.app-shell:not(.is-landing) .sf-block-list-dot.sf-slots-low { background: var(--warning); }
.app-shell:not(.is-landing) .sf-block-list-dot.sf-slots-critical { background: var(--danger); }

.app-shell:not(.is-landing) .sf-block-list-days {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 14px;
}

.app-shell:not(.is-landing) .sf-block-list-day-tag {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: none;
}

.app-shell:not(.is-landing) .sf-block-list-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line-faint);
  color: var(--blue-dark);
  font-size: 12.5px;
  font-weight: 600;
}

.app-shell:not(.is-landing) .sf-block-list-action svg { transition: transform 160ms var(--ease-out); }

.app-shell:not(.is-landing) .sf-block-list-card:hover .sf-block-list-action svg {
  transform: translateX(3px);
}

.app-shell:not(.is-landing) .sf-detail-capacity {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 18px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  box-shadow: none;
}

.app-shell:not(.is-landing) .sf-detail-capacity-info {
  display: flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
}

.app-shell:not(.is-landing) .sf-detail-capacity-num {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.app-shell:not(.is-landing) .sf-detail-capacity-label {
  font-size: 12px;
  color: var(--muted);
}

.app-shell:not(.is-landing) .sf-detail-capacity-bar {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
  box-shadow: none;
}

.app-shell:not(.is-landing) .sf-detail-capacity-fill {
  height: 100%;
  border-radius: inherit;
  box-shadow: none;
}

.app-shell:not(.is-landing) .sf-detail-schedule {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: none;
  overflow: hidden;
}

.app-shell:not(.is-landing) .sf-detail-schedule-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.app-shell:not(.is-landing) .sf-detail-schedule-header h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.app-shell:not(.is-landing) .sf-detail-schedule-header h2 i { color: var(--muted); font-size: 13px; }

.app-shell:not(.is-landing) .sf-detail-table-wrap {
  border: 0;
  border-radius: 0;
}

.app-shell:not(.is-landing) .sf-detail-sched { max-width: 280px; }

.app-shell:not(.is-landing) .sf-detail-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 1px 4px 1px 0;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: none;
}

.app-shell:not(.is-landing) .sf-detail-tag i { font-size: 9px; color: var(--muted); }

.app-shell:not(.is-landing) .sf-detail-submit-bar {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.app-shell:not(.is-landing) .sf-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  margin-bottom: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: none;
}

.app-shell:not(.is-landing) .sf-actions.sf-section { padding: 18px 22px; }

.app-shell:not(.is-landing) .sf-blocked {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--muted);
  font-size: 13px;
  text-align: left;
}

.app-shell:not(.is-landing) .sf-blocked-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 14px;
  box-shadow: none;
}

.app-shell:not(.is-landing) .sf-blocked p { margin: 0; }
.app-shell:not(.is-landing) .sf-blocked strong { color: var(--ink-2); }

/* ----------------------------------------------------------------
   18. STUDENT — STATUS DASHBOARD
   ---------------------------------------------------------------- */
.app-shell:not(.is-landing) .sf-status-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: none;
}

.app-shell:not(.is-landing) .sf-status-card::before {
  display: none;
}

.app-shell:not(.is-landing) .sf-status-card:hover {
  box-shadow: none;
  transform: none;
}

.app-shell:not(.is-landing) .sf-status-card-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--blue-dark);
  font-size: 18px;
  box-shadow: none;
}

.app-shell:not(.is-landing) .sf-status-enrolled .sf-status-card-icon {
  background: var(--success-bg);
  color: var(--success);
}

.app-shell:not(.is-landing) .sf-status-rejected .sf-status-card-icon {
  background: var(--danger-bg);
  color: var(--danger);
}

.app-shell:not(.is-landing) .sf-status-pending .sf-status-card-icon {
  background: var(--warning-bg);
  color: var(--warning);
}

.app-shell:not(.is-landing) .sf-status-card:hover .sf-status-card-icon { transform: none; }

.app-shell:not(.is-landing) .sf-status-card-info h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.app-shell:not(.is-landing) .sf-status-card-info p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
  opacity: 1;
}

.app-shell:not(.is-landing) .sf-status-card-detail {
  margin-left: auto;
  padding-left: 20px;
  border-left: 1px solid var(--line);
  text-align: right;
}

.app-shell:not(.is-landing) .sf-status-detail-row small {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.app-shell:not(.is-landing) .sf-status-detail-row strong {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
}

.app-shell:not(.is-landing) .sf-progress-badge {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  box-shadow: none;
  font-variant-numeric: tabular-nums;
}

.app-shell:not(.is-landing) .sf-timeline {
  display: flex;
  flex-direction: column;
  padding: 4px 0 0;
}

.app-shell:not(.is-landing) .sf-timeline-item {
  position: relative;
  display: flex;
  gap: 16px;
  padding-bottom: 22px;
}

.app-shell:not(.is-landing) .sf-timeline-item:last-child { padding-bottom: 0; }

.app-shell:not(.is-landing) .sf-timeline-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 15px;
  top: 32px;
  bottom: 0;
  width: 1px;
  background: var(--line-strong);
}

.app-shell:not(.is-landing) .sf-timeline-item.completed::after { background: var(--success-border); }

.app-shell:not(.is-landing) .sf-timeline-marker {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--muted);
  box-shadow: none;
  z-index: 1;
}

.app-shell:not(.is-landing) .sf-timeline-item.active .sf-timeline-marker {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  box-shadow: none;
  animation: none;
}

[data-theme="dark"] .app-shell:not(.is-landing) .sf-timeline-item.active .sf-timeline-marker {
  background: var(--ink);
  border-color: var(--ink);
  color: #0c1014;
}

.app-shell:not(.is-landing) .sf-timeline-item.completed .sf-timeline-marker {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success);
}

.app-shell:not(.is-landing) .sf-timeline-icon {
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.app-shell:not(.is-landing) .sf-timeline-content { padding-top: 3px; }

.app-shell:not(.is-landing) .sf-timeline-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

.app-shell:not(.is-landing) .sf-timeline-desc {
  margin-top: 2px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

.app-shell:not(.is-landing) .sf-timeline-item.active .sf-timeline-label { color: var(--blue-dark); }
.app-shell:not(.is-landing) .sf-timeline-item.completed .sf-timeline-label { color: var(--success); }

.app-shell:not(.is-landing) .sf-enrolled-msg,
.app-shell:not(.is-landing) .sf-rejected-msg {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.app-shell:not(.is-landing) .sf-enrolled-icon,
.app-shell:not(.is-landing) .sf-rejected-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success);
  font-size: 17px;
  box-shadow: none;
}

.app-shell:not(.is-landing) .sf-rejected-icon {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger);
}

.app-shell:not(.is-landing) .sf-enrolled-msg h3,
.app-shell:not(.is-landing) .sf-rejected-msg h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.app-shell:not(.is-landing) .sf-enrolled-msg p,
.app-shell:not(.is-landing) .sf-rejected-msg p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.app-shell:not(.is-landing) .sf-enrolled-actions { display: flex; flex-direction: column; gap: 18px; }

.app-shell:not(.is-landing) .sf-enrolled-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line-faint);
}

/* ----------------------------------------------------------------
   19. STUDENT — TERMINAL STATES
   ---------------------------------------------------------------- */
.app-shell:not(.is-landing) .sf-error,
.app-shell:not(.is-landing) .sf-closed {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 55vh;
  padding: 48px 24px;
  text-align: center;
}

.app-shell:not(.is-landing) .sf-error h3,
.app-shell:not(.is-landing) .sf-closed h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
}

.app-shell:not(.is-landing) .sf-error p,
.app-shell:not(.is-landing) .sf-closed p {
  margin: 0;
  max-width: 46ch;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
}

.app-shell:not(.is-landing) .sf-error-icon,
.app-shell:not(.is-landing) .sf-closed-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 4px;
  border-radius: 50%;
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger);
  font-size: 18px;
}

.app-shell:not(.is-landing) .sf-empty {
  padding: 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* ----------------------------------------------------------------
   20. STAFF — LAYOUT & SIDEBAR
   ---------------------------------------------------------------- */
.app-shell:not(.is-landing) .staff-layout {
  display: flex;
  align-items: flex-start;
  width: 100%;
  min-height: calc(100vh - var(--app-bar));
  margin: 0;
  background: var(--bg);
}

.app-shell:not(.is-landing) .staff-sidebar {
  position: sticky;
  top: var(--app-bar);
  display: flex;
  flex-direction: column;
  width: var(--app-rail);
  min-width: var(--app-rail);
  height: calc(100vh - var(--app-bar));
  background: var(--surface);
  border-right: 1px solid var(--line);
  box-shadow: none;
  overflow-x: hidden;
  overflow-y: auto;
  z-index: 20;
}

/* Header block */
.app-shell:not(.is-landing) .sidebar-header {
  position: relative;
  padding: 22px 18px 18px;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.app-shell:not(.is-landing) .sidebar-role-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 12px;
  border-radius: 10px;
  border: 1px solid var(--accent-soft-2);
  background: var(--accent-soft) !important;
  color: var(--blue-dark) !important;
  font-size: 15px;
  box-shadow: none;
}

[data-theme="dark"] .app-shell:not(.is-landing) .sidebar-role-icon {
  color: var(--blue) !important;
}

.app-shell:not(.is-landing) .sidebar-role-title {
  margin: 0 0 3px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.3;
}

.app-shell:not(.is-landing) .sidebar-role-subtitle {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--muted);
}

.app-shell:not(.is-landing) .sidebar-collapse-wrap {
  position: absolute;
  top: 18px;
  right: 14px;
  padding: 0;
}

.app-shell:not(.is-landing) .sidebar-collapse-btn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 10px;
  box-shadow: none;
}

.app-shell:not(.is-landing) .sidebar-collapse-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
  box-shadow: none;
}

/* Navigation */
.app-shell:not(.is-landing) .sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
}

.app-shell:not(.is-landing) .sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  margin-bottom: 2px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  box-shadow: none;
  transition: background-color 130ms var(--ease-out), color 130ms var(--ease-out);
}

.app-shell:not(.is-landing) .sidebar-nav-item i {
  width: 18px;
  flex-shrink: 0;
  font-size: 13px;
  text-align: center;
}

.app-shell:not(.is-landing) .sidebar-nav-item:hover {
  background: var(--surface-2);
  color: var(--ink);
  box-shadow: none;
}

.app-shell:not(.is-landing) .sidebar-nav-item.active {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--ink);
  font-weight: 700;
  box-shadow: inset 2px 0 0 var(--blue);
}

.app-shell:not(.is-landing) .sidebar-nav-item.active i { color: var(--blue); }

.app-shell:not(.is-landing) .sidebar-nav-item .nav-badge {
  margin-left: auto;
  min-width: 20px;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-3);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  box-shadow: none;
  font-variant-numeric: tabular-nums;
}

.app-shell:not(.is-landing) .sidebar-nav-item.active .nav-badge {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.app-shell:not(.is-landing) .sidebar-divider {
  height: 1px;
  margin: 8px 10px;
  background: var(--line);
}

.app-shell:not(.is-landing) .sidebar-footer {
  padding: 10px;
  border-top: 1px solid var(--line);
  background: transparent;
}

.app-shell:not(.is-landing) .sidebar-footer .sidebar-nav-item {
  color: var(--muted);
}

.app-shell:not(.is-landing) .sidebar-footer .sidebar-nav-item:last-child { color: var(--danger); }
.app-shell:not(.is-landing) .sidebar-footer .sidebar-nav-item:last-child i { color: var(--danger); }
.app-shell:not(.is-landing) .sidebar-footer .sidebar-nav-item:last-child:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

/* Collapsed rail */
.app-shell:not(.is-landing) .staff-sidebar.collapsed {
  width: 72px;
  min-width: 72px;
}

.app-shell:not(.is-landing) .staff-sidebar.collapsed .sidebar-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0;
}

.app-shell:not(.is-landing) .staff-sidebar.collapsed .sidebar-header > *:not(.sidebar-role-icon):not(.sidebar-collapse-wrap) {
  display: none;
}

.app-shell:not(.is-landing) .staff-sidebar.collapsed .sidebar-collapse-wrap {
  position: static;
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.app-shell:not(.is-landing) .staff-sidebar.collapsed .sidebar-role-icon {
  margin-bottom: 0;
  width: 36px;
  height: 36px;
}

.app-shell:not(.is-landing) .staff-sidebar.collapsed .sidebar-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
}

.app-shell:not(.is-landing) .staff-sidebar.collapsed .sidebar-nav-item {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  justify-content: center;
  font-size: 0;
  gap: 0;
}

.app-shell:not(.is-landing) .staff-sidebar.collapsed .sidebar-nav-item i { font-size: 15px; }
.app-shell:not(.is-landing) .staff-sidebar.collapsed .nav-badge { display: none; }

/* Main column */
.app-shell:not(.is-landing) .sidebar-main {
  flex: 1;
  min-width: 0;
  overflow-y: visible;
  background: var(--bg);
}

.app-shell:not(.is-landing) .sidebar-section { display: none; }
.app-shell:not(.is-landing) .sidebar-section.active {
  display: block;
  animation: appFadeIn 180ms var(--ease-out);
}

/* The floating hamburger is replaced by the mobile tab bar. */
.app-shell:not(.is-landing) .sidebar-toggle { display: none !important; }

.app-shell:not(.is-landing) .sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(10, 16, 22, 0.45);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.app-shell:not(.is-landing) .sidebar-overlay.open { display: block; }

/* Inline `style="padding:28px ..."` wrappers from the render layer
   are neutralised so every section shares the page rhythm. */
.app-shell:not(.is-landing) .sidebar-main [style*="padding:28px"] {
  padding: 0 !important;
}

/* ----------------------------------------------------------------
   21. STAFF — STATS, PIPELINE, CAPACITY
   ---------------------------------------------------------------- */
.app-shell:not(.is-landing) .admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.app-shell:not(.is-landing) .admin-stat-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: none;
  overflow: visible;
  animation: none;
  transition: border-color 140ms var(--ease-out);
}

/* The 3px accent strip on top was the loudest leftover. */
.app-shell:not(.is-landing) .admin-stat-card::before { display: none; }

.app-shell:not(.is-landing) .admin-stat-card:hover {
  border-color: var(--line-strong);
  box-shadow: none;
  transform: none;
}

.app-shell:not(.is-landing) .admin-stat-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--surface-2) !important;
  border: 1px solid var(--line);
  color: var(--accent, var(--blue)) !important;
  font-size: 13px;
  box-shadow: none;
}

.app-shell:not(.is-landing) .admin-stat-card:hover .admin-stat-icon { transform: none; }

.app-shell:not(.is-landing) .admin-stat-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.app-shell:not(.is-landing) .admin-stat-label {
  order: 0;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.app-shell:not(.is-landing) .admin-stat-value {
  order: 1;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* Pipeline */
.app-shell:not(.is-landing) .admin-pipeline-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}

.app-shell:not(.is-landing) .admin-pipeline-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  animation: none;
}

.app-shell:not(.is-landing) .admin-pipeline-card:last-child { border-right: 0; }
.app-shell:not(.is-landing) .admin-pipeline-card::before { display: none; }

.app-shell:not(.is-landing) .admin-pipeline-card:hover {
  background: var(--surface-2);
  border-color: var(--line);
  box-shadow: none;
  transform: none;
}

.app-shell:not(.is-landing) .admin-pipeline-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-bottom: 6px;
  border-radius: 7px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--accent, var(--blue));
  font-size: 11px;
  box-shadow: none;
}

.app-shell:not(.is-landing) .admin-pipeline-num {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.app-shell:not(.is-landing) .admin-pipeline-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}

/* Capacity */
.app-shell:not(.is-landing) .capacity-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.app-shell:not(.is-landing) .capacity-metric {
  position: relative;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: none;
  animation: none;
}

.app-shell:not(.is-landing) .capacity-metric-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-bottom: 12px;
  border-radius: 8px;
  background: var(--surface-2) !important;
  border: 1px solid var(--line) !important;
  font-size: 13px;
  box-shadow: none;
}

.app-shell:not(.is-landing) .capacity-metric-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.app-shell:not(.is-landing) .capacity-metric-label {
  margin-top: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}

.app-shell:not(.is-landing) .block-overload-section { margin-top: 8px; }

.app-shell:not(.is-landing) .block-overload-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 18px;
  margin-bottom: 8px;
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-md);
  background: var(--warning-bg);
  box-shadow: none;
  animation: none;
}

.app-shell:not(.is-landing) .block-overload-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-shell:not(.is-landing) .block-overload-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--warning-border);
  color: var(--warning);
  box-shadow: none;
}

.app-shell:not(.is-landing) .block-overload-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}

.app-shell:not(.is-landing) .block-overload-detail {
  font-size: 12px;
  color: var(--muted);
}

.app-shell:not(.is-landing) .overload-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--warning-border);
  background: var(--surface);
  color: var(--warning);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.app-shell:not(.is-landing) .btn-request-block {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.app-shell:not(.is-landing) .btn-request-block:hover {
  background: var(--surface-2);
  color: var(--ink);
}

/* ----------------------------------------------------------------
   22. STAFF — QUEUE ROWS
   ---------------------------------------------------------------- */
.app-shell:not(.is-landing) .queue-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  box-shadow: none;
  color: var(--muted);
  font-size: 12px;
}

.app-shell:not(.is-landing) .queue-status strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
}

.app-shell:not(.is-landing) .queue-status strong::before { display: none; }

.app-shell:not(.is-landing) .app-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px 16px;
  margin-bottom: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: none;
  cursor: pointer;
  transition: border-color 130ms var(--ease-out), background 130ms var(--ease-out);
}

.app-shell:not(.is-landing) .app-row:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.app-shell:not(.is-landing) .app-row-info { flex: 1; min-width: 0; }

.app-shell:not(.is-landing) .app-row-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

.app-shell:not(.is-landing) .app-row-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--muted);
}

.app-shell:not(.is-landing) .app-row-meta i { color: var(--muted-light); }

.app-shell:not(.is-landing) .app-row-grades {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.app-shell:not(.is-landing) .app-row-grade-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10.5px;
  box-shadow: none;
}

.app-shell:not(.is-landing) .app-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.app-shell:not(.is-landing) .app-row-actions .button {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
}

/* Enrolled list */
.app-shell:not(.is-landing) .enrolled-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 16px;
  margin-bottom: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: none;
}

.app-shell:not(.is-landing) .enrolled-row:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
}

.app-shell:not(.is-landing) .enrolled-row-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.app-shell:not(.is-landing) .enrolled-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 700;
  box-shadow: none;
}

.app-shell:not(.is-landing) .enrolled-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

.app-shell:not(.is-landing) .enrolled-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--muted);
}

.app-shell:not(.is-landing) .enrolled-coe-id {
  margin-top: 5px;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 11px;
  color: var(--seal);
}

.app-shell:not(.is-landing) .enrolled-row-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.app-shell:not(.is-landing) .enrolled-btn {
  min-height: 32px;
  padding: 0 11px;
  font-size: 12px;
}

/* Adviser block folders */
.app-shell:not(.is-landing) .adviser-block-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.app-shell:not(.is-landing) .adviser-block-card {
  display: flex;
  flex-direction: column;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: none;
  cursor: pointer;
  animation: none;
}

.app-shell:not(.is-landing) .adviser-block-card:hover {
  border-color: var(--line-strong);
  box-shadow: none;
  transform: none;
}

.app-shell:not(.is-landing) .adviser-block-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-shell:not(.is-landing) .adviser-block-card-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--blue);
  font-size: 13px;
  box-shadow: none;
}

.app-shell:not(.is-landing) .adviser-block-card-info h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.app-shell:not(.is-landing) .adviser-block-card-info p {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.app-shell:not(.is-landing) .adviser-block-card-bar {
  height: 4px;
  margin: 14px 0 12px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
  box-shadow: none;
}

.app-shell:not(.is-landing) .adviser-block-card-bar-fill {
  height: 100%;
  border-radius: inherit;
  box-shadow: none;
}

.app-shell:not(.is-landing) .adviser-block-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 14px;
}

.app-shell:not(.is-landing) .adviser-block-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
}

.app-shell:not(.is-landing) .adviser-block-tag--pending {
  border-color: var(--warning-border);
  background: var(--warning-bg);
  color: var(--warning);
}

.app-shell:not(.is-landing) .adviser-block-tag--enrolled {
  border-color: var(--success-border);
  background: var(--success-bg);
  color: var(--success);
}

.app-shell:not(.is-landing) .adviser-block-card-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line-faint);
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 600;
}

.app-shell:not(.is-landing) .adviser-block-card:hover .adviser-block-card-action svg {
  transform: translateX(3px);
}

.app-shell:not(.is-landing) .adviser-block-detail {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 18px;
  box-shadow: none;
}

.app-shell:not(.is-landing) .adviser-block-detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.app-shell:not(.is-landing) .adviser-block-detail-title h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.app-shell:not(.is-landing) .adviser-block-detail-title p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.app-shell:not(.is-landing) .adviser-block-detail-bar {
  position: relative;
  height: 6px;
  margin-bottom: 16px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
  box-shadow: none;
}

.app-shell:not(.is-landing) .adviser-block-detail-bar-fill {
  height: 100%;
  border-radius: inherit;
  box-shadow: none;
}

.app-shell:not(.is-landing) .adviser-block-detail-bar-label {
  display: none;
}

.app-shell:not(.is-landing) .adviser-student-name {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-shell:not(.is-landing) .adviser-student-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 700;
  box-shadow: none;
}

.app-shell:not(.is-landing) .adviser-honor-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--seal-border);
  background: var(--seal-soft);
  color: var(--seal);
  font-size: 10px;
  font-weight: 700;
}

/* ----------------------------------------------------------------
   23. STAFF — DETAIL PANEL
   ---------------------------------------------------------------- */
.app-shell:not(.is-landing) .detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  background: var(--overlay-bg);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  padding: 0;
}

.app-shell:not(.is-landing) .detail-panel {
  display: flex;
  flex-direction: column;
  width: min(680px, 100%);
  height: 100%;
  background: var(--bg);
  border-left: 1px solid var(--line);
  border-radius: 0;
  box-shadow: var(--flat-shadow-lg);
  animation: appSheetIn 220ms var(--ease-out);
}

@keyframes appSheetIn {
  from { transform: translateX(24px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.app-shell:not(.is-landing) .detail-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.app-shell:not(.is-landing) .detail-panel-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.app-shell:not(.is-landing) .detail-avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 10px;
  border: 1px solid var(--line) !important;
  background: var(--surface-2) !important;
  color: var(--ink-2) !important;
  font-size: 13px;
  font-weight: 700;
  box-shadow: none;
}

.app-shell:not(.is-landing) .detail-identity h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.app-shell:not(.is-landing) .detail-identity-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--muted);
}

.app-shell:not(.is-landing) .detail-student-id {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.app-shell:not(.is-landing) .detail-stage-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--line) !important;
  background: var(--surface-2) !important;
  color: var(--ink-2) !important;
  font-size: 10.5px;
  font-weight: 700;
}

.app-shell:not(.is-landing) .detail-close-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  box-shadow: none;
}

.app-shell:not(.is-landing) .detail-close-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
  box-shadow: none;
}

.app-shell:not(.is-landing) .detail-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px 32px;
}

.app-shell:not(.is-landing) .detail-section {
  padding: 16px 18px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: none;
}

.app-shell:not(.is-landing) .detail-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line-faint);
}

.app-shell:not(.is-landing) .detail-section-header h3 {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.app-shell:not(.is-landing) .detail-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.app-shell:not(.is-landing) .detail-info-card {
  padding: 10px 12px;
  border: 1px solid var(--line-faint);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  box-shadow: none;
}

.app-shell:not(.is-landing) .detail-info-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.app-shell:not(.is-landing) .detail-info-value {
  margin-top: 3px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.app-shell:not(.is-landing) .detail-info-value--accent {
  color: var(--blue-dark);
  font-family: var(--font-display);
  font-size: 15px;
}

.app-shell:not(.is-landing) .detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.app-shell:not(.is-landing) .detail-btn {
  flex: 1;
  min-height: 42px;
}

.app-shell:not(.is-landing) .detail-grades-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: none;
  overflow-x: auto;
}

/* ----------------------------------------------------------------
   24. ADMIN — CARDS, RECENT, SETTINGS
   ---------------------------------------------------------------- */
.app-shell:not(.is-landing) .admin-college-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.app-shell:not(.is-landing) .admin-college-card {
  position: relative;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: none;
  overflow: hidden;
}

.app-shell:not(.is-landing) .admin-college-card::before { display: none; }

.app-shell:not(.is-landing) .admin-college-card:hover {
  border-color: var(--line-strong);
  box-shadow: none;
  transform: none;
}

.app-shell:not(.is-landing) .admin-college-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.app-shell:not(.is-landing) .admin-college-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--accent, var(--blue));
  font-size: 13px;
  box-shadow: none;
}

.app-shell:not(.is-landing) .admin-college-info strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.app-shell:not(.is-landing) .admin-college-code {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.app-shell:not(.is-landing) .admin-college-stats {
  display: flex;
  gap: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--line-faint);
}

.app-shell:not(.is-landing) .admin-college-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.app-shell:not(.is-landing) .admin-college-stat-num {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.app-shell:not(.is-landing) .admin-college-stat-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.app-shell:not(.is-landing) .admin-college-bar-wrap {
  height: 3px;
  margin-top: 14px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.app-shell:not(.is-landing) .admin-college-bar {
  height: 100%;
  border-radius: inherit;
}

/* Recent activity list */
.app-shell:not(.is-landing) .admin-recent-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.app-shell:not(.is-landing) .admin-recent-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  box-shadow: none;
}

.app-shell:not(.is-landing) .admin-recent-row + .admin-recent-row {
  border-top: 1px solid var(--line-faint);
}

.app-shell:not(.is-landing) .admin-recent-row:hover {
  background: var(--surface-2);
  border-color: var(--line-faint);
}

.app-shell:not(.is-landing) .admin-recent-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-2) !important;
  color: var(--ink-2) !important;
  font-size: 11px;
  font-weight: 700;
}

.app-shell:not(.is-landing) .admin-recent-info { flex: 1; min-width: 0; }

.app-shell:not(.is-landing) .admin-recent-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.app-shell:not(.is-landing) .admin-recent-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}

.app-shell:not(.is-landing) .admin-recent-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
}

.app-shell:not(.is-landing) .admin-recent-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.app-shell:not(.is-landing) .admin-recent-stage {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line) !important;
  background: var(--surface-2) !important;
  color: var(--ink-2) !important;
  font-size: 10px;
  font-weight: 700;
}

.app-shell:not(.is-landing) .admin-recent-date {
  font-size: 10.5px;
  color: var(--muted);
}

/* Staff roster */
.app-shell:not(.is-landing) .admin-staff-list {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.app-shell:not(.is-landing) .admin-staff-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: var(--surface);
}

.app-shell:not(.is-landing) .admin-staff-row + .admin-staff-row {
  border-top: 1px solid var(--line-faint);
}

.app-shell:not(.is-landing) .admin-staff-row:hover { background: var(--surface-2); }

.app-shell:not(.is-landing) .admin-staff-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
  box-shadow: none;
}

.app-shell:not(.is-landing) .admin-staff-info { flex: 1; min-width: 0; }

.app-shell:not(.is-landing) .admin-staff-info strong {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}

.app-shell:not(.is-landing) .admin-staff-info span {
  display: block;
  margin-top: 1px;
  font-size: 11px;
  color: var(--muted);
}

.app-shell:not(.is-landing) .admin-staff-id {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--muted);
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 10.5px;
}

/* Gatekeeper + schedules */
.app-shell:not(.is-landing) .admin-gatekeeper-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  box-shadow: none;
}

.app-shell:not(.is-landing) .admin-gatekeeper-status {
  display: flex;
  align-items: center;
  gap: 9px;
}

.app-shell:not(.is-landing) .admin-gatekeeper-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted-light);
}

.app-shell:not(.is-landing) .admin-gatekeeper-dot.open {
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-bg);
}

.app-shell:not(.is-landing) .admin-gatekeeper-dot.closed {
  background: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-bg);
}

.app-shell:not(.is-landing) .admin-gatekeeper-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.app-shell:not(.is-landing) .admin-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
  box-shadow: none;
}

.app-shell:not(.is-landing) .admin-toggle-track {
  position: relative;
  display: block;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: var(--line-strong);
  box-shadow: none;
}

.app-shell:not(.is-landing) .admin-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--flat-shadow);
  transition: transform 160ms var(--ease-out);
}

.app-shell:not(.is-landing) .admin-toggle-btn.on .admin-toggle-track { background: var(--success); }
.app-shell:not(.is-landing) .admin-toggle-btn.on .admin-toggle-thumb { transform: translateX(16px); }

.app-shell:not(.is-landing) .admin-toggle-text {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.app-shell:not(.is-landing) .admin-toggle-btn.on .admin-toggle-text { color: var(--success); }

/* Schedule form */
.app-schedule-form {
  padding: 18px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.app-schedule-form h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.app-schedule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.app-field { display: flex; flex-direction: column; gap: 5px; }

.app-field > label,
.app-field > span {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Dialogs stack a short run of fields above their actions. */
.modal-content .app-field { margin-bottom: 12px; }
.modal-content .app-field:last-child { margin-bottom: 0; }

.app-schedule-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 16px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.app-schedule-row-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

.app-schedule-row-title i { color: var(--muted); font-size: 12px; }

.app-schedule-dates {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--muted);
}

.app-schedule-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-left: auto;
}

.app-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
}

.app-status-pill.is-active {
  border-color: var(--success-border);
  background: var(--success-bg);
  color: var(--success);
}

.app-status-pill.is-current {
  border-color: var(--accent-soft-2);
  background: var(--accent-soft);
  color: var(--blue-dark);
}

.app-status-pill.is-past {
  background: var(--surface-3);
}

.app-status-pill.is-upcoming {
  border-color: var(--warning-border);
  background: var(--warning-bg);
  color: var(--warning);
}

/* The programme comparison table */
.app-shell:not(.is-landing) .data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.app-shell:not(.is-landing) .data-table th {
  padding: 9px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
}

.app-shell:not(.is-landing) .data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-faint);
  color: var(--ink-2);
}

.app-shell:not(.is-landing) .table-scroll-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

/* ----------------------------------------------------------------
   25. RESPONSIVE — TABLET
   ---------------------------------------------------------------- */
@media (max-width: 1080px) {
  :root {
    --app-rail: 228px;
  }

  .app-shell:not(.is-landing) .admin-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-shell:not(.is-landing) .sf-info-badge {
    min-width: 92px;
    padding: 2px 14px;
  }
}

/* ----------------------------------------------------------------
   26. RESPONSIVE — APP SHELL (phone / small tablet)
   ---------------------------------------------------------------- */
@media (max-width: 900px) {
  :root {
    --app-bar: 58px;
    --app-gutter: 16px;
  }

  .app-mobile-nav { display: grid; }

  /* Staff: one column, bottom tab bar, sidebar becomes a sheet. */
  .app-shell:not(.is-landing) .staff-layout {
    display: block;
    min-height: calc(100vh - var(--app-bar));
  }

  .app-shell:not(.is-landing) .staff-sidebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: auto;
    min-width: 0;
    height: min(78vh, 620px);
    padding-bottom: env(safe-area-inset-bottom);
    border: 0;
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
    border-top: 1px solid var(--line);
    box-shadow: 0 -24px 60px -20px rgba(10, 16, 22, 0.4);
    transform: translateY(105%);
    transition: transform 240ms var(--ease-out);
    z-index: 200;
    overflow-y: auto;
  }

  .app-shell:not(.is-landing) .staff-sidebar::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    margin: 10px auto 4px;
    border-radius: 999px;
    background: var(--line-strong);
    flex-shrink: 0;
  }

  .app-shell:not(.is-landing) .staff-sidebar.open {
    transform: translateY(0);
  }

  .app-shell:not(.is-landing) .staff-sidebar.collapsed {
    width: auto;
    min-width: 0;
  }

  .app-shell:not(.is-landing) .staff-sidebar.collapsed .sidebar-header > *:not(.sidebar-role-icon):not(.sidebar-collapse-wrap) {
    display: block;
  }

  .app-shell:not(.is-landing) .staff-sidebar.collapsed .sidebar-nav-item {
    width: 100%;
    height: auto;
    min-height: 44px;
    justify-content: flex-start;
    padding: 9px 11px;
    font-size: 13px;
    gap: 11px;
  }

  .app-shell:not(.is-landing) .staff-sidebar.collapsed .nav-badge { display: inline-block; }

  /* The collapse toggle is meaningless in sheet mode. */
  .app-shell:not(.is-landing) .sidebar-collapse-wrap { display: none; }

  .app-shell:not(.is-landing) .sidebar-nav-item {
    min-height: 44px;
    font-size: 14px;
  }

  .app-shell:not(.is-landing) .sidebar-main {
    margin-left: 0;
    padding-bottom: calc(74px + env(safe-area-inset-bottom));
  }

  .app-shell:not(.is-landing) .app-page {
    padding: 20px var(--app-gutter) 24px;
  }

  .app-shell:not(.is-landing) .app-page-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    padding-bottom: 14px;
    margin-bottom: 18px;
  }

  .app-shell:not(.is-landing) .app-page-head-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .app-shell:not(.is-landing) .app-page-head-actions .app-search {
    flex: 1;
    min-width: 160px;
  }

  .app-shell:not(.is-landing) .admin-section-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .app-shell:not(.is-landing) .admin-section-header > div:last-child {
    display: flex;
    gap: 8px;
  }

  .app-shell:not(.is-landing) .app-search input {
    width: 100% !important;
  }

  /* Student: compact header, full-width actions. */
  .app-shell:not(.is-landing) .sf-header {
    padding: 16px var(--app-gutter);
  }

  .app-shell:not(.is-landing) .sf-header-content {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .app-shell:not(.is-landing) .sf-header-left {
    gap: 14px;
    align-items: flex-start;
  }

  .app-shell:not(.is-landing) .sf-step-indicator {
    padding-top: 3px;
  }

  .app-shell:not(.is-landing) .sf-header-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    width: 100%;
  }

  .app-shell:not(.is-landing) .sf-header-actions .button {
    flex: 1 1 auto;
    min-height: 42px;
  }

  .app-shell:not(.is-landing) .sf-body {
    padding: 16px var(--app-gutter) 24px;
  }

  .app-shell:not(.is-landing) .sf-info-banner {
    flex-wrap: wrap;
    align-items: flex-start;
    padding: 16px;
    gap: 12px;
  }

  .app-shell:not(.is-landing) .sf-info-details {
    flex: 1;
    min-width: 0;
  }

  .app-shell:not(.is-landing) .sf-info-badges {
    width: 100%;
    margin-left: 0;
    padding-top: 14px;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .app-shell:not(.is-landing) .sf-info-badge {
    flex: 1;
    min-width: 0;
    padding: 0 12px;
  }

  .app-shell:not(.is-landing) .sf-info-badge:first-child { padding-left: 0; }

  .app-shell:not(.is-landing) .sf-status-card {
    flex-wrap: wrap;
    gap: 14px;
    padding: 18px;
  }

  .app-shell:not(.is-landing) .sf-status-card-detail {
    width: 100%;
    margin-left: 0;
    padding: 12px 0 0;
    border-left: 0;
    border-top: 1px solid var(--line-faint);
    text-align: left;
  }

  .app-shell:not(.is-landing) .sf-actions,
  .app-shell:not(.is-landing) .sf-section.sf-actions {
    position: sticky;
    bottom: 0;
    z-index: 60;
    margin: 16px calc(-1 * var(--app-gutter)) 0;
    padding: 12px var(--app-gutter) calc(12px + env(safe-area-inset-bottom));
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  }

  .app-shell:not(.is-landing) .sf-actions .button {
    width: 100%;
  }

  .app-shell:not(.is-landing) .sf-detail-submit-bar {
    position: sticky;
    bottom: calc(0px + env(safe-area-inset-bottom));
    z-index: 60;
    margin: 16px calc(-1 * var(--app-gutter)) 0;
    padding: 12px var(--app-gutter);
    background: var(--surface);
    border-top: 1px solid var(--line);
  }

  .app-shell:not(.is-landing) .sf-detail-submit-bar .button {
    width: 100%;
  }

  .app-shell:not(.is-landing) .detail-panel {
    width: 100%;
    border-left: 0;
  }

  .app-shell:not(.is-landing) .detail-panel-body {
    padding: 16px 16px 28px;
  }

  .app-shell:not(.is-landing) .detail-actions .detail-btn {
    flex: 1 1 100%;
  }

  .app-shell:not(.is-landing) .admin-stats-grid {
    gap: 8px;
  }

  .app-shell:not(.is-landing) .admin-stat-card {
    padding: 13px 14px 15px;
    gap: 10px;
  }

  .app-shell:not(.is-landing) .admin-stat-value {
    font-size: 23px;
  }

  .app-shell:not(.is-landing) .capacity-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .app-shell:not(.is-landing) .capacity-metric {
    padding: 14px;
  }

  .app-shell:not(.is-landing) .capacity-metric-value { font-size: 23px; }

  .app-shell:not(.is-landing) .admin-pipeline-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-shell:not(.is-landing) .admin-pipeline-card {
    border-bottom: 1px solid var(--line);
  }

  .app-shell:not(.is-landing) .admin-pipeline-card:nth-child(2n) { border-right: 0; }
  .app-shell:not(.is-landing) .admin-pipeline-card:nth-last-child(-n+2) { border-bottom: 0; }

  .app-shell:not(.is-landing) .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal-content {
    max-width: 100%;
    border-radius: 18px 18px 0 0;
    border-bottom: 0;
    padding: 22px 18px calc(18px + env(safe-area-inset-bottom));
    max-height: 88vh;
    animation: appSheetIn 200ms var(--ease-out);
  }

  .app-shell:not(.is-landing) .admin-recent-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .app-shell:not(.is-landing) .admin-recent-right {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding-left: 44px;
  }

  .app-shell:not(.is-landing) .app-row {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 14px;
  }

  .app-shell:not(.is-landing) .app-row-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .app-shell:not(.is-landing) .app-row-actions .button {
    min-height: 40px;
  }

  .app-shell:not(.is-landing) .enrolled-row {
    flex-wrap: wrap;
    gap: 10px;
  }

  .app-shell:not(.is-landing) .enrolled-row-actions {
    width: 100%;
  }

  .app-shell:not(.is-landing) .enrolled-row-actions .button {
    flex: 1;
    min-height: 40px;
  }

  .app-shell:not(.is-landing) .queue-status {
    font-size: 11.5px;
  }

  .app-shell:not(.is-landing) .block-overload-card {
    align-items: flex-start;
  }
}

/* ----------------------------------------------------------------
   27. RESPONSIVE — PHONE TABLES AS RECORDS
   ---------------------------------------------------------------- */
@media (max-width: 640px) {
  /* Topbar: keep the identity chip and actions on one row without the bar
     spilling past the viewport. The account actions carry the same treatment
     as the landing page: icon-only, 44px touch targets. */
  .app-shell:not(.is-landing) .topbar {
    gap: 10px;
  }

  .app-shell:not(.is-landing) .brand {
    flex: 0 1 auto;
    min-width: 0;
  }

  .app-shell:not(.is-landing) .brand small {
    display: none;
  }

  .app-shell:not(.is-landing) .topbar-meta {
    min-width: 0;
    flex-wrap: nowrap;
  }

  .app-shell:not(.is-landing) #session-label {
    max-width: 26vw;
    padding: 5px 10px;
    font-size: 11px;
  }

  .app-shell:not(.is-landing) .theme-toggle {
    width: 44px;
    height: 44px;
  }

  /* ID selectors in styles.css cap these at 32px; match their specificity. */
  .app-shell:not(.is-landing) .topbar-meta #change-password-button,
  .app-shell:not(.is-landing) .topbar-meta #logout-button {
    min-width: 44px;
    min-height: 44px;
    padding: 0 12px;
  }

  .app-shell:not(.is-landing) .topbar-meta .btn-label {
    display: none;
  }

  .app-shell:not(.is-landing) :is(.sf-target-table, .sf-grades-table, .sf-detail-table, .adviser-students-table, .detail-grades-table) thead {
    display: none;
  }

  .app-shell:not(.is-landing) :is(.sf-target-table, .sf-grades-table, .sf-detail-table, .adviser-students-table, .detail-grades-table) tbody {
    display: block;
  }

  .app-shell:not(.is-landing) :is(.sf-target-table, .sf-grades-table, .sf-detail-table, .adviser-students-table, .detail-grades-table) tr {
    display: block;
    padding: 11px 14px;
    border-bottom: 1px solid var(--line-faint);
  }

  .app-shell:not(.is-landing) :is(.sf-target-table, .sf-grades-table, .sf-detail-table, .adviser-students-table, .detail-grades-table) tr:last-child {
    border-bottom: 0;
  }

  .app-shell:not(.is-landing) :is(.sf-target-table, .sf-grades-table, .sf-detail-table, .adviser-students-table, .detail-grades-table) td {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 10px;
    align-items: baseline;
    padding: 2px 0;
    border: 0;
    text-align: left !important;
  }

  .app-shell:not(.is-landing) :is(.sf-target-table, .sf-grades-table, .sf-detail-table, .adviser-students-table, .detail-grades-table) td::before {
    content: attr(data-label);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
  }

  .app-shell:not(.is-landing) :is(.sf-target-table, .sf-grades-table, .sf-detail-table, .adviser-students-table, .detail-grades-table) td:not([data-label])::before {
    display: none;
  }

  .app-shell:not(.is-landing) :is(.sf-target-table, .sf-grades-table, .sf-detail-table, .adviser-students-table, .detail-grades-table) td:not([data-label]) {
    display: block;
  }

  .app-shell:not(.is-landing) .sf-target-table-wrap,
  .app-shell:not(.is-landing) .sf-grades-table-wrap,
  .app-shell:not(.is-landing) .sf-detail-table-wrap,
  .app-shell:not(.is-landing) .detail-grades-wrap,
  .app-shell:not(.is-landing) .adviser-students-table-wrap {
    border: 0;
    border-radius: 0;
    background: transparent;
    overflow: visible;
  }

  .app-shell:not(.is-landing) .sf-target-table tfoot {
    display: block;
    margin-top: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
  }

  .app-shell:not(.is-landing) .sf-target-table tfoot tr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border: 0;
  }

  .app-shell:not(.is-landing) .sf-target-table tfoot td {
    display: block;
    padding: 0;
  }

  .app-shell:not(.is-landing) .sf-target-table tfoot td::before { display: none; }

  .app-shell:not(.is-landing) .sf-target-total-label {
    text-align: left;
    font-size: 11px;
  }

  .app-shell:not(.is-landing) .sf-search-wrap {
    flex-wrap: wrap;
  }

  .app-shell:not(.is-landing) .sf-search-input { flex: 1 1 100%; }

  .app-shell:not(.is-landing) .sf-info-name { font-size: 16px; }
  .app-shell:not(.is-landing) .sf-info-avatar { width: 42px; height: 42px; font-size: 16px; }

  .app-shell:not(.is-landing) .sf-block-list-grid {
    grid-template-columns: 1fr;
  }

  .app-shell:not(.is-landing) .sf-block-list-card {
    padding: 16px;
  }

  .app-shell:not(.is-landing) .sf-grades-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .app-shell:not(.is-landing) .admin-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-shell:not(.is-landing) .capacity-grid {
    grid-template-columns: 1fr;
  }

  .app-shell:not(.is-landing) .adviser-block-grid {
    grid-template-columns: 1fr;
  }

  .app-shell:not(.is-landing) .app-schedule-actions {
    width: 100%;
    margin-left: 0;
  }

  .app-shell:not(.is-landing) .app-schedule-row > div:first-child {
    flex: 1 1 100%;
  }

  .app-shell:not(.is-landing) .detail-info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ----------------------------------------------------------------
   28. RESPONSIVE — SMALL PHONE
   ---------------------------------------------------------------- */
@media (max-width: 400px) {
  .app-shell:not(.is-landing) .brand small { display: none; }
  .app-shell:not(.is-landing) .brand-logo { width: 30px; height: 30px; }
  .app-shell:not(.is-landing) .brand strong { font-size: 14px; }

  .app-shell:not(.is-landing) .sf-step-num { width: 24px; height: 24px; font-size: 10.5px; }
  .app-shell:not(.is-landing) .sf-step-line { width: 18px; }

  .app-shell:not(.is-landing) .admin-stat-value { font-size: 21px; }
  .app-shell:not(.is-landing) .admin-stat-label { font-size: 9.5px; }
  .app-shell:not(.is-landing) .admin-stat-icon { display: none; }

  .app-shell:not(.is-landing) .detail-info-grid { grid-template-columns: 1fr; }

  .app-shell:not(.is-landing) .app-mobile-nav-item { font-size: 9.5px; }
}

/* ----------------------------------------------------------------
   29. DARK MODE — THIRD-PARTY / LEGACY HARDCODED SURFACES
   These pages were written with literal light colours. Values are
   remapped here rather than edited one by one, except where markup
   was changed (see the task report).
   ---------------------------------------------------------------- */
[data-theme="dark"] .app-shell:not(.is-landing) .coe-edit-panel {
  background: var(--bg);
}

[data-theme="dark"] .app-shell:not(.is-landing) .coe-edit-header,
[data-theme="dark"] .app-shell:not(.is-landing) .coe-edit-section {
  background: var(--surface);
  border-color: var(--line);
}

[data-theme="dark"] .modal-content .notice {
  border-color: var(--line-strong);
}

/* ----------------------------------------------------------------
   30. REDUCED MOTION
   ---------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .app-shell:not(.is-landing) *,
  .app-shell:not(.is-landing) *::before,
  .app-shell:not(.is-landing) *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ----------------------------------------------------------------
   31. PRINT — the COE document must stay untouched
   ---------------------------------------------------------------- */
@media print {
  .app-mobile-nav,
  .app-page-head {
    display: none !important;
  }

  .app-shell:not(.is-landing) .sf-header {
    display: none !important;
  }

  .app-shell:not(.is-landing) #main-content,
  .app-shell:not(.is-landing) .sf-flow,
  .app-shell:not(.is-landing) .sf-body {
    background: #fff !important;
  }
}

/* ----------------------------------------------------------------
   32. MODAL INTERNALS
   ---------------------------------------------------------------- */
.modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 9px;
  border: 1px solid var(--accent-soft-2);
  background: var(--accent-soft);
  color: var(--blue-dark);
  font-size: 15px;
}

.modal-icon--warning {
  border-color: var(--warning-border);
  background: var(--warning-bg);
  color: var(--warning);
}

.modal-icon--danger {
  border-color: var(--danger-border);
  background: var(--danger-bg);
  color: var(--danger);
}

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

.modal-head h3 { margin: 0; }

.modal-body {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-2);
}

.modal-body p { margin: 0 0 10px; }
.modal-body p:last-child { margin-bottom: 0; }
.modal-body strong { color: var(--ink); }

/* Term / system banners used by admin and student panels. */
.app-term-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--success);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.app-term-banner--muted {
  border-left-color: var(--line-strong);
  background: var(--surface-2);
}

.app-term-banner i {
  font-size: 15px;
  color: var(--success);
}

.app-term-banner--muted i { color: var(--muted); }

.app-term-banner strong {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
}

.app-term-banner span {
  display: block;
  margin-top: 1px;
  font-size: 12px;
  color: var(--muted);
}

/* Schedule preview block inside the "next semester" dialog. */
.app-schedule-detail {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  text-align: left;
}

.app-schedule-detail-title {
  margin-bottom: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.app-schedule-detail-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 0;
  font-size: 12.5px;
  color: var(--muted);
}

.app-schedule-detail-row strong {
  color: var(--ink);
  font-weight: 600;
  text-align: right;
}

.app-dialog-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.app-dialog-center .modal-icon {
  width: 44px;
  height: 44px;
  margin-bottom: 12px;
  border-radius: 50%;
  font-size: 18px;
}

.app-dialog-center h4 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.app-dialog-center p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

/* ----------------------------------------------------------------
   33. SAFE AREA / NOTCH
   ---------------------------------------------------------------- */
@supports (padding: max(0px)) {
  .app-shell:not(.is-landing) .topbar {
    padding-left: max(var(--app-gutter), env(safe-area-inset-left));
    padding-right: max(var(--app-gutter), env(safe-area-inset-right));
  }
}


