/* ── DESIGN TOKENS ── */
:root {
  --green-bright: #B8F369;
  --green-dark: #2D6A1E;
  --green-deep: #0A1F02;
  --green-pale: #F0FFF0;
  --indigo-deep: #1B0A3C;
  --indigo-mid: #3D1E7C;
  --indigo-light: #7B68EE;
  --indigo-pale: #E8E0F0;

  --bg: #0D1117;
  --bg-card: #161B22;
  --bg-card2: #1C2333;
  --border: rgba(184, 243, 105, 0.12);
  --border-soft: rgba(255,255,255,0.07);
  --text-primary: #F0FFF0;
  --text-secondary: #8B9E7A;
  --text-muted: #4A5568;

  --sidebar-w: 240px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Bricolage Grotesque', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input { font-family: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── SIDEBAR ── */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem 1.5rem;
}
.logo-icon {
  font-size: 1.6rem;
  color: var(--green-bright);
  animation: spin-slow 8s linear infinite;
}
.logo-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--green-bright);
  letter-spacing: 0.02em;
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.nav-btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav-btn:hover {
  background: rgba(184, 243, 105, 0.08);
  color: var(--green-bright);
}
.nav-btn.active {
  background: rgba(184, 243, 105, 0.12);
  color: var(--green-bright);
}
.nav-btn.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--green-bright);
  border-radius: 0 4px 4px 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg-card2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
}
.user-avatar {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--green-bright), var(--indigo-light));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem; color: var(--green-deep);
  flex-shrink: 0;
}
.user-info { display: flex; flex-direction: column; }
.user-name { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }
.user-level { font-size: 0.72rem; color: var(--green-bright); }

/* ── TOPBAR (mobile) ── */
.topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  z-index: 200;
}
.menu-toggle {
  display: flex; flex-direction: column; gap: 5px;
  padding: 4px;
}
.menu-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--text-primary); border-radius: 2px;
  transition: var(--transition);
}
.topbar-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem; font-weight: 600;
  color: var(--green-bright);
}
.topbar-xp {
  display: flex; align-items: center; gap: 4px;
  font-weight: 700; font-size: 0.95rem;
  color: var(--green-bright);
}

/* ── MAIN CONTENT ── */
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  padding: 2rem 2.5rem 5rem;
  max-width: 900px;
}

/* ── PAGES ── */
.page { display: none; animation: fadeUp 0.4s ease; }
.page.active { display: block; }

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

/* ── HOME PAGE ── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.greeting-sub {
  font-size: 1rem; color: var(--text-secondary);
  margin-bottom: 0.25rem;
}
.greeting-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.4rem; font-weight: 600;
  color: var(--text-primary);
  line-height: 1.1;
}

.streak-card {
  display: flex; align-items: center; gap: 0.75rem;
  background: linear-gradient(135deg, #FF6B2B22, #FF6B2B11);
  border: 1px solid #FF6B2B44;
  border-radius: var(--radius);
  padding: 0.75rem 1.25rem;
}
.streak-fire { font-size: 2rem; }
.streak-info { display: flex; flex-direction: column; }
.streak-num { font-size: 1.6rem; font-weight: 800; color: #FF6B2B; line-height: 1; }
.streak-label { font-size: 0.72rem; color: var(--text-secondary); }

/* Daily Goal */
.daily-goal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}
.goal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.75rem;
}
.goal-title { font-weight: 600; font-size: 0.95rem; }
.goal-xp {
  background: rgba(184, 243, 105, 0.15);
  color: var(--green-bright);
  font-size: 0.8rem; font-weight: 700;
  padding: 0.2rem 0.6rem; border-radius: 20px;
}
.goal-progress-bar {
  height: 8px; background: var(--bg-card2);
  border-radius: 4px; overflow: hidden; margin-bottom: 0.5rem;
}
.goal-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green-bright), var(--indigo-light));
  border-radius: 4px;
  transition: width 1s ease;
}
.goal-stats {
  display: flex; justify-content: space-between;
  font-size: 0.78rem; color: var(--text-secondary);
}

/* Section Titles */
.section-title-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1rem;
}
.section-title {
  font-size: 1.1rem; font-weight: 700;
  color: var(--text-primary);
}
.see-all-btn {
  font-size: 0.82rem; color: var(--green-bright);
  font-weight: 600; transition: opacity var(--transition);
}
.see-all-btn:hover { opacity: 0.7; }

