/* ============================================================
   SBS SCHOOL MANAGER — Premium Design System
   Navy & Gold Academic UI
   ============================================================ */

/* ── Fonts ──────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&family=Libre+Baskerville:wght@400;700&display=swap');

/* ═══════════════════════════════════════════════════════════
   1. DESIGN TOKENS
   ═══════════════════════════════════════════════════════════ */

:root {
  /* ── Palette ──────────────────────────────────────── */
  --navy:          #082b55;
  --navy-deep:     #051f3e;
  --navy-light:    #1a3f6b;
  --gold:          #f2aa00;
  --gold-light:    #ffc34d;
  --gold-dark:     #c98200;
  --teal:          #0f5c86;
  --teal-light:    #1a7ab0;
  --success:       #15805f;
  --success-light: #1a9e75;
  --warning:       #d98f00;
  --danger:        #c2413b;
  --danger-light:  #d94a43;
  --info:          #0f5c86;

  /* ── Gradients ────────────────────────────────────── */
  --gradient-gold:    linear-gradient(135deg, var(--gold), var(--gold-dark));
  --gradient-navy:    linear-gradient(135deg, var(--navy), var(--navy-deep));
  --gradient-teal:    linear-gradient(135deg, var(--teal), var(--teal-light));
  --gradient-success: linear-gradient(135deg, var(--success), var(--success-light));
  --gradient-danger:  linear-gradient(135deg, var(--danger), var(--danger-light));
  --gradient-warm:    linear-gradient(135deg, #e8a000, #c97900);

  /* ── Surfaces ─────────────────────────────────────── */
  --bg-primary:    #f5f8fb;
  --bg-secondary:  #edf2f7;
  --bg-card:       #ffffff;
  --bg-card-hover: #fbfcfe;
  --bg-input:      #fbfcfe;
  --bg-sidebar:    var(--navy);
  --bg-glass:      rgba(8, 43, 85, 0.04);
  --bg-gold-glass: rgba(242, 170, 0, 0.08);
  --bg-green-glass:rgba(21, 128, 95, 0.08);
  --bg-red-glass:  rgba(194, 65, 59, 0.08);
  --bg-blue-glass: rgba(15, 92, 134, 0.08);

  /* ── Borders ──────────────────────────────────────── */
  --border:        #d8e2ed;
  --border-light:  #e7edf4;
  --border-focus:  var(--gold);

  /* ── Text ─────────────────────────────────────────── */
  --text-primary:    #102f4e;
  --text-secondary:  #48627a;
  --text-muted:      #71869a;
  --text-inverse:    #ffffff;
  --text-on-gold:    #1a1a1a;

  /* ── Typography Scale ─────────────────────────────── */
  --font-sans:  'DM Sans', system-ui, -apple-system, sans-serif;
  --font-serif: 'Libre Baskerville', Georgia, serif;

  --text-xs:   0.75rem;   /* 12px */
  --text-sm:   0.875rem;  /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-lg:   1.125rem;  /* 18px */
  --text-xl:   1.25rem;   /* 20px */
  --text-2xl:  1.5rem;    /* 24px */
  --text-3xl:  1.875rem;  /* 30px */
  --text-4xl:  2.25rem;   /* 36px */

  /* ── Spacing Scale ────────────────────────────────── */
  --space-1: 0.25rem;  /*  4px */
  --space-2: 0.5rem;   /*  8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.25rem;  /* 20px */
  --space-6: 1.5rem;   /* 24px */
  --space-8: 2rem;     /* 32px */
  --space-10: 2.5rem;  /* 40px */
  --space-12: 3rem;    /* 48px */

  /* ── Shadows ──────────────────────────────────────── */
  --shadow-sm:     0 1px 3px rgba(8, 43, 85, 0.06);
  --shadow-md:     0 4px 12px rgba(8, 43, 85, 0.08);
  --shadow-lg:     0 8px 28px rgba(8, 43, 85, 0.10);
  --shadow-xl:     0 16px 48px rgba(5, 31, 62, 0.14);
  --shadow-card:   0 2px 8px rgba(8, 43, 85, 0.06), 0 0 0 1px var(--border);
  --shadow-gold:   0 4px 16px rgba(242, 170, 0, 0.25);
  --shadow-gold-lg:0 8px 32px rgba(242, 170, 0, 0.30);

  /* ── Border Radius ────────────────────────────────── */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  20px;
  --radius-full: 9999px;

  /* ── Transitions ──────────────────────────────────── */
  --transition:        all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast:   all 0.15s ease;
  --transition-slow:   all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* ── Z-Index Scale ────────────────────────────────── */
  --z-dropdown:  100;
  --z-sticky:    200;
  --z-header:    300;
  --z-sidebar:   400;
  --z-overlay:   500;
  --z-modal:     600;
  --z-toast:     700;
  --z-tooltip:   800;

  /* ── Layout ───────────────────────────────────────── */
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
  --header-height: 68px;
  --content-max-width: 1720px;
}

/* ═══════════════════════════════════════════════════════════
   2. DARK MODE
   ═══════════════════════════════════════════════════════════ */

[data-theme="dark"] {
  --bg-primary:      #061a30;
  --bg-secondary:    #09233f;
  --bg-card:         #0c2a49;
  --bg-card-hover:   #123657;
  --bg-input:        #08213c;
  --bg-sidebar:      #041a33;
  --bg-glass:        rgba(255, 255, 255, 0.04);
  --bg-gold-glass:   rgba(242, 170, 0, 0.10);
  --bg-green-glass:  rgba(21, 128, 95, 0.10);
  --bg-red-glass:    rgba(194, 65, 59, 0.10);
  --bg-blue-glass:   rgba(15, 92, 134, 0.10);
  --border:          rgba(184, 205, 225, 0.18);
  --border-light:    rgba(255, 255, 255, 0.06);
  --text-primary:    #f7fbff;
  --text-secondary:  #bfd0df;
  --text-muted:      #8fa8bd;
  --text-inverse:    #051f3e;
  --shadow-sm:       0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md:       0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg:       0 8px 28px rgba(0, 0, 0, 0.5);
  --shadow-xl:       0 16px 48px rgba(0, 0, 0, 0.6);
  --shadow-card:     0 2px 8px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--border);
  --shadow-gold:     0 4px 16px rgba(242, 170, 0, 0.15);
}

