/* ================================================================
   ARA TECH CBT SYSTEM — style.css
   Full Design System: Variables · Reset · Layout · Components
   Covers: Landing · Admin Dashboard · Student Portal · Exam Engine
   ================================================================ */

/* ================================================================
   1. GOOGLE FONTS IMPORT
   ================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ================================================================
   2. CSS CUSTOM PROPERTIES — DESIGN TOKENS
   ================================================================ */
:root {

  /* — Brand Colors — */
  --blue-950:  #060e1f;
  --blue-900:  #0a1628;
  --blue-800:  #0d1f3c;
  --blue-700:  #102a52;
  --blue-600:  #1a3a6b;
  --blue-500:  #1e4d8c;
  --blue-400:  #2563b0;
  --blue-300:  #3b82d4;
  --blue-200:  #93c5fd;
  --blue-100:  #dbeafe;
  --blue-50:   #eff6ff;

  --gold-700:  #92400e;
  --gold-600:  #b7791f;
  --gold-500:  #d97706;
  --gold-400:  #f59e0b;
  --gold-300:  #fbbf24;
  --gold-200:  #fcd34d;
  --gold-100:  #fef3c7;
  --gold-50:   #fffbeb;

  /* — Neutrals — */
  --white:     #ffffff;
  --gray-50:   #f8fafc;
  --gray-100:  #f1f5f9;
  --gray-200:  #e2e8f0;
  --gray-300:  #cbd5e1;
  --gray-400:  #94a3b8;
  --gray-500:  #64748b;
  --gray-600:  #475569;
  --gray-700:  #334155;
  --gray-800:  #1e293b;
  --gray-900:  #0f172a;

  /* — Semantic Colors — */
  --success:        #10b981;
  --success-light:  rgba(16, 185, 129, .15);
  --success-border: rgba(16, 185, 129, .35);

  --danger:         #ef4444;
  --danger-light:   rgba(239, 68, 68, .15);
  --danger-border:  rgba(239, 68, 68, .35);

  --warning:        #f59e0b;
  --warning-light:  rgba(245, 158, 11, .15);
  --warning-border: rgba(245, 158, 11, .35);

  --info:           #3b82f6;
  --info-light:     rgba(59, 130, 246, .15);
  --info-border:    rgba(59, 130, 246, .35);

  --purple:         #8b5cf6;
  --purple-light:   rgba(139, 92, 246, .15);

  --cyan:           #06b6d4;
  --cyan-light:     rgba(6, 182, 212, .15);

  /* — Typography — */
  --font-display: 'Sora', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  --text-xs:   11px;
  --text-sm:   13px;
  --text-base: 15px;
  --text-md:   16px;
  --text-lg:   18px;
  --text-xl:   22px;
  --text-2xl:  28px;
  --text-3xl:  36px;
  --text-4xl:  48px;
  --text-5xl:  64px;

  --weight-light:    300;
  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;
  --weight-black:    800;

  --leading-tight:   1.15;
  --leading-snug:    1.35;
  --leading-normal:  1.6;
  --leading-relaxed: 1.75;

  /* — Spacing — */
  --space-1:   4px;
  --space-2:   8px;
  --space-3:   12px;
  --space-4:   16px;
  --space-5:   20px;
  --space-6:   24px;
  --space-8:   32px;
  --space-10:  40px;
  --space-12:  48px;
  --space-16:  64px;
  --space-20:  80px;
  --space-24:  96px;

  /* — Border Radii — */
  --radius-xs:   4px;
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-2xl:  32px;
  --radius-full: 9999px;

  /* — Shadows — */
  --shadow-xs:   0 1px 2px rgba(0,0,0,.10);
  --shadow-sm:   0 1px 4px rgba(0,0,0,.14), 0 1px 3px rgba(0,0,0,.10);
  --shadow-md:   0 4px 16px rgba(0,0,0,.18);
  --shadow-lg:   0 8px 32px rgba(0,0,0,.22);
  --shadow-xl:   0 20px 60px rgba(0,0,0,.30);
  --shadow-2xl:  0 30px 80px rgba(0,0,0,.40);
  --shadow-gold: 0 0 30px rgba(245, 158, 11, .28);
  --shadow-blue: 0 0 24px rgba(37, 99, 176, .35);
  --shadow-inset: inset 0 1px 0 rgba(255,255,255,.07);

  /* — Borders — */
  --border-subtle:  rgba(255, 255, 255, .07);
  --border-light:   rgba(255, 255, 255, .12);
  --border-medium:  rgba(255, 255, 255, .18);
  --border-blue:    rgba(37, 99, 176, .35);
  --border-gold:    rgba(245, 158, 11, .30);

  /* — Glass / Surface — */
  --surface-1: rgba(13, 31, 60, .70);
  --surface-2: rgba(13, 31, 60, .85);
  --surface-3: rgba(16, 36, 72, .90);
  --surface-4: rgba(10, 22, 40, .95);

  /* — Transitions — */
  --ease-fast:   all .15s ease;
  --ease-normal: all .25s ease;
  --ease-slow:   all .4s ease;

  /* — Layout — */
  --navbar-h:   70px;
  --sidebar-w:  260px;
  --sidebar-collapsed: 68px;
  --container:  1200px;
}

/* ================================================================
   3. CSS RESET & BASE
   ================================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
}

body {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--white);
  background-color: var(--blue-900);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a          { text-decoration: none; color: inherit; }
img        { max-width: 100%; display: block; }
video      { max-width: 100%; display: block; }
ul, ol     { list-style: none; }
button     { cursor: pointer; font-family: inherit; border: none; background: none; }
input,
select,
textarea   { font-family: inherit; outline: none; }
table      { border-collapse: collapse; width: 100%; }
h1,h2,h3,h4,h5,h6 { font-weight: var(--weight-bold); line-height: var(--leading-tight); }
p          { line-height: var(--leading-normal); }
strong     { font-weight: var(--weight-bold); }
small      { font-size: var(--text-xs); }

::selection {
  background: rgba(245, 158, 11, .30);
  color: var(--white);
}

/* Scrollbar styling */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--blue-900); }
::-webkit-scrollbar-thumb { background: var(--blue-600); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--blue-400); }

