/* ═══════════════════════════════════════════════
   DESIGN TOKENS
═══════════════════════════════════════════════ */
:root {
  --primary: #2563EB;
  --primary-light: #EFF6FF;
  --primary-dark: #1D4ED8;
  --secondary: #0F172A;
  --success: #10B981;
  --success-light: #ECFDF5;
  --warning: #F59E0B;
  --warning-light: #FFFBEB;
  --danger: #EF4444;
  --danger-light: #FEF2F2;
  --info: #6366F1;
  --info-light: #EEF2FF;

  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-2: #F1F5F9;
  --border: #E2E8F0;
  --border-light: #F1F5F9;

  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --text-inverse: #FFFFFF;
  --sidebar-section: #334155;
  --sidebar-section-muted: #64748B;
  --sidebar-section-bg: #F8FAFC;
  --sidebar-section-open-bg: #EFF6FF;
  --sidebar-section-border: #DBEAFE;
  --sidebar-item: #334155;
  --sidebar-item-hover: #0F172A;
  --sidebar-item-active: #1D4ED8;

  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
  --topbar-height: 64px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow: 0 1px 3px rgba(0,0,0,.1),0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -2px rgba(0,0,0,.05);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,.1),0 10px 10px -5px rgba(0,0,0,.04);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --font-display: 'Bricolage Grotesque', sans-serif;
  --font-body: 'DM Sans', sans-serif;

  --transition: all .2s cubic-bezier(.4,0,.2,1);
  --transition-slow: all .35s cubic-bezier(.4,0,.2,1);
}

[data-theme="dark"] {
  --bg: #0B1120;
  --surface: #131E2F;
  --surface-2: #1A2740;
  --border: #1E3050;
  --border-light: #1A2740;
  --text-primary: #F1F5F9;
  --text-secondary: #CBD5E1;
  --text-muted: #94A3B8;
  --sidebar-section: #E2E8F0;
  --sidebar-section-muted: #A8B4C7;
  --sidebar-section-bg: #172238;
  --sidebar-section-open-bg: #1A2A47;
  --sidebar-section-border: #29456F;
  --sidebar-item: #CBD5E1;
  --sidebar-item-hover: #F8FAFC;
  --sidebar-item-active: #93C5FD;
  --primary-light: #1E3050;
  --success-light: #0D2B1D;
  --warning-light: #2A1E0A;
  --danger-light: #2A0E0E;
  --info-light: #1A1E3C;
  --shadow: 0 1px 3px rgba(0,0,0,.4),0 1px 2px rgba(0,0,0,.3);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.4),0 2px 4px -1px rgba(0,0,0,.3);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.4),0 4px 6px -2px rgba(0,0,0,.2);
}

/* ═══════════════════════════════════════════════
   BASE RESET
═══════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
  overflow-x: hidden;
}
h1,h2,h3,h4,h5,h6 { font-family: var(--font-display); font-weight: 700; }
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; }
input, select, textarea, button { font-family: var(--font-body); }

/* ═══════════════════════════════════════════════
   SCROLLBAR
═══════════════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ═══════════════════════════════════════════════
   LOGIN PAGE
═══════════════════════════════════════════════ */
#login-page {
  min-height: 100vh;
  display: flex;
  background: var(--bg);
}
.login-left {
  flex: 1;
  background: linear-gradient(135deg, #1D4ED8 0%, #2563EB 40%, #0891B2 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px;
  position: relative;
  overflow: hidden;
}
.login-left::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  background: rgba(255,255,255,.06);
  border-radius: 50%;
  top: -150px; left: -150px;
}
.login-left::after {
  content: '';
  position: absolute;
  width: 350px; height: 350px;
  background: rgba(255,255,255,.04);
  border-radius: 50%;
  bottom: -100px; right: -80px;
}
.login-illustration {
  position: relative;
  z-index: 1;
  text-align: center;
  color: white;
}
.login-illustration .brand-logo {
  width: 72px; height: 72px;
  background: rgba(255,255,255,.2);
  border-radius: var(--radius-xl);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 28px;
  backdrop-filter: blur(20px);
  border: 1.5px solid rgba(255,255,255,.3);
  font-size: 32px;
}
.login-illustration h2 {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.2;
}
.login-illustration p {
  font-size: 1rem;
  opacity: .8;
  max-width: 340px;
  line-height: 1.7;
}
.login-stats {
  display: flex;
  gap: 32px;
  margin-top: 48px;
}
.login-stat {
  text-align: center;
  color: white;
}
.login-stat .num {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  display: block;
}
.login-stat .lbl {
  font-size: .8rem;
  opacity: .7;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.login-right {
  width: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 56px;
  background: var(--surface);
}
.login-form-wrap { width: 100%; }
.login-form-wrap .top-brand {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 40px;
}
.login-form-wrap .top-brand .ico {
  width: 40px; height: 40px;
  background: var(--primary);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 18px;
}
.login-form-wrap .top-brand span {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}
.login-form-wrap h3 {
  font-size: 1.75rem;
  margin-bottom: 6px;
  color: var(--text-primary);
}
.login-form-wrap .subtitle {
  color: var(--text-secondary);
  margin-bottom: 36px;
  font-size: .9rem;
}
.form-label {
  font-weight: 600;
  font-size: .82rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 6px;
}
.form-control, .form-select {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: .9rem;
  transition: var(--transition);
  font-family: var(--font-body);
}
.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
  color: var(--text-primary);
}
.form-control::placeholder { color: var(--text-muted); }
.input-group-text {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  color: var(--text-muted);
}
.input-group .form-control { border-left: none; }
.input-group .input-group-text { border-right: none; border-radius: var(--radius) 0 0 var(--radius); }
.input-group .form-control { border-radius: 0 var(--radius) var(--radius) 0; }
.btn-primary-custom {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 12px 24px;
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
  font-family: var(--font-display);
  letter-spacing: .02em;
}
.btn-primary-custom:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn-primary-custom:active { transform: translateY(0); }

/* ═══════════════════════════════════════════════
   APP LAYOUT
═══════════════════════════════════════════════ */
#app-layout { display: none; min-height: 100vh; }
#app-layout.active { display: flex; }

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: var(--transition-slow);
  overflow: hidden;
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar-header {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-logo {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 17px;
  flex-shrink: 0;
}
.sidebar-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  transition: var(--transition-slow);
}
.sidebar.collapsed .sidebar-brand { opacity: 0; width: 0; }
.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
  overflow-x: hidden;
}
.nav-section-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-muted);
  padding: 12px 10px 6px;
  white-space: nowrap;
  overflow: hidden;
  transition: var(--transition);
}
.sidebar.collapsed .nav-section-label { opacity: 0; }
.nav-section {
  margin-bottom: 8px;
  --nav-accent: var(--primary);
  --nav-accent-soft: var(--primary-light);
  --nav-accent-border: var(--sidebar-section-border);
}
.nav-section[data-nav-section="main"] { --nav-accent: #2563EB; --nav-accent-soft: #EFF6FF; --nav-accent-border: #BFDBFE; }
.nav-section[data-nav-section="academics"] { --nav-accent: #059669; --nav-accent-soft: #ECFDF5; --nav-accent-border: #A7F3D0; }
.nav-section[data-nav-section="insights"] { --nav-accent: #7C3AED; --nav-accent-soft: #F5F3FF; --nav-accent-border: #DDD6FE; }
.nav-section[data-nav-section="finance"] { --nav-accent: #B45309; --nav-accent-soft: #FFFBEB; --nav-accent-border: #FDE68A; }
.nav-section[data-nav-section="portals"] { --nav-accent: #0891B2; --nav-accent-soft: #ECFEFF; --nav-accent-border: #A5F3FC; }
.nav-section[data-nav-section="communication"] { --nav-accent: #DB2777; --nav-accent-soft: #FDF2F8; --nav-accent-border: #FBCFE8; }
.nav-section[data-nav-section="system"] { --nav-accent: #475569; --nav-accent-soft: #F8FAFC; --nav-accent-border: #CBD5E1; }
[data-theme="dark"] .nav-section[data-nav-section="main"] { --nav-accent: #60A5FA; --nav-accent-soft: #142642; --nav-accent-border: #1D4ED8; }
[data-theme="dark"] .nav-section[data-nav-section="academics"] { --nav-accent: #34D399; --nav-accent-soft: #0F2A23; --nav-accent-border: #047857; }
[data-theme="dark"] .nav-section[data-nav-section="insights"] { --nav-accent: #A78BFA; --nav-accent-soft: #251B45; --nav-accent-border: #6D28D9; }
[data-theme="dark"] .nav-section[data-nav-section="finance"] { --nav-accent: #FBBF24; --nav-accent-soft: #33270E; --nav-accent-border: #B45309; }
[data-theme="dark"] .nav-section[data-nav-section="portals"] { --nav-accent: #22D3EE; --nav-accent-soft: #0D2B35; --nav-accent-border: #0E7490; }
[data-theme="dark"] .nav-section[data-nav-section="communication"] { --nav-accent: #F472B6; --nav-accent-soft: #351629; --nav-accent-border: #BE185D; }
[data-theme="dark"] .nav-section[data-nav-section="system"] { --nav-accent: #CBD5E1; --nav-accent-soft: #1E293B; --nav-accent-border: #475569; }
[data-theme="dark"] .nav-section.open .nav-section-toggle {
  background: linear-gradient(135deg, color-mix(in srgb, var(--nav-accent) 70%, #020617 30%) 0%, color-mix(in srgb, var(--nav-accent) 38%, #020617 62%) 100%);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--nav-accent) 18%, transparent);
}
[data-theme="dark"] .nav-section-count,
[data-theme="dark"] .nav-section-chevron {
  background: rgba(15, 23, 42, .44);
}
[data-theme="dark"] .nav-section.open .nav-section-count,
[data-theme="dark"] .nav-section.open .nav-section-chevron {
  background: rgba(255,255,255,.16);
}
.nav-section-toggle {
  width: 100%;
  border: 1px solid transparent;
  background: var(--nav-accent-soft);
  color: var(--sidebar-section);
  display: grid;
  grid-template-columns: 6px minmax(0, 1fr) auto 24px;
  align-items: center;
  gap: 9px;
  padding: 9px 8px;
  border-radius: var(--radius);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: .72rem;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--nav-accent-border) 70%, transparent);
  transition: background .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.nav-section-toggle::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: var(--nav-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--nav-accent) 14%, transparent);
  transition: var(--transition);
}
.nav-section-toggle:hover {
  background: color-mix(in srgb, var(--nav-accent-soft) 82%, var(--nav-accent) 18%);
  border-color: var(--nav-accent-border);
  color: var(--sidebar-section);
}
.nav-section.open .nav-section-toggle {
  background: linear-gradient(135deg, var(--nav-accent) 0%, color-mix(in srgb, var(--nav-accent) 72%, #111827 28%) 100%);
  border-color: var(--nav-accent-border);
  color: #FFFFFF;
  box-shadow: 0 10px 22px color-mix(in srgb, var(--nav-accent) 22%, transparent);
}
.nav-section.open .nav-section-toggle::before {
  background: var(--nav-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--nav-accent) 18%, transparent);
}
.nav-section-title {
  min-width: 0;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-section-count {
  background: rgba(255,255,255,.72);
  border: 1px solid var(--nav-accent-border);
  border-radius: 99px;
  color: var(--sidebar-section-muted);
  font-size: .64rem;
  font-weight: 800;
  line-height: 1;
  min-width: 22px;
  padding: 4px 6px;
  text-align: center;
}
.nav-section.open .nav-section-count {
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.3);
  color: #FFFFFF;
}
.nav-section-chevron {
  align-items: center;
  background: rgba(255,255,255,.72);
  border: 1px solid color-mix(in srgb, var(--nav-accent-border) 70%, transparent);
  border-radius: 8px;
  color: var(--sidebar-section-muted);
  display: inline-flex;
  font-size: .58rem;
  height: 24px;
  justify-content: center;
  transition: transform .18s ease, color .18s ease, background .18s ease, border-color .18s ease;
  width: 24px;
}
.nav-section.open .nav-section-chevron {
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.3);
  color: #FFFFFF;
  transform: rotate(180deg);
}
.nav-section-items {
  display: grid;
  gap: 2px;
  max-height: 900px;
  opacity: 1;
  overflow: hidden;
  padding: 5px 0 0;
  transition: max-height .22s ease, opacity .16s ease;
}
.nav-section:not(.open) .nav-section-items {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}
.sidebar.collapsed .nav-section-toggle {
  grid-template-columns: 1fr;
  padding: 5px 0 1px;
}
.sidebar.collapsed .nav-section-toggle::before { margin: 0 auto; }
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .nav-section-count,
.sidebar.collapsed .nav-section-chevron {
  opacity: 0;
  overflow: hidden;
  width: 0;
}
.sidebar.collapsed .nav-section-items {
  max-height: 900px !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}
.nav-item-sidebar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px;
  border-radius: var(--radius);
  color: var(--sidebar-item);
  cursor: pointer;
  transition: background .18s ease, color .18s ease, transform .18s ease;
  margin-bottom: 2px;
  white-space: nowrap;
  position: relative;
}
.nav-item-sidebar:hover {
  background: var(--surface-2);
  color: var(--sidebar-item-hover);
  transform: translateX(2px);
}
.nav-item-sidebar.active {
  background: var(--nav-accent-soft, var(--primary-light));
  color: var(--nav-accent, var(--sidebar-item-active));
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--nav-accent, var(--primary));
}
.nav-item-sidebar .nav-icon {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: inherit;
  flex-shrink: 0;
  transition: var(--transition);
}
.nav-item-sidebar:hover .nav-icon {
  background: var(--surface);
}
.nav-item-sidebar.active .nav-icon {
  background: var(--surface);
  color: var(--nav-accent, var(--sidebar-item-active));
}
.nav-item-sidebar .nav-label {
  font-size: .875rem;
  font-weight: 600;
  overflow: hidden;
  transition: var(--transition-slow);
}
.sidebar.collapsed .nav-label { opacity: 0; width: 0; overflow: hidden; }
.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 99px;
  transition: var(--transition-slow);
}
.sidebar.collapsed .nav-badge { opacity: 0; }
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}
.sidebar-user:hover { background: var(--surface-2); }
.sidebar-user .avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: .85rem;
}
.sidebar-user .user-info { overflow: hidden; transition: var(--transition-slow); }
.sidebar-user .user-name { font-weight: 600; font-size: .85rem; white-space: nowrap; }
.sidebar-user .user-role { font-size: .72rem; color: var(--text-muted); white-space: nowrap; }
.sidebar.collapsed .user-info { opacity: 0; width: 0; }

/* TOPBAR */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--topbar-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  z-index: 99;
  transition: var(--transition-slow);
}
.topbar.collapsed { left: var(--sidebar-collapsed); }
.topbar-toggle {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  transition: var(--transition);
  font-size: 16px;
  flex-shrink: 0;
}
.topbar-toggle:hover { background: var(--surface-2); color: var(--text-primary); }
.topbar-search {
  flex: 1;
  max-width: 400px;
  position: relative;
}
.topbar-search input {
  width: 100%;
  padding: 8px 14px 8px 38px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface-2);
  color: var(--text-primary);
  font-size: .875rem;
  transition: var(--transition);
  font-family: var(--font-body);
}
.topbar-search input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.topbar-search input::placeholder { color: var(--text-muted); }
.topbar-search .search-icon {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted); font-size: 14px;
}
.topbar-spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  background: transparent;
  border: 1.5px solid var(--border);
  transition: var(--transition);
  position: relative;
  font-size: 15px;
}
.topbar-btn:hover { background: var(--surface-2); color: var(--text-primary); border-color: transparent; }
.topbar-btn .badge-dot {
  position: absolute; top: 6px; right: 6px;
  width: 7px; height: 7px;
  background: var(--danger);
  border-radius: 50%;
  border: 1.5px solid var(--surface);
}
.theme-toggle-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: transparent;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: var(--text-secondary);
  transition: var(--transition);
}
.theme-toggle-btn:hover { background: var(--surface-2); color: var(--text-primary); }
.topbar-profile {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px 6px 6px;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: transparent;
  transition: var(--transition);
}
.topbar-profile:hover { background: var(--surface-2); }
.topbar-profile .avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: .75rem;
}
.topbar-profile .name { font-size: .82rem; font-weight: 600; color: var(--text-primary); }

/* MAIN CONTENT */
.main-content {
  margin-left: var(--sidebar-width);
  margin-top: var(--topbar-height);
  flex: 1;
  min-height: calc(100vh - var(--topbar-height));
  transition: var(--transition-slow);
  padding: 28px;
}
.main-content.collapsed { margin-left: var(--sidebar-collapsed); }

/* ═══════════════════════════════════════════════
   PAGES (hidden by default)
═══════════════════════════════════════════════ */
.page { display: none; animation: fadeInUp .3s ease; }
.page.active { display: block; }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* PAGE HEADER */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}
.page-title { font-size: 1.65rem; font-weight: 800; color: var(--text-primary); line-height: 1.2; }
.page-subtitle { font-size: .875rem; color: var(--text-secondary); margin-top: 4px; font-weight: 400; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ═══════════════════════════════════════════════
   CARDS
═══════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header-custom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.card-title-custom {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
}
.card-subtitle-custom {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* STAT CARDS */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: default;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

/* Dashboard categorized menu */
.dashboard-menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.dashboard-menu-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.dashboard-menu-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.dashboard-menu-title {
  font-family: var(--font-display);
  font-weight: 850;
  color: var(--text-primary);
  font-size: .98rem;
}
.dashboard-menu-count {
  color: var(--text-muted);
  font-size: .74rem;
  margin-top: 2px;
}
.dashboard-menu-items {
  display: grid;
  gap: 8px;
}
.dashboard-menu-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto 14px;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
  min-height: 58px;
}
.dashboard-menu-item:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-1px);
}
.dashboard-menu-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  font-size: .92rem;
  flex-shrink: 0;
}
.dashboard-menu-icon.blue { background: var(--primary-light); color: var(--primary); }
.dashboard-menu-icon.green { background: var(--success-light); color: var(--success); }
.dashboard-menu-icon.amber { background: var(--warning-light); color: var(--warning); }
.dashboard-menu-icon.purple { background: rgba(99,102,241,.12); color: var(--info); }
.dashboard-menu-text {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.dashboard-menu-text strong {
  font-size: .86rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dashboard-menu-text small {
  color: var(--text-muted);
  font-size: .72rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dashboard-menu-badge {
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid rgba(37,99,235,.18);
  border-radius: 999px;
  padding: 3px 7px;
  font-size: .62rem;
  font-weight: 850;
  white-space: nowrap;
}
.dashboard-menu-arrow {
  color: var(--text-muted);
  font-size: .72rem;
}
.stat-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.amber { background: var(--warning-light); color: var(--warning); }
.stat-icon.red { background: var(--danger-light); color: var(--danger); }
.stat-icon.purple { background: var(--info-light); color: var(--info); }
.stat-body { flex: 1; min-width: 0; }
.stat-value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}
.stat-label { font-size: .8rem; color: var(--text-secondary); margin-top: 4px; font-weight: 500; }
.stat-trend { display: flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 600; margin-top: 8px; }
.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }

/* ═══════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════ */
.btn { border-radius: var(--radius); font-family: var(--font-body); font-weight: 600; font-size: .85rem; transition: var(--transition); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); color: white; transform: translateY(-1px); }
.btn-light { background: var(--surface-2); border-color: var(--border); color: var(--text-primary); }
.btn-light:hover { background: var(--border); }
.btn-success-custom { background: var(--success); border: none; color: white; }
.btn-success-custom:hover { background: #0DA870; color: white; transform: translateY(-1px); }
.btn-danger-custom { background: var(--danger); border: none; color: white; }
.btn-danger-custom:hover { background: #DC2626; color: white; transform: translateY(-1px); }

/* ═══════════════════════════════════════════════
   TABLE
═══════════════════════════════════════════════ */
.table-custom { width: 100%; border-collapse: collapse; }
.table-custom th {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  white-space: nowrap;
}
.table-custom th:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.table-custom th:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.table-custom td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  font-size: .875rem;
  vertical-align: middle;
}
.table-custom tr:last-child td { border-bottom: none; }
.table-custom tbody tr { transition: var(--transition); }
.table-custom tbody tr:hover { background: var(--surface-2); }
.student-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: .8rem;
  flex-shrink: 0;
}

