/* ============================================================
   GénoLab Platform — Design System
   Dark professional theme · Figtree + Noto Sans
============================================================ */

:root {
  --bg: #070D1B;
  --surface: #0D1526;
  --card: #111E30;
  --card-hover: #172540;
  --border: #1A2D45;
  --border-hover: #2A4060;

  --primary: #3B82F6;
  --primary-dark: #2563EB;
  --primary-light: #60A5FA;
  --primary-glow: rgba(59,130,246,0.12);
  --secondary: #8B5CF6;
  --secondary-glow: rgba(139,92,246,0.12);
  --accent: #06B6D4;
  --success: #10B981;
  --success-glow: rgba(16,185,129,0.12);
  --warning: #F59E0B;
  --warning-glow: rgba(245,158,11,0.12);
  --danger: #EF4444;
  --danger-glow: rgba(239,68,68,0.12);

  --text: #E8F0FE;
  --text-muted: #8EA9CC;
  --text-faint: #445E7A;

  --heading: 'Figtree', sans-serif;
  --body: 'Noto Sans', sans-serif;

  --r: 14px;
  --r-sm: 10px;
  --r-lg: 18px;
  --r-xl: 22px;

  --shadow: 0 1px 3px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.2);
  --shadow-lg: 0 4px 16px rgba(0,0,0,.5), 0 24px 48px rgba(0,0,0,.3);
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--body);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 60% 50% at 10% 0%, rgba(59,130,246,.07) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 90% 100%, rgba(139,92,246,.05) 0%, transparent 60%);
}
button { font-family: var(--body); cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: var(--body); }
.hidden { display: none !important; }
h1,h2,h3,h4,h5,h6 { font-family: var(--heading); line-height: 1.2; }

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

/* ===== LAYOUT ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.section { padding: 60px 0; }
.section-sm { padding: 40px 0 80px; }
.w-full { width: 100%; }

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.5} }
@keyframes shimmer {
  from { background-position: -600px 0; }
  to { background-position: 600px 0; }
}

#view-home { animation: fadeUp .45s ease; }
#view-courses { animation: fadeUp .35s ease; }
#view-course-detail { animation: fadeUp .35s ease; }
#view-register { animation: fadeUp .3s ease; }
#view-quiz { animation: fadeIn .25s ease; }
#view-result { animation: fadeUp .4s ease; }
#view-open { animation: fadeUp .35s ease; }
#view-admin-login { animation: fadeUp .3s ease; }
#view-admin { animation: fadeUp .35s ease; }

/* ===== NAVBAR ===== */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(7,13,27,.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.navbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.brand-logo {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: grid; place-items: center;
  box-shadow: 0 4px 14px rgba(59,130,246,.3);
}
.brand-name { font-family: var(--heading); font-size: 19px; font-weight: 700; color: var(--text); }
.brand-sub { font-size: 10.5px; color: var(--text-muted); margin-top: -2px; display: block; }
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-link {
  padding: 7px 13px; border-radius: 8px; font-size: 14px; font-weight: 500;
  color: var(--text-muted); transition: all .15s; cursor: pointer;
}
.nav-link:hover, .nav-link.active { color: var(--text); background: rgba(255,255,255,.05); }
.nav-right { display: flex; align-items: center; gap: 10px; }
@media (max-width: 700px) { .nav-links { display: none; } }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px; padding: 10px 20px; border-radius: 10px;
  font-weight: 600; font-size: 14px;
  transition: all .18s; cursor: pointer; white-space: nowrap;
}
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }
.btn-primary {
  background: var(--primary); color: #fff;
  box-shadow: 0 4px 14px rgba(59,130,246,.3);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark); transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(59,130,246,.4);
}
.btn-secondary {
  background: var(--secondary); color: #fff;
  box-shadow: 0 4px 14px rgba(139,92,246,.25);
}
.btn-secondary:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-1px); }
.btn-ghost {
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) {
  color: var(--text); border-color: var(--border-hover);
  background: rgba(255,255,255,.04);
}
.btn-danger { background: transparent; color: var(--danger); border: 1px solid rgba(239,68,68,.25); }
.btn-danger:hover:not(:disabled) { background: var(--danger-glow); border-color: var(--danger); }
.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 13px 28px; font-size: 16px; border-radius: 12px; }