/* ================================================================
   4. ANIMATED BACKGROUND
   ================================================================ */

/* Moving grid overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(30, 77, 140, .16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 77, 140, .16) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
  animation: bgGridShift 22s linear infinite;
}

/* Radial glow */
body::after {
  content: '';
  position: fixed;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 1000px;
  height: 700px;
  background: radial-gradient(
    ellipse at center,
    rgba(37, 99, 176, .32) 0%,
    rgba(10, 22, 40, 0) 70%
  );
  pointer-events: none;
  z-index: 0;
}

@keyframes bgGridShift {
  from { background-position: 0 0; }
  to   { background-position: 48px 48px; }
}

/* ================================================================
   5. LAYOUT UTILITIES
   ================================================================ */
.container      { max-width: var(--container); margin: 0 auto; padding: 0 var(--space-6); }
.container-sm   { max-width: 640px;  margin: 0 auto; padding: 0 var(--space-6); }
.container-md   { max-width: 860px;  margin: 0 auto; padding: 0 var(--space-6); }
.container-lg   { max-width: 1100px; margin: 0 auto; padding: 0 var(--space-6); }

.flex            { display: flex; }
.flex-col        { flex-direction: column; }
.inline-flex     { display: inline-flex; }
.grid            { display: grid; }

.items-start    { align-items: flex-start; }
.items-center   { align-items: center; }
.items-end      { align-items: flex-end; }
.items-stretch  { align-items: stretch; }

.justify-start   { justify-content: flex-start; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end     { justify-content: flex-end; }

.flex-wrap    { flex-wrap: wrap; }
.flex-nowrap  { flex-wrap: nowrap; }
.flex-1       { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }

.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); }
.gap-8  { gap: var(--space-8); }
.gap-10 { gap: var(--space-10); }
.gap-12 { gap: var(--space-12); }

.w-full   { width: 100%; }
.h-full   { height: 100%; }
.min-h-screen { min-height: 100vh; }

.relative { position: relative; }
.absolute { position: absolute; }
.fixed    { position: fixed; }
.sticky   { position: sticky; }
.inset-0  { inset: 0; }
.z-0  { z-index: 0; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-50 { z-index: 50; }
.z-100 { z-index: 100; }

.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }

/* ================================================================
   6. TYPOGRAPHY UTILITIES
   ================================================================ */
.text-xs   { font-size: var(--text-xs); }
.text-sm   { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-md   { font-size: var(--text-md); }
.text-lg   { font-size: var(--text-lg); }
.text-xl   { font-size: var(--text-xl); }
.text-2xl  { font-size: var(--text-2xl); }
.text-3xl  { font-size: var(--text-3xl); }
.text-4xl  { font-size: var(--text-4xl); }

.font-light    { font-weight: var(--weight-light); }
.font-regular  { font-weight: var(--weight-regular); }
.font-medium   { font-weight: var(--weight-medium); }
.font-semibold { font-weight: var(--weight-semibold); }
.font-bold     { font-weight: var(--weight-bold); }
.font-black    { font-weight: var(--weight-black); }
.font-mono     { font-family: var(--font-mono); }

.text-left   { text-align: left; }
.text-center { text-align: center; }
.text-right  { text-align: right; }

.text-white   { color: var(--white); }
.text-gold    { color: var(--gold-400); }
.text-blue    { color: var(--blue-300); }
.text-muted   { color: var(--gray-500); }
.text-light   { color: var(--gray-400); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }

.uppercase    { text-transform: uppercase; }
.capitalize   { text-transform: capitalize; }
.tracking-wide   { letter-spacing: .06em; }
.tracking-wider  { letter-spacing: .10em; }
.tracking-widest { letter-spacing: .16em; }

/* Gradient text helpers */
.text-gradient-gold {
  background: linear-gradient(90deg, var(--gold-400), var(--gold-200));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.text-gradient-blue {
  background: linear-gradient(90deg, var(--blue-300), var(--blue-100));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.text-gradient-white {
  background: linear-gradient(90deg, var(--white), var(--gray-300));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ================================================================
   7. SPACING UTILITIES
   ================================================================ */
.m-0  { margin: 0; }
.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-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }

.p-0  { padding: 0; }
.p-2  { padding: var(--space-2); }
.p-4  { padding: var(--space-4); }
.p-6  { padding: var(--space-6); }
.p-8  { padding: var(--space-8); }
.px-3 { padding-left: var(--space-3); padding-right: var(--space-3); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-6 { padding-left: var(--space-6); padding-right: var(--space-6); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-3 { padding-top: var(--space-3); padding-bottom: var(--space-3); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.py-6 { padding-top: var(--space-6); padding-bottom: var(--space-6); }

/* ================================================================
   8. SECTION LAYOUTS
   ================================================================ */
.section {
  position: relative;
  z-index: 10;
  padding: var(--space-20) var(--space-6);
}

.section-sm { padding: var(--space-12) var(--space-6); }
.section-lg { padding: var(--space-24) var(--space-6); }

.section-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold-400);
  margin-bottom: var(--space-3);
  text-align: center;
}

.section-title {
  font-size: clamp(26px, 4vw, 42px);
  font-weight: var(--weight-black);
  text-align: center;
  line-height: var(--leading-tight);
  margin-bottom: var(--space-3);
  color: var(--white);
}

.section-desc {
  text-align: center;
  color: var(--gray-400);
  font-size: var(--text-base);
  max-width: 540px;
  margin: 0 auto var(--space-12);
  line-height: var(--leading-relaxed);
}

.section-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: var(--space-8) 0;
}

/* ================================================================
   9. NAVIGATION BAR
   ================================================================ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--navbar-h);
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  background: rgba(10, 22, 40, .88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-gold);
}

.navbar-inner {
  max-width: var(--container);
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Brand / Logo */
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--blue-400), var(--gold-400));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: var(--shadow-gold);
  flex-shrink: 0;
  animation: brandPulse 3.5s ease-in-out infinite;
}