/* BADGES */
.badge-custom {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: .72rem;
  font-weight: 700;
  display: inline-block;
}
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-info { background: var(--info-light); color: var(--info); }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-gray { background: var(--surface-2); color: var(--text-secondary); }

/* ═══════════════════════════════════════════════
   ACTION BUTTONS (table)
═══════════════════════════════════════════════ */
.action-btn {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}
.action-btn.view { background: var(--primary-light); color: var(--primary); }
.action-btn.view:hover { background: var(--primary); color: white; }
.action-btn.edit { background: var(--warning-light); color: var(--warning); }
.action-btn.edit:hover { background: var(--warning); color: white; }
.action-btn.delete { background: var(--danger-light); color: var(--danger); }
.action-btn.delete:hover { background: var(--danger); color: white; }
.action-btn.print { background: var(--success-light); color: var(--success); }
.action-btn.print:hover { background: var(--success); color: white; }

/* ═══════════════════════════════════════════════
   PROGRESS BARS
═══════════════════════════════════════════════ */
.progress-custom {
  height: 7px;
  background: var(--surface-2);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width .8s cubic-bezier(.4,0,.2,1);
}

/* ═══════════════════════════════════════════════
   ACTIVITY FEED
═══════════════════════════════════════════════ */
.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.activity-body .activity-title { font-weight: 600; font-size: .875rem; }
.activity-body .activity-time { font-size: .75rem; color: var(--text-muted); margin-top: 2px; }

/* ═══════════════════════════════════════════════
   ANNOUNCEMENT CARDS
═══════════════════════════════════════════════ */
.announcement-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: var(--transition);
  border-left: 4px solid var(--primary);
}
.announcement-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.announcement-card.warning { border-left-color: var(--warning); }
.announcement-card.success { border-left-color: var(--success); }
.announcement-card.danger { border-left-color: var(--danger); }
.announcement-card.info { border-left-color: var(--info); }
.ann-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.ann-title { font-family: var(--font-display); font-size: 1rem; font-weight: 700; margin-bottom: 8px; color: var(--text-primary); }
.ann-desc { font-size: .875rem; color: var(--text-secondary); line-height: 1.7; }

/* ═══════════════════════════════════════════════
   MODALS
═══════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
  padding: 20px;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-box {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 28px;
  width: 100%;
  max-width: 500px;
  box-shadow: var(--shadow-xl);
  transform: scale(.95) translateY(10px);
  transition: var(--transition-slow);
}
.modal-overlay.open .modal-box { transform: scale(1) translateY(0); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-title { font-size: 1.2rem; font-weight: 800; }
.modal-close { width: 32px; height: 32px; border-radius: var(--radius-sm); background: var(--surface-2); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); font-size: 14px; transition: var(--transition); }
.modal-close:hover { background: var(--danger-light); color: var(--danger); }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

/* TOAST */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 99999;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-xl);
  min-width: 280px;
  animation: toastIn .3s ease;
  pointer-events: all;
}
.toast-item.success .toast-icon { color: var(--success); }
.toast-item.error .toast-icon { color: var(--danger); }
.toast-item.info .toast-icon { color: var(--primary); }
.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast-text { font-size: .875rem; font-weight: 500; flex: 1; color: var(--text-primary); }
.toast-close { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 12px; padding: 0; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(20px); }
}

/* SKELETON LOADER */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ═══════════════════════════════════════════════
   RESULTS ENTRY FORM
═══════════════════════════════════════════════ */
.grade-preview {
  background: var(--primary-light);
  border: 2px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
}
.grade-preview .grade-letter {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}
.grade-preview .grade-percent { font-size: 1.1rem; font-weight: 600; color: var(--text-secondary); }
.grade-preview .grade-label { font-size: .8rem; color: var(--text-muted); margin-top: 6px; }
.marks-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.marks-field label { font-size: .78rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .04em; display: block; margin-bottom: 6px; }
.marks-field .weight { font-size: .7rem; color: var(--text-muted); margin-left: 4px; font-weight: 400; }