/* ===== CARD ===== */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow);
}
.card-hover { transition: all .2s; cursor: pointer; }
.card-hover:hover {
  border-color: var(--border-hover); transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

/* ===== BADGE ===== */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: 99px;
  font-size: 12px; font-weight: 600;
}
.badge-blue { background: var(--primary-glow); color: #93C5FD; border: 1px solid rgba(59,130,246,.2); }
.badge-green { background: var(--success-glow); color: #6EE7B7; border: 1px solid rgba(16,185,129,.2); }
.badge-purple { background: var(--secondary-glow); color: #C4B5FD; border: 1px solid rgba(139,92,246,.2); }
.badge-yellow { background: var(--warning-glow); color: #FCD34D; border: 1px solid rgba(245,158,11,.2); }
.badge-red { background: var(--danger-glow); color: #FCA5A5; border: 1px solid rgba(239,68,68,.2); }
.badge-cyan { background: rgba(6,182,212,.1); color: #67E8F9; border: 1px solid rgba(6,182,212,.2); }

/* ===== FORM ===== */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block; font-size: 12.5px; font-weight: 600;
  color: var(--text-muted); margin-bottom: 7px; letter-spacing: .3px;
  text-transform: uppercase;
}
.form-input {
  width: 100%; padding: 11px 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font-size: 15px; transition: all .15s;
}
.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.form-input::placeholder { color: var(--text-faint); }
.form-error { font-size: 13px; color: var(--danger); margin-top: 7px; min-height: 20px; }
.info-box {
  padding: 13px 16px;
  background: var(--primary-glow); border: 1px solid rgba(59,130,246,.2);
  border-radius: 10px; font-size: 13.5px; color: var(--text-muted); margin: 16px 0;
}
.info-box b { color: var(--text); }

/* ===== PROGRESS ===== */
.progress { height: 5px; background: var(--surface); border-radius: 99px; overflow: hidden; }
.progress-bar {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width .3s ease;
}

/* ===== DIVIDER ===== */
.divider { height: 1px; background: var(--border); margin: 24px 0; }

/* ===== SECTION HEADER ===== */
.section-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 28px;
}
.section-title { font-size: 26px; font-weight: 700; color: var(--text); }
.section-sub { font-size: 14px; color: var(--text-muted); margin-top: 4px; }

/* ===== BREADCRUMB ===== */
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--text-muted); margin-bottom: 24px;
}
.breadcrumb-item { cursor: pointer; transition: color .15s; }
.breadcrumb-item:hover { color: var(--primary); }
.breadcrumb-sep { color: var(--text-faint); }
.breadcrumb-current { color: var(--text); font-weight: 600; }

/* =====================================================
   HOME / HERO
===================================================== */
.hero { padding: 72px 0 56px; position: relative; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 14px;
  background: var(--primary-glow); border: 1px solid rgba(59,130,246,.25);
  border-radius: 99px; font-size: 13px; font-weight: 600; color: #93C5FD;
  margin-bottom: 22px;
}
.hero-title {
  font-family: var(--heading); font-size: clamp(36px, 5.5vw, 62px);
  font-weight: 800; line-height: 1.05; letter-spacing: -1.5px; margin-bottom: 18px;
}
.highlight {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero-desc {
  font-size: 17px; color: var(--text-muted); max-width: 530px;
  margin-bottom: 32px; line-height: 1.7;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 52px; }
.hero-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 14px; padding-top: 28px; border-top: 1px solid var(--border);
}
@media (max-width: 760px) {
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 48px 0 36px; }
}
.hero-stat {
  padding: 18px 20px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r);
}
.hero-stat-val { font-family: var(--heading); font-size: 26px; font-weight: 800; }
.hero-stat-label { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; }