/* ═══════════════════════════════════════════════════════════
   3. RESET & BASE
   ═══════════════════════════════════════════════════════════ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

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

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

a {
  color: var(--teal);
  text-decoration: none;
  transition: var(--transition-fast);
}
a:hover { color: var(--gold); }

img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }
ul, ol { list-style: none; }

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--gold) 60%, var(--navy));
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ── Selection ──────────────────────────────────────────── */
::selection {
  background: rgba(242, 170, 0, 0.28);
  color: var(--navy-deep);
}

/* ── Focus ──────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════
   4. LAYOUT
   ═══════════════════════════════════════════════════════════ */

.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  background: linear-gradient(180deg, rgba(255,255,255,.035) 0%, transparent 16rem),
              linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  z-index: var(--z-sidebar);
  transition: var(--transition);
  overflow-x: hidden;
  box-shadow: 10px 0 34px rgba(5, 31, 62, 0.12);
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

.sidebar.collapsed .nav-label,
.sidebar.collapsed .sidebar-logo-text,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .sidebar-user-info {
  opacity: 0;
  pointer-events: none;
  width: 0;
  overflow: hidden;
}

/* Sidebar Header */
.sidebar-header {
  padding: var(--space-5) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  min-height: 78px;
  flex-shrink: 0;
}

.sidebar-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12), 0 8px 18px rgba(0, 0, 0, 0.2);
}

.sidebar-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  border-radius: 50%;
}

.sidebar-logo-text {
  overflow: hidden;
  white-space: nowrap;
  transition: var(--transition);
}

.sidebar-logo-text h3 {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

.sidebar-logo-text span {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.62);
}

.sidebar-close {
  display: none;
  width: 42px;
  height: 42px;
  margin-left: auto;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  flex-shrink: 0;
}

.sidebar-close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

/* Navigation Sections */
.nav-items {
  padding: var(--space-3) var(--space-3) var(--space-5);
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(242, 170, 0, 0.6) rgba(255, 255, 255, 0.04);
}

.nav-items::-webkit-scrollbar { width: 5px; }
.nav-items::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-full);
  margin: 8px 0;
}
.nav-items::-webkit-scrollbar-thumb {
  background: rgba(242, 170, 0, 0.6);
  border-radius: var(--radius-full);
}
.nav-items::-webkit-scrollbar-thumb:hover { background: var(--gold); }

.nav-section {
  padding: var(--space-2) var(--space-2) var(--space-1);
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  padding: var(--space-2) var(--space-1) var(--space-1);
  transition: var(--transition);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3);
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  margin-bottom: 2px;
  min-height: 43px;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.nav-item.active {
  color: var(--navy-deep);
  background: linear-gradient(135deg, #ffbd25, var(--gold));
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-label { transition: var(--transition); }

.nav-badge {
  margin-left: auto;
  background: #fff;
  color: var(--danger);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: var(--space-3);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-user-info {
  overflow: hidden;
  white-space: nowrap;
  flex: 1;
  transition: var(--transition);
}

.sidebar-user-info strong {
  display: block;
  font-size: 13px;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-info span {
  display: block;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.62);
  text-transform: capitalize;
}

.sidebar-footer .btn-icon {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
}

/* ── Main Content Area ──────────────────────────────────── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.sidebar.collapsed ~ .main-content {
  margin-left: var(--sidebar-collapsed);
}

/* ── Top Header / Navbar ────────────────────────────────── */
.top-header {
  height: 72px;
  min-height: 72px;
  background: color-mix(in srgb, var(--bg-card) 94%, transparent);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  padding: 0 var(--space-6);
  gap: var(--space-4);
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 3px 18px rgba(8, 43, 85, 0.05);
}

/* Hamburger Menu Toggle */
.header-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-2);
  color: var(--text-secondary);
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 42px;
}

.header-toggle:hover { background: var(--bg-gold-glass); color: var(--navy); }

/* Mobile Brand */
.mobile-brand {
  display: none;
  align-items: center;
  gap: var(--space-2);
  font-weight: 700;
  font-size: 14px;
  color: var(--navy);
}

.mobile-brand img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
}

/* Search Bar */
.header-search {
  flex: 1;
  max-width: 400px;
  position: relative;
}

.header-search input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 16px 10px 40px;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition-fast);
}

.header-search input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(242, 170, 0, 0.18);
}

.header-search input::placeholder { color: var(--text-muted); }

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}

.header-btn {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
  color: var(--text-secondary);
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-width: 42px;
  min-height: 42px;
}