@keyframes brandPulse {
  0%, 100% { box-shadow: 0 0 12px rgba(245,158,11,.4); }
  50%       { box-shadow: 0 0 30px rgba(245,158,11,.85); }
}

.brand-text { line-height: 1.1; }

.brand-title {
  font-size: 15px;
  font-weight: var(--weight-black);
  letter-spacing: .04em;
  background: linear-gradient(90deg, var(--white), var(--gold-300));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-subtitle {
  font-size: var(--text-xs);
  color: var(--gold-400);
  font-weight: var(--weight-medium);
  letter-spacing: .12em;
  text-transform: uppercase;
}

/* Nav Links */
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.nav-link {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--gray-400);
  transition: var(--ease-normal);
}
.nav-link:hover,
.nav-link.active {
  color: var(--white);
  background: rgba(255,255,255,.07);
}

/* ================================================================
   10. BUTTONS
   ================================================================ */

/* Primary (gold) */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 13px 28px;
  background: linear-gradient(135deg, var(--gold-500), var(--gold-300));
  border: none;
  border-radius: var(--radius-md);
  color: var(--blue-900);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  letter-spacing: .02em;
  transition: var(--ease-normal);
  box-shadow: 0 4px 20px rgba(245,158,11,.4);
  white-space: nowrap;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(245,158,11,.65);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Secondary (outlined) */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 12px 26px;
  background: transparent;
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-md);
  color: var(--white);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  transition: var(--ease-normal);
  white-space: nowrap;
}
.btn-secondary:hover {
  border-color: rgba(255,255,255,.45);
  background: rgba(255,255,255,.07);
  transform: translateY(-2px);
}

/* Blue solid */
.btn-blue {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--blue-400), var(--blue-600));
  border: none;
  border-radius: var(--radius-md);
  color: var(--white);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  transition: var(--ease-normal);
  box-shadow: 0 4px 18px rgba(37,99,176,.5);
  white-space: nowrap;
}
.btn-blue:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(37,99,176,.7);
}
.btn-blue:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* Danger */
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px 20px;
  background: var(--danger-light);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-md);
  color: var(--danger);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  transition: var(--ease-normal);
}
.btn-danger:hover { background: rgba(239,68,68,.25); transform: translateY(-1px); }

/* Success */
.btn-success {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px 20px;
  background: var(--success-light);
  border: 1px solid var(--success-border);
  border-radius: var(--radius-md);
  color: var(--success);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  transition: var(--ease-normal);
}
.btn-success:hover { background: rgba(16,185,129,.25); transform: translateY(-1px); }

/* Ghost / Icon-only */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 9px 14px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--gray-400);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  transition: var(--ease-fast);
}
.btn-ghost:hover { background: rgba(255,255,255,.06); color: var(--white); border-color: var(--border-light); }

/* Full-width login button */
.btn-login {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--blue-400), var(--blue-600));
  border: none;
  border-radius: var(--radius-md);
  color: var(--white);
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  letter-spacing: .02em;
  transition: var(--ease-normal);
  box-shadow: 0 4px 20px rgba(37,99,176,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}
.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(37,99,176,.7);
}
.btn-login:disabled { opacity: .65; cursor: not-allowed; transform: none; }

/* Nav login button */
.btn-nav-login {
  padding: 9px 22px;
  background: linear-gradient(135deg, var(--blue-400), var(--blue-500));
  border: none;
  border-radius: var(--radius-full);
  color: var(--white);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: .02em;
  transition: var(--ease-normal);
  box-shadow: 0 2px 12px rgba(37,99,176,.5);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.btn-nav-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(37,99,176,.7);
}

/* Button sizes */
.btn-sm { padding: 7px 14px; font-size: var(--text-xs); }
.btn-lg { padding: 16px 36px; font-size: var(--text-md); }
.btn-xl { padding: 18px 44px; font-size: var(--text-lg); }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: var(--radius-sm); }
.btn-icon-lg { width: 42px; height: 42px; padding: 0; }

/* ================================================================
   11. CARDS & SURFACES
   ================================================================ */
.card {
  background: var(--surface-1);
  border: 1px solid var(--border-blue);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  backdrop-filter: blur(12px);
  transition: var(--ease-normal);
  position: relative;
  overflow: hidden;
}
.card:hover {
  border-color: rgba(37, 99, 176, .55);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.card-flat {
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.card-glass {
  background: rgba(13, 31, 60, .6);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-xl), var(--shadow-inset);
}

.card-gold {
  background: var(--surface-1);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

/* Top-line accent */
.card-accent::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--blue-400), transparent);
  opacity: 0;
  transition: opacity .3s;
}
.card-accent:hover::before { opacity: 1; }

/* ================================================================
   12. STAT / METRIC CARDS
   ================================================================ */
.stat-card {
  background: var(--surface-2);
  border: 1px solid var(--border-blue);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  position: relative;
  overflow: hidden;
  transition: var(--ease-normal);
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(37,99,176,.5);
}

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.stat-icon.blue   { background: rgba(37,99,176,.2);   color: var(--blue-300); }
.stat-icon.gold   { background: rgba(245,158,11,.15); color: var(--gold-400); }
.stat-icon.green  { background: var(--success-light); color: var(--success); }
.stat-icon.red    { background: var(--danger-light);  color: var(--danger); }
.stat-icon.purple { background: var(--purple-light);  color: var(--purple); }
.stat-icon.cyan   { background: var(--cyan-light);    color: var(--cyan); }

