/* ═══════════════════════════════════════════════════════════════════
   TopicWisePYQs — Premium Design System
   Designed by DevGagan | Version 2.0
   Palette: Deep Cosmic Navy × Electric Amber × Jade Green
   ═══════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Syne:wght@700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── DESIGN TOKENS ─────────────────────────────────────────────── */
:root {
  /* DARK THEME (default) */
  --bg0: #080c14;
  --bg1: #0d1321;
  --bg2: #111827;
  --bg3: #1a2234;
  --bg4: #1e2940;
  --bg5: #243050;

  --primary:   #f59e0b;
  --primary2:  #fbbf24;
  --primary3:  #fde68a;
  --primary-bg:#1f1500;

  --accent:    #10b981;
  --accent2:   #34d399;
  --accent-bg: #001a0f;

  --blue:      #3b82f6;
  --blue2:     #60a5fa;
  --blue-bg:   #0a1628;

  --red:       #ef4444;
  --red2:      #f87171;
  --orange:    #f97316;
  --purple:    #a855f7;

  --text:      #f1f5f9;
  --text2:     #94a3b8;
  --text3:     #64748b;
  --text4:     #475569;

  --border:    rgba(255,255,255,.08);
  --border2:   rgba(255,255,255,.14);

  --shadow-sm: 0 2px 8px rgba(0,0,0,.4);
  --shadow:    0 4px 24px rgba(0,0,0,.5);
  --shadow-lg: 0 8px 48px rgba(0,0,0,.65);
  --shadow-glow: 0 0 30px rgba(245,158,11,.15);

  --radius:    14px;
  --radius-sm: 8px;
  --radius-xs: 5px;
  --radius-xl: 20px;
  --radius-2xl:28px;
  --radius-full: 9999px;

  --font: 'Space Grotesk', -apple-system, sans-serif;
  --font-display: 'Syne', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --nav-h: 68px;
  --sidebar-w: 260px;
  --transition: 0.22s cubic-bezier(0.4,0,0.2,1);

  /* GLOW EFFECTS */
  --glow-amber: 0 0 40px rgba(245,158,11,.2), 0 0 80px rgba(245,158,11,.08);
  --glow-green: 0 0 40px rgba(16,185,129,.2);
  --glow-blue:  0 0 40px rgba(59,130,246,.2);
}

[data-theme="light"] {
  --bg0: #f0f4ff;
  --bg1: #ffffff;
  --bg2: #f8faff;
  --bg3: #eef2ff;
  --bg4: #e4e9f7;
  --bg5: #d8e0f0;

  --text:  #0f172a;
  --text2: #334155;
  --text3: #64748b;
  --text4: #94a3b8;

  --border:  rgba(0,0,0,.07);
  --border2: rgba(0,0,0,.12);

  --shadow-sm: 0 2px 8px rgba(0,0,0,.06);
  --shadow:    0 4px 24px rgba(0,0,0,.1);
  --shadow-lg: 0 8px 48px rgba(0,0,0,.15);

  --primary-bg: #fffbeb;
  --accent-bg:  #ecfdf5;
  --blue-bg:    #eff6ff;
}