.header-btn:hover { background: var(--bg-gold-glass); color: var(--navy); }
.header-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }

.badge-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg-card);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.4); opacity: 0.6; }
}

/* Language Selector */
.lang-selector {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  outline: none;
  transition: var(--transition-fast);
  min-width: 42px;
  min-height: 42px;
}

.lang-selector:hover { border-color: var(--gold); }

/* User First Name */
.user-first-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ── Page Body ──────────────────────────────────────────── */
.page-body {
  flex: 1;
  padding: clamp(18px, 2.3vw, 34px);
  width: 100%;
  max-width: var(--content-max-width);
  margin: 0 auto;
}

/* Page Title */
.page-title {
  position: relative;
  margin-bottom: var(--space-6);
  padding-left: var(--space-4);
}

.page-title::before {
  content: '';
  position: absolute;
  inset: 3px auto 3px 0;
  width: 4px;
  border-radius: var(--radius-full);
  background: var(--gold);
}

.page-title h1 {
  font-family: var(--font-serif);
  font-size: clamp(23px, 2.3vw, 32px);
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.03em;
  margin-bottom: var(--space-1);
}

[data-theme="dark"] .page-title h1 { color: var(--text-primary); }

.page-title p {
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

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

.breadcrumb a { color: var(--teal); font-weight: 600; }
.breadcrumb span { color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════
   5. COMPONENTS
   ═══════════════════════════════════════════════════════════ */

/* ── 5.1 Cards ──────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: 0 6px 22px rgba(8, 43, 85, 0.065);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), transparent 68%);
  opacity: 0;
  transition: var(--transition);
}

.card:hover { box-shadow: 0 10px 30px rgba(8, 43, 85, 0.09); }
.card:hover::before { opacity: 0.75; }

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

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
}

[data-theme="dark"] .card-title { color: var(--text-primary); }

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

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

/* Card Variant: Compact */
.card-compact {
  padding: var(--space-4);
}

.card-compact .card-header {
  margin-bottom: var(--space-3);
}

/* Card Variant: Flat (no shadow, for settings/form sections) */
.card-flat {
  box-shadow: none;
  border-color: var(--border);
  background: var(--bg-glass);
}

.card-flat:hover { box-shadow: none; }
.card-flat::before { display: none; }

/* ── 5.2 Stat Cards ─────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  cursor: default;
  box-shadow: 0 6px 22px rgba(8, 43, 85, 0.065);
}

.stat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-gold);
  opacity: 0;
  transition: var(--transition);
  border-radius: inherit;
}

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

.stat-card:hover::after { opacity: 0.05; }

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.stat-icon svg {
  width: 24px;
  height: 24px;
  stroke: #fff;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stat-info {
  flex: 1;
  position: relative;
  z-index: 1;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 2px;
  color: var(--text-primary);
}

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

.stat-change {
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
}

.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* Stat Icon Background Colors */
.stat-icon-gold    { background: var(--gradient-gold); }
.stat-icon-navy    { background: var(--gradient-navy); }
.stat-icon-teal    { background: var(--gradient-teal); }
.stat-icon-success { background: var(--gradient-success); }
.stat-icon-danger  { background: var(--gradient-danger); }

/* ── 5.3 Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
  min-height: 42px;
}

.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; flex-shrink: 0; }

.btn:active { transform: scale(0.97); }

/* Button Variants */
.btn-primary {
  background: var(--gradient-gold);
  color: var(--text-on-gold);
  box-shadow: var(--shadow-gold);
  border-color: transparent;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold-lg);
  color: var(--text-on-gold);
}

.btn-secondary {
  background: var(--bg-glass);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-gold-glass);
  border-color: var(--gold);
  color: var(--navy);
}

.btn-success {
  background: var(--gradient-success);
  color: #fff;
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(21, 128, 95, 0.35);
  color: #fff;
}

.btn-danger {
  background: var(--gradient-danger);
  color: #fff;
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(194, 65, 59, 0.35);
  color: #fff;
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
}

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

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

/* Button Sizes */
.btn-xs { padding: 4px 10px; font-size: 11px; min-height: 28px; }
.btn-sm { padding: 7px 14px; font-size: 12px; min-height: 36px; }
.btn-lg { padding: 14px 28px; font-size: 16px; min-height: 50px; }

/* Button States */
.btn-loading {
  position: relative;
  pointer-events: none;
  color: transparent !important;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.btn-loading.btn-primary::after { border-color: rgba(0,0,0,0.3); border-right-color: transparent; }

/* Icon Button */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: var(--radius-md);
  background: var(--bg-glass);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: var(--transition-fast);
  cursor: pointer;
}

.btn-icon:hover { background: var(--bg-gold-glass); color: var(--navy); }
.btn-icon svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }

/* Button Group */
.btn-group {
  display: inline-flex;
  gap: 0;
}

.btn-group .btn {
  border-radius: 0;
}

.btn-group .btn:first-child {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.btn-group .btn:last-child {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.btn-group .btn + .btn {
  border-left: 0;
}

/* ── 5.4 Forms ──────────────────────────────────────────── */
.form-group {
  margin-bottom: var(--space-5);
}

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

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition-fast);
}

.form-control:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(242, 170, 0, 0.18);
  background: var(--bg-card);
}

.form-control::placeholder { color: var(--text-muted); }
.form-control:hover:not(:focus) { border-color: rgba(242, 170, 0, 0.4); }