/* Majors Grid */
.majors-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 18px;
}
.major-card {
  padding: 26px; position: relative; overflow: hidden;
}
.major-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2.5px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.major-icon {
  width: 50px; height: 50px; border-radius: 14px;
  display: grid; place-items: center; margin-bottom: 14px;
}
.major-name { font-size: 19px; font-weight: 700; margin-bottom: 6px; }
.major-desc { font-size: 13.5px; color: var(--text-muted); margin-bottom: 16px; line-height: 1.55; }
.major-meta { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--text-faint); }
.major-meta-badge {
  display: flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600;
}

/* =====================================================
   COURSES
===================================================== */
.courses-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
}
.course-card { padding: 24px; }
.course-card-top { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 12px; }
.course-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.course-name { font-size: 17px; font-weight: 700; margin-bottom: 3px; }
.course-major-tag { font-size: 11.5px; color: var(--text-faint); }
.course-desc { font-size: 13.5px; color: var(--text-muted); margin-bottom: 14px; line-height: 1.5; }
.course-footer { display: flex; align-items: center; justify-content: space-between; }
.course-meta { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-faint); }
.course-meta-item { display: flex; align-items: center; gap: 4px; }

/* =====================================================
   COURSE DETAIL
===================================================== */
.course-hero { padding: 32px 36px; margin-bottom: 22px; }
.course-hero-header { display: flex; align-items: flex-start; gap: 20px; }
.course-hero-icon { width: 60px; height: 60px; border-radius: 16px; display: grid; place-items: center; flex-shrink: 0; }
.course-hero-title { font-size: 28px; font-weight: 800; margin-bottom: 8px; }
.course-hero-desc { font-size: 14.5px; color: var(--text-muted); max-width: 600px; line-height: 1.6; }
@media (max-width: 640px) {
  .course-hero { padding: 24px; }
  .course-hero-header { flex-direction: column; gap: 14px; }
}

.chapters-list { display: flex; flex-direction: column; gap: 12px; }
.chapter-item {
  padding: 20px 24px; display: flex; align-items: center; gap: 18px;
  cursor: pointer; transition: all .15s;
}
.chapter-item:hover { border-color: var(--border-hover); transform: translateX(4px); }
.chapter-num {
  width: 38px; height: 38px; border-radius: 9px;
  background: var(--surface); border: 1px solid var(--border);
  display: grid; place-items: center; font-family: var(--heading);
  font-weight: 700; font-size: 14px; color: var(--text-muted); flex-shrink: 0;
  transition: all .15s;
}
.chapter-item:hover .chapter-num {
  background: var(--primary-glow); border-color: rgba(59,130,246,.3); color: var(--primary);
}
.chapter-info { flex: 1; }
.chapter-name { font-weight: 600; font-size: 15.5px; margin-bottom: 3px; }
.chapter-meta { font-size: 13px; color: var(--text-muted); }
.chapter-arrow { color: var(--text-faint); transition: transform .15s; }
.chapter-item:hover .chapter-arrow { transform: translateX(4px); color: var(--primary); }

/* =====================================================
   REGISTER
===================================================== */
.register-card { max-width: 500px; margin: 60px auto; padding: 38px; }

/* =====================================================
   QUIZ
===================================================== */
.quiz-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; margin-bottom: 10px; flex-wrap: wrap; gap: 12px;
}
.quiz-student { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: grid; place-items: center; font-weight: 700; font-size: 15px; color: #fff;
  flex-shrink: 0;
}
.quiz-student-name { font-weight: 600; font-size: 15px; }
.quiz-student-sub { font-size: 12px; color: var(--text-muted); }
.quiz-timer {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; background: var(--card); border: 1px solid var(--border);
  border-radius: 99px; font-family: var(--heading); font-weight: 700; font-size: 18px;
}
.quiz-timer.warn { color: var(--warning); border-color: rgba(245,158,11,.3); }
.quiz-timer.danger { color: var(--danger); border-color: rgba(239,68,68,.3); animation: pulse 1s infinite; }