/* ═══════════════════════════════════════════════
   REPORT CARD
═══════════════════════════════════════════════ */
.report-card-paper {
  background: white;
  max-width: 920px;
  margin: 0 auto 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.report-card-page + .report-card-page { margin-top: 24px; }
.report-download-bar {
  max-width: 920px;
  margin: 0 auto 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}
.report-download-bar strong {
  display: block;
  font-size: .88rem;
  color: var(--text-primary);
}
.report-download-bar span {
  display: block;
  margin-top: 2px;
  font-size: .74rem;
  color: var(--text-muted);
}
.report-header-band {
  background: linear-gradient(135deg,#123B7A,#1D4ED8 58%,#0891B2);
  padding: 20px 28px;
  color: white;
  display: flex;
  align-items: center;
  gap: 18px;
  border-bottom: 4px solid #F59E0B;
}
.report-school-logo {
  width: 52px; height: 52px;
  background: rgba(255,255,255,.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 23px; border: 2px solid rgba(255,255,255,.4);
  flex-shrink: 0;
}
.report-school-info h2 { font-size: 1.2rem; font-weight: 800; margin: 0; text-transform: uppercase; letter-spacing: .04em; }
.report-school-info p { opacity: .88; font-size: .78rem; margin: 3px 0 0; }
.report-body { padding: 18px 26px 22px; }
.report-student-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 2px solid #E2E8F0;
}
.report-student-info-compact {
  grid-template-columns: 1.5fr .9fr .85fr .85fr .65fr;
  gap: 8px;
  margin-bottom: 10px;
  padding: 8px 10px 9px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
}
.report-student-photo {
  width: 80px; height: 80px;
  border-radius: var(--radius-lg);
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 2rem; font-weight: 700;
  border: 3px solid #E2E8F0;
}
.report-field { margin-bottom: 4px; }
.report-field .lbl { font-size: .6rem; text-transform: uppercase; letter-spacing: .05em; color: #64748B; font-weight: 700; line-height: 1.15; }
.report-field .val { font-weight: 700; font-size: .78rem; color: #0F172A; line-height: 1.25; }
.report-table { width: 100%; border-collapse: collapse; margin-bottom: 10px; border: 1px solid #CBD5E1; }
.report-table th { background: #123B7A; color: white; padding: 6px 8px; font-size: .66rem; text-align: left; font-family: var(--font-display); text-transform: uppercase; letter-spacing: .03em; border-right: 1px solid rgba(255,255,255,.2); }
.report-table td { padding: 5px 8px; border-bottom: 1px solid #E2E8F0; border-right: 1px solid #E2E8F0; font-size: .72rem; line-height: 1.28; }
.report-table tr:nth-child(even) td { background: #F8FAFC; }
.report-summary {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 5px;
  margin: 8px 0;
}
.report-summary-card {
  background: #F8FAFC;
  border-radius: 6px;
  padding: 4px 5px;
  text-align: center;
  border: 1px solid #CBD5E1;
  min-width: 0;
}
.report-summary-card .num { font-family: var(--font-display); font-size: .82rem; font-weight: 800; color: var(--primary); line-height: 1; }
.report-summary-card .lbl { font-size: .5rem; color: #475569; font-weight: 600; margin-top: 0; line-height: 1.12; }
.report-card-paper .report-summary { grid-template-columns: repeat(4,minmax(0,1fr)); }
.report-remarks { background: #FFFBEB; border: 1px solid #FDE68A; border-radius: 8px; padding: 9px; margin-top: 9px; }
.report-remarks .lbl { font-weight: 700; font-size: .68rem; color: #92400E; margin-bottom: 4px; }
.report-remarks p { font-size: .72rem; color: #78350F; line-height: 1.4; margin: 0; }
.report-signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 20px; }
.sig-line { border-top: 1.5px solid #CBD5E1; padding-top: 8px; text-align: center; }
.sig-line .sig-label { font-size: .75rem; color: #64748B; font-weight: 600; }

.report-batch-cover {
  max-width: 920px;
  margin: 0 auto 24px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 24px;
}
.batch-cover-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  color: white;
  background: linear-gradient(135deg,#123B7A,#1D4ED8 58%,#0891B2);
  border-radius: 10px;
  border-bottom: 4px solid #F59E0B;
}
.batch-cover-head h2 {
  margin: 0;
  font-size: 1.15rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.batch-cover-head p { margin: 3px 0; font-size: .84rem; opacity: .9; }
.batch-cover-head span { font-size: .74rem; opacity: .78; }
.batch-kpi-row {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 8px;
  margin: 14px 0;
}
.batch-kpi {
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  background: #F8FAFC;
  padding: 8px;
  text-align: center;
}
.batch-kpi strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: #1D4ED8;
  line-height: 1;
}
.batch-kpi span {
  display: block;
  margin-top: 3px;
  color: #475569;
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.batch-list-title {
  font-family: var(--font-display);
  font-size: .9rem;
  font-weight: 800;
  margin: 8px 0 6px;
  color: #0F172A;
}
.batch-performance-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #CBD5E1;
}
.batch-performance-table th {
  background: #123B7A;
  color: white;
  text-align: left;
  padding: 6px 7px;
  font-size: .63rem;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.batch-performance-table td {
  padding: 5px 7px;
  border-top: 1px solid #E2E8F0;
  border-right: 1px solid #E2E8F0;
  font-size: .68rem;
  line-height: 1.25;
}
.batch-performance-table tr:nth-child(even) td { background: #F8FAFC; }

.report-form-paper {
  max-width: 820px;
  min-height: 1120px;
  background:
    linear-gradient(90deg, #0F766E 0 7px, transparent 7px),
    #FFFFFF;
  border: 1px solid #D7DEE8;
  border-radius: 4px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .11);
  padding: 26px;
  color: #101828;
  font-family: "DM Sans", Arial, Helvetica, sans-serif;
}
.report-form-inner {
  min-height: 1070px;
  border: 1px solid #E4E7EC;
  padding: 22px 26px;
  position: relative;
}
.report-form-inner::before {
  content: '';
  position: absolute;
  inset: 10px;
  border: 1px solid #EEF2F6;
  pointer-events: none;
}
.official-report-header {
  border: 1px solid #D0D5DD;
  border-left: 5px solid #0F766E;
  background: linear-gradient(135deg, #F8FAFC 0%, #FFFFFF 60%, #ECFDF5 100%);
  min-height: 130px;
  display: grid;
  grid-template-columns: 86px 1fr 178px 74px;
  align-items: center;
  gap: 18px;
  padding: 16px 20px;
  position: relative;
  z-index: 1;
}
.official-school-title {
  text-align: left;
  font-size: .74rem;
  line-height: 1.35;
  font-weight: 800;
  color: #0F766E;
  text-transform: uppercase;
  letter-spacing: .13em;
}
.official-school-title strong {
  display: block;
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 1.32rem;
  font-weight: 800;
  color: #101828;
  text-transform: none;
  letter-spacing: 0;
}
.official-school-title small {
  display: block;
  margin-top: 6px;
  color: #667085;
  font-size: .74rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: .02em;
}
.official-school-contact {
  font-size: .76rem;
  line-height: 1.5;
  font-weight: 600;
  color: #475467;
  border-left: 1px solid #E4E7EC;
  padding-left: 14px;
}
.official-logo {
  width: 72px;
  height: 72px;
  border-radius: 6px;
  border: 1px solid #A7F3D0;
  background: #ECFDF5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #0F766E;
}
.official-logo i { font-size: 1.45rem; }
.official-logo span {
  margin-top: 4px;
  font-size: .42rem;
  line-height: 1.05;
  text-align: center;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: .04em;
}
.official-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.official-logo-right {
  width: 70px;
  height: 74px;
  justify-self: end;
  background: #FFFFFF;
  border-color: transparent;
  color: #344054;
  font-size: 1.9rem;
  overflow: hidden;
  border-radius: 0;
}
.official-coat img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.official-student-grid {
  display: grid;
  grid-template-columns: 1.25fr .8fr 1fr;
  column-gap: 18px;
  margin: 18px 0 12px;
  padding: 12px 14px;
  border: 1px solid #E4E7EC;
  background: #FCFCFD;
  font-size: .78rem;
  line-height: 1.35;
  position: relative;
  z-index: 1;
}
.official-student-grid p {
  margin: 0 0 5px;
}
.official-student-grid span {
  display: inline-block;
  min-width: 86px;
  color: #667085;
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.official-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 12px;
  position: relative;
  z-index: 1;
}
.official-summary-strip div {
  border: 1px solid #D0D5DD;
  border-top: 3px solid #0F766E;
  background: #FFFFFF;
  padding: 8px 10px;
}
.official-summary-strip span {
  display: block;
  color: #667085;
  font-size: .58rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
}
.official-summary-strip strong {
  display: block;
  margin-top: 2px;
  color: #101828;
  font-size: .96rem;
  line-height: 1.15;
}
.official-report-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  border: 1px solid #D0D5DD;
  font-size: .72rem;
  line-height: 1.25;
  position: relative;
  z-index: 1;
}
.official-report-table th,
.official-report-table td {
  border: 1px solid #E4E7EC;
  padding: 6px 7px;
  text-align: left;
  vertical-align: middle;
  color: #101828;
  background: #fff;
  font-weight: 600;
}
.official-report-table th {
  background: #F2F4F7;
  color: #344054;
  font-size: .62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.official-report-table th:nth-child(1),
.official-report-table td:nth-child(1) { width: 12.5%; }
.official-report-table th:nth-child(2),
.official-report-table td:nth-child(2),
.official-report-table th:nth-child(3),
.official-report-table td:nth-child(3),
.official-report-table th:nth-child(4),
.official-report-table td:nth-child(4),
.official-report-table th:nth-child(5),
.official-report-table td:nth-child(5),
.official-report-table th:nth-child(6),
.official-report-table td:nth-child(6),
.official-report-table th:nth-child(7),
.official-report-table td:nth-child(7) { width: 12.5%; }
.official-report-table th:nth-child(8),
.official-report-table td:nth-child(8) { width: 13%; }
.missing-result-row td {
  background: #FFF7ED;
  color: #9A3412;
}
.missing-result-text {
  color: #B42318;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .03em;
  white-space: nowrap;
}
.report-na-note {
  margin: 5px 0 0;
  color: #667085;
  font-size: 7.2pt;
  line-height: 1.25;
}
.report-na-note strong {
  color: #B42318;
  font-weight: 900;
}
.official-report-footer {
  margin: 16px 0 0;
  border-top: 2px solid #0F766E;
  padding-top: 10px;
  font-size: .8rem;
  line-height: 1.45;
  position: relative;
  z-index: 1;
}
.official-report-footer p {
  margin: 0 0 5px;
}
.official-report-footer span {
  color: #475467;
  font-weight: 800;
}

/* ═══════════════════════════════════════════════
   STUDENT PROFILE
═══════════════════════════════════════════════ */
.profile-hero {
  background: linear-gradient(135deg, #1D4ED8, #0891B2);
  border-radius: var(--radius-lg);
  padding: 28px;
  color: white;
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
}
.profile-avatar {
  width: 80px; height: 80px;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem; font-weight: 800;
  border: 3px solid rgba(255,255,255,.4);
  flex-shrink: 0;
}
.profile-info h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 4px; }
.profile-info p { opacity: .8; font-size: .875rem; margin: 0; }
.profile-badges { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.profile-badge {
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: var(--radius-full);
  padding: 3px 12px;
  font-size: .75rem;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════
   ANALYTICS
═══════════════════════════════════════════════ */
.analytics-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  text-align: center;
}
.analytics-kpi .kpi-val {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}
.analytics-kpi .kpi-lbl { font-size: .8rem; color: var(--text-secondary); margin-top: 6px; font-weight: 500; }
.analytics-kpi .kpi-trend { font-size: .78rem; font-weight: 700; margin-top: 6px; }
.kpi-trend.up { color: var(--success); }
.kpi-trend.down { color: var(--danger); }

/* ═══════════════════════════════════════════════
   CHARTS WRAPPER
═══════════════════════════════════════════════ */
.chart-wrap { position: relative; }
.chart-wrap canvas { max-width: 100%; }

/* ═══════════════════════════════════════════════
   PAGINATION
═══════════════════════════════════════════════ */
.pagination-custom {
  display: flex; align-items: center; gap: 4px;
}
.page-btn {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: .82rem;
  font-weight: 600;
  transition: var(--transition);
}
.page-btn:hover, .page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* ═══════════════════════════════════════════════
   PORTAL CARDS
═══════════════════════════════════════════════ */
.portal-subject-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  border-top: 3px solid var(--primary);
  transition: var(--transition);
}
.portal-subject-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.portal-subject-card.green { border-top-color: var(--success); }
.portal-subject-card.amber { border-top-color: var(--warning); }
.portal-subject-card.purple { border-top-color: var(--info); }
.portal-subject-card.red { border-top-color: var(--danger); }

/* ═══════════════════════════════════════════════
   SEARCH + FILTER BAR
═══════════════════════════════════════════════ */
.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}
.filter-bar .search-wrap { position: relative; flex: 1; min-width: 200px; }
.filter-bar .search-wrap input { width: 100%; }
.filter-bar .search-wrap .si { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 13px; }
.filter-bar .search-wrap input { padding-left: 34px; }

/* ═══════════════════════════════════════════════
   LOADING SCREEN
═══════════════════════════════════════════════ */
#loading-screen {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity .4s;
}
#loading-screen.hidden { opacity: 0; pointer-events: none; }
.loader-logo { width: 64px; height: 64px; background: var(--primary); border-radius: var(--radius-xl); display: flex; align-items: center; justify-content: center; font-size: 30px; color: white; margin-bottom: 24px; }
.loader-bar { width: 200px; height: 4px; background: var(--border); border-radius: var(--radius-full); overflow: hidden; }
.loader-fill { height: 100%; background: var(--primary); border-radius: var(--radius-full); animation: loaderAnim 1.6s ease-in-out infinite; }
@keyframes loaderAnim { 0%{width:0%} 60%{width:80%} 80%{width:90%} 100%{width:100%} }
.loader-text { font-size: .875rem; color: var(--text-secondary); margin-top: 14px; }

/* ═══════════════════════════════════════════════
   EMPTY STATE
═══════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 16px; opacity: .5; }
.empty-state h4 { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: .875rem; }

/* ═══════════════════════════════════════════════
   CLASSES & SUBJECTS
═══════════════════════════════════════════════ */
.class-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  transition: var(--transition);
  border-top: 3px solid var(--primary);
  cursor: pointer;
}
.class-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.class-card.green { border-top-color: var(--success); }
.class-card.amber { border-top-color: var(--warning); }
.class-card.purple { border-top-color: var(--info); }
.class-card.red { border-top-color: var(--danger); }
.class-card.cyan { border-top-color: #0891B2; }
.class-card .cc-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.class-card .cc-name { font-family: var(--font-display); font-size: 1.05rem; font-weight: 800; }
.class-card .cc-meta { font-size: .78rem; color: var(--text-muted); margin-top: 2px; }
.class-card .cc-subjects { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.subject-chip {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 3px 10px;
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: default;
  transition: var(--transition);
}
.subject-chip:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.subject-chip.selected { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.subject-row {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
  gap: 12px;
}
.subject-row:last-child { border-bottom: none; }
.subject-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.checkbox-custom {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}
.checkbox-custom.checked { background: var(--primary); border-color: var(--primary); color: white; font-size: 11px; }
.checkbox-custom:hover { border-color: var(--primary); }

/* ═══════════════════════════════════════════════
   SEND RESULTS MODAL
═══════════════════════════════════════════════ */
.report-send-modal {
  max-width: min(1120px, calc(100vw - 28px)) !important;
  max-height: calc(100vh - 28px);
  overflow-y: auto;
}
.report-send-modal .modal-header { margin-bottom: 14px; }
.report-send-modal > p { margin-bottom: 14px !important; }
.report-send-modal .row.g-3.mb-4 { margin-bottom: 14px !important; }

.send-method-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}
.send-method-card:hover { border-color: var(--primary); background: var(--primary-light); }
.send-method-card.selected { border-color: var(--primary); background: var(--primary-light); }
.send-method-card .icon { font-size: 1.55rem; margin-bottom: 6px; }
.send-method-card .label { font-weight: 700; font-size: .85rem; }
.send-method-card .desc { font-size: .72rem; color: var(--text-muted); margin-top: 3px; }
.send-method-card.selected {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent);
}
.report-send-selected {
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 26%, var(--border));
  border-radius: 8px;
  background: var(--primary-light);
  color: var(--text-secondary);
  font-size: .86rem;
}
.report-send-selected i,
.report-send-selected strong {
  color: var(--primary);
}
.report-sms-template-panel {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}
.report-sms-template-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, .9fr);
  gap: 14px;
  align-items: stretch;
}
.report-sms-template-grid textarea {
  min-height: 132px;
  resize: vertical;
}
.report-sms-preview {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.report-sms-preview-title {
  padding: 9px 11px;
  border-bottom: 1px solid var(--border);
  font-size: .8rem;
  font-weight: 900;
  color: var(--text-secondary);
}
.report-sms-preview pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0;
  padding: 12px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: .82rem;
  line-height: 1.45;
  max-height: 174px;
  overflow: auto;
}
.report-send-modal .modal-footer {
  position: sticky;
  bottom: 0;
  margin: 14px -28px -28px;
  padding: 14px 28px;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(10px);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.report-batch-scroll {
  max-height: calc(100vh - 210px);
  overflow: auto;
  padding: 0 10px 18px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) var(--surface-2);
}
.report-batch-scroll::-webkit-scrollbar { width: 12px; height: 12px; }
.report-batch-scroll::-webkit-scrollbar-track {
  background: var(--surface-2);
  border-radius: 999px;
}
.report-batch-scroll::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--primary) 74%, var(--text-muted));
  border-radius: 999px;
  border: 3px solid var(--surface-2);
}
.report-batch-scroll-note {
  position: sticky;
  top: 0;
  z-index: 4;
  margin-bottom: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(10px);
  color: var(--text-secondary);
  font-size: .82rem;
  font-weight: 800;
}
.brand-color-control {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}
.brand-color-control .form-control-color {
  width: 54px;
  min-width: 54px;
  height: 44px;
  padding: 4px;
}
.results-lock-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-left: 4px solid var(--success);
}
.results-lock-banner.locked {
  border-left-color: var(--warning);
  background: color-mix(in srgb, var(--warning-light) 42%, var(--surface));
}
.results-lock-banner.open {
  background: color-mix(in srgb, var(--success-light) 42%, var(--surface));
}
.results-lock-title {
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 3px;
}
.results-lock-text {
  color: var(--text-secondary);
  font-size: .84rem;
  line-height: 1.5;
}
.teacher-profile-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.teacher-profile-preview {
  text-align: center;
  position: sticky;
  top: 18px;
}
.teacher-profile-photo {
  width: 148px;
  height: 148px;
  border-radius: 18px;
  margin: 0 auto 16px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary), var(--success));
  color: white;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 900;
  box-shadow: var(--shadow-lg);
}
.teacher-profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.teacher-profile-preview h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 900;
  margin: 0 0 4px;
  color: var(--text-primary);
}
.teacher-profile-role {
  font-size: .82rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 12px;
}
.teacher-profile-preview p {
  color: var(--text-secondary);
  line-height: 1.65;
  font-size: .9rem;
}
.teacher-profile-tags {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
  text-align: left;
}
.teacher-profile-tags span,
.teacher-assignment-grid > div {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  padding: 10px 12px;
  color: var(--text-secondary);
  font-size: .84rem;
}
.teacher-profile-tags i {
  color: var(--primary);
  margin-right: 8px;
}
.teacher-assignment-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.teacher-assignment-grid strong {
  display: block;
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  margin-bottom: 5px;
}
.teacher-assignment-grid span {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════
   CALENDAR
═══════════════════════════════════════════════ */
.cal-wrap { user-select: none; }
.cal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.cal-nav-btn {
  width: 34px; height: 34px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); font-size: 13px;
  transition: var(--transition);
}
.cal-nav-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }
.cal-month-title { font-family: var(--font-display); font-size: 1.1rem; font-weight: 800; }
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; }
.cal-day-label {
  text-align: center; padding: 8px 0;
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted);
}
.cal-day {
  aspect-ratio: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding: 6px 4px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  min-height: 54px;
}
.cal-day:hover { background: var(--surface-2); }
.cal-day.today { background: var(--primary-light); }
.cal-day.today .cal-day-num { color: var(--primary); font-weight: 800; }
.cal-day.selected { background: var(--primary); }
.cal-day.selected .cal-day-num { color: white; }
.cal-day.other-month .cal-day-num { color: var(--text-muted); }
.cal-day.has-event::after {
  content: '';
  position: absolute; bottom: 5px;
  width: 5px; height: 5px;
  border-radius: 50%; background: var(--primary);
}
.cal-day.has-event.event-holiday::after { background: var(--danger); }
.cal-day.has-event.event-term::after { background: var(--success); }
.cal-day.has-event.event-sports::after { background: var(--warning); }
.cal-day-num { font-size: .82rem; font-weight: 600; }
.event-dot-row { display: flex; gap: 2px; margin-top: 2px; flex-wrap: wrap; justify-content: center; }
.event-dot { width: 5px; height: 5px; border-radius: 50%; }
.cal-event-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border-light);
}
.cal-event-item:last-child { border-bottom: none; }
.cal-event-color { width: 4px; border-radius: 2px; align-self: stretch; flex-shrink: 0; min-height: 40px; }
.cal-event-title { font-weight: 700; font-size: .875rem; }
.cal-event-meta { font-size: .75rem; color: var(--text-muted); margin-top: 2px; }
.cal-event-desc { font-size: .8rem; color: var(--text-secondary); margin-top: 4px; }
.event-type-badge {
  display: inline-block; padding: 2px 8px;
  border-radius: var(--radius-full); font-size: .68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
}