/* Select Arrow */
select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371869a' stroke-width='2'%3E%3Cpolyline points='6,9 12,15 18,9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* Textarea */
textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

/* Form Validation */
.form-error {
  color: var(--danger);
  font-size: 12px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

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

.form-control.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(194, 65, 59, 0.12);
}

.form-control.is-valid {
  border-color: var(--success);
  box-shadow: 0 0 0 3px rgba(21, 128, 95, 0.12);
}

/* Form Grid */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-4);
}

/* Form Section */
.form-section {
  background: var(--bg-glass);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
}

.form-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Checkbox / Toggle Switch */
.form-check {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.form-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
  cursor: pointer;
}

.form-check-label {
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
}

/* Toggle Switch */
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

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

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-fast);
  border: 1px solid var(--border);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle input:checked + .toggle-slider {
  background: var(--gold);
  border-color: var(--gold);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* ── 5.5 Tables ─────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead tr {
  background: rgba(242, 170, 0, 0.06);
}

thead th {
  padding: 14px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition-fast);
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(242, 170, 0, 0.03); }

tbody td {
  padding: 14px 16px;
  color: var(--text-primary);
  vertical-align: middle;
}

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

/* Table Avatar */
.table-avatar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

/* Table Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-5);
  padding: var(--space-3) 0;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
}

.pagination-btn:hover {
  border-color: var(--gold);
  color: var(--navy);
  background: var(--bg-gold-glass);
}

.pagination-btn.active {
  background: var(--gradient-gold);
  color: var(--text-on-gold);
  border-color: transparent;
  box-shadow: var(--shadow-gold);
}

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

/* ── 5.6 Badges / Status Pills ──────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.badge-gold     { background: rgba(242, 170, 0, 0.15); color: var(--gold-dark); }
.badge-success  { background: rgba(21, 128, 95, 0.12); color: var(--success); }
.badge-warning  { background: rgba(217, 143, 0, 0.12); color: var(--warning); }
.badge-danger   { background: rgba(194, 65, 59, 0.12); color: var(--danger); }
.badge-info     { background: rgba(15, 92, 134, 0.12); color: var(--teal); }
.badge-secondary { background: rgba(0, 0, 0, 0.05); color: var(--text-muted); }
.badge-male     { background: rgba(99, 179, 237, 0.15); color: #3182ce; }
.badge-female   { background: rgba(246, 135, 179, 0.15); color: #d53f8c; }

/* Status Dot */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}

.status-dot.active    { background: var(--success); }
.status-dot.inactive  { background: var(--text-muted); }
.status-dot.suspended { background: var(--danger); }
.status-dot.pending   { background: var(--warning); }

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

.alert-success { background: var(--bg-green-glass);  border-color: rgba(21, 128, 95, 0.25);  color: var(--success); }
.alert-danger  { background: var(--bg-red-glass);    border-color: rgba(194, 65, 59, 0.25);  color: var(--danger); }
.alert-warning { background: var(--bg-gold-glass);   border-color: rgba(242, 170, 0, 0.25);  color: var(--warning); }
.alert-info    { background: var(--bg-blue-glass);   border-color: rgba(15, 92, 134, 0.25);  color: var(--teal); }

.alert-close {
  background: none;
  border: none;
  color: currentColor;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  margin-left: auto;
  padding: 0;
  opacity: 0.7;
  flex-shrink: 0;
}

.alert-close:hover { opacity: 1; }

/* ── 5.8 Progress Bars ──────────────────────────────────── */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--gradient-gold);
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

/* Progress Fill Colors */
.progress-fill-green { background: var(--gradient-success); }
.progress-fill-red   { background: var(--gradient-danger); }
.progress-fill-blue  { background: var(--gradient-teal); }

@keyframes shimmer {
  0%   { left: -100%; }
  100% { left: 100%; }
}

/* ── 5.9 Tabs ───────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: var(--space-1);
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: var(--space-1);
  margin-bottom: var(--space-6);
  border: 1px solid var(--border);
  overflow-x: auto;
}

.tab {
  flex: 1;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: center;
  white-space: nowrap;
}

.tab.active {
  background: var(--gradient-gold);
  color: var(--text-on-gold);
  box-shadow: var(--shadow-gold);
}

.tab:hover:not(.active) { color: var(--text-primary); background: var(--bg-glass); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── 5.10 Modals ────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

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

.modal-title {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-glass);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.modal-close:hover { background: var(--bg-red-glass); color: var(--danger); }

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

.modal-footer {
  padding: var(--space-4) var(--space-6);
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
  border-top: 1px solid var(--border);
}

/* Modal Sizes */
.modal-sm { max-width: 400px; }
.modal-lg { max-width: 800px; }
.modal-xl { max-width: 1100px; }

/* ── 5.11 Dropdown ──────────────────────────────────────── */
.dropdown { position: relative; display: inline-block; }

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: var(--space-1);
  z-index: var(--z-dropdown);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: all 0.2s ease;
}

.dropdown-menu.open { opacity: 1; pointer-events: all; transform: translateY(0); }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
}

.dropdown-item:hover { background: var(--bg-gold-glass); color: var(--navy); }
.dropdown-item.danger:hover { background: var(--bg-red-glass); color: var(--danger); }

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

/* ── 5.12 Notification Panel ────────────────────────────── */
.notif-panel {
  position: fixed;
  top: var(--header-height);
  right: 0;
  width: 360px;
  height: calc(100vh - var(--header-height));
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  z-index: calc(var(--z-sidebar) - 1);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
}