/* ── BASE RESET ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg0);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

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

/* ── SCROLLBAR ──────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg1); }
::-webkit-scrollbar-thumb { background: var(--bg5); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ── TYPOGRAPHY ─────────────────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 { font-family: var(--font-display); font-weight: 800; line-height: 1.2; }
.display-font { font-family: var(--font-display); }
.mono { font-family: var(--font-mono); }

/* ── NAVBAR ─────────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(8,12,20,.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 max(20px, calc((100vw - 1280px) / 2));
  gap: 20px;
  transition: all var(--transition);
}
[data-theme="light"] .navbar {
  background: rgba(255,255,255,.92);
}
.navbar.scrolled {
  box-shadow: var(--shadow);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  flex-shrink: 0;
}
.nav-logo svg { flex-shrink: 0; }
.nav-logo .logo-dot { color: var(--primary); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  padding-left: 32px;
}
.nav-link {
  padding: 7px 14px;
  border-radius: var(--radius-xs);
  font-size: .9rem;
  font-weight: 500;
  color: var(--text2);
  transition: all var(--transition);
  position: relative;
}
.nav-link:hover, .nav-link.active {
  color: var(--text);
  background: var(--bg3);
}
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 50%; transform: translateX(-50%);
  width: 16px; height: 2px;
  background: var(--primary);
  border-radius: 99px;
}

.nav-end {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

/* ── BUTTONS ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  border: none;
  transition: all var(--transition);
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: white;
  opacity: 0;
  transition: opacity .15s;
}
.btn:hover::after { opacity: .05; }
.btn:active { transform: scale(.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #d97706);
  color: #000;
  box-shadow: 0 4px 15px rgba(245,158,11,.35);
}
.btn-primary:hover { box-shadow: 0 6px 25px rgba(245,158,11,.5); transform: translateY(-1px); }

.btn-accent {
  background: linear-gradient(135deg, var(--accent), #059669);
  color: #fff;
  box-shadow: 0 4px 15px rgba(16,185,129,.3);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border2);
  color: var(--text2);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }

.btn-ghost {
  background: transparent;
  color: var(--text2);
  padding: 8px 14px;
}
.btn-ghost:hover { background: var(--bg3); color: var(--text); }

.btn-danger {
  background: var(--red);
  color: #fff;
}
.btn-danger:hover { background: #dc2626; }

.btn-sm { padding: 7px 14px; font-size: .82rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; border-radius: var(--radius); }
.btn-icon { padding: 8px; width: 36px; height: 36px; justify-content: center; border-radius: var(--radius-xs); }
.btn-icon.btn-sm { width: 30px; height: 30px; padding: 6px; }

/* ── CARDS ──────────────────────────────────────────────────────── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.card:hover { border-color: var(--border2); }
.card-glow:hover { box-shadow: var(--glow-amber); border-color: rgba(245,158,11,.3); }
.card-sm { padding: 16px; border-radius: var(--radius-sm); }

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── GLASS CARD ─────────────────────────────────────────────────── */
.glass {
  background: rgba(255,255,255,.04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.08);
}
[data-theme="light"] .glass {
  background: rgba(255,255,255,.7);
  border-color: rgba(0,0,0,.07);
}

/* ── INPUTS ─────────────────────────────────────────────────────── */
.inp {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .9rem;
  transition: all var(--transition);
  outline: none;
}
.inp:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(245,158,11,.12); }
.inp::placeholder { color: var(--text4); }
textarea.inp { min-height: 100px; resize: vertical; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: .82rem; font-weight: 600; color: var(--text2); margin-bottom: 6px; }
.form-group .hint { font-size: .77rem; color: var(--text3); margin-top: 4px; }

/* ── BADGE / TAG ────────────────────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: .73rem;
  font-weight: 600;
  letter-spacing: .02em;
}
.tag-amber  { background: rgba(245,158,11,.15); color: var(--primary); border: 1px solid rgba(245,158,11,.2); }
.tag-green  { background: rgba(16,185,129,.12);  color: var(--accent);  border: 1px solid rgba(16,185,129,.2); }
.tag-blue   { background: rgba(59,130,246,.12);  color: var(--blue);    border: 1px solid rgba(59,130,246,.2); }
.tag-red    { background: rgba(239,68,68,.12);   color: var(--red);     border: 1px solid rgba(239,68,68,.2); }
.tag-gray   { background: var(--bg4);            color: var(--text3);   border: 1px solid var(--border); }
.tag-purple { background: rgba(168,85,247,.12);  color: var(--purple);  border: 1px solid rgba(168,85,247,.2); }

/* ── ALERT ──────────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  margin-bottom: 16px;
}
.alert-success { background: var(--accent-bg); border: 1px solid rgba(16,185,129,.25); color: var(--accent2); }
.alert-danger  { background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.2); color: var(--red2); }
.alert-info    { background: var(--blue-bg); border: 1px solid rgba(59,130,246,.2); color: var(--blue2); }
.alert-warning { background: var(--primary-bg); border: 1px solid rgba(245,158,11,.2); color: var(--primary2); }

/* ── TABLES ─────────────────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
thead tr { background: var(--bg3); }
th {
  text-align: left;
  padding: 11px 14px;
  font-size: .77rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text3);
  white-space: nowrap;
}
td { padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg3); }

/* ── MODALS ─────────────────────────────────────────────────────── */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(6px);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.modal-bg.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-xl);
  padding: 28px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(.96) translateY(8px);
  transition: transform .22s cubic-bezier(0.34,1.56,0.64,1);
}
.modal-bg.open .modal { transform: scale(1) translateY(0); }
.modal-lg { max-width: 780px; }

.modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 1.1rem; font-weight: 700; }
.modal-close {
  margin-left: auto;
  width: 32px; height: 32px;
  border-radius: var(--radius-xs);
  background: var(--bg4);
  border: none;
  color: var(--text2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 1rem;
}
.modal-close:hover { background: var(--red); color: #fff; }

/* ── EMPTY STATE ────────────────────────────────────────────────── */
.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text3);
}
.empty svg, .empty i { font-size: 2.5rem; margin-bottom: 12px; opacity: .4; }
.empty p { font-size: .9rem; }

/* ── PROGRESS BAR ───────────────────────────────────────────────── */
.progress { background: var(--bg4); border-radius: 99px; height: 6px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width .6s ease; }

/* ── STAT CARDS ─────────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all var(--transition);
}
.stat-card:hover { border-color: var(--primary); box-shadow: var(--shadow-glow); transform: translateY(-2px); }
.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.stat-icon.amber { background: rgba(245,158,11,.15); color: var(--primary); }
.stat-icon.green { background: rgba(16,185,129,.12);  color: var(--accent); }
.stat-icon.blue  { background: rgba(59,130,246,.12);  color: var(--blue); }
.stat-icon.red   { background: rgba(239,68,68,.12);   color: var(--red); }
.stat-icon.purple{ background: rgba(168,85,247,.12);  color: var(--purple); }
.stat-val   { font-size: 1.7rem; font-weight: 800; font-family: var(--font-display); line-height: 1; }
.stat-label { font-size: .78rem; color: var(--text3); margin-top: 3px; }

/* ── QUIZ OPTIONS ───────────────────────────────────────────────── */
.opt-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 10px;
}
.opt-label:hover { border-color: var(--primary); background: var(--primary-bg); }
.opt-label.selected { border-color: var(--primary); background: rgba(245,158,11,.08); }
.opt-label.correct  { border-color: var(--accent);  background: rgba(16,185,129,.08); }
.opt-label.wrong    { border-color: var(--red);      background: rgba(239,68,68,.08); }
.opt-key {
  width: 28px; height: 28px;
  border-radius: var(--radius-xs);
  background: var(--bg4);
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 700;
  flex-shrink: 0;
  transition: all var(--transition);
}
.opt-label.selected .opt-key { background: var(--primary); color: #000; }
.opt-label.correct .opt-key  { background: var(--accent); color: #fff; }
.opt-label.wrong .opt-key    { background: var(--red); color: #fff; }
.opt-text { flex: 1; font-size: .9rem; line-height: 1.5; }

/* ── QUIZ TIMER ─────────────────────────────────────────────────── */
.quiz-timer {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--primary);
  background: var(--primary-bg);
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(245,158,11,.2);
}
.quiz-timer.danger { color: var(--red); background: rgba(239,68,68,.08); border-color: rgba(239,68,68,.2); animation: pulse-red 1s infinite; }

@keyframes pulse-red { 0%,100% { opacity: 1; } 50% { opacity: .6; } }

/* ── LEADERBOARD ────────────────────────────────────────────────── */
.leaderboard-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius-sm); margin-bottom: 8px; background: var(--bg3); transition: all var(--transition); }
.leaderboard-row:hover { background: var(--bg4); transform: translateX(4px); }
.leaderboard-rank { width: 36px; text-align: center; font-family: var(--font-display); font-size: 1.1rem; font-weight: 800; }
.lb-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--bg5); overflow: hidden; flex-shrink: 0; }
.lb-info { flex: 1; }
.lb-name { font-weight: 600; font-size: .92rem; }
.lb-meta { font-size: .77rem; color: var(--text3); }
.lb-score { font-family: var(--font-display); font-size: 1.1rem; font-weight: 800; color: var(--primary); }