.stat-number {
  font-size: var(--text-3xl);
  font-weight: var(--weight-black);
  line-height: 1;
  background: linear-gradient(90deg, var(--white), var(--blue-200));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: var(--text-xs);
  color: var(--gray-500);
  font-weight: var(--weight-medium);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.stat-change {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}
.stat-change.up   { background: var(--success-light); color: var(--success); border: 1px solid var(--success-border); }
.stat-change.down { background: var(--danger-light);  color: var(--danger);  border: 1px solid var(--danger-border); }

/* ================================================================
   13. BADGES & TAGS
   ================================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: .04em;
}

.badge-blue    { background: var(--info-light);    color: var(--blue-200); border: 1px solid var(--info-border); }
.badge-gold    { background: var(--warning-light); color: var(--gold-300); border: 1px solid var(--warning-border); }
.badge-green   { background: var(--success-light); color: var(--success);  border: 1px solid var(--success-border); }
.badge-red     { background: var(--danger-light);  color: var(--danger);   border: 1px solid var(--danger-border); }
.badge-purple  { background: var(--purple-light);  color: var(--purple);   border: 1px solid rgba(139,92,246,.35); }
.badge-gray    { background: rgba(255,255,255,.05); color: var(--gray-400); border: 1px solid var(--border-subtle); }

.badge .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: dotBlink 1.8s ease-in-out infinite;
}
@keyframes dotBlink { 0%,100%{opacity:1} 50%{opacity:.3} }

/* Grade badges */
.grade-a1 { background: rgba(16,185,129,.2);  color: #34d399; border: 1px solid rgba(16,185,129,.4); }
.grade-b2 { background: rgba(59,130,246,.2);  color: #60a5fa; border: 1px solid rgba(59,130,246,.4); }
.grade-b3 { background: rgba(99,102,241,.2);  color: #a5b4fc; border: 1px solid rgba(99,102,241,.4); }
.grade-c4 { background: rgba(245,158,11,.15); color: var(--gold-300); border: 1px solid rgba(245,158,11,.35); }
.grade-c5 { background: rgba(245,158,11,.1);  color: var(--gold-200); border: 1px solid rgba(245,158,11,.25); }
.grade-c6 { background: rgba(251,191,36,.1);  color: #fde68a; border: 1px solid rgba(251,191,36,.25); }
.grade-d7 { background: rgba(249,115,22,.15); color: #fb923c; border: 1px solid rgba(249,115,22,.35); }
.grade-e8 { background: rgba(239,68,68,.12);  color: #fca5a5; border: 1px solid rgba(239,68,68,.3); }
.grade-f9 { background: rgba(239,68,68,.2);   color: var(--danger); border: 1px solid var(--danger-border); }

/* ================================================================
   14. FORM ELEMENTS
   ================================================================ */
.form-group { margin-bottom: var(--space-5); }

.form-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--gray-400);
  margin-bottom: var(--space-2);
  letter-spacing: .05em;
  text-transform: uppercase;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--white);
  font-size: var(--text-sm);
  font-family: var(--font-display);
  transition: var(--ease-normal);
}
.form-control:focus {
  border-color: var(--blue-400);
  background: rgba(37,99,176,.1);
  box-shadow: 0 0 0 3px rgba(37,99,176,.2);
}
.form-control::placeholder { color: var(--gray-600); }
.form-control:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* Textarea */
textarea.form-control {
  resize: vertical;
  min-height: 100px;
  line-height: var(--leading-normal);
}

/* Select */
select.form-control {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  padding-right: 40px;
}
select.form-control option { background: var(--blue-800); color: var(--white); }

/* Input with icon */
.input-wrap { position: relative; }
.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-600);
  font-size: 14px;
  pointer-events: none;
}
.input-wrap .form-control { padding-left: 42px; }

.input-action {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-500);
  font-size: 14px;
  cursor: pointer;
  transition: var(--ease-fast);
}
.input-action:hover { color: var(--gray-300); }

/* Checkbox & Radio */
.form-check {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
}
.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 17px;
  height: 17px;
  accent-color: var(--blue-400);
  cursor: pointer;
}

/* Form validation */
.form-control.is-invalid { border-color: var(--danger); }
.form-control.is-valid   { border-color: var(--success); }
.form-hint { font-size: var(--text-xs); margin-top: var(--space-1); color: var(--gray-500); }
.form-error { font-size: var(--text-xs); margin-top: var(--space-1); color: var(--danger); }

/* Role tab switcher on login */
.role-tabs {
  display: flex;
  background: rgba(255,255,255,.04);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: var(--space-6);
  gap: 3px;
}
.role-tab {
  flex: 1;
  padding: 9px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--gray-500);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  transition: var(--ease-normal);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.role-tab.active {
  background: var(--blue-500);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}
.role-tab:not(.active):hover { color: var(--gray-300); background: rgba(255,255,255,.04); }

/* ================================================================
   15. TABLES
   ================================================================ */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-blue);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.table thead tr {
  background: rgba(16, 40, 80, .9);
  border-bottom: 1px solid var(--border-blue);
}

.table thead th {
  padding: 14px 18px;
  text-align: left;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--gray-400);
  letter-spacing: .07em;
  text-transform: uppercase;
  white-space: nowrap;
}

.table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: var(--ease-fast);
}
.table tbody tr:last-child { border-bottom: none; }
.table tbody tr:hover { background: rgba(37, 99, 176, .08); }

.table tbody td {
  padding: 14px 18px;
  color: var(--gray-300);
  vertical-align: middle;
  white-space: nowrap;
}

.table td .avatar {
  width: 34px; height: 34px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--white);
  flex-shrink: 0;
}

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