/* Continue Cards */
.continue-cards {
  display: flex; flex-direction: column; gap: 0.75rem;
  margin-bottom: 2rem;
}
.continue-card {
  display: flex; align-items: center; gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  transition: all var(--transition);
  cursor: pointer;
}
.continue-card:hover {
  border-color: var(--border);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.cc-badge {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; flex-shrink: 0;
}
.cc-info { flex: 1; min-width: 0; }
.cc-info h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.15rem; }
.cc-info p { font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.cc-progress {
  height: 4px; background: var(--bg-card2);
  border-radius: 2px; overflow: hidden; margin-bottom: 0.25rem;
}
.cc-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green-bright), var(--indigo-light));
  border-radius: 2px;
}
.cc-pct { font-size: 0.72rem; color: var(--green-bright); font-weight: 600; }
.cc-play {
  width: 40px; height: 40px;
  background: var(--green-bright);
  color: var(--green-deep);
  border-radius: 50%;
  font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform var(--transition);
}
.cc-play:hover { transform: scale(1.1); }

/* Badges */
.badges-row {
  display: flex; gap: 0.75rem; flex-wrap: wrap;
  margin-bottom: 2rem;
}
.badge-item {
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  min-width: 80px;
  opacity: 0.4;
  transition: all var(--transition);
}
.badge-item.earned {
  opacity: 1;
  border-color: rgba(184, 243, 105, 0.3);
  background: rgba(184, 243, 105, 0.05);
}
.badge-icon { font-size: 1.6rem; }
.badge-item span { font-size: 0.68rem; color: var(--text-secondary); text-align: center; }

/* Leaderboard */
.leaderboard-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}
.leaderboard-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }
.lb-list { display: flex; flex-direction: column; gap: 0.5rem; }
.lb-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}
.lb-rank { font-weight: 800; width: 24px; text-align: center; }
.lb-name { flex: 1; font-weight: 500; }
.lb-xp { font-weight: 700; font-size: 0.8rem; }
.lb-gold { background: rgba(255, 215, 0, 0.1); }
.lb-gold .lb-rank { color: #FFD700; }
.lb-silver { background: rgba(192, 192, 192, 0.1); }
.lb-silver .lb-rank { color: #C0C0C0; }
.lb-bronze { background: rgba(205, 127, 50, 0.1); }
.lb-bronze .lb-rank { color: #CD7F32; }
.lb-you { background: rgba(184, 243, 105, 0.08); border: 1px solid rgba(184, 243, 105, 0.2); }
.lb-you .lb-rank { color: var(--green-bright); }

/* ── COURSES PAGE ── */
.page-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.2rem; font-weight: 600;
  margin-bottom: 0.25rem;
}
.page-subtitle { font-size: 0.9rem; color: var(--text-secondary); }

.search-bar {
  display: flex; align-items: center; gap: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin: 1.5rem 0 1rem;
  transition: border-color var(--transition);
}
.search-bar:focus-within { border-color: var(--green-bright); }
.search-bar svg { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }
.search-bar input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text-primary); font-size: 0.9rem;
}
.search-bar input::placeholder { color: var(--text-muted); }

.filter-tabs {
  display: flex; gap: 0.5rem; flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.filter-tab {
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.82rem; font-weight: 600;
  color: var(--text-secondary);
  border: 1px solid var(--border-soft);
  transition: all var(--transition);
}
.filter-tab:hover { border-color: var(--green-bright); color: var(--green-bright); }
.filter-tab.active {
  background: var(--green-bright);
  color: var(--green-deep);
  border-color: var(--green-bright);
}

.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.course-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.25rem;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.course-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--green-bright), var(--indigo-light));
  opacity: 0;
  transition: opacity var(--transition);
}
.course-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--border);
}
.course-card:hover::before { opacity: 1; }

.course-emoji { font-size: 2.2rem; margin-bottom: 0.75rem; display: block; }
.course-tag {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--green-bright);
  background: rgba(184, 243, 105, 0.1);
  padding: 0.2rem 0.5rem; border-radius: 4px;
  display: inline-block; margin-bottom: 0.5rem;
}
.course-name { font-size: 1rem; font-weight: 700; margin-bottom: 0.25rem; }
.course-desc { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 0.75rem; line-height: 1.5; }
.course-meta {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.75rem; color: var(--text-muted);
}
.course-lessons { display: flex; align-items: center; gap: 0.3rem; }
.course-difficulty {
  padding: 0.15rem 0.5rem; border-radius: 4px;
  font-weight: 600;
}
.diff-easy { background: rgba(184, 243, 105, 0.15); color: var(--green-bright); }
.diff-medium { background: rgba(255, 165, 0, 0.15); color: #FFA500; }
.diff-hard { background: rgba(255, 100, 100, 0.15); color: #FF6464; }

.course-progress-mini {
  height: 3px; background: var(--bg-card2);
  border-radius: 2px; overflow: hidden; margin-top: 0.75rem;
}
.course-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green-bright), var(--indigo-light));
  border-radius: 2px;
}