.notif-panel.open { transform: translateX(0); }

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

.notif-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-3);
}

.notif-item {
  display: flex;
  gap: var(--space-3);
  padding: 14px;
  border-radius: var(--radius-md);
  margin-bottom: 6px;
  border: 1px solid var(--border-light);
  transition: var(--transition-fast);
  cursor: pointer;
}

.notif-item:hover { background: var(--bg-glass); }
.notif-item.unread {
  background: var(--bg-gold-glass);
  border-color: rgba(242, 170, 0, 0.2);
}

.notif-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notif-body { flex: 1; }

.notif-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.notif-msg  { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }
.notif-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ── 5.13 Toast Notifications ────────────────────────────── */
#toast-container {
  position: fixed;
  top: 90px;
  right: 20px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  cursor: pointer;
  max-width: 340px;
  color: var(--text-primary);
  animation: fadeInRight 0.3s ease;
  font-family: var(--font-sans);
  border-left: 3px solid var(--gold);
}

.toast-success { border-left-color: var(--success); }
.toast-danger  { border-left-color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }
.toast-info    { border-left-color: var(--teal); }

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

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

/* ── 5.14 Skeleton Loaders ──────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: skeleton-wave 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-wave {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
  width: 100%;
}

.skeleton-text:last-child { width: 60%; }

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.skeleton-card {
  height: 120px;
  border-radius: var(--radius-lg);
}

/* ── 5.15 Attendance Grid ────────────────────────────────── */
.attendance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 6px;
}

.att-cell {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  border: 2px solid transparent;
}

.att-present  { background: rgba(21, 128, 95, 0.15);  color: var(--success); border-color: rgba(21, 128, 95, 0.3); }
.att-absent   { background: rgba(194, 65, 59, 0.15);   color: var(--danger); border-color: rgba(194, 65, 59, 0.3); }
.att-late     { background: rgba(242, 170, 0, 0.15);   color: var(--gold-dark); border-color: rgba(242, 170, 0, 0.3); }
.att-excused  { background: rgba(15, 92, 134, 0.12);   color: var(--teal); border-color: rgba(15, 92, 134, 0.25); }
.att-unknown  { background: var(--bg-glass); color: var(--text-muted); border-color: var(--border); }

.att-cell:hover { transform: scale(1.1); z-index: 1; }

/* ── 5.16 Score Input Grid ──────────────────────────────── */
.score-table td input {
  width: 70px;
  text-align: center;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
}

.score-table td input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(242, 170, 0, 0.15);
}

/* ── 5.17 Payment Method Grid ────────────────────────────── */
.payment-method-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.payment-method-btn {
  background: var(--bg-glass);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
}

.payment-method-btn.selected {
  border-color: var(--gold);
  background: var(--bg-gold-glass);
  box-shadow: 0 0 0 1px var(--gold);
}

.payment-method-btn:hover { border-color: rgba(242, 170, 0, 0.5); }

.payment-method-icon {
  font-size: 28px;
  margin-bottom: var(--space-2);
}

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

/* ── 5.18 Calendar ──────────────────────────────────────── */
.calendar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 6px 22px rgba(8, 43, 85, 0.065);
}

.calendar-header {
  background: var(--gradient-gold);
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.calendar-header h3 { color: var(--text-on-gold); font-size: 16px; font-weight: 700; }

.calendar-grid { padding: var(--space-4); }

.calendar-days-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: var(--space-2);
}

.calendar-days-header span {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 4px 0;
  text-transform: uppercase;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  color: var(--text-secondary);
  position: relative;
}

.cal-day:hover { background: var(--bg-gold-glass); color: var(--navy); }
.cal-day.today { background: var(--gradient-gold); color: var(--text-on-gold); font-weight: 700; box-shadow: var(--shadow-gold); }
.cal-day.has-event::after {
  content: '';
  position: absolute;
  bottom: 2px;
  width: 4px;
  height: 4px;
  background: var(--gold);
  border-radius: 50%;
}
.cal-day.other-month { opacity: 0.3; }
.cal-day.weekend { opacity: 0.35; cursor: default; pointer-events: none; }
.calendar-days-header .weekend-header { opacity: 0.35; }

