/* ================================================================
   CatSU Enrollment — Flat Design System (Revamp)
   ----------------------------------------------------------------
   Loaded AFTER styles.css / ui-polish.css / student-flow.css.
   Converts the previous neomorphic UI into a high-end flat system:
   hairline borders, layered neutral surfaces, a single accent hue.
   Applies to every surface EXCEPT the landing (login) page and the
   COE document (which retain their original treatment).

   Dark mode is a purpose-built deep-slate palette driven by
   [data-theme="dark"] on <html>.
   ================================================================ */

/* ----------------------------------------------------------------
   1. DESIGN TOKENS — LIGHT
   ---------------------------------------------------------------- */
:root {
  /* Surfaces & layers */
  --bg: #f4f5f7;
  --bg-subtle: #fafbfc;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #eef0f3;
  --surface-hover: #f2f4f7;

  /* Hairlines */
  --line: #e6e8ec;
  --line-strong: #d3d7de;
  --line-faint: #eef0f3;

  /* Ink */
  --ink: #10151c;
  --ink-2: #37404d;
  --muted: #67707d;
  --muted-light: #9aa2ad;

  /* Accent (institutional blue) + neutrals stay brand-true */
  --blue: #1a73b5;
  --blue-dark: #0f5c93;
  --blue-strong: #0b476f;
  --accent-soft: #e9f2f9;
  --accent-soft-2: #dcebf6;
  --navy: #0f1b2d;

  /* Depth — flat means borders, not blur */
  --flat-shadow: 0 1px 2px rgba(16, 21, 28, 0.04);
  --flat-shadow-md: 0 4px 16px -6px rgba(16, 21, 28, 0.12);
  --flat-shadow-lg: 0 24px 48px -18px rgba(16, 21, 28, 0.22);

  /* Radii — tightened for a crisp flat feel */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Status surfaces */
  --success: #0f766e;
  --success-bg: #f0fdfa;
  --success-border: #b6e9df;
  --danger: #c0392b;
  --danger-bg: #fdf2f1;
  --danger-border: #f3c9c4;
  --warning: #b45309;
  --warning-bg: #fffbeb;
  --warning-border: #f3dca0;

  --ring: 0 0 0 3px rgba(26, 115, 181, 0.22);
  --overlay-bg: rgba(16, 21, 28, 0.55);
}

/* ----------------------------------------------------------------
   2. DESIGN TOKENS — DARK (designed, not inverted)
   ---------------------------------------------------------------- */
[data-theme="dark"] {
  --bg: #0b0f14;
  --bg-subtle: #0e1218;
  --surface: #141a21;
  --surface-2: #19212a;
  --surface-3: #212a34;
  --surface-hover: #1d2632;

  --line: #262f3a;
  --line-strong: #38434f;
  --line-faint: #1e262f;

  --ink: #e8eef4;
  --ink-2: #c4cdd8;
  --muted: #8b98a6;
  --muted-light: #66737f;

  --blue: #52a7e0;
  --blue-dark: #7cc0ec;
  --blue-strong: #a6d6f4;
  --accent-soft: #13293a;
  --accent-soft-2: #17364c;
  --navy: #e8eef4;

  --flat-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  --flat-shadow-md: 0 6px 22px -10px rgba(0, 0, 0, 0.7);
  --flat-shadow-lg: 0 28px 60px -20px rgba(0, 0, 0, 0.8);

  --success: #34d3b5;
  --success-bg: #0d2723;
  --success-border: #1c4a41;
  --danger: #f0705f;
  --danger-bg: #2a1512;
  --danger-border: #4d2a24;
  --warning: #e0a44a;
  --warning-bg: #2a210f;
  --warning-border: #4a3a1a;

  --ring: 0 0 0 3px rgba(82, 167, 224, 0.32);
  --overlay-bg: rgba(0, 0, 0, 0.68);
}

/* Smooth theme crossfade (disabled when the user prefers reduced motion) */
html.theme-transition,
html.theme-transition * {
  transition: background-color 0.22s ease, border-color 0.22s ease, color 0.22s ease !important;
}

/* ----------------------------------------------------------------
   3. BASE
   ---------------------------------------------------------------- */
body {
  background: var(--bg);
  color: var(--ink);
  font-size: 14.5px;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(26, 115, 181, 0.22); }