/* ── LESSON PAGE ── */
.lesson-topbar {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 2rem;
}
.back-btn {
  font-size: 0.85rem; color: var(--text-secondary);
  font-weight: 600; white-space: nowrap;
  transition: color var(--transition);
}
.back-btn:hover { color: var(--green-bright); }
.lesson-progress-bar {
  flex: 1; height: 6px;
  background: var(--bg-card2); border-radius: 3px; overflow: hidden;
}
.lesson-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green-bright), var(--indigo-light));
  border-radius: 3px;
  transition: width 0.5s ease;
}
.lesson-xp-badge {
  font-size: 0.78rem; font-weight: 700;
  color: var(--green-bright);
  background: rgba(184, 243, 105, 0.1);
  padding: 0.2rem 0.6rem; border-radius: 20px;
  white-space: nowrap;
}

.lesson-container { max-width: 640px; margin: 0 auto; }

.lesson-step-indicator {
  display: flex; gap: 0.4rem; justify-content: center;
  margin-bottom: 1.5rem;
}
.step-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--bg-card2);
  transition: all var(--transition);
}
.step-dot.active { background: var(--green-bright); transform: scale(1.3); }
.step-dot.done { background: var(--green-dark); }

.lesson-content {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 2rem;
  min-height: 320px;
  margin-bottom: 1.5rem;
  animation: fadeUp 0.3s ease;
}
.lesson-content h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.8rem; font-weight: 600;
  margin-bottom: 1rem; color: var(--green-bright);
}
.lesson-content p {
  font-size: 0.95rem; line-height: 1.8;
  color: var(--text-secondary); margin-bottom: 1rem;
}
.lesson-content .code-block {
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  color: var(--green-bright);
  margin: 1rem 0;
  overflow-x: auto;
  line-height: 1.7;
}
.lesson-content .highlight {
  background: rgba(184, 243, 105, 0.1);
  border-left: 3px solid var(--green-bright);
  padding: 0.75rem 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.lesson-actions {
  display: flex; gap: 0.75rem; justify-content: flex-end;
}
.lesson-btn {
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 700;
  transition: all var(--transition);
}
.lesson-btn.primary {
  background: var(--green-bright);
  color: var(--green-deep);
}
.lesson-btn.primary:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(184,243,105,0.3); }
.lesson-btn.secondary {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-soft);
}
.lesson-btn.secondary:hover { border-color: var(--green-bright); color: var(--green-bright); }
.lesson-btn:disabled { opacity: 0.3; cursor: not-allowed; transform: none !important; }

/* ── QUIZ PAGE ── */
.quiz-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1.5rem;
}
.quiz-timer {
  display: flex; align-items: center; gap: 0.4rem;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem; font-weight: 700;
  color: var(--text-secondary);
}
.quiz-timer svg { width: 16px; height: 16px; }
.quiz-timer.urgent { color: #FF6464; border-color: rgba(255,100,100,0.3); }

.quiz-select-label {
  font-size: 0.9rem; color: var(--text-secondary);
  margin-bottom: 1rem;
}
.quiz-topic-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}
.quiz-topic-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  font-size: 1rem; font-weight: 600;
  color: var(--text-primary);
  transition: all var(--transition);
  text-align: center;
}
.quiz-topic-btn:hover {
  border-color: var(--green-bright);
  background: rgba(184, 243, 105, 0.05);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.quiz-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1rem;
  font-size: 0.85rem; color: var(--text-secondary);
}
.quiz-score-badge {
  background: rgba(184, 243, 105, 0.1);
  color: var(--green-bright);
  padding: 0.2rem 0.75rem; border-radius: 20px;
  font-weight: 700;
}

.quiz-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 2rem;
  animation: fadeUp 0.3s ease;
}
.quiz-question {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem; font-weight: 600;
  line-height: 1.4;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}
.quiz-options {
  display: flex; flex-direction: column; gap: 0.6rem;
}
.quiz-option {
  background: var(--bg-card2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.25rem;
  font-size: 0.9rem; font-weight: 500;
  color: var(--text-primary);
  text-align: left;
  transition: all var(--transition);
}
.quiz-option:hover:not(:disabled) {
  border-color: var(--green-bright);
  background: rgba(184, 243, 105, 0.05);
}
.quiz-option.correct {
  border-color: var(--green-bright);
  background: rgba(184, 243, 105, 0.12);
  color: var(--green-bright);
}
.quiz-option.wrong {
  border-color: #FF6464;
  background: rgba(255, 100, 100, 0.1);
  color: #FF6464;
}

/* Quiz Result */
.quiz-result {
  text-align: center;
  padding: 3rem 1rem;
  animation: fadeUp 0.4s ease;
}
.result-emoji { font-size: 4rem; margin-bottom: 1rem; }
.result-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.5rem; font-weight: 600;
  margin-bottom: 0.5rem;
}
.result-score { font-size: 1rem; color: var(--text-secondary); margin-bottom: 1rem; }
.result-xp {
  font-size: 1.4rem; font-weight: 800;
  color: var(--green-bright);
  margin-bottom: 2rem;
}