/* Sortable column */
.col-sort { cursor: pointer; user-select: none; }
.col-sort:hover { color: var(--white); }
.col-sort i { font-size: 10px; margin-left: 5px; opacity: .5; }
.col-sort.asc i, .col-sort.desc i { opacity: 1; color: var(--gold-400); }

/* ================================================================
   16. PAGINATION
   ================================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border-subtle);
  font-size: var(--text-xs);
  color: var(--gray-500);
}

.pagination-info { font-size: var(--text-xs); color: var(--gray-500); }

.page-btns { display: flex; gap: 4px; }
.page-btn {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--gray-400);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border-subtle);
  transition: var(--ease-fast);
  cursor: pointer;
}
.page-btn:hover  { background: rgba(255,255,255,.08); color: var(--white); }
.page-btn.active { background: var(--blue-500); color: var(--white); border-color: var(--blue-400); }
.page-btn:disabled { opacity: .3; cursor: not-allowed; }

/* ================================================================
   17. ADMIN SIDEBAR
   ================================================================ */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--surface-4);
  border-right: 1px solid var(--border-blue);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: var(--ease-slow);
  overflow: hidden;
}

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

.sidebar-brand {
  padding: 18px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
  min-height: var(--navbar-h);
  overflow: hidden;
}
.sidebar-brand .brand-text { white-space: nowrap; overflow: hidden; transition: var(--ease-slow); }
.sidebar.collapsed .sidebar-brand .brand-text { opacity: 0; width: 0; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-4) 0;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: var(--weight-bold);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gray-700);
  padding: var(--space-4) 20px var(--space-2);
  white-space: nowrap;
  overflow: hidden;
  transition: var(--ease-normal);
}
.sidebar.collapsed .sidebar-section-label { opacity: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  color: var(--gray-500);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  transition: var(--ease-fast);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  border-left: 2px solid transparent;
  text-decoration: none;
}
.nav-item:hover {
  color: var(--gray-200);
  background: rgba(255,255,255,.05);
  border-left-color: var(--blue-400);
}
.nav-item.active {
  color: var(--white);
  background: rgba(37, 99, 176, .18);
  border-left-color: var(--gold-400);
}
.nav-item.active .nav-icon { color: var(--gold-400); }
.nav-item.danger:hover { color: var(--danger); border-left-color: var(--danger); }

.nav-icon {
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  font-size: 15px;
}

.nav-label { transition: var(--ease-slow); }
.sidebar.collapsed .nav-label { opacity: 0; width: 0; }

.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  background: var(--blue-500);
  color: var(--white);
  font-size: 10px;
  font-weight: var(--weight-bold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sidebar.collapsed .nav-badge { display: none; }

/* Sidebar footer */
.sidebar-footer {
  padding: var(--space-4) 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}
.sidebar-user-avatar {
  width: 36px; height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--blue-400), var(--gold-400));
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  flex-shrink: 0;
}
.sidebar-user-info { overflow: hidden; transition: var(--ease-slow); white-space: nowrap; }
.sidebar-user-name { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--white); }
.sidebar-user-role { font-size: var(--text-xs); color: var(--gold-400); }
.sidebar.collapsed .sidebar-user-info { opacity: 0; width: 0; }

/* Admin main content */
.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: var(--ease-slow);
}
.admin-main.expanded { margin-left: var(--sidebar-collapsed); }

/* Admin topbar */
.admin-topbar {
  height: var(--navbar-h);
  padding: 0 var(--space-6);
  background: rgba(10, 22, 40, .88);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-blue);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-left { display: flex; align-items: center; gap: var(--space-4); }
.topbar-right { display: flex; align-items: center; gap: var(--space-3); }

.topbar-title { font-size: var(--text-lg); font-weight: var(--weight-bold); color: var(--white); }
.topbar-sub   { font-size: var(--text-xs); color: var(--gray-500); }

.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  min-width: 220px;
}
.topbar-search input {
  border: none;
  background: none;
  color: var(--white);
  font-size: var(--text-sm);
  width: 100%;
}
.topbar-search input::placeholder { color: var(--gray-600); }
.topbar-search i { color: var(--gray-600); font-size: 13px; flex-shrink: 0; }

.topbar-icon-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-400);
  font-size: 15px;
  transition: var(--ease-fast);
  position: relative;
  cursor: pointer;
}
.topbar-icon-btn:hover { background: rgba(255,255,255,.09); color: var(--white); }

.topbar-icon-btn .notif-dot {
  position: absolute;
  top: 7px; right: 7px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--blue-900);
  animation: dotBlink 2s ease-in-out infinite;
}

/* Page content area */
.admin-content { padding: var(--space-6); flex: 1; }

/* Page header */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  gap: var(--space-4);
  flex-wrap: wrap;
}
.page-title { font-size: var(--text-2xl); font-weight: var(--weight-black); color: var(--white); line-height: var(--leading-tight); }
.page-subtitle { font-size: var(--text-sm); color: var(--gray-500); margin-top: var(--space-1); }
.page-actions { display: flex; gap: var(--space-3); flex-wrap: wrap; align-items: center; }

/* Stats grid */
.stats-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); margin-bottom: var(--space-6); }
.stats-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); margin-bottom: var(--space-6); }

/* ================================================================
   18. EXAM ENGINE INTERFACE
   ================================================================ */
.exam-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--blue-900);
}

/* Exam top bar */
.exam-topbar {
  height: 62px;
  padding: 0 var(--space-6);
  background: var(--surface-4);
  border-bottom: 1px solid var(--border-blue);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 200;
}

.exam-subject-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(37,99,176,.2);
  border: 1px solid var(--border-blue);
  border-radius: var(--radius-full);
  padding: 5px 14px;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--blue-200);
  letter-spacing: .06em;
}