/* ── NOTIFICATION BADGE ─────────────────────────────────────────── */
.notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 18px; height: 18px;
  background: var(--red);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  border-radius: 99px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg1);
  animation: notif-pop .3s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes notif-pop { from { transform: scale(0); } to { transform: scale(1); } }

/* ── BREADCRUMB ─────────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  color: var(--text3);
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.breadcrumb a { color: var(--text3); transition: color var(--transition); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { opacity: .4; font-size: .7rem; }

/* ── SKELETON ───────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg3) 25%, var(--bg4) 50%, var(--bg3) 75%);
  background-size: 200% 100%;
  animation: skeleton-wave 1.5s infinite;
  border-radius: var(--radius-xs);
}
@keyframes skeleton-wave { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── HERO SECTION ───────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-top: var(--nav-h);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 80% at 50% -20%, rgba(245,158,11,.15) 0%, transparent 60%),
              radial-gradient(ellipse 60% 60% at 80% 80%, rgba(16,185,129,.08) 0%, transparent 50%),
              radial-gradient(ellipse 50% 50% at 20% 60%, rgba(59,130,246,.06) 0%, transparent 50%);
}

.hero-grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

/* ── SECTION LAYOUT ─────────────────────────────────────────────── */
.section { padding: 90px max(20px, calc((100vw - 1280px) / 2)); }
.section-sm { padding: 60px max(20px, calc((100vw - 1280px) / 2)); }
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-bg);
  border: 1px solid rgba(245,158,11,.2);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 18px;
}
.section-title { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; margin-bottom: 14px; }
.section-desc { font-size: 1.05rem; color: var(--text2); max-width: 580px; line-height: 1.7; }

/* ── FLOATING ELEMENTS ──────────────────────────────────────────── */
.float-1 { animation: float1 6s ease-in-out infinite; }
.float-2 { animation: float2 8s ease-in-out infinite; }
.float-3 { animation: float3 7s ease-in-out infinite; }
@keyframes float1 { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-16px); } }
@keyframes float2 { 0%,100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-12px) rotate(5deg); } }
@keyframes float3 { 0%,100% { transform: translateY(-8px); } 50% { transform: translateY(8px); } }

/* ── ADMIN LAYOUT ───────────────────────────────────────────────── */
.admin-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg1);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: .95rem;
  font-weight: 800;
}

.sidebar-section-label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text4);
  padding: 18px 18px 6px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  font-size: .88rem;
  font-weight: 500;
  color: var(--text3);
  transition: all var(--transition);
  border-radius: 0;
  margin: 1px 8px;
  border-radius: var(--radius-sm);
}
.sidebar-link:hover { color: var(--text); background: var(--bg3); }
.sidebar-link.active { color: var(--primary); background: var(--primary-bg); font-weight: 600; }
.sidebar-link.active svg, .sidebar-link.active i { color: var(--primary); }
.sidebar-link i, .sidebar-link svg { font-size: .95rem; width: 18px; flex-shrink: 0; opacity: .7; }
.sidebar-link.active i { opacity: 1; }

.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  height: 60px;
  background: var(--bg1);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.admin-page-title { font-size: 1rem; font-weight: 700; }

.admin-content { padding: 24px; flex: 1; }

/* ── THEME TOGGLE ───────────────────────────────────────────────── */
.theme-toggle {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  background: var(--bg3);
  border: 1.5px solid var(--border);
  color: var(--text2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  font-size: .95rem;
}
.theme-toggle:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }

/* ── SEARCH ─────────────────────────────────────────────────────── */
.search-wrap { position: relative; }
.search-wrap .inp { padding-left: 38px; }
.search-wrap .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text3); font-size: .9rem; pointer-events: none; }