.print-only { display: none; }
.results-ranking-page .card:has(.ranking-sheet-table) {
  border-radius: var(--radius);
}
.ranking-sheet-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: auto;
  background: var(--surface);
}
.ranking-sheet-table {
  min-width: 760px;
  border-collapse: collapse;
  table-layout: auto;
}
.ranking-sheet-table th,
.ranking-sheet-table td {
  border-right: 1px solid var(--border-light);
  vertical-align: middle;
}
.ranking-sheet-table th:last-child,
.ranking-sheet-table td:last-child { border-right: 0; }
.ranking-sheet-table th {
  white-space: nowrap;
  background: #EAF2FF;
  color: #0F172A;
  border-bottom: 1px solid #BFDBFE;
  font-size: .7rem;
}
.ranking-sheet-table td {
  color: var(--text-primary);
  font-size: .82rem;
  line-height: 1.25;
}
.ranking-sheet-table tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--surface-2) 58%, transparent);
}
.ranking-sheet-table .student-avatar {
  width: 30px;
  height: 30px;
  font-size: .68rem;
}
.ranking-sheet-table .progress-custom {
  display: none;
}
.ranking-sheet-table .badge-custom {
  white-space: nowrap;
}
.ranking-sheet-table td:nth-child(1),
.ranking-sheet-table td:nth-child(4),
.ranking-sheet-table td:nth-child(6),
.ranking-sheet-table th:nth-child(1),
.ranking-sheet-table th:nth-child(4),
.ranking-sheet-table th:nth-child(6) {
  text-align: center;
}
.ranking-sheet-table td:nth-child(5),
.ranking-sheet-table th:nth-child(5) {
  text-align: right;
}

/* ═══════════════════════════════════════════════
   BLOG / NEWS
═══════════════════════════════════════════════ */
.public-nav {
  position: relative;
  top: 0;
  z-index: 200;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 96%, transparent), color-mix(in srgb, var(--surface) 88%, transparent));
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 16px clamp(20px, 4.5vw, 72px);
  min-height: 140px;
  display: flex;
  align-items: center;
  box-shadow: 0 14px 34px rgba(15,23,42,.06);
  max-width: 100vw;
  overflow: hidden;
}
.public-nav-shell {
  width: 100%;
  max-width: 1540px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(0, auto) minmax(120px, 1fr);
  grid-template-areas:
    "theme brand actions"
    ". menu .";
  align-items: center;
  gap: 16px 34px;
  position: relative;
}
.public-nav-left {
  grid-area: theme;
  justify-self: end;
  position: relative;
  z-index: 2;
}
.public-brand {
  align-items: center;
  color: inherit;
  display: inline-flex;
  flex-direction: column;
  gap: 9px;
  grid-area: brand;
  justify-self: center;
  min-width: 0;
  text-decoration: none;
  text-align: center;
  position: relative;
  z-index: 1;
}
.public-brand:hover { color: inherit; }
.public-brand-logo {
  width: 70px;
  height: 70px;
  object-fit: contain;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 4px;
  flex-shrink: 0;
  box-shadow: 0 12px 26px rgba(15,23,42,.10);
}
.public-brand-mark {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, var(--primary), #0891B2);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: 0 10px 24px rgba(37,99,235,.18);
}
.public-brand-name {
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.08;
  max-width: 720px;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}
.public-nav-center {
  grid-area: menu;
  justify-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--surface-2) 82%, var(--surface));
  min-width: min(100%, 940px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 10px 24px rgba(15,23,42,.05);
}
.public-nav-divider {
  align-self: stretch;
  background: var(--border);
  display: inline-block;
  margin: 5px 8px;
  width: 1px;
}
.pub-nav-link {
  align-items: center;
  color: var(--text-secondary);
  display: inline-flex;
  gap: 8px;
  text-decoration: none;
  font-size: .9rem;
  font-weight: 800;
  padding: 12px 22px;
  border-radius: var(--radius-full);
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
  line-height: 1;
}
.pub-nav-count {
  align-items: center;
  background: var(--danger);
  border-radius: var(--radius-full);
  color: #FFFFFF;
  display: inline-flex;
  font-size: .65rem;
  font-weight: 900;
  justify-content: center;
  line-height: 1;
  min-width: 18px;
  padding: 3px 6px;
}
.pub-nav-link.active .pub-nav-count {
  background: rgba(255,255,255,.22);
  color: #FFFFFF;
}
.pub-nav-link:hover {
  color: var(--primary);
  background: var(--surface);
}
.pub-nav-link.active {
  color: white;
  background: var(--primary);
  box-shadow: 0 10px 22px rgba(37,99,235,.22);
}
.public-nav-actions {
  grid-area: actions;
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 2;
}
.public-theme-btn {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text-secondary);
  display: inline-flex;
  height: 42px;
  justify-content: center;
  width: 42px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.public-menu-theme-btn {
  border-radius: var(--radius-full);
  height: 34px;
  width: 34px;
}
.public-menu-btn,
.public-search-mobile-btn {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-secondary);
  display: none;
  height: 40px;
  justify-content: center;
  width: 40px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.public-menu-btn:hover,
.public-search-mobile-btn:hover {
  background: var(--surface-2);
  color: var(--primary);
}
.public-theme-btn:hover {
  background: var(--surface-2);
  color: var(--primary);
}
.public-login-btn {
  align-items: center;
  background: linear-gradient(135deg, var(--primary), #1D4ED8);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px;
  box-shadow: 0 12px 24px rgba(37,99,235,.22);
  color: white;
  display: inline-flex;
  font-size: .84rem;
  font-weight: 900;
  gap: 9px;
  min-height: 42px;
  padding: 10px 15px;
  text-decoration: none;
}
.public-menu-login-btn {
  border-radius: var(--radius-full);
  box-shadow: 0 10px 20px rgba(37,99,235,.18);
  min-height: 34px;
  padding: 8px 13px;
}
.public-login-btn:hover {
  color: white;
  filter: brightness(1.04);
}

@media (min-width: 993px) {
  .public-nav {
    background: linear-gradient(180deg, #0F172A, #111827);
    border-bottom-color: rgba(255,255,255,.10);
    box-shadow: 0 18px 42px rgba(15,23,42,.22);
  }
  .public-brand-logo {
    border-color: rgba(255,255,255,.18);
    background: rgba(255,255,255,.94);
  }
  .public-brand-name {
    color: #F8FAFC;
  }
  .public-nav-center {
    border-color: rgba(255,255,255,.14);
    background: rgba(255,255,255,.08);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.10), 0 14px 34px rgba(0,0,0,.18);
  }
  .public-nav-divider {
    background: rgba(255,255,255,.18);
  }
  .public-nav-center .pub-nav-link {
    color: rgba(255,255,255,.84);
  }
  .public-nav-center .pub-nav-link:hover {
    color: #FFFFFF;
    background: rgba(255,255,255,.12);
  }
  .public-nav-center .pub-nav-link.active {
    color: #FFFFFF;
    background: linear-gradient(135deg, var(--primary), #0891B2);
    box-shadow: 0 12px 26px rgba(37,99,235,.32);
  }
  .public-menu-theme-btn {
    background: rgba(255,255,255,.08);
    border-color: rgba(255,255,255,.16);
    color: rgba(255,255,255,.88);
  }
  .public-menu-theme-btn:hover {
    background: rgba(255,255,255,.14);
    color: #FFFFFF;
  }
}
.public-mobile-search {
  position: relative;
  top: auto;
  z-index: 190;
  display: none;
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  max-width: 100vw;
}
.public-mobile-search.open { display: block; }
.public-mobile-search form {
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 8px;
  padding: 8px 10px 8px 12px;
}
.public-mobile-search i { color: var(--text-muted); }
.public-mobile-search input {
  background: transparent;
  border: 0;
  color: var(--text-primary);
  min-width: 0;
  outline: 0;
}
.public-mobile-search button {
  background: var(--primary);
  border: 0;
  border-radius: var(--radius-full);
  color: white;
  font-size: .75rem;
  font-weight: 900;
  padding: 7px 11px;
}
.public-mobile-menu {
  position: relative;
  top: auto;
  z-index: 189;
  display: none;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 16px 34px rgba(15,23,42,.08);
  padding: 12px 14px 14px;
}
.public-mobile-menu.open { display: block; }
.public-mobile-menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.public-mobile-menu .pub-nav-link {
  background: var(--surface-2);
  border: 1px solid var(--border);
  justify-content: center;
  padding: 11px 12px;
}
.public-mobile-menu .pub-nav-link.active {
  background: var(--primary);
  border-color: var(--primary);
}
.public-mobile-menu-actions {
  border-top: 1px solid var(--border-light);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
}
.public-mobile-menu-actions .public-theme-btn,
.public-mobile-menu-actions .public-login-btn {
  border-radius: var(--radius);
  display: inline-flex;
  gap: 8px;
  height: 42px;
  min-height: 42px;
  padding: 0 12px;
  width: 100%;
}
.public-mobile-menu-actions .public-theme-btn {
  justify-content: center;
  font-size: .8rem;
  font-weight: 900;
}
.public-mobile-menu-actions .public-login-btn {
  justify-content: center;
}
.public-container {
  max-width: 1420px;
  margin: 0 auto;
  padding: 32px clamp(22px, 3.4vw, 42px);
}
.public-content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
  gap: 28px;
}
.public-main-content {
  min-width: 0;
  max-width: 100%;
}
.public-side-panel {
  position: sticky;
  top: 84px;
  display: grid;
  gap: 14px;
}
.public-side-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 12px 30px rgba(15,23,42,.06);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.public-side-card:hover {
  border-color: color-mix(in srgb, var(--primary) 22%, var(--border));
  box-shadow: 0 18px 38px rgba(15,23,42,.09);
  transform: translateY(-1px);
}
.public-side-card.accent {
  border-left: 4px solid var(--primary);
  background: linear-gradient(135deg, rgba(29,78,216,.08), rgba(15,118,110,.06)), var(--surface);
}
.public-side-label {
  font-size: .68rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--primary);
  margin-bottom: 8px;
}
.public-side-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
}
.public-side-title i {
  align-items: center;
  background: var(--primary-light);
  border-radius: 8px;
  color: var(--primary);
  display: inline-flex;
  height: 26px;
  justify-content: center;
  width: 26px;
}
.public-side-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: .88rem;
  line-height: 1.65;
}
.public-staff-list {
  display: grid;
  gap: 10px;
}
.public-staff-grid.compact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.public-staff-slider {
  display: grid;
  grid-auto-columns: minmax(124px, 1fr);
  grid-auto-flow: column;
  gap: 10px;
  margin: 2px -4px 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 2px 4px 8px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}