/* Timer */
.exam-timer {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--danger-light);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-full);
  padding: 7px 18px;
  font-family: var(--font-mono);
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  color: #f87171;
  letter-spacing: .04em;
}
.exam-timer.warning {
  background: rgba(245,158,11,.15);
  border-color: var(--warning-border);
  color: var(--gold-300);
  animation: timerWarning 1s ease-in-out infinite;
}
@keyframes timerWarning { 0%,100%{opacity:1} 50%{opacity:.7} }
.exam-timer.critical {
  animation: timerCritical .7s ease-in-out infinite;
}
@keyframes timerCritical { 0%,100%{opacity:1} 50%{opacity:.6} }

/* Exam body */
.exam-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Question panel */
.question-panel {
  background: var(--surface-2);
  border: 1px solid var(--border-blue);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
}

.question-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-6);
}
.question-number-badge {
  background: rgba(245,158,11,.15);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-full);
  padding: 5px 14px;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--gold-300);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.question-progress {
  height: 4px;
  background: rgba(255,255,255,.06);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-6);
  overflow: hidden;
}
.question-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--blue-400), var(--gold-400));
  border-radius: var(--radius-full);
  transition: width .4s ease;
}

.question-text {
  font-size: var(--text-md);
  color: var(--gray-200);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-6);
  font-weight: var(--weight-medium);
}

/* Answer options */
.options-list { display: flex; flex-direction: column; gap: 10px; }

.option-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--ease-normal);
  user-select: none;
}
.option-item:hover {
  border-color: rgba(37,99,176,.5);
  background: rgba(37,99,176,.08);
}
.option-item.selected {
  border-color: var(--gold-400);
  background: rgba(245,158,11,.1);
}
.option-item.correct {
  border-color: var(--success);
  background: var(--success-light);
}
.option-item.wrong {
  border-color: var(--danger);
  background: var(--danger-light);
}

.option-letter {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.07);
  border: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  flex-shrink: 0;
  transition: var(--ease-fast);
}
.option-item.selected .option-letter {
  background: var(--gold-400);
  color: var(--blue-900);
  border-color: var(--gold-400);
}
.option-item.correct .option-letter {
  background: var(--success);
  color: var(--white);
  border-color: var(--success);
}
.option-item.wrong .option-letter {
  background: var(--danger);
  color: var(--white);
  border-color: var(--danger);
}

.option-text {
  font-size: var(--text-sm);
  color: var(--gray-300);
  line-height: var(--leading-snug);
  padding-top: 4px;
}
.option-item.selected .option-text { color: var(--white); }

/* Question navigation controls */
.question-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-subtle);
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* Question grid sidebar */
.question-sidebar { display: flex; flex-direction: column; gap: var(--space-4); }

.question-grid-card {
  background: var(--surface-2);
  border: 1px solid var(--border-blue);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
}
.question-grid-title {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--gray-500);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}

.question-dots {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.q-dot {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: var(--weight-semibold);
  font-family: var(--font-mono);
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  background: rgba(255,255,255,.04);
  color: var(--gray-600);
  transition: var(--ease-fast);
}
.q-dot:hover  { border-color: var(--blue-400); color: var(--blue-300); }
.q-dot.answered { background: var(--success-light); border-color: var(--success-border); color: var(--success); }
.q-dot.current  { background: rgba(245,158,11,.2); border-color: var(--gold-400); color: var(--gold-300); }
.q-dot.flagged  { background: rgba(249,115,22,.15); border-color: rgba(249,115,22,.4); color: #fb923c; }
.q-dot.unanswered { }

/* Legend */
.legend { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-3); }
.legend-item { display: flex; align-items: center; gap: 5px; font-size: var(--text-xs); color: var(--gray-500); }
.legend-dot {
  width: 10px; height: 10px;
  border-radius: var(--radius-xs);
}
.legend-dot.answered  { background: var(--success-light); border: 1px solid var(--success-border); }
.legend-dot.current   { background: rgba(245,158,11,.2); border: 1px solid var(--border-gold); }
.legend-dot.flagged   { background: rgba(249,115,22,.15); border: 1px solid rgba(249,115,22,.4); }
.legend-dot.unanswered { background: rgba(255,255,255,.04); border: 1px solid var(--border-subtle); }

/* ================================================================
   19. LOGIN PAGE
   ================================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  position: relative;
  z-index: 10;
}

.login-card {
  background: var(--surface-2);
  border: 1px solid var(--border-blue);
  border-radius: var(--radius-xl);
  padding: var(--space-10);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 440px;
}

.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
}
.login-logo-icon {
  width: 68px; height: 68px;
  background: linear-gradient(135deg, var(--blue-400), var(--gold-400));
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  box-shadow: var(--shadow-gold);
}
.login-logo-title {
  font-size: var(--text-xl);
  font-weight: var(--weight-black);
  background: linear-gradient(90deg, var(--white), var(--gold-300));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.login-logo-sub { font-size: var(--text-xs); color: var(--gray-500); letter-spacing: .08em; text-transform: uppercase; }

.login-divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-5) 0;
  font-size: var(--text-xs);
  color: var(--gray-700);
}
.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.demo-box {
  background: rgba(245,158,11,.07);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  color: var(--gray-400);
  line-height: 1.8;
}
.demo-box strong {
  color: var(--gold-300);
  display: block;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 3px;
}
.demo-box span { color: var(--white); }

/* ================================================================
   20. HERO SECTION
   ================================================================ */
.hero {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: calc(var(--navbar-h) + 40px) var(--space-6) var(--space-16);
}

.hero-inner {
  max-width: var(--container);
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(245,158,11,.1);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-full);
  padding: 6px 16px;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--gold-300);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: var(--space-6);
  width: fit-content;
}