[data-theme="dark"] ::selection { background: rgba(82, 167, 224, 0.3); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 999px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--muted-light); }

/* Visible, accessible focus for every interactive element */
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 9999;
  background: var(--blue);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  transition: top 0.2s ease;
}
.skip-link:focus { top: 12px; color: #fff; }

/* ----------------------------------------------------------------
   4. TOPBAR
   ---------------------------------------------------------------- */
.topbar {
  height: 64px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
  backdrop-filter: saturate(140%) blur(6px);
}
.topbar::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--blue);
  opacity: 1;
  border-radius: 0;
}

.brand-logo {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: none;
  padding: 4px;
}
.brand strong { color: var(--ink); }
.brand small { color: var(--muted); }

.portal-link {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: none;
  color: var(--muted);
}
.portal-link:hover {
  color: var(--blue);
  border-color: var(--blue);
  background: var(--accent-soft);
  box-shadow: none;
}

#session-label {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: none;
  color: var(--ink-2);
}

/* Theme toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.theme-toggle:hover {
  color: var(--blue);
  border-color: var(--blue);
  background: var(--accent-soft);
}
.theme-toggle i { font-size: 14px; }

/* ----------------------------------------------------------------
   5. BUTTONS — flat
   ---------------------------------------------------------------- */
.button {
  border-radius: var(--radius-md);
  font-weight: 600;
  box-shadow: none !important;
  transition: background-color var(--transition-fast), border-color var(--transition-fast),
    color var(--transition-fast), transform var(--transition-fast);
}
.button:active { transform: translateY(1px); }

.button:where(:not(.button-gold):not(.button-light):not(.button-ghost):not(.button-danger):not(.button-reject):not(.button-outline)) {
  background: var(--blue);
  color: #fff;
  border: 1px solid var(--blue);
}
.button:where(:not(.button-gold):not(.button-light):not(.button-ghost):not(.button-danger):not(.button-reject):not(.button-outline)):hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  transform: none;
}