.public-staff-slider::-webkit-scrollbar { height: 6px; }
.public-staff-slider::-webkit-scrollbar-track { background: transparent; }
.public-staff-slider::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}
.public-staff-slide-card {
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  min-width: 0;
  overflow: hidden;
  scroll-snap-align: start;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.public-staff-slide-card:hover {
  background: var(--surface);
  border-color: color-mix(in srgb, var(--primary) 28%, var(--border));
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.public-staff-slide-photo {
  aspect-ratio: 4 / 3;
  background:
    linear-gradient(135deg, rgba(37,99,235,.10), rgba(8,145,178,.08)),
    var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.public-staff-slide-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.public-staff-slide-photo span {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), #0891B2);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(37,99,235,.18);
}
.public-staff-slide-body {
  padding: 10px;
  text-align: center;
}
.public-staff-item {
  display: flex;
  align-items: center;
  gap: 10px;
}
.public-staff-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 900;
  flex-shrink: 0;
}
.public-staff-name {
  color: var(--text-primary);
  font-weight: 800;
  font-size: .84rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.public-staff-role {
  color: var(--text-muted);
  font-size: .72rem;
  font-weight: 700;
  margin-top: 3px;
}
.public-side-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  color: var(--primary);
  font-size: .8rem;
  font-weight: 900;
  text-decoration: none;
}
.public-recent-list {
  display: grid;
  gap: 10px;
}
.public-recent-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
  background: var(--surface-2);
  transition: border-color .2s ease, transform .2s ease;
}
.public-recent-item:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}
.public-recent-thumb {
  width: 58px;
  height: 46px;
  border-radius: 6px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.82);
  overflow: hidden;
}
.public-recent-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.public-recent-copy strong {
  color: var(--text-primary);
  font-size: .82rem;
  line-height: 1.32;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.public-recent-copy small {
  color: var(--text-muted);
  font-size: .7rem;
}
.public-newsletter-card {
  background:
    radial-gradient(circle at top right, rgba(37,99,235,.16), transparent 34%),
    linear-gradient(135deg, rgba(29,78,216,.08), rgba(15,118,110,.06)),
    var(--surface);
}
.public-section-head {
  align-items: end;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 2px 0 14px;
}
.public-section-kicker {
  color: var(--primary);
  display: block;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .08em;
  line-height: 1;
  margin-bottom: 7px;
  text-transform: uppercase;
}
.public-section-head h2 {
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1.1;
  margin: 0;
}
.public-section-link {
  align-items: center;
  color: var(--primary);
  display: inline-flex;
  gap: 8px;
  font-size: .82rem;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}
.public-section-link span {
  align-items: center;
  background: var(--primary);
  border-radius: var(--radius-full);
  color: white;
  display: inline-flex;
  font-size: .68rem;
  justify-content: center;
  min-width: 20px;
  padding: 3px 7px;
}
.public-staff-directory {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.public-staff-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.public-staff-photo {
  height: 160px;
  background: linear-gradient(135deg, rgba(29,78,216,.08), rgba(15,118,110,.08)), var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.public-staff-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.public-staff-photo span {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 900;
}
.public-staff-card-body {
  padding: 15px;
}
.public-staff-card-body h3 {
  font-size: 1rem;
  font-weight: 900;
  margin: 0 0 3px;
  color: var(--text-primary);
}
.public-staff-card-role {
  color: var(--primary);
  font-size: .74rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 10px;
}
.public-staff-card-body p {
  margin: 0 0 7px;
  color: var(--text-secondary);
  font-size: .82rem;
  line-height: 1.5;
}
.public-hero-slider {
  position: relative;
  min-height: clamp(420px, 46vw, 540px);
  margin-bottom: 28px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--secondary);
  box-shadow: 0 20px 45px rgba(15,23,42,.14);
  max-width: 100%;
}
.public-hero-slide {
  position: absolute;
  inset: 0;
  display: block;
  opacity: 0;
  pointer-events: none;
  transition: opacity .7s ease;
}
.public-hero-slide.active {
  opacity: 1;
  pointer-events: auto;
}
.public-hero-media {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 86px;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0F172A, #1E293B);
  overflow: hidden;
}
.public-hero-slide.has-image .public-hero-media::before {
  content: '';
  position: absolute;
  inset: -24px;
  background-image: var(--slide-image);
  background-size: cover;
  background-position: center;
  filter: blur(18px);
  opacity: .42;
  transform: scale(1.06);
}
.public-hero-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(15,23,42,.04), rgba(15,23,42,.10) 58%, rgba(15,23,42,.22)),
    linear-gradient(90deg, rgba(15,23,42,.16), transparent 36%, rgba(15,23,42,.22));
  pointer-events: none;
}
.public-hero-slide img {
  position: relative;
  z-index: 1;
  width: auto;
  height: auto;
  max-width: calc(100% - 48px);
  max-height: calc(100% - 38px);
  object-fit: contain;
  display: block;
  padding: 0;
  filter: drop-shadow(0 18px 40px rgba(0,0,0,.34));
}
.public-hero-text-media {
  background:
    linear-gradient(135deg, rgba(29,78,216,.82), rgba(15,118,110,.72)),
    var(--secondary);
}
.public-hero-monogram {
  width: 92px;
  height: 92px;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 2rem;
}
.public-hero-slide.fallback {
  background: var(--surface);
}
.public-hero-shade {
  display: none;
}
.public-hero-content {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 86px;
  max-width: none;
  color: white;
  padding: 14px clamp(18px, 3vw, 30px) 15px;
  border-top: 1px solid rgba(255,255,255,.16);
  border-radius: 0;
  background:
    linear-gradient(135deg, rgba(15,23,42,.97), rgba(30,41,59,.93));
  backdrop-filter: blur(10px);
  box-shadow: 0 -10px 30px rgba(0,0,0,.16);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.public-hero-content::before {
  content: '';
  position: absolute;
  left: clamp(18px, 3vw, 30px);
  top: 0;
  width: 64px;
  height: 3px;
  border-radius: 999px;
  background: var(--primary);
}
.public-hero-kicker {
  font-size: .66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  opacity: .78;
  margin-bottom: 7px;
  color: var(--primary);
}
.public-hero-content h1 {
  font-family: var(--font-display);
  font-size: clamp(1.02rem, 1.55vw, 1.28rem);
  line-height: 1.2;
  font-weight: 900;
  margin: 0;
  letter-spacing: 0;
  max-width: 680px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.public-hero-content p {
  font-size: .9rem;
  line-height: 1.6;
  color: rgba(255,255,255,.82);
  max-width: 600px;
  margin: 6px 0 0;
}
.public-hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: white;
  background: var(--primary);
  border: 1px solid rgba(255,255,255,.24);
  border-radius: var(--radius-full);
  padding: 8px 13px;
  font-size: .78rem;
  font-weight: 800;
  text-decoration: none;
  width: fit-content;
  margin-top: 10px;
}
.public-hero-btn:hover { color: white; filter: brightness(1.05); }
.public-hero-dots {
  position: absolute;
  z-index: 4;
  right: clamp(18px, 3vw, 34px);
  top: clamp(18px, 3vw, 30px);
  display: flex;
  gap: 7px;
}
.public-hero-dots button {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.46);
}
.public-hero-dots button.active {
  width: 24px;
  border-radius: 999px;
  background: white;
}
.homepage-slide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}
.homepage-slide-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.homepage-slide-card .slide-preview-img {
  height: 142px;
  background-color: var(--surface-2);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  border-bottom: 1px solid var(--border);
}
.homepage-slide-card .slide-preview-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1.8rem;
  background:
    linear-gradient(135deg, rgba(15,118,110,.08), rgba(29,78,216,.08)),
    var(--surface-2);
}
.homepage-slide-card .slide-preview-body {
  padding: 12px;
}
.homepage-slide-card .slide-preview-title {
  font-weight: 800;
  font-size: .9rem;
  color: var(--text-primary);
  line-height: 1.25;
  margin-bottom: 5px;
}
.homepage-slide-card .slide-preview-subtitle {
  font-size: .76rem;
  color: var(--text-secondary);
  line-height: 1.45;
  min-height: 32px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.homepage-slide-card .slide-preview-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
  font-size: .7rem;
  color: var(--text-muted);
}
.blog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  min-width: 0;
  box-shadow: var(--shadow-sm);
}
.blog-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.public-blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.public-blog-grid.single {
  grid-template-columns: minmax(300px, 420px);
}
.public-blog-grid.single .blog-card {
  max-width: 420px;
}
.public-material-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.public-material-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-width: 0;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.public-material-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.public-material-top {
  min-height: 104px;
  padding: 18px;
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.public-material-icon {
  width: 54px;
  height: 54px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  background: var(--primary-light);
  color: var(--primary);
  flex-shrink: 0;
}
.public-material-icon.pdf { background: #FEF2F2; color: #DC2626; }
.public-material-icon.doc,
.public-material-icon.docx { background: #EFF6FF; color: #2563EB; }
.public-material-icon.ppt,
.public-material-icon.pptx { background: #FFF7ED; color: #F97316; }
.public-material-icon.xls,
.public-material-icon.xlsx { background: #ECFDF5; color: #059669; }
.public-material-icon.mp4 { background: #F5F3FF; color: #7C3AED; }
.public-material-icon.zip,
.public-material-icon.rar { background: #F8FAFC; color: #475569; }
.public-material-badge {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  padding: 4px 9px;
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .06em;
}
.public-material-body {
  padding: 16px 18px 12px;
  flex: 1;
  min-width: 0;
}
.public-material-body h3 {
  font-family: var(--font-display);
  font-size: 1.02rem;
  line-height: 1.28;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 8px;
}
.public-material-body p {
  color: var(--text-secondary);
  font-size: .84rem;
  line-height: 1.55;
  margin: 0 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.public-material-meta {
  display: grid;
  gap: 7px;
  color: var(--text-muted);
  font-size: .78rem;
}
.public-material-meta span {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.public-material-meta i { color: var(--primary); width: 14px; text-align: center; }
.public-material-footer {
  border-top: 1px solid var(--border-light);
  padding: 12px 18px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: .75rem;
  color: var(--text-muted);
}
.public-material-download {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: var(--radius-full);
  padding: 7px 12px;
  background: var(--primary);
  color: white;
  font-weight: 800;
  font-size: .75rem;
  text-decoration: none;
  transition: var(--transition);
}
.public-material-download:hover { color: white; filter: brightness(1.05); }
.public-material-download.muted {
  background: var(--surface-2);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.public-material-download.disabled {
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.public-footer {
  background:
    radial-gradient(circle at top left, rgba(37,99,235,.18), transparent 32%),
    linear-gradient(135deg, #0F172A, #111827 58%, #0E7490);
  color: rgba(255,255,255,.74);
  margin-top: 54px;
  padding: 34px 24px;
}
.public-footer-inner {
  align-items: center;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1240px;
}
.public-footer-brand {
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 7px;
}
.public-footer p {
  color: rgba(255,255,255,.72);
  font-size: .86rem;
  line-height: 1.55;
  margin: 0 0 8px;
  max-width: 620px;
}
.public-footer-copy {
  color: rgba(255,255,255,.58);
  font-size: .8rem;
}
.public-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: flex-end;
}
.public-footer-links a {
  align-items: center;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-full);
  color: rgba(255,255,255,.84);
  display: inline-flex;
  font-size: .8rem;
  font-weight: 800;
  padding: 8px 12px;
  text-decoration: none;
}
.public-footer-links a:hover {
  background: rgba(255,255,255,.14);
  color: #FFFFFF;
}
.blog-img {
  height: auto;
  aspect-ratio: 16 / 10;
  background-color: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; color: rgba(255,255,255,.5);
  position: relative; overflow: hidden;
}
.blog-img.has-cover::before {
  content: "";
  position: absolute;
  inset: -10px;
  background-image: var(--blog-cover);
  background-size: cover;
  background-position: center;
  filter: blur(9px);
  opacity: .24;
  transform: scale(1.04);
}
.blog-img.has-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15,23,42,.10), rgba(15,23,42,.18));
}
.blog-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  position: relative;
  z-index: 1;
}
.blog-img .blog-cat-overlay {
  position: absolute; top: 12px; left: 12px;
  z-index: 2;
  background: rgba(0,0,0,.45); backdrop-filter: blur(6px);
  color: white; font-size: .7rem; font-weight: 700;
  padding: 3px 10px; border-radius: var(--radius-full);
  text-transform: uppercase; letter-spacing: .05em;
}
.blog-featured-overlay {
  position: absolute;
  z-index: 2;
  right: 12px;
  top: 12px;
  background: rgba(245,158,11,.95);
  color: #111827;
  font-size: .68rem;
  font-weight: 900;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.blog-body { padding: 16px; }
.blog-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.blog-meta .dot { width: 3px; height: 3px; background: var(--text-muted); border-radius: 50%; }
.blog-title { font-family: var(--font-display); font-size: 1.02rem; font-weight: 800; margin-bottom: 8px; color: var(--text-primary); line-height: 1.3; overflow-wrap: anywhere; }
.blog-title:hover { color: var(--primary); }
.blog-excerpt { font-size: .82rem; color: var(--text-secondary); line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.blog-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-light); }
.blog-author { display: flex; align-items: center; gap: 8px; }
.blog-author-av { width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: white; font-size: .65rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.blog-author-name { font-size: .75rem; font-weight: 600; color: var(--text-secondary); }
.blog-read-time { font-size: .72rem; color: var(--text-muted); }

/* Single post */
.post-hero-clean {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.post-hero-clean.has-cover::before {
  content: "";
  position: absolute;
  inset: -12px -10px auto;
  height: min(560px, 62vw);
  min-height: 260px;
  background-image: var(--post-cover);
  background-size: cover;
  background-position: center;
  filter: blur(10px);
  opacity: .22;
  transform: scale(1.04);
}
.post-hero-clean.has-cover::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: min(540px, 60vw);
  min-height: 240px;
  background: linear-gradient(180deg, rgba(15,23,42,.08), rgba(15,23,42,.18));
  pointer-events: none;
}
.post-hero-clean > img,
.post-hero-placeholder {
  width: 100%;
  max-height: 520px;
  min-height: 240px;
  object-fit: contain;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  color: rgba(255,255,255,.72);
  font-size: 3.2rem;
  position: relative;
  z-index: 1;
}
.post-title-panel {
  padding: 22px 24px 24px;
  position: relative;
  z-index: 1;
  background: var(--surface);
}
.post-title-panel .post-hero-cat {
  background: var(--primary-light);
  color: var(--primary);
  border-color: rgba(29,78,216,.16);
}
.post-title-panel h1 {
  color: var(--text-primary);
  font-size: 1.9rem;
  line-height: 1.18;
  margin: 10px 0 12px;
}
.post-title-panel .post-hero-meta {
  color: var(--text-secondary);
  opacity: 1;
}
.post-hero {
  background: linear-gradient(135deg, #1D4ED8, #0891B2);
  border-radius: var(--radius-lg);
  padding: 40px;
  color: white;
  margin-bottom: 28px;
  position: relative; overflow: hidden;
}
.post-hero::before {
  content: ''; position: absolute;
  width: 300px; height: 300px;
  background: rgba(255,255,255,.05);
  border-radius: 50%; right: -60px; top: -80px;
}
.post-hero-cat {
  background: rgba(255,255,255,.2);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.3);
  color: white; font-size: .72rem; font-weight: 700;
  padding: 3px 12px; border-radius: var(--radius-full);
  text-transform: uppercase; letter-spacing: .06em;
  display: inline-block; margin-bottom: 14px;
}
.post-hero h1 { font-size: 1.8rem; font-weight: 800; line-height: 1.25; margin-bottom: 14px; }
.post-hero-meta { display: flex; align-items: center; gap: 16px; opacity: .85; font-size: .82rem; flex-wrap: wrap; }
.post-reading-card {
  padding: clamp(22px, 4vw, 38px);
}
.post-content {
  max-width: 760px;
  margin: 0 auto;
  font-size: 1.08rem;
  line-height: 1.86;
  color: var(--text-secondary);
  word-break: break-word;
}
.post-content > *:first-child { margin-top: 0; }
.post-content > *:last-child { margin-bottom: 0; }
.post-content p {
  margin: 0 0 1.2rem;
}
.post-content p + p {
  margin-top: .2rem;
}
.post-content h2,
.post-content h3,
.post-content h4 {
  font-family: var(--font-display);
  color: var(--text-primary);
  line-height: 1.25;
  letter-spacing: 0;
}
.post-content h2 {
  font-size: 1.42rem;
  margin: 2rem 0 .8rem;
}
.post-content h3 {
  margin: 1.7rem 0 .7rem;
  font-size: 1.24rem;
}
.post-content h4 {
  margin: 1.4rem 0 .55rem;
  font-size: 1.08rem;
}
.post-content ul,
.post-content ol {
  margin: .4rem 0 1.25rem;
  padding-left: 1.35rem;
}
.post-content li {
  margin-bottom: .45rem;
  padding-left: .15rem;
}
.post-content strong,
.post-content b {
  color: var(--text-primary);
  font-weight: 800;
}
.post-content a { color: var(--primary); font-weight: 700; text-decoration: none; }
.post-content a:hover { text-decoration: underline; }
.post-content img,
.post-content video,
.post-content iframe {
  width: 100%;
  max-width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: block;
  margin: 0 auto;
  background: var(--surface-2);
}
.post-content iframe { aspect-ratio: 16 / 9; min-height: 260px; }
.post-content figure {
  margin: 1.6rem auto;
  max-width: 920px;
}
.post-content figcaption {
  display: none;
}
.post-content blockquote {
  border-left: 4px solid var(--primary);
  padding: 16px 20px;
  background: var(--primary-light);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--text-primary);
  margin: 1.5rem 0;
}
.post-content blockquote p {
  margin-bottom: 0;
}
.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--surface-2);
}
.editor-toolbar + textarea {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

/* Blog admin list */
.blog-admin-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid var(--border-light);
}
.blog-admin-row:last-child { border-bottom: none; }
.blog-admin-thumb {
  width: 56px; height: 44px;
  border-radius: var(--radius);
  background: linear-gradient(135deg,#1D4ED8,#0891B2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; color: rgba(255,255,255,.6); flex-shrink: 0;
}

/* ═══════════════════════════════════════════════
   STUDY MATERIALS
═══════════════════════════════════════════════ */
.material-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex; align-items: center; gap: 14px;
  transition: var(--transition);
}
.material-card:hover { box-shadow: var(--shadow-md); }
.material-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.material-icon.pdf { background: #FEF2F2; color: #EF4444; }
.material-icon.doc { background: #EFF6FF; color: #2563EB; }
.material-icon.ppt { background: #FFF7ED; color: #F97316; }
.material-icon.img { background: #ECFDF5; color: #10B981; }
.material-icon.zip { background: #F5F3FF; color: #8B5CF6; }
.material-body { flex: 1; min-width: 0; }
.material-name { font-weight: 700; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.material-meta { font-size: .75rem; color: var(--text-muted); margin-top: 3px; }
.material-actions { display: flex; gap: 6px; flex-shrink: 0; }
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-muted);
}
.upload-area:hover { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.upload-area .up-icon { font-size: 2.5rem; margin-bottom: 12px; }
.upload-area h5 { font-size: 1rem; font-weight: 700; margin-bottom: 4px; color: var(--text-primary); }
.upload-area p { font-size: .82rem; }
.file-type-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.ftype-tab {
  padding: 5px 14px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: .78rem; font-weight: 600;
  cursor: pointer; transition: var(--transition);
  color: var(--text-secondary);
}
.ftype-tab:hover, .ftype-tab.active { background: var(--primary); color: white; border-color: var(--primary); }
.sparkline-wrap { display:flex; align-items:flex-end; gap:2px; height:24px; margin-top:8px; }
.spark-bar { flex:1; border-radius:2px 2px 0 0; opacity:.65; transition:opacity .15s; min-width:3px; }
.spark-bar:hover { opacity:1; }

/* ═══════════════════════════════════════════════
   UPLOAD ZONE
═══════════════════════════════════════════════ */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}
.upload-zone:hover { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.upload-zone .icon { font-size: 2rem; margin-bottom: 10px; }

/* ═══════════════════════════════════════════════
   TOOLTIP
═══════════════════════════════════════════════ */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%);
  background: var(--secondary); color: white;
  font-size: .72rem; font-weight: 600;
  padding: 4px 8px; border-radius: var(--radius-sm);
  white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity .15s; z-index: 9999;
}
[data-tip]:hover::after { opacity: 1; }

/* ═══════════════════════════════════════════════
   NOTIFICATION DROPDOWN
═══════════════════════════════════════════════ */
.notif-wrap { position: relative; }
.notif-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0;
  width: 300px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl); z-index: 9998;
  display: none; animation: fadeInUp .2s ease;
}
.notif-dropdown.open { display: block; }
.notif-hd { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.notif-hd strong { font-size: .9rem; }
.notif-hd a { font-size: .75rem; color: var(--primary); font-weight: 600; }
.notif-item { display: flex; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--border-light); cursor: pointer; transition: var(--transition); }
.notif-item:hover { background: var(--surface-2); }
.notif-item:last-child { border-bottom: none; }
.ndot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-top: 5px; flex-shrink: 0; }
.ndot.r { background: var(--border); }
.ntext { font-size: .82rem; font-weight: 500; color: var(--text-primary); }
.ntime { font-size: .72rem; color: var(--text-muted); margin-top: 2px; }

/* ═══════════════════════════════════════════════
   WELCOME BANNER
═══════════════════════════════════════════════ */
.welcome-banner {
  background: linear-gradient(135deg, #1D4ED8 0%, #2563EB 55%, #0891B2 100%);
  border-radius: var(--radius-lg); padding: 20px 24px;
  color: white; display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 24px;
  position: relative; overflow: hidden;
}
.welcome-banner::before {
  content: ''; position: absolute;
  width: 200px; height: 200px; background: rgba(255,255,255,.06);
  border-radius: 50%; right: -40px; top: -60px;
}
.wb-text h3 { font-size: 1.1rem; font-weight: 800; margin: 0 0 3px; }
.wb-text p { margin: 0; opacity: .8; font-size: .82rem; }

/* ═══════════════════════════════════════════════
   MOBILE OVERLAY
═══════════════════════════════════════════════ */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 99;
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════ */
@media (max-width: 992px) {
  :root { --sidebar-width: var(--sidebar-collapsed); }
  .sidebar { transform: translateX(-100%); width: 260px; }
  .sidebar.mobile-open { transform: translateX(0); }
  .sidebar-overlay { display: block; opacity: 0; pointer-events: none; transition: opacity .3s; }
  .sidebar-overlay.open { opacity: 1; pointer-events: all; }
  .topbar { left: 0 !important; }
  .main-content { margin-left: 0 !important; }
  .marks-row { grid-template-columns: 1fr; }
  .login-left { display: none; }
  .login-right { width: 100%; }
  .report-student-info { grid-template-columns: 1fr; }
  .report-summary { grid-template-columns: 1fr 1fr; }
  .welcome-banner { flex-direction: column; align-items: flex-start; gap: 14px; }
  .welcome-banner .wb-action { width: 100%; }
  .welcome-banner .wb-action button { width: 100%; }
  .profile-hero { flex-direction: column; }
  .post-hero h1 { font-size: 1.3rem; }
  .public-nav { min-height: 112px; }
  .public-nav-shell { gap: 9px 14px; }
  .public-brand-name { max-width: min(58vw, 420px); }
  .public-container { padding: 22px 16px; }
  .public-content-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 16px;
  }
  .public-side-card { padding: 14px; }
  .public-staff-grid.compact { grid-template-columns: 1fr; }
  .public-blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .public-blog-grid.single { grid-template-columns: minmax(0, 420px); }
  .public-material-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-menu-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .public-nav {
    background:
      linear-gradient(180deg, color-mix(in srgb, var(--surface) 96%, transparent), color-mix(in srgb, var(--surface) 88%, transparent));
    border-bottom: 1px solid var(--border);
    box-shadow: 0 14px 34px rgba(15,23,42,.06);
    min-height: 94px;
    padding: 9px 14px;
  }
  .public-nav-shell {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }
  .public-nav-left,
  .public-nav-actions {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
  }
  .public-nav-left { left: 0; }
  .public-nav-actions { right: 0; display: none !important; }
  .public-brand-name {
    color: var(--text-primary);
    max-width: 58vw;
    font-size: .88rem;
    line-height: 1.12;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    word-break: normal;
    overflow-wrap: anywhere;
  }
  .public-brand-logo,
  .public-brand-mark { width: 44px; height: 44px; }
  .public-theme-btn {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text-secondary);
  }
  .public-theme-btn:hover {
    background: var(--surface-2);
    color: var(--primary);
  }
  .public-theme-btn,
  .public-login-btn,
  .public-menu-btn,
  .public-search-mobile-btn {
    border-radius: 12px;
    height: 38px;
    min-height: 38px;
    width: 38px;
    padding: 0;
    justify-content: center;
  }
  .public-nav-left,
  .public-nav-actions { width: 42px; }
  .public-menu-btn,
  .public-search-mobile-btn { display: inline-flex; }
  .public-search-mobile-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
  }
  .public-login-text { display: none; }
  .public-mobile-search,
  .public-mobile-menu { top: auto; }
  .public-container { padding: 18px 14px; }
  .public-content-layout { grid-template-columns: 1fr; }
  .public-side-panel { position: static; }
  .public-staff-grid.compact { grid-template-columns: 1fr; }
  .public-staff-slider {
    grid-auto-columns: initial;
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-left: 0;
    margin-right: 0;
    overflow-x: visible;
    padding-left: 0;
    padding-right: 0;
    scroll-snap-type: none;
  }
  .public-blog-grid { grid-template-columns: 1fr; }
  .public-blog-grid.single { grid-template-columns: 1fr; }
  .public-blog-grid.single .blog-card { max-width: none; }
  .public-material-grid { grid-template-columns: 1fr; }
  .public-section-head { align-items: flex-start; flex-direction: column; gap: 8px; }
  .public-section-head h2 { font-size: 1.18rem; }
  .public-footer { margin-top: 36px; padding: 28px 18px; }
  .public-footer-inner {
    align-items: center;
    flex-direction: column;
    text-align: center;
  }
  .public-footer p { margin-left: auto; margin-right: auto; }
  .public-footer-links {
    justify-content: center;
    width: 100%;
  }
  .public-material-top { min-height: 92px; padding: 16px; }
  .public-material-body,
  .public-material-footer { padding-left: 16px; padding-right: 16px; }
  .public-hero-slider { min-height: 390px; border-radius: var(--radius); margin-bottom: 22px; }
  .public-hero-media { bottom: 92px; }
  .public-hero-slide img {
    max-width: calc(100% - 28px);
    max-height: calc(100% - 24px);
  }
  .public-hero-content {
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 92px;
    padding: 13px 16px;
  }
  .public-hero-content::before { left: 16px; }
  .public-hero-content h1 { font-size: 1rem; -webkit-line-clamp: 2; }
  .public-hero-content p { font-size: .86rem; line-height: 1.45; }
  .public-hero-dots { right: 18px; top: 14px; }
  .post-hero-clean > img,
  .post-hero-placeholder { height: 210px; }
  .post-title-panel { padding: 18px; }
  .post-title-panel h1 { font-size: 1.35rem; }
  .post-reading-card { padding: 20px 18px; }
  .post-content { font-size: 1rem; line-height: 1.78; }
  .post-content h2 { font-size: 1.24rem; }
  .post-content h3 { font-size: 1.12rem; }
  .post-content iframe { min-height: 210px; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .page-actions { width: 100%; flex-wrap: wrap; }
  .page-actions .btn, .page-actions .form-select { font-size: .78rem; padding: 6px 10px; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar .search-wrap { min-width: unset; }
  .filter-bar .form-select { width: 100% !important; }
  .modal-box { padding: 20px; margin: 0; max-width: 100% !important; border-radius: var(--radius-lg); }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-box { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .report-send-modal {
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
  }
  .report-batch-scroll {
    max-height: calc(100vh - 150px);
    padding-right: 4px;
  }
  .report-batch-scroll-note {
    font-size: .76rem;
    padding: 9px 10px;
  }
  .report-sms-template-grid { grid-template-columns: 1fr; }
  .report-sms-template-grid textarea { min-height: 110px; }
  .report-sms-preview pre { max-height: 145px; }
  .report-send-modal .modal-footer {
    bottom: -20px;
    margin: 12px -20px -20px;
    padding: 12px 20px;
    border-radius: 0;
  }
  .send-method-card .icon { font-size: 1.5rem; }
  .send-method-card .desc { display: none; }
  .ranking-filter-bar { flex-direction: column; }
  .ranking-filter-bar .form-select { width: 100% !important; }
  .report-table { font-size: .75rem; }
  .report-table th, .report-table td { padding: 6px 8px; }
  .report-header-band { flex-direction: column; gap: 12px; padding: 20px; }
  .report-body { padding: 16px; }
  .blog-admin-row { flex-wrap: wrap; gap: 8px; }
  .material-card { flex-wrap: wrap; }
  .class-card .cc-subjects { display: none; }
  .cal-day { min-height: 38px; padding: 4px 2px; }
  .cal-day-num { font-size: .72rem; }
  .notif-dropdown { width: 280px; right: -60px; }
}
@media (max-width: 576px) {
  .main-content { padding: 12px; }
  .page-header {
    gap: 10px;
    margin-bottom: 14px;
  }
  .page-title { font-size: 1.35rem; line-height: 1.2; }
  .page-subtitle { font-size: .82rem; }
  .card {
    padding: 16px;
    border-radius: 12px;
  }
  .card-header-custom,
  .page-actions,
  .filter-bar,
  .table-toolbar,
  .dashboard-actions {
    flex-direction: column;
    align-items: stretch !important;
    gap: 10px;
  }
  .page-actions .btn,
  .filter-bar .btn,
  .filter-bar .form-select,
  .filter-bar .form-control,
  .dashboard-actions .btn {
    width: 100% !important;
  }
  .row.g-3 > [class*="col-6"],
  .row.g-2 > [class*="col-2"],
  .row.g-2 > [class*="col-3"],
  .row.g-2 > [class*="col-4"],
  .row.g-2 > [class*="col-5"],
  .row.g-2 > [class*="col-6"] {
    flex: 0 0 100%;
    max-width: 100%;
  }
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table-custom {
    min-width: 680px;
  }
  .modal-overlay {
    overflow-y: auto;
    align-items: flex-end;
  }
  .modal-box {
    max-height: 92vh;
    overflow-y: auto;
  }
  .modal-footer {
    position: sticky;
    bottom: 0;
    background: var(--surface);
    padding-top: 12px;
    flex-wrap: wrap;
  }
  .modal-footer .btn {
    flex: 1 1 130px;
  }
  .brand-color-control {
    grid-template-columns: 64px minmax(0, 1fr);
  }
  .brand-color-control .form-control-color {
    width: 64px;
    min-width: 64px;
  }
  .results-lock-banner {
    flex-direction: column;
    align-items: flex-start;
  }
  .teacher-profile-layout,
  .teacher-assignment-grid {
    grid-template-columns: 1fr;
  }
  .teacher-profile-preview {
    position: static;
  }
  .teacher-profile-photo {
    width: 118px;
    height: 118px;
    border-radius: 14px;
  }
  .stat-card { padding: 14px; }
  .dashboard-menu-group { padding: 14px; }
  .dashboard-menu-item {
    grid-template-columns: 34px minmax(0, 1fr) 12px;
    min-height: 54px;
  }
  .dashboard-menu-icon { width: 34px; height: 34px; font-size: .84rem; }
  .dashboard-menu-badge { display: none; }
  .stat-value { font-size: 1.4rem; }
  .topbar-search { display: none; }
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar-profile .name { display: none; }
  .report-summary { grid-template-columns: 1fr; }
  .report-signatures { grid-template-columns: 1fr; gap: 16px; }
  .report-summary-card .num { font-size: 1.3rem; }
  .profile-hero { padding: 18px; }
  .profile-hero .profile-info h2 { font-size: 1.2rem; }
  .profile-badges { flex-wrap: wrap; gap: 5px; }
  .post-hero { padding: 20px; }
  .post-hero h1 { font-size: 1.1rem; }
  .blog-img {
    width: 100%;
    height: clamp(240px, 74vw, 360px);
    min-height: 240px;
    aspect-ratio: auto;
    padding: 8px;
    background: var(--surface-2);
  }
  .blog-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
  .analytics-kpi .kpi-val { font-size: 1.6rem; }
  .welcome-banner { padding: 16px; }
  .welcome-banner .wb-text h3 { font-size: .95rem; }
  .file-type-tabs { gap: 4px; }
  .ftype-tab { padding: 4px 10px; font-size: .72rem; }
  .cal-day { min-height: 32px; }
  .cal-day-num { font-size: .65rem; }
  .event-dot { width: 4px; height: 4px; }
  .table-custom th { font-size: .65rem; padding: 8px 8px; }
  .table-custom td { padding: 9px 8px; font-size: .82rem; }
  .action-btn { width: 26px; height: 26px; font-size: 11px; }
  .badge-custom { font-size: .65rem; padding: 2px 7px; }
  .card { padding: 14px; }
  .card-title-custom { font-size: .9rem; }
  .page-title { font-size: 1.3rem; }
  .notif-dropdown { width: calc(100vw - 24px); right: -100px; }
  .notif-wrap { position: static; }
  .topbar-actions { position: relative; }
  .notif-dropdown { right: 0; }
  /* report card horizontal scroll on mobile */
  .report-card-paper { overflow-x: auto; }
  .report-table-wrap { min-width: 600px; }
  /* hide less important table columns on mobile */
  .hide-mobile { display: none !important; }
}

/* Toast mobile fix */
@media (max-width: 576px) {
  .toast-container {
    bottom: 12px;
    right: 12px;
    left: 12px;
    align-items: stretch;
  }
  .toast-item {
    min-width: unset;
    width: 100%;
  }
}

/* ═══════════════════════════════════════════════
   DARK MODE CHART DEFAULTS
═══════════════════════════════════════════════ */
[data-theme="dark"] .report-card-paper { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .report-header-band { /* stays blue */ }
[data-theme="dark"] .report-table th { background: #1D4ED8; }
[data-theme="dark"] .report-table td { color: #E2E8F0; border-bottom-color: var(--border); }
[data-theme="dark"] .report-table tr:nth-child(even) td { background: var(--surface-2); }
[data-theme="dark"] .report-field .lbl { color: var(--text-muted); }
[data-theme="dark"] .report-field .val { color: var(--text-primary); }
[data-theme="dark"] .report-student-info { border-bottom-color: var(--border); }
[data-theme="dark"] .report-remarks { background: #2A1E0A; border-color: #92400E; }
[data-theme="dark"] .report-remarks .lbl { color: var(--warning); }
[data-theme="dark"] .report-remarks p { color: #FDE68A; }
[data-theme="dark"] .report-summary-card { background: var(--primary-light); border-color: var(--border); }
[data-theme="dark"] .sig-line { border-top-color: var(--border); }
[data-theme="dark"] .sig-line .sig-label { color: var(--text-muted); }
[data-theme="dark"] .ranking-sheet-table th { background: #1E3050; color: #F8FAFC; border-color: #29456F; }
[data-theme="dark"] .ranking-sheet-table td { color: var(--text-primary); border-color: var(--border); }
[data-theme="dark"] .ranking-sheet-table tbody tr:nth-child(even) td { background: var(--surface-2); }
.report-card-paper .report-summary { grid-template-columns: repeat(4,minmax(0,1fr)) !important; }

@media print {
  @page { size: A4 portrait; margin: 8mm; }
  body { background: white !important; color: #111827 !important; }
  .print-only { display: block !important; }
  .no-print,
  .sidebar,
  .topbar,
  .sidebar-overlay,
  .loader,
  .toast-container,
  .page-header,
  .file-type-tabs,
  .ranking-filter-bar,
  .chart-wrap,
  script {
    display: none !important;
  }
  .main-content,
  .results-ranking-page {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: none !important;
    background: white !important;
  }
  .results-ranking-page .row,
  .results-ranking-page [class*="col-"] {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
  }
  .results-ranking-page .card {
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    background: white !important;
  }
  .results-print-title {
    text-align: center;
    margin: 0 0 4mm !important;
    padding-bottom: 2.5mm;
    border-bottom: .35mm solid #111827;
  }
  .results-print-title h1 {
    font-size: 14pt !important;
    line-height: 1.15 !important;
    margin: 0 !important;
    color: #111827 !important;
    text-transform: uppercase;
  }
  .results-print-title p {
    margin: 1mm 0 0 !important;
    font-size: 9pt !important;
    color: #374151 !important;
  }
  .results-ranking-page .card-header-custom {
    display: block !important;
    margin: 0 0 2mm !important;
  }
  .results-ranking-page .card-title-custom {
    font-size: 10pt !important;
    color: #111827 !important;
    margin: 0 !important;
  }
  .results-ranking-page .card-subtitle-custom {
    font-size: 8pt !important;
    color: #4B5563 !important;
  }
  .analytics-kpi {
    display: none !important;
  }
  .ranking-sheet-wrap {
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
  }
  .ranking-sheet-table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    font-family: Arial, sans-serif !important;
  }
  .ranking-sheet-table th,
  .ranking-sheet-table td {
    border: .25mm solid #9CA3AF !important;
    padding: 1.35mm 1.2mm !important;
    color: #111827 !important;
    background: white !important;
    font-size: 7.6pt !important;
    line-height: 1.15 !important;
    vertical-align: middle !important;
  }
  .ranking-sheet-table th {
    background: #E5E7EB !important;
    color: #111827 !important;
    font-size: 7.2pt !important;
    font-weight: 700 !important;
    text-transform: uppercase;
  }
  .ranking-sheet-table tbody tr:nth-child(even) td {
    background: #F9FAFB !important;
  }
  .ranking-sheet-table .badge-custom {
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    color: #111827 !important;
    font-size: 7.4pt !important;
    font-weight: 700 !important;
  }
  .ranking-sheet-table .student-avatar,
  .ranking-sheet-table .progress-custom,
  .ranking-sheet-table .action-btn {
    display: none !important;
  }
  .ranking-sheet-table th:nth-child(1),
  .ranking-sheet-table td:nth-child(1) { width: 8%; text-align: center !important; }
  .ranking-sheet-table th:nth-child(2),
  .ranking-sheet-table td:nth-child(2) { width: 31%; }
  .ranking-sheet-table th:nth-child(3),
  .ranking-sheet-table td:nth-child(3) { width: 12%; text-align: center !important; }
  .ranking-sheet-table th:nth-child(4),
  .ranking-sheet-table td:nth-child(4) { width: 13%; text-align: right !important; }
  .ranking-sheet-table th:nth-child(5),
  .ranking-sheet-table td:nth-child(5) { width: 18%; }
  .ranking-sheet-table th:nth-child(6),
  .ranking-sheet-table td:nth-child(6) { width: 10%; text-align: center !important; }
  .ranking-sheet-table th:nth-child(7),
  .ranking-sheet-table td:nth-child(7) { width: 0; display: none !important; }
  .ranking-sheet-table th:last-child,
  .ranking-sheet-table td:last-child { display: none !important; }
  .report-card-paper {
    max-width: 100% !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
  }
  .report-form-paper {
    width: 194mm !important;
    min-height: 281mm !important;
    max-width: none !important;
    margin: 0 auto !important;
    padding: 7mm !important;
    border: .35mm solid #D0D5DD !important;
    background: linear-gradient(90deg, #0F766E 0 2mm, transparent 2mm), #FFFFFF !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }
  .report-form-inner {
    min-height: 265mm !important;
    border: .3mm solid #E4E7EC !important;
    padding: 5mm 6mm !important;
  }
  .report-form-inner::before {
    inset: 3mm !important;
    border-color: #EEF2F6 !important;
  }
  .official-report-header {
    border: .3mm solid #D0D5DD !important;
    border-left: 1.4mm solid #0F766E !important;
    background: #F8FAFC !important;
    min-height: 32mm !important;
    padding: 3mm 5mm !important;
    grid-template-columns: 22mm 1fr 42mm 18mm !important;
  }
  .official-logo {
    width: 18mm !important;
    height: 18mm !important;
    border-radius: 1.5mm !important;
    border-color: #A7F3D0 !important;
    background: #ECFDF5 !important;
  }
  .official-logo-right {
    width: 18mm !important;
    height: 20mm !important;
    background: #FFFFFF !important;
    border-color: transparent !important;
    border-radius: 0 !important;
  }
  .official-school-title { font-size: 8pt !important; }
  .official-school-title strong { font-size: 15pt !important; }
  .official-school-title small { font-size: 8pt !important; }
  .official-school-contact { font-size: 8pt !important; }
  .official-student-grid {
    font-size: 9pt !important;
    margin: 5mm 0 3mm !important;
    padding: 3mm !important;
    column-gap: 5mm !important;
  }
  .official-student-grid span { font-size: 7pt !important; }
  .official-summary-strip {
    gap: 2mm !important;
    margin-bottom: 3mm !important;
  }
  .official-summary-strip div {
    padding: 2mm !important;
    border-top: .8mm solid #0F766E !important;
  }
  .official-summary-strip span { font-size: 6.5pt !important; }
  .official-summary-strip strong { font-size: 10pt !important; }
  .official-report-table {
    font-size: 8pt !important;
    border-color: #D0D5DD !important;
  }
  .official-report-table th,
  .official-report-table td {
    padding: 1.45mm 1.2mm !important;
    border: .25mm solid #E4E7EC !important;
  }
  .official-report-table th {
    background: #F2F4F7 !important;
    color: #344054 !important;
    font-size: 7pt !important;
  }
  .official-report-footer {
    font-size: 9pt !important;
    margin-top: 5mm !important;
    border-top: .6mm solid #0F766E !important;
  }
  .report-batch-cover {
    max-width: 100% !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
  .batch-cover-head {
    padding: 14px 18px !important;
    border-radius: 0 !important;
  }
  .batch-kpi-row {
    gap: 6px !important;
    margin: 10px 0 !important;
  }
  .batch-kpi {
    padding: 6px !important;
    border-radius: 5px !important;
  }
  .batch-kpi strong { font-size: .9rem !important; }
  .batch-kpi span { font-size: .52rem !important; }
  .batch-performance-table th {
    padding: 5px 6px !important;
    font-size: .58rem !important;
  }
  .batch-performance-table td {
    padding: 4px 6px !important;
    font-size: .62rem !important;
  }
  .report-card-page {
    break-after: page;
    page-break-after: always;
  }
  .report-card-page:last-child {
    break-after: auto;
    page-break-after: auto;
  }
  .report-header-band {
    padding: 14px 18px !important;
    gap: 12px !important;
  }
  .report-school-logo {
    width: 46px !important;
    height: 46px !important;
    font-size: 20px !important;
  }
  .report-school-info h2 { font-size: 1.05rem !important; }
  .report-school-info p { font-size: .72rem !important; margin-top: 2px !important; }
  .report-body { padding: 14px 18px !important; }
  .report-student-info,
  .report-student-info-compact {
    grid-template-columns: 1.6fr 1fr 1fr .9fr .7fr !important;
    gap: 8px !important;
    margin-bottom: 10px !important;
    padding-bottom: 8px !important;
  }
  .report-field { margin-bottom: 3px !important; }
  .report-field .lbl { font-size: .56rem !important; letter-spacing: .04em !important; }
  .report-field .val { font-size: .72rem !important; }
  .report-table {
    margin-bottom: 10px !important;
    page-break-inside: avoid;
  }
  .report-table th {
    padding: 5px 7px !important;
    font-size: .62rem !important;
  }
  .report-table td {
    padding: 5px 7px !important;
    font-size: .66rem !important;
  }
  .report-summary {
    grid-template-columns: repeat(4,minmax(0,1fr)) !important;
    gap: 5px !important;
    margin: 8px 0 6px !important;
  }
  .report-summary-card {
    padding: 4px 5px !important;
    border-radius: 6px !important;
  }
  .report-summary-card .num { font-size: .82rem !important; }
  .report-summary-card .lbl { font-size: .5rem !important; }
  .report-remarks {
    padding: 8px !important;
    margin-top: 8px !important;
  }
  .report-remarks .lbl { font-size: .62rem !important; margin-bottom: 3px !important; }
  .report-remarks p { font-size: .66rem !important; line-height: 1.35 !important; }
  .report-signatures {
    gap: 16px !important;
    margin-top: 18px !important;
    page-break-inside: avoid;
  }
  .sig-line { padding-top: 5px !important; }
  .sig-line .sig-label { font-size: .62rem !important; }
}

/* Classes management */
.classes-page .classes-overview-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}
.classes-page .classes-overview-card {
  position: relative;
  overflow: hidden;
  min-height: 104px;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.classes-page .classes-overview-card::after {
  content: "";
  position: absolute;
  inset: auto -28px -34px auto;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  opacity: .14;
  background: currentColor;
}
.classes-page .classes-overview-card span {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  margin-bottom: 10px;
  background: color-mix(in srgb, currentColor 12%, transparent);
}
.classes-page .classes-overview-card strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.45rem;
  line-height: 1;
  color: var(--text-primary);
}
.classes-page .classes-overview-card small {
  display: block;
  margin-top: 6px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: .68rem;
}
.classes-page .classes-overview-card.primary { color: var(--primary); }
.classes-page .classes-overview-card.success { color: var(--success); }
.classes-page .classes-overview-card.info { color: var(--info); }
.classes-page .classes-overview-card.warning { color: var(--warning); }
.classes-page .classes-overview-card.danger { color: var(--danger); }

.classes-page .class-empty-state {
  color: var(--text-muted);
  text-align: center;
  padding: 54px 20px;
  border: 1px dashed color-mix(in srgb, var(--primary) 35%, var(--border));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 7%, transparent), transparent 42%),
    var(--surface);
}
.classes-page .subject-panel-mount:not(:empty) {
  margin-bottom: 20px;
}
.classes-page .subject-panel-visible {
  animation: classSubjectPanelIn .22s ease both;
}
@keyframes classSubjectPanelIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.classes-page .classes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.classes-page .classes-grid > [class*="col-"] {
  width: auto;
  max-width: none;
  padding: 0;
}
.classes-page .classes-grid > [class*="col-"] > .card {
  position: relative;
  overflow: hidden;
  min-height: 285px;
  display: flex;
  flex-direction: column;
  padding: 18px;
  border: 1px solid var(--border) !important;
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--primary) 7%, transparent), transparent 34%),
    var(--surface);
  box-shadow: 0 12px 34px rgba(15, 23, 42, .07);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.classes-page .classes-grid > [class*="col-"] > .class-tone-card {
  --class-accent: var(--primary);
  --class-accent-2: var(--success);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--class-accent) 9%, transparent), transparent 35%),
    var(--surface);
}
.classes-page .classes-grid > [class*="col-"] > .class-tone-card.tone-0 { --class-accent: #2563EB; --class-accent-2: #0891B2; }
.classes-page .classes-grid > [class*="col-"] > .class-tone-card.tone-1 { --class-accent: #059669; --class-accent-2: #14B8A6; }
.classes-page .classes-grid > [class*="col-"] > .class-tone-card.tone-2 { --class-accent: #7C3AED; --class-accent-2: #DB2777; }
.classes-page .classes-grid > [class*="col-"] > .class-tone-card.tone-3 { --class-accent: #D97706; --class-accent-2: #EA580C; }
.classes-page .classes-grid > [class*="col-"] > .class-tone-card.tone-4 { --class-accent: #0F766E; --class-accent-2: #65A30D; }
.classes-page .classes-grid > [class*="col-"] > .class-tone-card.tone-5 { --class-accent: #475569; --class-accent-2: #2563EB; }
.classes-page .classes-grid > [class*="col-"] > .card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--class-accent, var(--primary)), var(--class-accent-2, var(--success)));
}
.classes-page .classes-grid > [class*="col-"] > .card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 44px rgba(15, 23, 42, .12);
  border-color: color-mix(in srgb, var(--primary) 36%, var(--border)) !important;
}
.classes-page .classes-grid > [class*="col-"] > .card[style*="var(--primary)"] {
  border-color: var(--primary) !important;
  box-shadow: 0 18px 44px color-mix(in srgb, var(--primary) 18%, transparent);
}
.classes-page .classes-grid .card > .d-flex:first-child {
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  min-width: 0;
}
.classes-page .classes-grid .card > .d-flex:first-child > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
}
.classes-page .classes-grid .card > .d-flex:first-child > div:first-child::before {
  content: "";
  width: 44px;
  height: 44px;
  float: left;
  margin-right: 12px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--class-accent, var(--primary)) 24%, transparent), color-mix(in srgb, var(--class-accent-2, var(--success)) 18%, transparent));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--class-accent, var(--primary)) 20%, transparent);
}
.classes-page .classes-grid .card > .d-flex:first-child > div:first-child > div:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  line-height: 1.25;
}
.classes-page .classes-grid .card > .d-flex:first-child > div:first-child > div:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.classes-page .classes-grid .card > .d-flex:first-child > div:last-child {
  flex: 0 0 auto;
  max-width: 44%;
}
.classes-page .classes-grid .card > .d-flex:nth-of-type(2) {
  align-items: center;
  flex-wrap: wrap;
  gap: 10px !important;
  margin-bottom: 14px !important;
}
.classes-page .classes-grid .card > .d-flex:nth-of-type(2) span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 9px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.classes-page .classes-grid .card > .d-flex:nth-of-type(3) {
  gap: 10px !important;
  margin-top: auto;
}
.classes-page .classes-grid .card > .d-flex:nth-of-type(3) > div {
  border: 1px solid var(--border);
  border-radius: 8px !important;
  padding: 11px 8px !important;
  background: var(--surface-2) !important;
}
.classes-page .classes-grid .card > .d-flex:nth-of-type(3) > div:nth-child(1) { box-shadow: inset 0 3px 0 var(--class-accent, var(--primary)); }
.classes-page .classes-grid .card > .d-flex:nth-of-type(3) > div:nth-child(2) { box-shadow: inset 0 3px 0 var(--class-accent-2, var(--success)); }
.classes-page .classes-grid .card > .d-flex:nth-of-type(3) > div:nth-child(3) { box-shadow: inset 0 3px 0 color-mix(in srgb, var(--class-accent, var(--info)) 65%, var(--class-accent-2, var(--success))); }
.classes-page .classes-grid .card > .d-flex:last-child {
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid var(--border);
  align-items: center;
}
.classes-page .classes-grid .card .btn-light {
  border-color: var(--border);
  background: var(--surface);
}
.classes-page .classes-grid .card button[style*="var(--danger)"],
.classes-page .classes-grid .card .class-delete-btn {
  color: var(--danger) !important;
}

.classes-page .class-subject-panel {
  border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border));
  box-shadow: 0 18px 46px rgba(15, 23, 42, .09);
}
.classes-page .class-subject-panel .card-header-custom {
  padding: 0 0 16px;
  border-bottom: 1px solid var(--border);
}
.classes-page .class-subject-panel .row.g-2 {
  --bs-gutter-x: 12px;
  --bs-gutter-y: 12px;
}
.classes-page .class-subject-panel .row.g-2 .card {
  border-radius: 8px !important;
  box-shadow: none;
}
.classes-page .class-subject-panel label {
  min-height: 42px;
}
.classes-page .class-subject-panel .form-select-sm {
  min-height: 36px;
}