.quiz-layout { display: grid; grid-template-columns: 1fr 240px; gap: 18px; align-items: start; }
@media (max-width: 860px) { .quiz-layout { grid-template-columns: 1fr; } }

.question-card { padding: 30px; min-height: 340px; }
.question-tag {
  font-size: 11px; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--primary);
}
.question-counter { float: right; font-size: 13px; color: var(--text-faint); font-weight: 600; }
.question-text {
  font-family: var(--heading); font-size: 21px; font-weight: 600;
  line-height: 1.35; margin: 14px 0 22px; color: var(--text);
  clear: both;
}
.options { display: flex; flex-direction: column; gap: 9px; }
.option {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 16px; border: 1.5px solid var(--border); border-radius: 11px;
  background: var(--surface); transition: all .15s; cursor: pointer;
  text-align: left; font-size: 14.5px; color: var(--text); width: 100%;
}
.option:hover { border-color: var(--primary); background: var(--primary-glow); }
.option-key {
  width: 30px; height: 30px; flex-shrink: 0; border-radius: 7px;
  border: 1.5px solid var(--border); display: grid; place-items: center;
  font-weight: 700; font-size: 12.5px; color: var(--text-muted); transition: all .15s;
}
.option.selected { border-color: var(--primary); background: var(--primary-glow); }
.option.selected .option-key { background: var(--primary); color: #fff; border-color: var(--primary); }
.question-nav {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 22px; gap: 8px; flex-wrap: wrap;
}

.nav-panel { padding: 18px; position: sticky; top: 80px; }
.nav-panel-title {
  font-size: 11.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 12px;
}
.question-grid { display: grid; grid-template-columns: repeat(6,1fr); gap: 5px; }
.q-cell {
  aspect-ratio: 1; border-radius: 6px; border: 1.5px solid var(--border);
  background: var(--surface); font-size: 11px; font-weight: 600;
  color: var(--text-faint); display: grid; place-items: center; cursor: pointer; transition: all .1s;
}
.q-cell:hover { border-color: var(--primary); color: var(--text); }
.q-cell.answered { background: var(--primary); border-color: var(--primary); color: #fff; }
.q-cell.current { outline: 2.5px solid var(--accent); outline-offset: 1px; }
.nav-legend { margin-top: 12px; font-size: 11.5px; color: var(--text-faint); display: flex; flex-direction: column; gap: 5px; }
.legend-item { display: flex; align-items: center; gap: 7px; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; }

/* =====================================================
   RESULT
===================================================== */
.result-hero {
  display: grid; grid-template-columns: 250px 1fr;
  gap: 40px; padding: 36px; align-items: center;
}
@media (max-width: 700px) { .result-hero { grid-template-columns: 1fr; text-align: center; } }
.gauge-container { position: relative; width: 220px; height: 220px; margin: 0 auto; }
.gauge-text {
  position: absolute; inset: 0; display: flex;
  flex-direction: column; align-items: center; justify-content: center;
}
.gauge-score { font-family: var(--heading); font-size: 50px; font-weight: 800; line-height: 1; }
.gauge-out { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.result-verdict {
  display: inline-block; padding: 5px 14px; border-radius: 99px;
  font-size: 13px; font-weight: 700; margin-bottom: 10px;
}
.result-title { font-size: 26px; font-weight: 800; margin-bottom: 8px; }
.result-detail { font-size: 14.5px; color: var(--text-muted); margin-bottom: 20px; }
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.breakdown-card { padding: 26px 30px; margin-top: 18px; }
.breakdown-title { font-size: 17px; font-weight: 700; }
.cat-row { margin-bottom: 13px; }
.cat-row-header {
  display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 5px;
}
.cat-row-header span { color: var(--text-muted); font-weight: 600; }

.review-card { padding: 26px 30px; margin-top: 18px; }
.rev-item { padding: 14px 0; border-bottom: 1px solid var(--border); }
.rev-item:last-child { border: none; }
.rev-q { font-weight: 600; font-size: 14.5px; margin-bottom: 7px; }
.rev-num { color: var(--text-faint); margin-right: 5px; }
.rev-a { font-size: 13.5px; display: flex; gap: 8px; align-items: flex-start; margin: 3px 0; color: var(--text-muted); }
.rev-a.correct { color: var(--success); }
.rev-a.wrong { color: var(--danger); }

/* =====================================================
   OPEN QUESTIONS
===================================================== */
.open-item { padding: 22px 26px; margin-bottom: 12px; }
.open-item-header { display: flex; gap: 14px; align-items: flex-start; }
.open-num {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--primary-glow); border: 1px solid rgba(59,130,246,.25);
  display: grid; place-items: center; font-weight: 700; font-size: 13.5px;
  color: var(--primary); flex-shrink: 0;
}
.open-question { font-family: var(--heading); font-size: 16.5px; font-weight: 600; line-height: 1.35; }
.open-textarea {
  width: 100%; min-height: 88px; padding: 12px 14px; margin-top: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font-size: 14px; resize: vertical;
  transition: border-color .15s;
}
.open-textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.answer-box {
  margin-top: 12px; padding: 14px 16px;
  background: var(--success-glow); border: 1px solid rgba(16,185,129,.22);
  border-radius: 10px; font-size: 13.5px; color: #86EFAC; line-height: 1.55;
}
.answer-box b { color: #4ADE80; }

/* =====================================================
   ADMIN LOGIN
===================================================== */
.admin-login-card { max-width: 440px; margin: 80px auto; padding: 38px; }

/* =====================================================
   ADMIN DASHBOARD
===================================================== */
.admin-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 26px;
}
.admin-tabs {
  display: flex; gap: 4px; margin-bottom: 24px;
  background: var(--card); padding: 5px; border-radius: 12px;
  border: 1px solid var(--border); overflow-x: auto;
}
.admin-tab {
  padding: 8px 16px; border-radius: 8px; font-size: 14px; font-weight: 600;
  color: var(--text-muted); transition: all .15s; cursor: pointer; white-space: nowrap;
}
.admin-tab:hover:not(.active) { color: var(--text); background: rgba(255,255,255,.04); }
.admin-tab.active { background: var(--primary); color: #fff; }

/* KPI Grid */
.kpi-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 22px; }
@media (max-width: 880px) { .kpi-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 480px) { .kpi-grid { grid-template-columns: 1fr; } }
.kpi-card { padding: 20px 22px; position: relative; overflow: hidden; }
.kpi-label { font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; }
.kpi-value { font-family: var(--heading); font-size: 34px; font-weight: 800; line-height: 1; }
.kpi-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 6px; }
.kpi-card.kpi-blue .kpi-value { color: var(--primary); }
.kpi-card.kpi-green .kpi-value { color: var(--success); }
.kpi-card.kpi-yellow .kpi-value { color: var(--warning); }
.kpi-card.kpi-purple .kpi-value { color: var(--secondary); }
.kpi-icon {
  position: absolute; top: 14px; right: 14px;
  width: 36px; height: 36px; border-radius: 9px;
  display: grid; place-items: center; opacity: .15;
}

/* Charts */
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 22px; }
@media (max-width: 800px) { .charts-grid { grid-template-columns: 1fr; } }
.chart-card { padding: 22px 24px; }
.chart-title { font-size: 15.5px; font-weight: 700; margin-bottom: 3px; }
.chart-sub { font-size: 12.5px; color: var(--text-muted); margin-bottom: 18px; }