.button-gold {
  background: var(--gold, #e5a91a) !important;
  color: #3d2c00;
  border: 1px solid #d19a10;
  box-shadow: none !important;
}
.button-gold:hover { background: #d19a10 !important; transform: none; }

.button-ghost {
  background: var(--surface);
  color: var(--ink-2);
  border: 1px solid var(--line);
  box-shadow: none;
}
.button-ghost:hover {
  background: var(--surface-hover);
  color: var(--blue);
  border-color: var(--line-strong);
  box-shadow: none;
}

.button-light {
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.button-light:hover { background: var(--surface-3); color: var(--ink); border-color: var(--line-strong); }

.button-danger, .button-reject {
  background: var(--danger);
  color: #fff;
  border: 1px solid var(--danger);
  box-shadow: none;
}
.button-danger:hover, .button-reject:hover { background: #a53024; border-color: #a53024; transform: none; }
[data-theme="dark"] .button-danger:hover,
[data-theme="dark"] .button-reject:hover { background: #d95c4c; border-color: #d95c4c; }

.button-outline {
  background: transparent;
  color: var(--blue);
  border: 1px solid var(--line-strong);
}
.button-outline:hover { background: var(--accent-soft); color: var(--blue-dark); border-color: var(--blue); }

/* ----------------------------------------------------------------
   6. PANELS / CARDS / SECTIONS
   ---------------------------------------------------------------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--flat-shadow);
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: none;
}
.stat strong { color: var(--ink); }
.stat small { color: var(--muted); }

/* ----------------------------------------------------------------
   7. STAFF SIDEBAR
   ---------------------------------------------------------------- */
.staff-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  box-shadow: none;
}
.sidebar-header { border-bottom: 1px solid var(--line); }
.sidebar-role-icon {
  background: var(--accent-soft);
  color: var(--blue);
  border: 1px solid var(--accent-soft-2);
  box-shadow: none;
}
.sidebar-nav-item {
  border-radius: var(--radius-md);
  color: var(--muted);
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}
.sidebar-nav-item:hover {
  background: var(--surface-hover);
  color: var(--ink);
  box-shadow: none;
}
.sidebar-nav-item.active {
  background: var(--accent-soft);
  color: var(--blue);
  border-color: var(--accent-soft-2);
  box-shadow: inset 3px 0 0 var(--blue);
}
.sidebar-nav-item .nav-badge {
  background: var(--surface-3);
  color: var(--muted);
  box-shadow: none;
  border: 1px solid var(--line);
}
.sidebar-nav-item.active .nav-badge { background: var(--blue); color: #fff; border-color: var(--blue); }
.sidebar-divider { background: var(--line); }
.sidebar-footer { border-top: 1px solid var(--line); background: transparent; }

.sidebar-collapse-btn {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  box-shadow: none;
}
.sidebar-collapse-btn:hover { background: var(--surface-3); color: var(--blue); box-shadow: none; }

.sidebar-main { background: var(--bg); }

/* ----------------------------------------------------------------
   8. QUEUE / APP ROWS / PIPELINE
   ---------------------------------------------------------------- */
.pipeline-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: none;
}
.pipeline-card:hover { border-color: var(--blue); transform: none; box-shadow: var(--flat-shadow); }

.queue-status {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: none;
}

.app-row {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: none;
}
.app-row:hover { border-color: var(--line-strong); background: var(--surface-hover); }
.app-row-grade-chip {
  background: var(--surface-3);
  border: 1px solid var(--line);
  box-shadow: none;
  color: var(--ink-2);
}

/* ----------------------------------------------------------------
   9. ADVISER BLOCKS
   ---------------------------------------------------------------- */
.adviser-block-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: none;
}
.adviser-block-card:hover { border-color: var(--blue); transform: none; box-shadow: var(--flat-shadow); }
.adviser-block-card-icon { background: var(--accent-soft); color: var(--blue); box-shadow: none; border: 1px solid var(--accent-soft-2); }
.adviser-block-tag--empty {
  background: var(--surface-3);
  color: var(--muted);
  box-shadow: none;
  border: 1px solid var(--line);
}
.adviser-students-table-wrap { border: 1px solid var(--line); box-shadow: none; background: var(--surface); }
.adviser-students-table th { background: var(--surface-2); color: var(--muted); border-bottom: 1px solid var(--line); }
.adviser-students-table td { border-bottom: 1px solid var(--line-faint); }

/* ----------------------------------------------------------------
   10. ADMIN
   ---------------------------------------------------------------- */
.admin-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: none;
}
.admin-stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: none;
}
.admin-stat-card:hover { border-color: var(--line-strong); transform: none; box-shadow: var(--flat-shadow); }
.admin-stat-icon { background: var(--accent-soft); color: var(--blue); box-shadow: none; border: 1px solid var(--accent-soft-2); }

.admin-pipeline-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: none; }
.admin-pipeline-card:hover { border-color: var(--blue); transform: none; box-shadow: var(--flat-shadow); }
.admin-pipeline-icon { background: var(--accent-soft); color: var(--blue); box-shadow: none; }

.admin-college-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: none; }
.admin-college-card:hover { border-color: var(--line-strong); box-shadow: var(--flat-shadow); }
.admin-program-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: none; }
.admin-program-card:hover { border-color: var(--line-strong); }
.admin-program-card.active { background: var(--accent-soft); border-color: var(--blue); }

.admin-recent-row { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: none; }
.admin-recent-row:hover { background: var(--surface-hover); border-color: var(--line-strong); }

.admin-staff-row:hover { background: var(--surface-hover); }
.admin-staff-avatar { background: var(--accent-soft); color: var(--blue); border: 1px solid var(--accent-soft-2); box-shadow: none; }
.admin-staff-id { background: var(--surface-3); border: 1px solid var(--line); }

.admin-detail-chip { background: var(--surface-2); border: 1px solid var(--line); box-shadow: none; }
.admin-detail-chip:hover { background: var(--surface-3); box-shadow: none; }

.admin-gatekeeper-body { background: var(--surface); border: 1px solid var(--line); box-shadow: none; }

/* Enrollment toggle */
.admin-toggle-btn { background: transparent; }
.admin-toggle-track { background: var(--line-strong); box-shadow: none; border: 1px solid var(--line-strong); }
.admin-toggle-thumb { background: var(--surface); box-shadow: var(--flat-shadow); }
.admin-toggle-btn.active .admin-toggle-track { background: var(--success); border-color: var(--success); }

/* ----------------------------------------------------------------
   11. DETAIL SLIDE-OUT
   ---------------------------------------------------------------- */