/* ── DROPDOWN ───────────────────────────────────────────────────── */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  min-width: 200px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scale(.97);
  transition: all .18s cubic-bezier(0.4,0,0.2,1);
  z-index: 200;
}
.dropdown-menu.open { opacity: 1; pointer-events: all; transform: translateY(0) scale(1); }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font-size: .88rem;
  color: var(--text2);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition);
}
.dropdown-item:hover { background: var(--bg3); color: var(--text); }
.dropdown-item.danger { color: var(--red); }
.dropdown-item.danger:hover { background: rgba(239,68,68,.08); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ── FOOTER ─────────────────────────────────────────────────────── */
footer {
  background: var(--bg1);
  border-top: 1px solid var(--border);
  padding: 60px max(20px, calc((100vw - 1280px) / 2)) 30px;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 48px; }
.footer-brand .logo { margin-bottom: 14px; }
.footer-desc { font-size: .88rem; color: var(--text3); line-height: 1.7; max-width: 280px; }
.footer-col h4 { font-size: .85rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text2); margin-bottom: 16px; }
.footer-col a { display: block; font-size: .88rem; color: var(--text3); padding: 4px 0; transition: color var(--transition); }
.footer-col a:hover { color: var(--primary); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 24px; display: flex; align-items: center; justify-content: space-between; font-size: .82rem; color: var(--text3); flex-wrap: wrap; gap: 12px; }
.footer-social { display: flex; gap: 10px; }
.social-icon { width: 34px; height: 34px; border-radius: var(--radius-sm); background: var(--bg3); border: 1px solid var(--border); color: var(--text3); display: flex; align-items: center; justify-content: center; font-size: .9rem; transition: all var(--transition); }
.social-icon:hover { background: var(--primary); border-color: var(--primary); color: #000; }

/* ── TESTIMONIAL CARD ───────────────────────────────────────────── */
.testimonial-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  transition: all var(--transition);
}
.testimonial-card:hover { border-color: rgba(245,158,11,.3); box-shadow: var(--shadow-glow); }
.t-stars { display: flex; gap: 4px; color: var(--primary); font-size: .9rem; margin-bottom: 14px; }
.t-content { font-size: .92rem; line-height: 1.7; color: var(--text2); margin-bottom: 18px; }
.t-author { display: flex; align-items: center; gap: 12px; }
.t-avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--bg4); overflow: hidden; }
.t-name { font-weight: 700; font-size: .9rem; }
.t-role { font-size: .78rem; color: var(--text3); }

/* ── RESULT SCREEN ──────────────────────────────────────────────── */
.result-circle {
  width: 140px; height: 140px;
  border-radius: 50%;
  border: 6px solid var(--bg4);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  position: relative;
  margin: 0 auto 24px;
}
.result-circle.pass { border-color: var(--accent); box-shadow: 0 0 30px rgba(16,185,129,.25); }
.result-circle.fail { border-color: var(--red); box-shadow: 0 0 30px rgba(239,68,68,.15); }
.result-pct { font-family: var(--font-display); font-size: 2rem; font-weight: 800; line-height: 1; }
.result-label { font-size: .75rem; color: var(--text3); margin-top: 4px; }

/* ── PWA INSTALL BANNER ─────────────────────────────────────────── */
.pwa-banner {
  position: fixed;
  bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--bg2);
  border: 1px solid var(--primary);
  border-radius: var(--radius-xl);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  z-index: 999;
  max-width: 380px;
  width: calc(100% - 40px);
  animation: slide-up .4s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes slide-up { from { transform: translateX(-50%) translateY(100px); opacity: 0; } to { transform: translateX(-50%) translateY(0); opacity: 1; } }
.pwa-banner.hidden { display: none; }

/* ── COURSE CARD ────────────────────────────────────────────────── */
.course-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}
.course-card:hover { border-color: rgba(245,158,11,.3); box-shadow: var(--shadow-glow); transform: translateY(-4px); }
.course-thumb { height: 160px; background: var(--bg4); position: relative; overflow: hidden; }
.course-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.course-card:hover .course-thumb img { transform: scale(1.05); }
.course-body { padding: 18px; flex: 1; display: flex; flex-direction: column; }
.course-tag { margin-bottom: 10px; }
.course-title { font-size: .95rem; font-weight: 700; margin-bottom: 8px; }
.course-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: .78rem; color: var(--text3); margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); }
.course-meta span { display: flex; align-items: center; gap: 4px; }