@media (max-width: 1200px) {
  .classes-page .classes-overview-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .classes-page .classes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .classes-page .classes-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .classes-page .classes-grid { grid-template-columns: 1fr; }
  .classes-page .classes-grid > [class*="col-"] > .card { min-height: 0; }
  .classes-page .classes-grid .card > .d-flex:first-child { align-items: flex-start !important; }
  .classes-page .classes-grid .card > .d-flex:last-child {
    flex-wrap: wrap;
  }
  .classes-page .classes-grid .card > .d-flex:last-child > a {
    flex: 1 1 100% !important;
  }
}
@media (max-width: 520px) {
  .classes-page .classes-overview-grid { grid-template-columns: 1fr; }
  .classes-page .classes-grid .card > .d-flex:nth-of-type(3) {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

[data-theme="dark"] .classes-page .classes-grid > [class*="col-"] > .card {
  box-shadow: 0 14px 34px rgba(0, 0, 0, .28);
}
[data-theme="dark"] .classes-page .classes-overview-card,
[data-theme="dark"] .classes-page .classes-grid .card > .d-flex:nth-of-type(2) span,
[data-theme="dark"] .classes-page .classes-grid .card > .d-flex:nth-of-type(3) > div {
  border-color: rgba(148, 163, 184, .18);
}

/* ═══════════════════════════════════════════════
   UTILITY — Standalone avatar (for lists/tables)
═══════════════════════════════════════════════ */
.avatar {
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700;
  flex-shrink: 0;
  user-select: none;
  font-family: var(--font-display);
}

.student-timetable-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.student-timetable-day {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 7%, transparent), transparent 46%),
    var(--surface-2);
  padding: 10px;
}