.detail-overlay { background: var(--overlay-bg); }
.detail-panel {
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: var(--flat-shadow-lg);
}
.detail-panel-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.detail-avatar { background: var(--accent-soft); color: var(--blue); border: 1px solid var(--accent-soft-2); box-shadow: none; }
.detail-close-btn { background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); box-shadow: none; }
.detail-close-btn:hover { background: var(--surface-3); color: var(--ink); box-shadow: none; }
.detail-section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: none; }
.detail-section-header { border-bottom: 1px solid var(--line); }
.detail-section-count { background: var(--surface-3); border: 1px solid var(--line); color: var(--muted); }
.detail-section-gwa { background: var(--accent-soft); color: var(--blue); border: 1px solid var(--accent-soft-2); }
.detail-info-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: none; }
.detail-info-card--wide { background: var(--surface-2); }
.detail-grades-wrap { border: 1px solid var(--line); background: var(--surface); box-shadow: none; }
.detail-grades-table th { background: var(--surface-2); color: var(--muted); border-bottom: 1px solid var(--line); }
.detail-grades-table td { border-bottom: 1px solid var(--line-faint); }
.detail-btn--approve { background: var(--success); border: 1px solid var(--success); color: #fff; box-shadow: none; }
.detail-btn--approve:hover { background: #0b5f58; box-shadow: none; }
.detail-btn--reject { background: var(--danger); border: 1px solid var(--danger); color: #fff; box-shadow: none; }
.detail-btn--reject:hover { background: #a53024; box-shadow: none; }

/* ----------------------------------------------------------------
   12. MODALS
   ---------------------------------------------------------------- */
.modal-overlay { background: var(--overlay-bg); }
.modal-content {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--flat-shadow-lg);
}
.modal-content h3, .modal-content strong { color: var(--ink); }

/* ----------------------------------------------------------------
   13. FORMS
   ---------------------------------------------------------------- */
.input,
.form-field input,
.form-field select,
.form-field textarea,
.registrar-coe-field input,
.registrar-coe-field select {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--ink);
  box-shadow: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.input:focus,
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus,
.registrar-coe-field input:focus {
  border-color: var(--blue);
  box-shadow: var(--ring);
  outline: none;
}
.input::placeholder, .form-field input::placeholder { color: var(--muted-light); }

/* ----------------------------------------------------------------
   14. TAGS / BADGES / CHIPS
   ---------------------------------------------------------------- */
.tag {
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  box-shadow: none;
  color: var(--ink-2);
}

/* ----------------------------------------------------------------
   15. TABLES
   ---------------------------------------------------------------- */
.table-scroll-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: none;
}
.data-table th { background: var(--surface-2); color: var(--muted); border-bottom: 1px solid var(--line); }
.data-table td { border-bottom: 1px solid var(--line-faint); color: var(--ink-2); }
.data-table tr:hover td { background: var(--surface-hover); }

/* ----------------------------------------------------------------
   16. EMPTY / LOADING
   ---------------------------------------------------------------- */
.empty-state {
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: none;
}
.admin-empty-icon { background: var(--surface-3); color: var(--muted-light); box-shadow: none; border: 1px solid var(--line); }
.spinner { border: 3px solid var(--line); border-top-color: var(--blue); box-shadow: none; }

/* ----------------------------------------------------------------
   17. STUDENT FLOW (sf-*)
   ---------------------------------------------------------------- */
.sf-info-banner { background: var(--surface); border: 1px solid var(--line); box-shadow: none; }
.sf-info-banner:hover { box-shadow: var(--flat-shadow); border-color: var(--line-strong); }
.sf-info-avatar { background: var(--accent-soft); color: var(--blue); border: 1px solid var(--accent-soft-2); box-shadow: none; }
.sf-info-badge { background: var(--surface-2); border: 1px solid var(--line); box-shadow: none; }
.sf-info-badge:hover { background: var(--surface-3); box-shadow: none; }
.sf-info-tag { background: var(--accent-soft); color: var(--blue); border: 1px solid var(--accent-soft-2); box-shadow: none; }
.sf-progress-badge { background: var(--surface-2); border: 1px solid var(--line); box-shadow: none; }
.sf-search-input { background: var(--surface); border: 1px solid var(--line-strong); box-shadow: none; color: var(--ink); }
.sf-search-input:focus { border-color: var(--blue); box-shadow: var(--ring); }
.sf-search-count { background: var(--surface-3); border: 1px solid var(--line); color: var(--muted); }
.sf-section-header { border-bottom: 1px solid var(--line); }
.sf-target-banner { background: var(--surface); border: 1px solid var(--line); box-shadow: none; }
.sf-target-banner:hover { box-shadow: var(--flat-shadow); border-color: var(--line-strong); }
.sf-target-table-wrap { border: 1px solid var(--line); background: var(--surface); box-shadow: none; }
.sf-target-table-wrap:hover { box-shadow: var(--flat-shadow); }
.sf-target-table th { background: var(--surface-2); color: var(--muted); border-bottom: 1px solid var(--line); }
.sf-target-table td { border-bottom: 1px solid var(--line-faint); }
.sf-target-table tfoot td { background: var(--surface-2); }
.sf-block-card { background: var(--surface); border: 1px solid var(--line); box-shadow: none; }
.sf-block-card:hover { border-color: var(--blue); box-shadow: var(--flat-shadow); }
.sf-block-card.selected { border-color: var(--blue); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--blue) inset; }
.sf-block-card-top { background: var(--surface-2); border-bottom: 1px solid var(--line); }
.sf-block-list-card { background: var(--surface); border: 1px solid var(--line); box-shadow: none; }
.sf-block-list-card:hover { border-color: var(--blue); box-shadow: var(--flat-shadow); }
.sf-block-list-day-tag { background: var(--accent-soft); color: var(--blue); border: 1px solid var(--accent-soft-2); box-shadow: none; }
.sf-block-slot-bar { background: var(--surface-3); box-shadow: none; }
.sf-block-subject { border-bottom: 1px solid var(--line-faint); }
.sf-block-subject-units { background: var(--surface-3); border: 1px solid var(--line); color: var(--muted); }
.sf-blocked { background: var(--surface-2); border: 1px solid var(--line); box-shadow: none; }
.sf-blocked-icon { background: var(--surface-3); color: var(--muted-light); box-shadow: none; }
.sf-category-tag { border: 1px solid var(--line); box-shadow: none; }
.sf-detail-capacity { background: var(--surface-2); border: 1px solid var(--line); box-shadow: none; }
.sf-detail-capacity-bar { background: var(--surface-3); box-shadow: none; }
.sf-detail-lab, .sf-detail-lec { background: var(--surface-3); border: 1px solid var(--line); box-shadow: none; }
.sf-detail-schedule { border: 1px solid var(--line); box-shadow: none; background: var(--surface); }
.sf-detail-schedule-header { background: var(--surface-2); border-bottom: 1px solid var(--line); }
.sf-detail-table th { background: var(--surface-2); color: var(--muted); border-bottom: 1px solid var(--line); }
.sf-detail-table td { border-bottom: 1px solid var(--line-faint); }
.sf-grades-section { background: var(--surface); border: 1px solid var(--line); box-shadow: none; }
.sf-grades-section:hover { box-shadow: var(--flat-shadow); }
.sf-grades-header { background: var(--surface-2); border-bottom: 1px solid var(--line); }
.sf-grades-toggle { background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); box-shadow: none; }
.sf-grades-table th { background: var(--surface-2); color: var(--muted); border-bottom: 1px solid var(--line); }
.sf-grades-table td { border-bottom: 1px solid var(--line-faint); }
.sf-grade-summary { background: var(--surface-2); border: 1px solid var(--line); box-shadow: none; }
.sf-grade-dist { background: var(--surface-2); border: 1px solid var(--line); box-shadow: none; }