/* ── MOBILE MENU ────────────────────────────────────────────────── */
.mobile-menu-btn {
  display: none;
  width: 38px; height: 38px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.mobile-menu-btn span { display: block; width: 18px; height: 2px; background: var(--text2); border-radius: 2px; transition: all .25s; }

.mobile-nav {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  background: var(--bg1);
  border-bottom: 1px solid var(--border);
  padding: 12px;
  flex-direction: column;
  gap: 4px;
  z-index: 990;
  box-shadow: var(--shadow-lg);
}
.mobile-nav.open { display: flex; }
.mobile-nav .nav-link { width: 100%; }

/* ── RESPONSIVE ─────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 99; display: none; }
  .sidebar-overlay.show { display: block; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .mobile-menu-btn { display: flex; }
  .section, footer { padding-left: 16px; padding-right: 16px; }
  .section { padding-top: 60px; padding-bottom: 60px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .modal { padding: 20px; }
  .admin-content { padding: 16px; }
  .admin-topbar { padding: 0 16px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .btn-lg { padding: 12px 22px; }
}

/* ── UTILITY ────────────────────────────────────────────────────── */
.text-primary { color: var(--primary); }
.text-accent  { color: var(--accent); }
.text-muted   { color: var(--text3); }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.fw-700       { font-weight: 700; }
.fw-800       { font-weight: 800; }
.d-flex       { display: flex; }
.align-center { align-items: center; }
.gap-8        { gap: 8px; }
.gap-12       { gap: 12px; }
.gap-16       { gap: 16px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.p-0   { padding: 0; }
.hidden { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ── ANIMATIONS ─────────────────────────────────────────────────── */
@keyframes fade-in-up { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade-in    { from { opacity: 0; } to { opacity: 1; } }
@keyframes scale-in   { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: scale(1); } }
@keyframes spin       { to { transform: rotate(360deg); } }
@keyframes bounce-in  { 0% { transform: scale(0); } 70% { transform: scale(1.1); } 100% { transform: scale(1); } }

.anim-fade-up { animation: fade-in-up .5s ease both; }
.anim-fade    { animation: fade-in .4s ease both; }
.anim-scale   { animation: scale-in .3s ease both; }

/* Staggered children */
.stagger > * { animation: fade-in-up .5s ease both; }
.stagger > *:nth-child(1) { animation-delay: .05s; }
.stagger > *:nth-child(2) { animation-delay: .1s; }
.stagger > *:nth-child(3) { animation-delay: .15s; }
.stagger > *:nth-child(4) { animation-delay: .2s; }
.stagger > *:nth-child(5) { animation-delay: .25s; }
.stagger > *:nth-child(6) { animation-delay: .3s; }

/* ── SPINNER ─────────────────────────────────────────────────────── */
.spinner { width: 20px; height: 20px; border: 2.5px solid var(--border2); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
.spinner-lg { width: 36px; height: 36px; border-width: 3px; }

/* ── QUIZ PROGRESS NAV ──────────────────────────────────────────── */
.q-nav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); gap: 6px; }
.q-nav-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-xs);
  border: 1.5px solid var(--border);
  background: var(--bg3);
  color: var(--text3);
  font-size: .8rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}
.q-nav-btn.answered { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); }
.q-nav-btn.current  { background: var(--primary); border-color: var(--primary); color: #000; }
.q-nav-btn:hover    { border-color: var(--primary); color: var(--primary); }

/* ── PRINT STYLES ───────────────────────────────────────────────── */
@media print {
  .navbar, .sidebar, footer, .btn, .modal-bg { display: none !important; }
  .admin-main { margin: 0; }
  body { background: #fff; color: #000; }
}

/* ── FOCUS VISIBLE ──────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}
