@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

:root {
  --mat: #FF6B6B; --len: #6C5CE7; --nat: #00B894; --soc: #0984E3;
  --pen: #E17055; --tec: #00CEC9; --hab: #FD79A8;
  --gold: #FDCB6E; --bg: #F0F4FF; --card: #FFFFFF;
  --text: #2D3436; --muted: #636E72; --radius: 18px;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --bot-w: 300px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Nunito', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }

/* ── HEADER ── */
.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white; padding: 0.9rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 2px 12px rgba(102,126,234,0.4); position: sticky; top: 0; z-index: 100;
}
.header h1 { font-size: 1.3rem; font-weight: 900; }
.header-right { display: flex; align-items: center; gap: 0.7rem; }
.back-btn {
  background: rgba(255,255,255,0.25); border: none; color: white;
  font-family: 'Nunito', sans-serif; font-size: 0.95rem; font-weight: 700;
  padding: 0.35rem 0.9rem; border-radius: 30px; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; gap: 0.3rem;
  transition: background 0.2s;
}
.back-btn:hover { background: rgba(255,255,255,0.4); }
.stars-badge {
  background: var(--gold); color: #333; font-weight: 800;
  padding: 0.3rem 0.8rem; border-radius: 30px; font-size: 0.95rem;
  display: flex; align-items: center; gap: 0.3rem;
}
.mute-btn {
  background: rgba(255,255,255,0.2); border: none; color: white;
  font-size: 1.1rem; width: 34px; height: 34px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.mute-btn:hover { background: rgba(255,255,255,0.35); }

/* ── PAGE LAYOUT (sidebar bot) ── */
.page-layout {
  display: flex; align-items: flex-start; gap: 1rem;
  max-width: 1200px; margin: 0 auto; padding: 1.2rem 1rem;
}
.main-content { flex: 1; min-width: 0; }
.bot-sidebar {
  width: var(--bot-w); flex-shrink: 0;
  position: sticky; top: 70px; max-height: calc(100vh - 80px);
  display: flex; flex-direction: column;
}

/* ── FLOATING BOT FAB (mobile only) ── */
.bot-fab {
  display: none;
  position: fixed; bottom: 1.3rem; right: 1.3rem;
  width: 54px; height: 54px; border-radius: 50%;
  background: linear-gradient(135deg,#667eea,#764ba2);
  color: white; font-size: 1.6rem; border: none;
  box-shadow: 0 4px 20px rgba(102,126,234,0.5);
  cursor: pointer; z-index: 201;
  align-items: center; justify-content: center;
  transition: transform 0.2s;
}
.bot-fab:active { transform: scale(0.9); }

@media (max-width: 820px) {
  .page-layout { flex-direction: column; }
  .bot-sidebar {
    position: fixed; bottom: 0; left: 0; right: 0; top: auto;
    width: 100%; max-height: 55vh;
    z-index: 200; border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  }
  .bot-sidebar.mobile-open { transform: translateY(0); }
  .bot-sidebar-panel { border-radius: 20px 20px 0 0; height: 55vh; }
  .bot-fab { display: flex; }
  .bot-messages-area { max-height: 160px; }
}

/* ── CONTAINER (dashboard only) ── */
.container { max-width: 900px; margin: 0 auto; padding: 1.2rem 1rem; }

/* ── WELCOME ── */
.welcome-card {
  background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
  border-radius: var(--radius); padding: 1.3rem; color: white;
  margin-bottom: 1.2rem; display: flex; align-items: center; gap: 1rem;
}
.welcome-card .avatar { font-size: 3rem; }
.welcome-card h2 { font-size: 1.5rem; font-weight: 900; }
.welcome-card p { font-size: 0.95rem; opacity: 0.9; }

/* ── SECTION TITLE ── */
.section-title {
  font-size: 1rem; font-weight: 800; color: var(--muted);
  text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 0.7rem; margin-top: 1.3rem;
}

/* ── DAILY TASKS ── */
.tasks-card { background: var(--card); border-radius: var(--radius); padding: 1.1rem; box-shadow: var(--shadow); margin-bottom: 1.2rem; }
.task-item {
  display: flex; align-items: center; gap: 0.7rem; padding: 0.7rem;
  border-radius: 12px; margin-bottom: 0.4rem; transition: background 0.2s; cursor: pointer;
}
.task-item:last-child { margin-bottom: 0; }
.task-item:hover { background: #f8f9ff; }
.task-item.done { opacity: 0.5; }
.task-item.done .task-text { text-decoration: line-through; }
.task-check {
  width: 26px; height: 26px; border-radius: 50%; border: 3px solid #ddd;
  display: flex; align-items: center; justify-content: center; font-size: 0.9rem; flex-shrink: 0; transition: all 0.2s;
}
.task-item.done .task-check { background: #00B894; border-color: #00B894; color: white; }
.task-icon { font-size: 1.4rem; }
.task-text { flex: 1; }
.task-text strong { display: block; font-size: 0.95rem; font-weight: 700; }
.task-text span { font-size: 0.82rem; color: var(--muted); }
.task-stars { font-size: 0.85rem; color: var(--gold); font-weight: 700; }

/* ── SUBJECTS GRID ── */
.subjects-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.9rem; }
@media (max-width: 500px) { .subjects-grid { grid-template-columns: 1fr; } }

.subject-card {
  border-radius: var(--radius); padding: 1.3rem; color: white;
  text-decoration: none; display: block;
  transition: transform 0.2s, box-shadow 0.2s; box-shadow: var(--shadow); overflow: hidden;
}
.subject-card:hover { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(0,0,0,0.15); }
.subject-card.mat { background: linear-gradient(135deg, #FF6B6B, #ee5a24); }
.subject-card.len { background: linear-gradient(135deg, #6C5CE7, #a29bfe); }
.subject-card.nat { background: linear-gradient(135deg, #00B894, #55efc4); }
.subject-card.soc { background: linear-gradient(135deg, #0984E3, #74b9ff); }
.subject-card.pen { background: linear-gradient(135deg, #E17055, #fab1a0); }
.subject-card.tec { background: linear-gradient(135deg, #00CEC9, #81ecec); }
.subject-card.hab { background: linear-gradient(135deg, #FD79A8, #fdcfe8); }
.subject-card .s-icon { font-size: 2.4rem; margin-bottom: 0.4rem; }
.subject-card h3 { font-size: 1.1rem; font-weight: 900; }
.subject-card p { font-size: 0.8rem; opacity: 0.85; margin-top: 0.15rem; }
.subject-card .progress-bar { margin-top: 0.7rem; background: rgba(255,255,255,0.3); border-radius: 10px; height: 7px; overflow: hidden; }
.subject-card .progress-fill { background: white; height: 100%; border-radius: 10px; transition: width 0.5s ease; }

/* ── SUBJECT HEADER ── */
.subject-header {
  color: white; padding: 1.3rem; border-radius: var(--radius);
  margin-bottom: 1.2rem; display: flex; align-items: center; gap: 1rem;
}
.subject-header .s-icon { font-size: 2.5rem; }
.subject-header h2 { font-size: 1.5rem; font-weight: 900; }
.subject-header p { opacity: 0.88; font-size: 0.9rem; }
.subject-header.mat { background: linear-gradient(135deg, #FF6B6B, #ee5a24); }
.subject-header.len { background: linear-gradient(135deg, #6C5CE7, #a29bfe); }
.subject-header.nat { background: linear-gradient(135deg, #00B894, #55efc4); color: #1a5c4a; }
.subject-header.soc { background: linear-gradient(135deg, #0984E3, #74b9ff); }
.subject-header.pen { background: linear-gradient(135deg, #E17055, #fab1a0); }
.subject-header.tec { background: linear-gradient(135deg, #00CEC9, #81ecec); color: #00504e; }
.subject-header.hab { background: linear-gradient(135deg, #FD79A8, #fdcfe8); color: #6d2043; }

/* ── TABS ── */
.tabs { display: flex; gap: 0.5rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.tab-btn {
  padding: 0.55rem 1.1rem; border-radius: 30px; border: 2px solid #ddd;
  background: white; font-family: 'Nunito', sans-serif; font-size: 0.9rem;
  font-weight: 700; cursor: pointer; transition: all 0.2s; color: var(--muted);
}
.tab-btn.active { border-color: transparent; color: white; }
.tab-btn.active.mat { background: var(--mat); }
.tab-btn.active.len { background: var(--len); }
.tab-btn.active.nat { background: var(--nat); }
.tab-btn.active.soc { background: var(--soc); }
.tab-btn.active.pen { background: var(--pen); }
.tab-btn.active.tec { background: var(--tec); color: #004d4b; }
.tab-btn.active.hab { background: var(--hab); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── LESSON CARD ── */
.lesson-card { background: var(--card); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.lesson-card h3 { font-size: 1.15rem; font-weight: 800; margin-bottom: 0.8rem; }
.lesson-card p, .lesson-card li { font-size: 0.97rem; line-height: 1.75; color: #444; }
.lesson-card ul { padding-left: 1.4rem; margin-top: 0.5rem; }
.lesson-card .highlight {
  background: #fff9e6; border-left: 4px solid var(--gold);
  padding: 0.8rem 1rem; border-radius: 0 10px 10px 0; margin: 0.8rem 0; font-weight: 600; font-size: 0.95rem;
}
.lesson-card .example {
  background: #f0f4ff; border-radius: 12px; padding: 0.9rem 1rem;
  margin: 0.8rem 0; font-size: 1rem; font-weight: 700; line-height: 1.8;
}

/* ── VISUAL ELEMENTS ── */
.visual-row {
  display: flex; gap: 0.6rem; flex-wrap: wrap; margin: 0.8rem 0;
}
.visual-box {
  flex: 1; min-width: 120px; background: #f8f9ff; border-radius: 12px;
  padding: 0.8rem; text-align: center; border: 2px solid #e0e7ff;
}
.visual-box .vb-icon { font-size: 2rem; }
.visual-box .vb-label { font-size: 0.8rem; font-weight: 700; color: var(--muted); margin-top: 0.3rem; }
.visual-box .vb-val { font-size: 1rem; font-weight: 800; color: var(--text); }

.flow-diagram { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; margin: 0.8rem 0; }
.flow-step {
  background: #667eea; color: white; padding: 0.5rem 0.9rem;
  border-radius: 20px; font-weight: 700; font-size: 0.88rem;
}
.flow-arrow { font-size: 1.2rem; color: var(--muted); }

.comparison-table { width: 100%; border-collapse: collapse; margin: 0.8rem 0; border-radius: 12px; overflow: hidden; }
.comparison-table th { background: #667eea; color: white; padding: 0.6rem 0.8rem; font-size: 0.88rem; text-align: left; }
.comparison-table td { padding: 0.6rem 0.8rem; font-size: 0.88rem; border-bottom: 1px solid #f0f0f0; }
.comparison-table tr:nth-child(even) td { background: #f8f9ff; }

.did-you-know {
  background: linear-gradient(135deg, #667eea20, #764ba220);
  border: 2px solid #667eea40; border-radius: 12px;
  padding: 0.9rem 1rem; margin: 0.8rem 0;
  display: flex; gap: 0.7rem; align-items: flex-start;
}
.did-you-know .dyk-icon { font-size: 1.5rem; flex-shrink: 0; }
.did-you-know p { font-size: 0.9rem; color: #444; font-weight: 600; }

/* ── LESSON FOOTER ── */
.lesson-footer {
  background: var(--card); border-radius: var(--radius); padding: 1.2rem;
  box-shadow: var(--shadow); margin-top: 1rem;
  display: flex; flex-direction: column; align-items: center; gap: 0.8rem; text-align: center;
}
.lesson-footer p { color: var(--muted); font-size: 0.9rem; }
.finish-btn {
  padding: 0.8rem 2rem; border-radius: 30px; border: none;
  background: linear-gradient(135deg, #00B894, #55efc4);
  color: white; font-family: 'Nunito', sans-serif;
  font-size: 1.05rem; font-weight: 800; cursor: pointer;
  box-shadow: 0 4px 15px rgba(0,184,148,0.3); transition: transform 0.2s;
}
.finish-btn:hover { transform: scale(1.03); }
.footer-tabs { display: flex; gap: 0.7rem; flex-wrap: wrap; justify-content: center; }
.footer-tab-btn {
  padding: 0.6rem 1.3rem; border-radius: 30px; border: 2px solid #ddd;
  background: white; font-family: 'Nunito', sans-serif; font-size: 0.95rem;
  font-weight: 700; cursor: pointer; transition: all 0.2s; color: var(--muted);
}
.footer-tab-btn:hover { border-color: #667eea; color: #667eea; }

/* ── EXERCISES ── */
.exercise-card { background: var(--card); border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.exercise-card .q-num { font-size: 0.78rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 0.4rem; }
.exercise-card .question { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.9rem; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem; }
@media (max-width: 480px) { .options { grid-template-columns: 1fr; } }
.option-btn {
  padding: 0.75rem 0.9rem; border-radius: 12px; border: 2px solid #e0e0e0;
  background: #fafafa; font-family: 'Nunito', sans-serif; font-size: 0.95rem;
  font-weight: 600; cursor: pointer; text-align: left; transition: all 0.15s;
}
.option-btn:hover { border-color: #aaa; background: #f0f0f0; }
.option-btn.correct { border-color: #00B894; background: #d4f5ed; color: #00634f; }
.option-btn.wrong { border-color: #FF6B6B; background: #ffe0e0; color: #c0392b; }
.option-btn:disabled { cursor: default; }
.fill-input {
  width: 100%; padding: 0.75rem 1rem; border-radius: 12px; border: 2px solid #e0e0e0;
  font-family: 'Nunito', sans-serif; font-size: 1rem; font-weight: 600; outline: none; transition: border 0.2s;
}
.fill-input:focus { border-color: #667eea; }
.fill-input.correct { border-color: #00B894; background: #d4f5ed; }
.fill-input.wrong { border-color: #FF6B6B; background: #ffe0e0; }
.check-btn {
  margin-top: 0.7rem; padding: 0.65rem 1.4rem; border-radius: 30px; border: none;
  background: #667eea; color: white; font-family: 'Nunito', sans-serif;
  font-size: 0.95rem; font-weight: 700; cursor: pointer; transition: background 0.2s;
}
.check-btn:hover { background: #5a6fd6; }
.feedback {
  margin-top: 0.7rem; padding: 0.6rem 1rem; border-radius: 10px;
  font-weight: 700; font-size: 0.9rem; display: none;
}
.feedback.show { display: block; }
.feedback.ok { background: #d4f5ed; color: #00634f; }
.feedback.err { background: #ffe0e0; color: #c0392b; }

/* ── SCORE SUMMARY ── */
.score-summary { background: var(--card); border-radius: var(--radius); padding: 1.4rem; text-align: center; box-shadow: var(--shadow); margin-top: 1rem; }
.score-summary h3 { font-size: 1.2rem; font-weight: 900; margin-bottom: 0.4rem; }
.score-summary .big-score { font-size: 2.8rem; font-weight: 900; color: var(--gold); }
.score-summary p { color: var(--muted); }

/* ── GAME AREA ── */
.game-area { background: var(--card); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); text-align: center; }
.game-area h3 { font-size: 1.15rem; font-weight: 900; margin-bottom: 0.5rem; }
.game-problem { font-size: 2.2rem; font-weight: 900; margin: 1rem 0; color: #333; }
.game-input { width: 130px; padding: 0.65rem; border-radius: 12px; border: 3px solid #667eea; font-family: 'Nunito', sans-serif; font-size: 1.4rem; font-weight: 800; text-align: center; outline: none; }
.game-stats { display: flex; justify-content: center; gap: 2rem; margin: 0.9rem 0; font-weight: 700; }
.game-stats span { color: var(--muted); font-size: 0.85rem; }
.game-stats strong { display: block; font-size: 1.2rem; color: var(--text); }
.start-game-btn {
  padding: 0.75rem 2rem; border-radius: 30px; border: none;
  background: linear-gradient(135deg, #667eea, #764ba2); color: white;
  font-family: 'Nunito', sans-serif; font-size: 1.05rem; font-weight: 800; cursor: pointer; margin-top: 0.5rem;
}

/* ── BOT SIDEBAR (always open) ── */
.bot-sidebar-panel {
  background: white; border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; flex-direction: column; height: 100%; overflow: hidden;
  border: 2px solid #e8e4ff;
}
.bot-header-bar {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white; padding: 0.9rem 1rem;
  display: flex; align-items: center; gap: 0.6rem; flex-shrink: 0;
}
.bot-avatar { font-size: 1.8rem; }
.bot-header-bar .bot-name { font-weight: 800; font-size: 1rem; }
.bot-header-bar .bot-sub { font-size: 0.75rem; opacity: 0.85; }
.bot-messages-area {
  flex: 1; overflow-y: auto; padding: 0.9rem;
  display: flex; flex-direction: column; gap: 0.5rem;
  min-height: 150px; max-height: 280px;
}
.bot-msg {
  background: #f0f4ff; border-radius: 14px 14px 14px 4px;
  padding: 0.65rem 0.85rem; font-size: 0.88rem; font-weight: 600;
  line-height: 1.55; max-width: 95%; animation: popIn 0.2s ease;
}
.bot-msg.bot-speak { background: #e8f5e9; border-left: 3px solid #00B894; }
@keyframes popIn { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.bot-quick-btns {
  padding: 0.7rem; display: flex; flex-direction: column; gap: 0.4rem;
  border-top: 1px solid #eee; flex-shrink: 0;
}
.bot-q-btn {
  width: 100%; padding: 0.5rem 0.8rem; border-radius: 20px;
  border: 2px solid #e8e4ff; background: white; color: #667eea;
  font-family: 'Nunito', sans-serif; font-size: 0.82rem; font-weight: 700;
  cursor: pointer; transition: all 0.15s; text-align: left;
}
.bot-q-btn:hover { background: #667eea; color: white; border-color: #667eea; }
.bot-q-btn.nope { border-color: #FF6B6B; color: #FF6B6B; }
.bot-q-btn.nope:hover { background: #FF6B6B; color: white; }
.bot-q-btn.yes { border-color: #00B894; color: #00B894; }
.bot-q-btn.yes:hover { background: #00B894; color: white; }

/* ── MODAL ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 2000; }
.modal { background: white; border-radius: var(--radius); padding: 2rem; max-width: 380px; width: 90%; text-align: center; }
.modal h2 { font-size: 1.4rem; font-weight: 900; margin-bottom: 0.4rem; }
.modal p { color: var(--muted); margin-bottom: 1.1rem; font-size: 0.95rem; }
.modal input {
  width: 100%; padding: 0.75rem 1rem; border-radius: 12px; border: 2px solid #e0e0e0;
  font-family: 'Nunito', sans-serif; font-size: 1.05rem; font-weight: 600; outline: none;
  margin-bottom: 0.9rem; text-align: center;
}
.modal input:focus { border-color: #667eea; }
.modal .primary-btn {
  width: 100%; padding: 0.85rem; border-radius: 12px; border: none;
  background: linear-gradient(135deg, #667eea, #764ba2); color: white;
  font-family: 'Nunito', sans-serif; font-size: 1.05rem; font-weight: 800; cursor: pointer;
}

/* ── REWARD POPUP ── */
#reward-popup {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0);
  background: white; border-radius: 20px; padding: 1.8rem;
  text-align: center; z-index: 3000;
  box-shadow: 0 8px 40px rgba(0,0,0,0.2);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); min-width: 200px;
}
#reward-popup.show { transform: translate(-50%, -50%) scale(1); }
#reward-popup .reward-emoji { font-size: 2.8rem; }
#reward-popup h3 { font-size: 1.2rem; font-weight: 900; margin: 0.4rem 0; }
#reward-popup p { color: var(--muted); font-size: 0.9rem; }

/* ── PARALLAX ── */
.subject-header {
  position: relative;
  overflow: hidden;
  transition: background-position 0.1s linear;
}
.subject-header .s-icon {
  display: inline-block;
  transition: transform 0.1s linear;
  will-change: transform;
}
.welcome-card {
  position: relative;
  overflow: hidden;
  transition: background-position 0.1s linear;
}
.parallax-float {
  animation: floatIcon 3.5s ease-in-out infinite;
}
@keyframes floatIcon {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-10px); }
}

/* ── VIDEO MODAL ── */
.video-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 2500; padding: 1rem;
}
.video-modal {
  background: #111; border-radius: 16px; overflow: hidden;
  width: 100%; max-width: 720px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  display: flex; flex-direction: column;
}
.video-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1rem; background: #1a1a1a;
}
.video-modal-header span {
  color: white; font-weight: 800; font-size: 0.95rem;
}
.video-modal-close {
  background: none; border: none; color: white; font-size: 1.4rem;
  cursor: pointer; line-height: 1; padding: 0 0.3rem;
}
.video-modal-close:hover { color: #FF0000; }
.video-modal iframe {
  width: 100%; aspect-ratio: 16/9; border: none; display: block;
}

/* ── YOUTUBE BUTTON ── */
.yt-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 30px;
  border: none;
  background: #FF0000;
  color: white;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(255,0,0,0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}
.yt-btn:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 20px rgba(255,0,0,0.4);
}

/* ── ANIMATIONS ── */
@keyframes bounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }
.bounce { animation: bounce 0.5s ease 2; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)} }
.shake { animation: shake 0.4s ease; }

/* ── ADMIN ── */
.admin-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 1rem; margin-bottom: 1.2rem; }
@media (max-width:500px) { .admin-grid { grid-template-columns: 1fr; } }
.stat-card { background: white; border-radius: var(--radius); padding: 1.2rem; box-shadow: var(--shadow); text-align: center; }
.stat-card .stat-icon { font-size: 2rem; }
.stat-card .stat-val { font-size: 2rem; font-weight: 900; color: #667eea; }
.stat-card .stat-label { font-size: 0.82rem; color: var(--muted); font-weight: 700; }
.prog-row { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 0.6rem; }
.prog-row .prog-label { width: 120px; font-size: 0.88rem; font-weight: 700; flex-shrink: 0; }
.prog-row .prog-track { flex: 1; background: #f0f0f0; border-radius: 10px; height: 12px; overflow: hidden; }
.prog-row .prog-fill { height: 100%; border-radius: 10px; transition: width 0.5s; }
.prog-row .prog-pct { width: 36px; font-size: 0.82rem; font-weight: 700; color: var(--muted); text-align: right; flex-shrink: 0; }
.log-item { display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 0; border-bottom: 1px solid #f0f0f0; font-size: 0.88rem; }
.log-item:last-child { border-bottom: none; }
.admin-link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: rgba(255,255,255,0.2); color: white; text-decoration: none;
  padding: 0.35rem 0.9rem; border-radius: 30px; font-size: 0.85rem; font-weight: 700;
  transition: background 0.2s;
}
.admin-link:hover { background: rgba(255,255,255,0.35); }

/* ── GRADE PICKER BUTTONS ── */
.grade-pick-btn {
  background: #f0f4ff; border: 2px solid #d1d9ff;
  color: #667eea; font-family: 'Nunito', sans-serif;
  font-size: 1.05rem; font-weight: 800;
  width: 52px; height: 52px; border-radius: 14px;
  cursor: pointer; transition: all 0.18s;
}
.grade-pick-btn:hover { background: #e0e7ff; border-color: #667eea; }
.grade-pick-btn.active {
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-color: #764ba2; color: white;
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(102,126,234,0.35);
}

/* ── GUIDED TOUR ── */
#tour-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 9000;
  pointer-events: none;
}
#tour-highlight {
  position: absolute;
  border-radius: 16px;
  box-shadow: 0 0 0 4px #667eea, 0 0 0 9999px rgba(0,0,0,0.55);
  z-index: 9100;
  pointer-events: none;
  transition: all 0.35s ease;
  animation: tour-pulse 1.8s infinite;
}
@keyframes tour-pulse {
  0%,100% { box-shadow: 0 0 0 4px #667eea, 0 0 0 9999px rgba(0,0,0,0.55); }
  50%      { box-shadow: 0 0 0 7px #a78bfa, 0 0 0 9999px rgba(0,0,0,0.55); }
}
#tour-box {
  position: absolute;
  z-index: 9200;
  background: #fff;
  border-radius: 20px;
  padding: 1.4rem 1.5rem 1.1rem;
  box-shadow: 0 12px 40px rgba(0,0,0,0.22);
  font-family: 'Nunito', sans-serif;
  max-width: 320px;
  min-width: 260px;
  transition: top 0.35s ease, left 0.35s ease;
}
#tour-title {
  font-size: 1.05rem;
  font-weight: 900;
  color: #667eea;
  margin-bottom: 0.5rem;
}
#tour-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: #2D3436;
  line-height: 1.5;
  margin-bottom: 1rem;
}
#tour-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
#tour-skip {
  background: none; border: none;
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem; font-weight: 700;
  color: #aaa; cursor: pointer;
  padding: 0.3rem 0.5rem;
}
#tour-skip:hover { color: #667eea; }
#tour-next {
  background: linear-gradient(135deg, #667eea, #764ba2);
  border: none; border-radius: 30px;
  color: white; font-family: 'Nunito', sans-serif;
  font-size: 0.95rem; font-weight: 800;
  padding: 0.5rem 1.2rem; cursor: pointer;
  box-shadow: 0 4px 12px rgba(102,126,234,0.35);
  transition: transform 0.15s;
}
#tour-next:hover { transform: scale(1.05); }
#tour-dots {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-top: 0.8rem;
}
.tour-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #ddd;
  transition: background 0.2s;
}
.tour-dot.active { background: #667eea; }