/* ── 5.19 Charts ─────────────────────────────────────────── */
.chart-container {
  position: relative;
  width: 100%;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

/* ── 5.20 Breadcrumb Component ──────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
  flex-wrap: wrap;
}

.breadcrumb a { color: var(--teal); font-weight: 600; }
.breadcrumb a:hover { color: var(--gold); }
.breadcrumb span { color: var(--text-muted); }
.breadcrumb .separator { color: var(--border); margin: 0 2px; }

/* ═══════════════════════════════════════════════════════════
   6. PAGE-SPECIFIC STYLES
   ═══════════════════════════════════════════════════════════ */

/* ── 6.1 Login Page ──────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg-primary);
  overflow: hidden;
}

.login-left {
  background: linear-gradient(135deg, var(--navy-deep) 0%, #1a0a3a 50%, var(--navy) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-10);
  position: relative;
  overflow: hidden;
}

.login-left::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(242, 170, 0, 0.15) 0%, transparent 70%);
  top: -100px;
  left: -100px;
  animation: float 6s ease-in-out infinite;
}

.login-left::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
  bottom: -100px;
  right: -100px;
  animation: float 8s ease-in-out infinite reverse;
}

.login-hero { position: relative; z-index: 1; max-width: 440px; }

.login-logo {
  width: 72px;
  height: 72px;
  background: var(--gradient-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 900;
  color: var(--text-on-gold);
  margin-bottom: var(--space-8);
  box-shadow: 0 16px 48px rgba(242, 170, 0, 0.4);
  animation: float 4s ease-in-out infinite, glow 3s ease-in-out infinite;
  overflow: hidden;
}

.login-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.login-hero h1 {
  font-size: var(--text-4xl);
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
  margin-bottom: var(--space-4);
}

.login-hero h1 span {
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-hero p {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: var(--space-10);
  line-height: 1.6;
}

.login-features { display: flex; flex-direction: column; gap: 14px; }

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

.login-feature-icon {
  width: 36px;
  height: 36px;
  background: rgba(242, 170, 0, 0.15);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.login-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-10) var(--space-8);
  background: var(--bg-secondary);
}

.login-form-wrapper {
  width: 100%;
  max-width: 400px;
  animation: fadeInUp 0.6s ease;
}

.login-form-header {
  text-align: center;
  margin-bottom: var(--space-8);
}

.login-form-header h2 {
  font-size: var(--text-2xl);
  font-weight: 800;
  margin-bottom: var(--space-2);
}

.login-form-header p { color: var(--text-secondary); font-size: 14px; }

.login-form { display: flex; flex-direction: column; gap: var(--space-4); }

.login-input-group {
  position: relative;
}

.login-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.login-input {
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 14px 14px 44px;
  font-size: 15px;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
}

.login-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(242, 170, 0, 0.15);
  background: var(--bg-card);
}

.login-input::placeholder { color: var(--text-muted); }

.login-password-toggle {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.login-password-toggle:hover,
.login-password-toggle:focus-visible {
  color: var(--navy);
  background: var(--bg-gold-glass);
  outline: none;
}

.login-input.has-toggle { padding-right: 54px; }

.login-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-1);
}

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

.login-remember input { accent-color: var(--gold); }

.login-forgot { font-size: 13px; color: var(--teal); }

.login-btn {
  width: 100%;
  padding: 15px;
  background: var(--gradient-gold);
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-on-gold);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-gold);
  font-family: var(--font-sans);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold-lg);
}

.login-btn:active { transform: translateY(0); }

.login-demo {
  margin-top: var(--space-6);
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.login-demo h4 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

.demo-credentials {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.demo-cred {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: var(--transition-fast);
}

.demo-cred:hover { border-color: var(--gold); }

.demo-cred-role {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.demo-cred-email {
  font-size: 11px;
  color: var(--text-muted);
  font-family: monospace;
}

/* ── 6.2 Public Landing Page (index.php) ────────────────── */
.public-skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  padding: 10px 16px;
  color: var(--navy);
  background: #fff;
  border: 2px solid var(--gold);
  border-radius: var(--radius-sm);
  transform: translateY(-160%);
}
.public-skip-link:focus { transform: translateY(0); }

.public-topbar {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  padding: 8px 0;
}

.public-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.public-topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.public-contact-links {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.public-contact-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 12px;
}

.public-contact-item svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }

.public-portal-links {
  display: flex;
  gap: 12px;
}

.public-portal-links a {
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.public-portal-links a:hover { text-decoration: underline; }

/* Public Navigation */
.public-nav {
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}

.public-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  gap: 20px;
}

.public-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.public-brand img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
}

.public-brand strong {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
  font-family: var(--font-serif);
}

.public-brand span {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.public-nav-links {
  display: flex;
  gap: 4px;
}

.public-nav-links li a {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition-fast);
}

.public-nav-links li a:hover,
.public-nav-links li a[aria-current] {
  color: var(--navy);
  background: var(--bg-gold-glass);
}

.public-nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.public-nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  color: var(--text-secondary);
  cursor: pointer;
}

.public-nav-toggle svg { width: 22px; height: 22px; }

/* Public Buttons */
.public-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
  border: none;
}

.public-btn-gold {
  background: var(--gradient-gold);
  color: var(--text-on-gold);
  box-shadow: var(--shadow-gold);
}

.public-btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold-lg);
}

.public-btn-navy {
  background: var(--navy);
  color: #fff;
}

.public-btn-navy:hover {
  background: var(--navy-light);
  transform: translateY(-2px);
}

.public-btn-outline {
  background: transparent;
  color: var(--navy);
  border: 2px solid var(--navy);
}

.public-btn-outline:hover {
  background: var(--navy);
  color: #fff;
  transform: translateY(-2px);
}

/* Public Hero */
.public-hero {
  padding: 80px 0;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-deep) 100%);
  position: relative;
  overflow: hidden;
}

.public-hero::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(242, 170, 0, 0.1) 0%, transparent 70%);
  top: -200px;
  right: -100px;
}

.public-hero-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.public-hero-copy { }

.public-eyebrow {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--gold);
  margin-bottom: 16px;
}

.public-hero-copy h1 {
  font-family: var(--font-serif);
  font-size: 44px;
  font-weight: 700;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 20px;
}

.public-hero-copy h1 span {
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.public-hero-copy p {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.7;
  margin-bottom: 32px;
  max-width: 480px;
}

.public-hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.public-hero-actions .public-btn-outline {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.public-hero-actions .public-btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #fff;
}

.public-reference-crop {
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-xl);
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

/* Values Bar */
.public-values-wrap {
  background: #fff;
  border-bottom: 1px solid var(--border-light);
}

.public-values {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}

.public-value {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 28px 24px;
  border-right: 1px solid var(--border-light);
}

.public-value:last-child { border-right: none; }

.public-value-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--bg-gold-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.public-value-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--gold);
  fill: none;
  stroke-width: 2;
}