/* stragglers */
.sf-flow { background: var(--bg); }
.sf-submit-bar { background: var(--surface); border-top: 1px solid var(--line); }
.adviser-block-detail-bar { background: var(--surface-2); border: 1px solid var(--line); box-shadow: none; }
.sf-block-card-subjects { background: var(--surface); }
.data-table tbody tr:nth-child(even) { background: var(--surface-2); }
.data-table tbody tr:hover { background: var(--surface-hover); }
.enrolled-btn--print:hover { background: var(--surface-3); }
.form-field input:focus, .form-field select:focus { background: var(--surface); }

/* ----------------------------------------------------------------
   18. FOOTER (landing only) — redesigned
   ---------------------------------------------------------------- */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 0;
  margin-top: auto;
  text-align: left;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 52px clamp(20px, 4vw, 48px) 36px;
}
.footer-brand { display: flex; flex-direction: column; gap: 16px; }
.footer-brand-head { display: flex; align-items: center; gap: 12px; }
.footer-brand-head img { width: 40px; height: 40px; }
.footer-brand-head strong {
  display: block;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.2px;
}
.footer-brand-head small {
  display: block;
  font-size: 10px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.footer-brand p { font-size: 13px; line-height: 1.65; color: var(--muted); max-width: 34ch; }
.footer-col h4 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted-light);
  margin-bottom: 16px;
}
.footer-col a,
.footer-col button.footer-link {
  display: block;
  font-size: 13px;
  color: var(--ink-2);
  padding: 5px 0;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: color var(--transition-fast), padding-left var(--transition-fast);
}
.footer-col a:hover,
.footer-col button.footer-link:hover { color: var(--blue); padding-left: 4px; }
.footer-bottom {
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px clamp(20px, 4vw, 48px) 28px;
  font-size: 12px;
  color: var(--muted-light);
}