/* ── PROGRESS PAGE ── */
.xp-overview-card {
  background: linear-gradient(135deg, var(--indigo-deep), var(--indigo-mid));
  border: 1px solid rgba(123, 104, 238, 0.3);
  border-radius: var(--radius);
  padding: 1.75rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.xp-circle {
  position: relative;
  width: 120px; height: 120px;
  flex-shrink: 0;
}
.xp-circle svg { width: 100%; height: 100%; }
.xp-circle-text {
  position: absolute;
  inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.xp-num { font-size: 1.4rem; font-weight: 800; color: var(--green-bright); line-height: 1; }
.xp-label { font-size: 0.7rem; color: var(--indigo-pale); }

.xp-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  flex: 1;
}
.xp-stat { display: flex; flex-direction: column; gap: 0.2rem; }
.xp-stat-val { font-size: 1.1rem; font-weight: 800; color: var(--text-primary); }
.xp-stat-key { font-size: 0.72rem; color: var(--indigo-pale); }

/* Weekly Chart */
.weekly-chart {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  height: 140px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1rem 1.25rem 0.5rem;
}
.week-bar-group {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end;
  gap: 0.4rem;
  height: 100%;
}
.week-bar {
  width: 100%;
  background: rgba(184, 243, 105, 0.2);
  border-radius: 4px 4px 0 0;
  position: relative;
  transition: height 1s ease;
  min-height: 8px;
}
.week-bar.active { background: var(--green-bright); }
.week-xp {
  position: absolute;
  top: -20px; left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem; color: var(--text-muted);
  white-space: nowrap;
}
.week-day { font-size: 0.72rem; color: var(--text-muted); }

/* Course Progress List */
.course-progress-list {
  display: flex; flex-direction: column; gap: 0.75rem;
}
.cp-item {
  display: flex; align-items: center; gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.25rem;
}
.cp-icon { font-size: 1.5rem; flex-shrink: 0; }
.cp-info { flex: 1; min-width: 0; }
.cp-name { font-size: 0.88rem; font-weight: 600; display: block; margin-bottom: 0.4rem; }
.cp-bar {
  height: 5px; background: var(--bg-card2);
  border-radius: 3px; overflow: hidden;
}
.cp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green-bright), var(--indigo-light));
  border-radius: 3px;
}
.cp-pct { font-size: 0.8rem; font-weight: 700; color: var(--green-bright); flex-shrink: 0; }

/* ── BOTTOM NAV (mobile) ── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 0.5rem 0 0.75rem;
  z-index: 200;
}
.bnav-btn {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; gap: 0.25rem;
  padding: 0.4rem;
  color: var(--text-muted);
  font-size: 0.65rem; font-weight: 600;
  transition: color var(--transition);
}
.bnav-btn svg { width: 22px; height: 22px; }
.bnav-btn.active { color: var(--green-bright); }

/* ── XP TOAST ── */
.xp-toast {
  position: fixed;
  bottom: 5rem; right: 1.5rem;
  background: var(--green-bright);
  color: var(--green-deep);
  font-weight: 800; font-size: 1rem;
  padding: 0.6rem 1.25rem;
  border-radius: 30px;
  box-shadow: 0 4px 20px rgba(184,243,105,0.4);
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  z-index: 999;
}
.xp-toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* ── HIDDEN ── */
.hidden { display: none !important; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  }
  .topbar { display: flex; }
  .bottom-nav { display: flex; }
  .main-content {
    margin-left: 0;
    padding: 4.5rem 1rem 5.5rem;
  }
  .greeting-title { font-size: 1.8rem; }
  .page-title { font-size: 1.7rem; }
  .courses-grid { grid-template-columns: 1fr; }
  .quiz-topic-grid { grid-template-columns: repeat(2, 1fr); }
  .xp-overview-card { flex-direction: column; align-items: flex-start; }
  .weekly-chart { height: 110px; }
  .lesson-content { padding: 1.25rem; }
  .lesson-content h2 { font-size: 1.4rem; }
}

@media (max-width: 400px) {
  .quiz-topic-grid { grid-template-columns: 1fr; }
  .badges-row { gap: 0.5rem; }
  .badge-item { min-width: 70px; padding: 0.6rem 0.75rem; }
}

/* ── OVERLAY ── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}
.sidebar-overlay.show { display: block; }