.public-value h2 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 2px;
}

.public-value p {
  font-size: 12px;
  color: var(--text-muted);
}

/* Public Sections */
.public-section {
  padding: 80px 0;
}

.public-about {
  background: var(--bg-primary);
}

.public-about-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.public-about-visual {
  position: relative;
}

.public-years-badge {
  position: absolute;
  bottom: 20px;
  left: 20px;
  background: var(--gold);
  color: var(--text-on-gold);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 14px;
  box-shadow: var(--shadow-gold);
}

.public-years-badge strong {
  display: block;
  font-size: 18px;
}

.public-heading {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 20px;
}

.public-heading span {
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.public-about-copy p {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 32px;
}

.public-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.public-stat {
  text-align: center;
}

.public-stat strong {
  display: block;
  font-size: 28px;
  font-weight: 800;
  color: var(--navy);
  font-family: var(--font-serif);
}

.public-stat span {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Discover Section */
.public-discover {
  background: #fff;
}

.public-discover-header {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
}

.public-program-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.public-program {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
}

.public-program:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.public-program-image {
  aspect-ratio: 16/10;
}

.public-program-body {
  padding: 20px;
}

.public-program-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-gold-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.public-program-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--gold);
  fill: none;
  stroke-width: 2;
}

.public-program-body h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.public-program-body p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}

.public-text-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--gold-dark);
  text-decoration: none;
}

.public-text-link:hover { color: var(--gold); }

/* Contact Section */
.public-contact {
  background: var(--bg-primary);
}

.public-contact-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}

.public-contact-copy {
}

.public-contact-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 32px;
}

.public-contact-line {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.public-contact-line-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-gold-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.public-contact-line-icon svg {
  width: 18px;
  height: 18px;
  stroke: var(--gold);
  fill: none;
  stroke-width: 2;
}

.public-contact-line strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.public-contact-line span,
.public-contact-line a {
  font-size: 13px;
  color: var(--text-secondary);
}

.public-form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 36px;
  box-shadow: var(--shadow-card);
}

.public-form-card h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 24px;
}

.public-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.public-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.public-field input,
.public-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-input);
  outline: none;
  transition: var(--transition-fast);
}

.public-field input:focus,
.public-field textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(242, 170, 0, 0.15);
}

.public-field textarea {
  min-height: 120px;
  resize: vertical;
}

.public-alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  margin-bottom: 16px;
}

.public-alert-success { background: var(--bg-green-glass); color: var(--success); border: 1px solid rgba(21, 128, 95, 0.25); }
.public-alert-error   { background: var(--bg-red-glass); color: var(--danger); border: 1px solid rgba(194, 65, 59, 0.25); }

/* Public Footer */
.public-footer {
  background: var(--navy-deep);
  color: rgba(255, 255, 255, 0.7);
  padding: 60px 0 0;
}

.public-footer-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
}

.public-footer-about .public-brand strong { color: #fff; }
.public-footer-about .public-brand span { color: rgba(255, 255, 255, 0.5); }
.public-footer-about p {
  font-size: 14px;
  line-height: 1.6;
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.5);
}

.public-footer h2 {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
}

.public-footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.public-footer-links a {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  transition: var(--transition-fast);
}

.public-footer-links a:hover { color: var(--gold); }

.public-footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.3);
}

.public-scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gradient-gold);
  color: var(--text-on-gold);
  border: none;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-gold);
  transition: var(--transition);
  opacity: 0;
  pointer-events: none;
  z-index: 50;
}

.public-scroll-top.is-visible {
  opacity: 1;
  pointer-events: all;
}

.public-scroll-top:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-gold-lg);
}

/* ═══════════════════════════════════════════════════════════
   7. ANIMATIONS
   ═══════════════════════════════════════════════════════════ */

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

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

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

@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px rgba(242, 170, 0, 0.3); }
  50%      { box-shadow: 0 0 40px rgba(242, 170, 0, 0.5); }
}

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

.animate-fade-up   { animation: fadeInUp 0.5s ease forwards; }
.animate-fade-left { animation: fadeInLeft 0.5s ease forwards; }
.animate-scale-in  { animation: scaleIn 0.4s ease forwards; }
.animate-float     { animation: float 3s ease-in-out infinite; }
.animate-glow      { animation: glow 2s ease-in-out infinite; }

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }

/* ═══════════════════════════════════════════════════════════
   8. UTILITIES
   ═══════════════════════════════════════════════════════════ */

/* Flex */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }

/* Gap */
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }

/* Width */
.w-full { width: 100%; }
.w-auto { width: auto; }