/* ----------------------------------------------------------------
   19. LANDING PAGE
   The landing (unauthenticated) view is a self-contained design in
   landing.css, loaded after this file. It owns the topbar and footer
   presentation while .app-shell.is-landing is set.
   ---------------------------------------------------------------- */

/* ----------------------------------------------------------------
   20. COE DOCUMENT EXCEPTION
   The official COE document keeps its print styling. Neutralise any
   inherited flat overrides inside the document + its edit overlay so
   the printed form renders exactly as designed.
   ---------------------------------------------------------------- */
.coe-document, .coe-front, .coe-back,
.coe-document *, .coe-edit-panel, .coe-edit-panel * { --flat-shadow: 0 0 0 transparent; }
.coe-edit-panel { background: #e4e9f0; border: none; }

/* ----------------------------------------------------------------
   21. MOBILE REFINEMENTS
   ---------------------------------------------------------------- */
@media (max-width: 900px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    padding: 40px 20px 28px;
  }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 24px 20px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 8px; }
}

@media (max-width: 480px) {
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
  .footer-col h4 { margin-bottom: 10px; }
  .theme-toggle { width: 34px; height: 34px; }
}

@media (max-width: 768px) {
  .topbar { gap: 8px; padding: 0 14px; height: 58px; }
  .topbar-meta { gap: 6px; }
  .theme-toggle { display: inline-flex; }
  .detail-panel { width: 100vw; }
  .modal-content { max-height: 88vh; }
}

/* ----------------------------------------------------------------
   22. REDUCED MOTION
   ---------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ----------------------------------------------------------------
   23. GRADIENT FLATTENING (non-landing only)
   Requirement: no decorative gradients outside the landing page.
   Each rule converts a gradient into a flat solid / tinted surface.
   ---------------------------------------------------------------- */