.student-timetable-day-title {
  font-family: var(--font-display);
  font-size: .86rem;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.student-timetable-lesson {
  display: grid;
  gap: 2px;
  margin-bottom: 7px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.student-timetable-lesson:last-child {
  margin-bottom: 0;
}

.student-timetable-lesson strong {
  font-size: .78rem;
  color: var(--primary);
}

.student-timetable-lesson span {
  font-size: .86rem;
  font-weight: 800;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.student-timetable-lesson small,
.student-timetable-empty {
  font-size: .74rem;
  color: var(--text-muted);
}

.student-timetable-empty {
  padding: 8px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px dashed var(--border);
}

.departments-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.department-card {
  --dept-accent: var(--primary);
  --dept-accent-2: var(--success);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 240px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--dept-accent) 10%, transparent), transparent 38%),
    var(--surface);
  box-shadow: 0 14px 34px rgba(15, 23, 42, .07);
}

.department-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--dept-accent), var(--dept-accent-2));
}

.department-card.tone-0 { --dept-accent: #2563EB; --dept-accent-2: #0891B2; }
.department-card.tone-1 { --dept-accent: #059669; --dept-accent-2: #14B8A6; }
.department-card.tone-2 { --dept-accent: #7C3AED; --dept-accent-2: #DB2777; }
.department-card.tone-3 { --dept-accent: #D97706; --dept-accent-2: #EA580C; }
.department-card.tone-4 { --dept-accent: #0F766E; --dept-accent-2: #65A30D; }
.department-card.tone-5 { --dept-accent: #475569; --dept-accent-2: #2563EB; }

.department-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.department-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 900;
  color: var(--text-primary);
}

.department-hod,
.department-desc,
.department-teachers {
  font-size: .8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.department-desc {
  margin: 12px 0 0;
  color: var(--text-secondary);
}

.department-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 10px;
}

.department-metrics span {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px;
  background: var(--surface-2);
  font-size: .78rem;
  color: var(--text-secondary);
}

.department-metrics strong {
  color: var(--dept-accent);
  font-size: 1rem;
}

.department-teachers {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px dashed var(--border);
}

.department-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.department-teacher-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}

.department-teacher-picker.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-height: 190px;
}

.department-teacher-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}

.department-teacher-option input {
  margin-top: 3px;
}

.department-teacher-option span {
  display: grid;
  min-width: 0;
}

.department-teacher-option strong {
  font-size: .82rem;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.department-teacher-option small {
  font-size: .72rem;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

@media (max-width: 1100px) {
  .departments-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .department-teacher-picker.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .departments-grid,
  .department-teacher-picker,
  .department-teacher-picker.compact {
    grid-template-columns: 1fr;
  }
  .department-card { min-height: 0; }
  .department-actions { flex-direction: column; }
  .department-actions .btn,
  .department-actions form,
  .department-actions form button { width: 100%; }
}

.student-portal-page .page-header {
  gap: 16px;
}

.student-portal-page .page-actions .btn {
  min-height: 38px;
}

.student-portal-page .student-welcome {
  min-height: auto;
  align-items: center;
  overflow: hidden;
}

.student-portal-page .student-welcome > div {
  min-width: 0;
}

.student-portal-page .student-kpi-row {
  --bs-gutter-x: 10px;
  --bs-gutter-y: 10px;
}

.student-portal-page .analytics-kpi {
  min-height: 100%;
}

.student-attendance-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.student-portal-page .material-card {
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.student-portal-page .table-responsive {
  border: 1px solid var(--border);
  border-radius: 8px;
}

@media (max-width: 768px) {
  .student-timetable-grid {
    grid-template-columns: 1fr;
  }

  .student-portal-page {
    padding-left: 10px;
    padding-right: 10px;
  }

  .student-portal-page .page-header {
    margin-bottom: 14px;
  }

  .student-portal-page .page-title {
    font-size: 1.32rem;
    line-height: 1.2;
  }

  .student-portal-page .page-subtitle {
    font-size: .82rem;
    overflow-wrap: anywhere;
  }

  .student-portal-page .page-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .student-portal-page .page-actions .btn {
    justify-content: center;
    width: 100%;
    padding: 9px 10px;
    white-space: normal;
  }

  .student-portal-page .card {
    padding: 14px;
    border-radius: 8px;
  }

  .student-portal-page .card-header-custom {
    align-items: flex-start;
    gap: 10px;
  }

  .student-portal-page .card-header-custom .btn,
  .student-portal-page .card-header-custom .badge-custom {
    flex: 0 0 auto;
  }

  .student-portal-page .student-welcome {
    padding: 16px;
    margin-bottom: 14px !important;
  }

  .student-portal-page .student-welcome div[style*="font-size:1.15rem"] {
    font-size: 1rem !important;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .student-portal-page .student-welcome div[style*="font-size:.86rem"] {
    font-size: .78rem !important;
    line-height: 1.4;
  }

  .student-portal-page form.row.g-3 {
    --bs-gutter-y: 10px;
  }

  .student-portal-page .form-label {
    font-size: .78rem;
  }

  .student-portal-page .form-select,
  .student-portal-page .form-control {
    min-height: 42px;
    font-size: .88rem;
  }

  .student-portal-page .btn.w-100 {
    min-height: 42px;
  }

  .student-portal-page .analytics-kpi {
    padding: 13px 10px;
    border-radius: 8px;
  }

  .student-portal-page .analytics-kpi .kpi-val {
    font-size: 1.28rem;
    line-height: 1.1;
  }

  .student-portal-page .analytics-kpi .kpi-lbl {
    font-size: .72rem;
    line-height: 1.2;
  }

  .student-timetable-day {
    padding: 9px;
  }

  .student-timetable-day-title {
    font-size: .9rem;
  }

  .student-timetable-lesson {
    padding: 10px;
  }

  .student-timetable-lesson strong {
    font-size: .8rem;
  }

  .student-timetable-lesson span {
    font-size: .9rem;
  }

  .student-timetable-lesson small,
  .student-timetable-empty {
    font-size: .78rem;
  }

  .student-portal-page .table-custom {
    min-width: 540px;
  }

  .student-portal-page .table-custom th,
  .student-portal-page .table-custom td {
    padding: 10px 8px;
    font-size: .78rem;
    white-space: nowrap;
  }

  .student-attendance-mini-grid {
    gap: 7px;
  }

  .student-attendance-mini-grid .analytics-kpi {
    padding: 10px 6px !important;
  }

  .student-attendance-mini-grid .analytics-kpi .kpi-val {
    font-size: 1.05rem !important;
  }
}

@media (max-width: 420px) {
  .student-portal-page .page-actions {
    grid-template-columns: 1fr;
  }

  .student-portal-page .card-header-custom {
    flex-direction: column;
  }

  .student-portal-page .card-header-custom .btn,
  .student-portal-page .card-header-custom .badge-custom {
    width: 100%;
    justify-content: center;
  }

  .student-portal-page .student-kpi-row > [class*="col-"] {
    width: 50%;
  }

  .student-portal-page .analytics-kpi .kpi-val {
    font-size: 1.16rem;
  }

  .student-attendance-mini-grid {
    grid-template-columns: 1fr;
  }

  .student-portal-page .material-card {
    align-items: flex-start;
  }
}