/* Text */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-xs   { font-size: var(--text-xs); }
.text-sm   { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg   { font-size: var(--text-lg); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary { color: var(--text-primary); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-serif { font-family: var(--font-serif); }

/* Margin */
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }
.ml-auto { margin-left: auto; }

/* Padding */
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }
.p-6 { padding: var(--space-6); }

/* Display */
.hidden { display: none !important; }
.block { display: block; }
.inline-block { display: inline-block; }
.overflow-hidden { overflow: hidden; }
.relative { position: relative; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opacity-0 { opacity: 0; }
.cursor-pointer { cursor: pointer; }
.no-shrink { flex-shrink: 0; }

/* Grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-5); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-5); }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: var(--space-5); }

/* Skip Link */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  padding: 10px 16px;
  color: var(--navy);
  background: #fff;
  border: 2px solid var(--gold);
  border-radius: var(--radius-sm);
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

/* Mobile Overlay */
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: calc(var(--z-sidebar) - 1);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.mobile-overlay.open { display: block; }

/* ═══════════════════════════════════════════════════════════
   9. RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

/* ── Tablet / Small Laptop (≤1024px) ────────────────────── */
@media (max-width: 1024px) {
  .login-page { grid-template-columns: 1fr; }
  .login-left { display: none; }
  .login-right { min-height: 100vh; }

  .sidebar {
    transform: translateX(-100%);
    z-index: var(--z-sidebar);
    box-shadow: none;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: var(--shadow-xl), 4px 0 40px rgba(0, 0, 0, 0.5);
  }
  .sidebar-close { display: flex; }
  .main-content { margin-left: 0 !important; }
  .mobile-brand { display: flex; }
  .header-search { max-width: 280px; }

  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }

  .notif-panel { width: min(360px, 100vw); }

  .public-hero-grid { grid-template-columns: 1fr; text-align: center; }
  .public-hero-copy p { margin: 0 auto 32px; }
  .public-hero-actions { justify-content: center; }
  .public-values { grid-template-columns: 1fr 1fr; }
  .public-value:nth-child(2) { border-right: none; }
  .public-program-grid { grid-template-columns: 1fr 1fr; }
  .public-about-grid { grid-template-columns: 1fr; }
  .public-contact-grid { grid-template-columns: 1fr; }
  .public-footer-main { grid-template-columns: 1fr 1fr; }
  .public-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ── Mobile Landscape / Small Tablet (≤768px) ──────────── */
@media (max-width: 768px) {
  .page-body { padding: var(--space-4); }
  .page-title h1 { font-size: var(--text-2xl); }
  .page-title p  { font-size: var(--text-sm); }

  .stat-grid   { grid-template-columns: 1fr 1fr; }
  .chart-grid  { grid-template-columns: 1fr; }
  .form-grid   { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .payment-method-grid { grid-template-columns: 1fr 1fr; }
  .grid-auto { grid-template-columns: 1fr; }

  .top-header { padding: 0 var(--space-3); gap: var(--space-2); }
  .header-search { display: none; }
  .lang-selector { display: none; }
  .user-first-name { display: none; }

  .notif-panel { width: 100vw; }

  /* Sheet-style modals */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal {
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    max-height: 92vh;
    max-width: 100%;
    width: 100%;
  }

  /* Reduce hover transforms on touch devices */
  .card:hover        { transform: none; }
  .stat-card:hover   { transform: translateY(-2px); box-shadow: var(--shadow-md); }
  .btn-primary:hover { transform: none; }
  .btn-danger:hover  { transform: none; }
  .btn-success:hover { transform: none; }

  .public-nav-links { display: none; }
  .public-nav-links.is-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    padding: 16px;
    box-shadow: var(--shadow-lg);
    border-top: 1px solid var(--border-light);
  }
  .public-nav-toggle { display: flex; }
  .public-hero-copy h1 { font-size: 32px; }
  .public-values { grid-template-columns: 1fr; }
  .public-value { border-right: none; border-bottom: 1px solid var(--border-light); }
  .public-program-grid { grid-template-columns: 1fr; }
  .public-discover-header { flex-direction: column; align-items: flex-start; }
  .public-footer-main { grid-template-columns: 1fr; }
  .public-stats { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}

/* ── Mobile Portrait (≤480px) ──────────────────────────── */
@media (max-width: 480px) {
  .page-body { padding: var(--space-3); }
  .page-title h1 { font-size: var(--text-xl); }
  .page-title p  { font-size: var(--text-xs); }
  .breadcrumb    { font-size: 11px; }

  .stat-grid { grid-template-columns: 1fr; }
  .payment-method-grid { grid-template-columns: 1fr; }
  .tabs { flex-direction: column; }

  .top-header { padding: 0 var(--space-2); gap: var(--space-1); }
  .header-toggle { min-width: 36px; min-height: 36px; }

  .card { padding: var(--space-4); }
  .stat-card { padding: var(--space-3); }
  .stat-value { font-size: var(--text-2xl); }

  .modal-body   { padding: var(--space-4); }
  .modal-header { padding: var(--space-4) var(--space-4) var(--space-3); }
  .modal-footer { padding: var(--space-3) var(--space-4); gap: var(--space-2); }

  .btn-sm { padding: 9px 14px; min-height: 36px; }
  .btn-icon { padding: 10px; min-width: 36px; min-height: 36px; }

  .public-hero-copy h1 { font-size: 28px; }
  .public-stats { grid-template-columns: 1fr 1fr; }
}

/* ═══════════════════════════════════════════════════════════
   10. PRINT
   ═══════════════════════════════════════════════════════════ */

@media print {
  .sidebar, .top-header, .btn, .modal-overlay,
  .notif-panel, .mobile-overlay, .public-nav,
  .public-topbar, .public-footer, .public-scroll-top,
  .header-search, .header-actions, .lang-selector {
    display: none !important;
  }
  .main-content { margin-left: 0; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  .page-title h1 { -webkit-text-fill-color: var(--navy); }
}