.staff-header::after { background: var(--blue); }
.adviser-block-card-icon { background: var(--accent-soft); color: var(--blue); }
.adviser-student-avatar { background: var(--accent-soft); color: var(--blue); }
.adviser-honor--deans, .detail-section-honor--deans { background: #fde68a; color: #7c4a03; }
.adviser-honor--presidents, .detail-section-honor--presidents { background: #bfdbfe; color: #1e3a8a; }
[data-theme="dark"] .adviser-honor--deans, [data-theme="dark"] .detail-section-honor--deans { background: #3a2c0d; color: #f0c14b; }
[data-theme="dark"] .adviser-honor--presidents, [data-theme="dark"] .detail-section-honor--presidents { background: #14283a; color: #7cc0ec; }

/* Capacity / slot indicators — solid semantic fills */
.adviser-block-card-bar-fill.sf-slots-good, .adviser-block-detail-bar-fill.sf-slots-good::before { background: #14b8a6; }
.adviser-block-card-bar-fill.sf-slots-low, .adviser-block-detail-bar-fill.sf-slots-low::before { background: #f59e0b; }
.adviser-block-card-bar-fill.sf-slots-critical, .adviser-block-detail-bar-fill.sf-slots-critical::before { background: #ef4444; }
.sf-slots-good .sf-block-slot-fill, .sf-block-list-bar-fill.sf-slots-good, .sf-detail-capacity-fill.sf-slots-good { background: #14b8a6; }
.sf-slots-low .sf-block-slot-fill, .sf-block-list-bar-fill.sf-slots-low, .sf-detail-capacity-fill.sf-slots-low { background: #f59e0b; }
.sf-slots-critical .sf-block-slot-fill, .sf-block-list-bar-fill.sf-slots-critical, .sf-detail-capacity-fill.sf-slots-critical { background: #ef4444; }

/* Admin hero — deep solid instead of gradient */
.admin-hero-bg { background: #0f1b2d; }
.admin-hero-bg::after { background: none; }
[data-theme="dark"] .admin-hero-bg { background: #0a1420; }

/* Skeleton shimmer — flat tint */
.skeleton-line, .skeleton-stat-box { background: #e8ecf0; }
[data-theme="dark"] .skeleton-line, [data-theme="dark"] .skeleton-stat-box { background: var(--surface-3); }

/* Student-flow gradient flattening */
.sf-header::after { background: var(--blue); }
.sf-info-banner::before { background: var(--blue); }
/* --navy is a background (not text) in these — keep it dark in dark mode */
[data-theme="dark"] .sf-header { background: #0e1620; }
[data-theme="dark"] .sidebar-toggle { background: #1e2a38; color: #e8eef4; }
[data-theme="dark"] .sf-step-num.active { background: #e8eef4; border-color: #e8eef4; color: #0e1620; }
[data-theme="dark"] .sf-step-num.active .sf-step-label,
[data-theme="dark"] .sf-step-num.active { color: #0e1620; }
.sf-info-avatar { background: #0f1b2d; }
.sf-info-avatar::after { background: var(--blue); }
[data-theme="dark"] .sf-info-avatar { background: #24313f; }
.sf-target-icon { background: var(--blue); }
.sf-block-card.selected::before { background: var(--blue); }
.sf-btn-proceed::before { display: none; }
.sf-honor-deans { background: #fde68a; color: #7c4a03; }
.sf-honor-presidents { background: #bfdbfe; color: #1e3a8a; }
[data-theme="dark"] .sf-honor-deans { background: #3a2c0d; color: #f0c14b; }
[data-theme="dark"] .sf-honor-presidents { background: #14283a; color: #7cc0ec; }

/* Status cards — flat semantic tints + solid accent bar */
.sf-status-pending { background: var(--warning-bg); }
.sf-status-pending::before { background: var(--warning); }
.sf-status-enrolled { background: var(--success-bg); }
.sf-status-enrolled::before { background: var(--success); }
.sf-status-rejected { background: var(--danger-bg); }
.sf-status-rejected::before { background: var(--danger); }
.sf-enrolled-msg { background: var(--success-bg); }
.sf-enrolled-msg::before { background: var(--success); }
.sf-rejected-msg { background: var(--danger-bg); }
.sf-rejected-msg::before { background: var(--danger); }

/* Semantic cards — dark-mode text/icon/border corrections */
[data-theme="dark"] .sf-status-pending { border-color: var(--warning-border); }
[data-theme="dark"] .sf-status-pending .sf-status-card-icon { color: var(--warning); background: rgba(255,255,255,0.06); }
[data-theme="dark"] .sf-status-enrolled { border-color: var(--success-border); }
[data-theme="dark"] .sf-status-enrolled .sf-status-card-icon { color: var(--success); background: rgba(255,255,255,0.06); }
[data-theme="dark"] .sf-status-rejected { border-color: var(--danger-border); }
[data-theme="dark"] .sf-status-rejected .sf-status-card-icon { color: var(--danger); background: rgba(255,255,255,0.06); }
[data-theme="dark"] .sf-status-card-icon { background: rgba(255,255,255,0.06); }
[data-theme="dark"] .sf-enrolled-msg { border-color: var(--success-border); }
[data-theme="dark"] .sf-enrolled-msg h3,
[data-theme="dark"] .sf-enrolled-msg p { color: var(--success); }
[data-theme="dark"] .sf-enrolled-icon { color: var(--success); background: rgba(52, 211, 181, 0.12); }
[data-theme="dark"] .sf-rejected-msg { border-color: var(--danger-border); }
[data-theme="dark"] .sf-rejected-msg h3,
[data-theme="dark"] .sf-rejected-msg p { color: var(--danger); }
[data-theme="dark"] .sf-rejected-icon { color: var(--danger); background: rgba(240, 112, 95, 0.12); }
[data-theme="dark"] .sf-target-info h3 { color: var(--blue); }
[data-theme="dark"] .sf-target-info p { color: var(--muted); }