.hero-title {
  font-size: clamp(38px, 5.5vw, 68px);
  font-weight: var(--weight-black);
  line-height: var(--leading-tight);
  letter-spacing: -.02em;
  margin-bottom: var(--space-2);
}

.hero-desc {
  font-size: var(--text-md);
  color: var(--gray-400);
  line-height: var(--leading-relaxed);
  margin: var(--space-5) 0 var(--space-8);
  max-width: 480px;
}

.hero-stats {
  display: flex;
  gap: var(--space-8);
  margin-top: var(--space-10);
  padding-top: var(--space-8);
  border-top: 1px solid var(--border-subtle);
}
.hero-stat-number {
  font-size: var(--text-2xl);
  font-weight: var(--weight-black);
  background: linear-gradient(90deg, var(--white), var(--blue-200));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.hero-stat-label {
  font-size: var(--text-xs);
  color: var(--gray-600);
  font-weight: var(--weight-medium);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-top: 3px;
}

/* ================================================================
   21. FEATURE CARDS (landing)
   ================================================================ */
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-5); }

.feature-card {
  background: var(--surface-1);
  border: 1px solid var(--border-blue);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: var(--ease-normal);
  position: relative;
  overflow: hidden;
}
.feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--blue-400), transparent);
  opacity: 0;
  transition: opacity .3s;
}
.feature-card:hover {
  border-color: rgba(37,99,176,.5);
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}
.feature-card:hover::before { opacity: 1; }

.feature-icon {
  width: 50px; height: 50px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  margin-bottom: var(--space-4);
}
.fi-blue   { background: rgba(37,99,176,.2);   color: var(--blue-300); }
.fi-gold   { background: rgba(245,158,11,.15); color: var(--gold-400); }
.fi-green  { background: var(--success-light); color: var(--success); }
.fi-red    { background: var(--danger-light);  color: var(--danger); }
.fi-purple { background: var(--purple-light);  color: var(--purple); }
.fi-cyan   { background: var(--cyan-light);    color: var(--cyan); }

.feature-title { font-size: var(--text-base); font-weight: var(--weight-bold); margin-bottom: 6px; }
.feature-desc  { font-size: var(--text-xs);   color: var(--gray-500); line-height: var(--leading-relaxed); }

/* ================================================================
   22. MODALS
   ================================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .65);
  backdrop-filter: blur(6px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--surface-3);
  border: 1px solid var(--border-blue);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  width: 100%;
  max-width: 540px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-2xl);
  transform: translateY(16px) scale(.97);
  transition: transform .25s ease;
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }

.modal-lg { max-width: 760px; }
.modal-sm { max-width: 400px; }

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  gap: var(--space-4);
}
.modal-title   { font-size: var(--text-xl); font-weight: var(--weight-bold); color: var(--white); }
.modal-sub     { font-size: var(--text-sm); color: var(--gray-500); margin-top: 3px; }
.modal-close {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-400);
  font-size: 15px;
  transition: var(--ease-fast);
  flex-shrink: 0;
  cursor: pointer;
}
.modal-close:hover { background: var(--danger-light); color: var(--danger); border-color: var(--danger-border); }

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

/* ================================================================
   23. ALERTS & TOASTS
   ================================================================ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
}
.alert-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-text  { line-height: var(--leading-normal); }
.alert-title { font-weight: var(--weight-semibold); margin-bottom: 2px; }

.alert-info    { background: var(--info-light);    border: 1px solid var(--info-border);    color: var(--blue-200); }
.alert-success { background: var(--success-light); border: 1px solid var(--success-border); color: #6ee7b7; }
.alert-warning { background: var(--warning-light); border: 1px solid var(--warning-border); color: var(--gold-200); }
.alert-danger  { background: var(--danger-light);  border: 1px solid var(--danger-border);  color: #fca5a5; }

/* Toast container */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}
.toast {
  background: var(--surface-3);
  border: 1px solid var(--border-blue);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: var(--text-sm);
  color: var(--gray-200);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  pointer-events: all;
  animation: toastSlide .3s ease;
}
@keyframes toastSlide { from { opacity:0; transform: translateX(20px); } to { opacity:1; transform: translateX(0); } }
.toast.success { border-color: var(--success-border); }
.toast.error   { border-color: var(--danger-border); }
.toast.success i { color: var(--success); }
.toast.error   i { color: var(--danger); }

/* ================================================================
   24. PROGRESS BARS
   ================================================================ */