.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar-val { font-size: 12.5px; font-weight: 700; color: var(--text-muted); }
.bar { width: 100%; max-width: 44px; border-radius: 5px 5px 0 0; min-height: 3px; transition: height .8s cubic-bezier(.2,.8,.2,1); }
.bar-label { font-size: 10.5px; color: var(--text-faint); text-align: center; white-space: nowrap; }

.mastery-list { display: flex; flex-direction: column; gap: 10px; }
.mastery-item {}
.mastery-header { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 5px; }
.mastery-name { font-weight: 600; }
.mastery-pct { font-weight: 700; }

/* Tables */
.table-wrapper { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th {
  text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; color: var(--text-faint); padding: 10px 14px;
  border-bottom: 1px solid var(--border); cursor: pointer; user-select: none; white-space: nowrap;
}
.data-table th:hover { color: var(--text-muted); }
.data-table th.sort-asc::after { content: ' ↑'; color: var(--primary); }
.data-table th.sort-desc::after { content: ' ↓'; color: var(--primary); }
.data-table td { padding: 11px 14px; border-bottom: 1px solid var(--border); }
.data-table tr:last-child td { border: none; }
.data-table tbody tr:hover td { background: rgba(255,255,255,.02); }

/* Score chips in table */
.score-chip {
  display: inline-block; padding: 3px 10px; border-radius: 99px;
  font-size: 12.5px; font-weight: 700;
}
.score-chip.excel { background: var(--success-glow); color: #6EE7B7; }
.score-chip.pass { background: var(--warning-glow); color: #FCD34D; }
.score-chip.fail { background: var(--danger-glow); color: #FCA5A5; }

.mini-bar {
  display: inline-block; width: 72px; height: 5px;
  background: var(--surface); border-radius: 99px; vertical-align: middle; overflow: hidden;
}
.mini-bar-fill { display: block; height: 100%; border-radius: 99px; }

/* Toolbar */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.search-wrap { flex: 1; min-width: 200px; position: relative; }
.search-wrap svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--text-faint); pointer-events: none; }
.search-input {
  width: 100%; padding: 9px 12px 9px 36px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 9px; color: var(--text); font-size: 13.5px;
}
.search-input:focus { outline: none; border-color: var(--primary); }
.search-input::placeholder { color: var(--text-faint); }
.filter-select {
  padding: 9px 12px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 9px; color: var(--text); font-size: 13.5px; cursor: pointer;
}
.filter-select:focus { outline: none; border-color: var(--primary); }

/* Course stats */
.course-stat-block { padding: 22px 24px; margin-bottom: 16px; }
.course-stat-header { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.course-stat-icon { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; }
.course-stat-title { font-size: 16px; font-weight: 700; }
.course-stat-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.course-kpis { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
@media (max-width: 700px) { .course-kpis { grid-template-columns: repeat(2,1fr); } }
.ckpi {
  padding: 14px 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 11px;
}
.ckpi-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--text-faint); margin-bottom: 6px; }
.ckpi-value { font-family: var(--heading); font-size: 24px; font-weight: 800; }

/* Empty state */
.empty-state { text-align: center; padding: 64px 24px; color: var(--text-muted); }
.empty-state svg { width: 50px; height: 50px; color: var(--text-faint); margin: 0 auto 16px; display: block; }

/* =====================================================
   MODAL
===================================================== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.75);
  backdrop-filter: blur(6px); z-index: 200;
  display: grid; place-items: center; padding: 20px;
  animation: fadeIn .2s ease;
}
.modal {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-xl); max-width: 540px; width: 100%;
  max-height: 88vh; overflow-y: auto; padding: 30px;
  position: relative; box-shadow: var(--shadow-lg);
  animation: fadeUp .22s ease;
}
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 30px; height: 30px; border-radius: 7px;
  background: var(--surface); color: var(--text-muted);
  display: grid; place-items: center; font-size: 18px;
  cursor: pointer; transition: all .15s; line-height: 1;
}
.modal-close:hover { background: var(--border); color: var(--text); }

/* =====================================================
   FOOTER
===================================================== */
.footer {
  margin-top: 60px; padding: 26px 0; border-top: 1px solid var(--border);
  text-align: center; font-size: 13px; color: var(--text-faint);
}
.footer b { color: var(--text-muted); }

/* =====================================================
   RESPONSIVE
===================================================== */
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .register-card { margin: 32px auto; padding: 24px; }
  .admin-login-card { margin: 40px auto; padding: 24px; }
  .question-card { padding: 20px; }
  .result-hero { padding: 24px; gap: 24px; }
  .breakdown-card { padding: 18px 20px; }
  .review-card { padding: 18px 20px; }
}