.progress-wrap {
  background: rgba(255,255,255,.06);
  border-radius: var(--radius-full);
  overflow: hidden;
  height: 8px;
}
.progress-bar {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width .5s ease;
}
.pb-blue   { background: linear-gradient(90deg, var(--blue-400), var(--blue-300)); }
.pb-gold   { background: linear-gradient(90deg, var(--gold-500), var(--gold-300)); }
.pb-green  { background: linear-gradient(90deg, var(--success), #34d399); }
.pb-red    { background: linear-gradient(90deg, var(--danger), #f87171); }
.pb-multi  { background: linear-gradient(90deg, var(--blue-400), var(--gold-400)); }

/* ================================================================
   25. RESULT / SCORE CARD
   ================================================================ */
.result-card {
  background: var(--surface-2);
  border: 1px solid var(--border-blue);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.result-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue-400), var(--gold-400), var(--blue-400));
  background-size: 200%;
  animation: shimmer 2.5s linear infinite;
}
@keyframes shimmer { 0%{background-position:0%} 100%{background-position:200%} }

.score-circle {
  width: 140px; height: 140px;
  border-radius: 50%;
  background: conic-gradient(var(--blue-400) calc(var(--pct) * 3.6deg), rgba(255,255,255,.06) 0);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-6);
  position: relative;
}
.score-circle::before {
  content: '';
  position: absolute;
  inset: 10px;
  background: var(--surface-2);
  border-radius: 50%;
}
.score-inner {
  position: relative;
  z-index: 1;
  text-align: center;
}
.score-number { font-size: var(--text-3xl); font-weight: var(--weight-black); color: var(--white); line-height: 1; }
.score-unit   { font-size: var(--text-xs); color: var(--gray-500); }

/* ================================================================
   26. STUDENT DASHBOARD
   ================================================================ */
.student-layout {
  max-width: 900px;
  margin: 0 auto;
  padding: calc(var(--navbar-h) + 32px) var(--space-6) var(--space-10);
  position: relative;
  z-index: 10;
}

.exam-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  background: var(--surface-1);
  border: 1px solid var(--border-blue);
  border-radius: var(--radius-lg);
  transition: var(--ease-normal);
  gap: var(--space-4);
}
.exam-list-item:hover {
  border-color: rgba(37,99,176,.5);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.exam-list-icon {
  width: 46px; height: 46px;
  border-radius: var(--radius-md);
  background: rgba(37,99,176,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  color: var(--blue-300);
  flex-shrink: 0;
}
.exam-list-info { flex: 1; min-width: 0; }
.exam-list-title { font-size: var(--text-base); font-weight: var(--weight-semibold); color: var(--white); }
.exam-list-meta  { font-size: var(--text-xs); color: var(--gray-500); margin-top: 2px; display: flex; gap: 12px; flex-wrap: wrap; }
.exam-list-meta span { display: flex; align-items: center; gap: 5px; }

/* ================================================================
   27. UPLOAD / FILE INPUT
   ================================================================ */
.upload-zone {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-10) var(--space-6);
  text-align: center;
  cursor: pointer;
  transition: var(--ease-normal);
}
.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--blue-400);
  background: rgba(37,99,176,.07);
}
.upload-icon { font-size: 40px; color: var(--gray-600); margin-bottom: var(--space-4); }
.upload-title { font-size: var(--text-base); font-weight: var(--weight-semibold); color: var(--gray-300); margin-bottom: var(--space-2); }
.upload-desc  { font-size: var(--text-xs); color: var(--gray-600); }
.upload-accepted { font-size: var(--text-xs); color: var(--gold-500); margin-top: 6px; }

/* ================================================================
   28. SCROLL ANIMATIONS
   ================================================================ */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .55s ease, transform .55s ease;
}
.fade-up.visible { opacity: 1; transform: translateY(0); }

.fade-in {
  opacity: 0;
  transition: opacity .5s ease;
}
.fade-in.visible { opacity: 1; }

.slide-left {
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity .5s ease, transform .5s ease;
}
.slide-left.visible { opacity: 1; transform: translateX(0); }

/* Stagger delays */
.delay-1 { transition-delay: .1s; }
.delay-2 { transition-delay: .2s; }
.delay-3 { transition-delay: .3s; }
.delay-4 { transition-delay: .4s; }
.delay-5 { transition-delay: .5s; }

/* ================================================================
   29. PRINT STYLES
   ================================================================ */
@media print {
  body {
    background: white;
    color: black;
  }
  body::before, body::after { display: none; }
  .sidebar, .admin-topbar, .navbar,
  .no-print, .btn-primary, .btn-secondary { display: none !important; }
  .admin-main { margin-left: 0 !important; }
  .card, .stat-card {
    background: white;
    border: 1px solid #e2e8f0;
    box-shadow: none;
  }
  .table { font-size: 12px; }
  .table tbody tr { border-bottom: 1px solid #e2e8f0; }
  .page-break { page-break-after: always; }
  h1,h2,h3 { color: #0a1628; }
  p, td, th { color: #1e293b; }

  /* Result slip print */
  .print-result {
    max-width: 700px;
    margin: 0 auto;
    font-family: 'Sora', sans-serif;
  }
  .print-header { text-align: center; padding-bottom: 16px; border-bottom: 2px solid #0a1628; }
  .print-school-name { font-size: 22px; font-weight: 800; color: #0a1628; }
  .print-title { font-size: 14px; color: #475569; letter-spacing: .1em; text-transform: uppercase; }
}

/* ================================================================
   30. RESPONSIVE BREAKPOINTS
   ================================================================ */

/* Large tablets / small desktops */
@media (max-width: 1100px) {
  .stats-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .exam-body { grid-template-columns: 1fr 240px; }
}

/* Tablets */
@media (max-width: 900px) {
  .hero-inner     { grid-template-columns: 1fr; gap: var(--space-12); text-align: center; }
  .hero-badge     { margin: 0 auto var(--space-6); }
  .hero-desc      { max-width: 100%; }
  .hero-actions   { justify-content: center; }
  .hero-stats     { justify-content: center; }
  .hero-visual    { display: none; }

  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); }
  .admin-main { margin-left: 0 !important; }

  .exam-body      { grid-template-columns: 1fr; }
  .question-sidebar { display: none; }

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

/* Mobile */
@media (max-width: 640px) {
  :root { --space-6: 16px; }

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

  .nav-links      { display: none; }

  .login-card     { padding: var(--space-6); }

  .question-panel { padding: var(--space-5); }

  .admin-content  { padding: var(--space-4); }

  .page-header    { flex-direction: column; }
  .page-actions   { width: 100%; }

  .topbar-search  { display: none; }

  .hero-stats     { gap: var(--space-5); flex-wrap: wrap; }
  .table-wrapper  { border-radius: var(--radius-md); }

  .modal          { padding: var(--space-6); }
  .toast-container { bottom: 12px; right: 12px; left: 12px; }
  .toast          { min-width: unset; width: 100%; }
}

/* Very small screens */
@media (max-width: 380px) {
  .hero-title { font-size: 30px; }
  .hero-actions { flex-direction: column; }
  .btn-primary, .btn-secondary { width: 100%; justify-content: center; }
  .stats-grid-4 { grid-template-columns: 1fr; }
}
