/* ═══════════════════════════════════════════════════════════════
   Makers and Leaders Lab Studio — v2.0 CSS
   Brand: Debiso Best | Red #CC0000 · Black #111111 · White #FFFFFF
   ═══════════════════════════════════════════════════════════════ */

:root {
  --primary:      #CC0000;
  --primary-dark: #990000;
  --primary-light:#FF3333;
  --black:        #111111;
  --surface:      #1A1A1A;
  --surface-2:    #222222;
  --surface-3:    #2A2A2A;
  --border:       #333333;
  --border-light: #444444;
  --text-primary: #F0F0F0;
  --text-muted:   #888888;
  --text-dim:     #555555;
  --success:      #22C55E;
  --warning:      #F59E0B;
  --info:         #3B82F6;
  --danger:       #EF4444;
  --sidebar-w:    240px;
  --topbar-h:     60px;
  --radius:       10px;
  --radius-sm:    6px;
  --shadow:       0 2px 12px rgba(0,0,0,0.5);
  --shadow-lg:    0 8px 32px rgba(0,0,0,0.7);
  --transition:   0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--black);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
  height: 100vh;
}

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

/* ════════════════════════════════════════════════
   LOGIN
   ════════════════════════════════════════════════ */
#login-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--black);
  z-index: 1000;
}

.login-bg-pattern {
  position: absolute; inset: 0;
  background-image: radial-gradient(circle at 20% 20%, rgba(204,0,0,0.08) 0%, transparent 50%),
                    radial-gradient(circle at 80% 80%, rgba(204,0,0,0.05) 0%, transparent 50%);
  pointer-events: none;
}

.login-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}

.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo-img { width: 80px; height: 80px; margin-bottom: 12px; }
.login-logo h1 { font-size: 20px; font-weight: 800; color: var(--text-primary); line-height: 1.3; }
.login-brand { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.login-brand a { color: var(--primary); text-decoration: none; }
.login-brand strong { color: var(--primary); }
.login-tagline { color: var(--text-dim); font-size: 11px; letter-spacing: 3px; margin-top: 6px; text-transform: uppercase; }
.login-error { background: rgba(204,0,0,0.1); border: 1px solid var(--primary); color: #FF6666; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 12px; }

.login-demo { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 16px; }
.demo-label { text-align: center; color: var(--text-muted); font-size: 12px; margin-bottom: 10px; }
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.demo-btn { background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted); padding: 8px 12px; border-radius: var(--radius-sm); cursor: pointer; font-size: 12px; transition: var(--transition); }
.demo-btn:hover { border-color: var(--primary); color: var(--primary); background: rgba(204,0,0,0.05); }

/* ════════════════════════════════════════════════
   APP LAYOUT
   ════════════════════════════════════════════════ */
#app { display: flex; height: 100vh; overflow: hidden; }

/* ── SIDEBAR ───────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  overflow-y: auto;
  transition: transform var(--transition);
}

.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-logo-img { width: 36px; height: 36px; }
.sidebar-logo-title { font-size: 12px; font-weight: 800; color: var(--text-primary); line-height: 1.2; }
.sidebar-logo-sub { font-size: 10px; color: var(--primary); font-weight: 600; }

.sidebar-nav { flex: 1; padding: 12px 8px; overflow-y: auto; }
.nav-section-label { font-size: 10px; color: var(--text-dim); letter-spacing: 1.5px; text-transform: uppercase; font-weight: 700; padding: 16px 8px 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 12px;
  border: none; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-muted);
  cursor: pointer; font-size: 13px; font-weight: 500;
  text-align: left; transition: var(--transition);
  margin-bottom: 2px;
}
.nav-item:hover { background: var(--surface-2); color: var(--text-primary); }
.nav-item.active { background: rgba(204,0,0,0.15); color: var(--primary); border-left: 3px solid var(--primary); }
.nav-icon { font-size: 15px; flex-shrink: 0; }

.sidebar-footer {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary); color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.sidebar-user-name { font-size: 12px; font-weight: 600; color: var(--text-primary); }
.sidebar-user-role { font-size: 11px; color: var(--text-muted); text-transform: capitalize; }
.sidebar-user-info { flex: 1; min-width: 0; overflow: hidden; }
.sidebar-user-name, .sidebar-user-role { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logout-btn { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 16px; padding: 4px; flex-shrink: 0; transition: var(--transition); }
.logout-btn:hover { color: var(--danger); }

/* ── MAIN AREA ─────────────────────────────────── */
#main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* ── TOPBAR ────────────────────────────────────── */
#topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px;
  flex-shrink: 0;
}
.sidebar-toggle { background: none; border: none; color: var(--text-muted); font-size: 18px; cursor: pointer; padding: 4px; display: none; }
.topbar-title { font-size: 17px; font-weight: 700; color: var(--text-primary); flex: 1; }
.topbar-breadcrumb { font-size: 12px; color: var(--text-muted); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* ── PAGES ─────────────────────────────────────── */
#pages { flex: 1; overflow-y: auto; padding: 24px; }
.page { display: none; }
.page.active { display: block; animation: fadeIn 0.2s ease; }

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

.page-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 24px; flex-wrap: wrap;
}
.page-header h2 { font-size: 22px; font-weight: 800; flex: 1; }
.page-sub { color: var(--text-muted); font-size: 13px; margin-top: 2px; }

/* ════════════════════════════════════════════════
   COMPONENTS
   ════════════════════════════════════════════════ */

/* ── CARD ──────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: var(--transition);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.card-title { font-size: 14px; font-weight: 700; color: var(--text-primary); }

/* ── BUTTONS ───────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; cursor: pointer;
  border: none; transition: var(--transition); text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-ghost { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text-primary); border-color: var(--border-light); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { opacity: 0.85; }
.btn-success { background: var(--success); color: white; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ── BADGES ────────────────────────────────────── */
.badge {
  display: inline-block; padding: 3px 9px;
  border-radius: 20px; font-size: 11px; font-weight: 600;
}
.badge-primary   { background: rgba(204,0,0,0.15); color: var(--primary); }
.badge-success   { background: rgba(34,197,94,0.15); color: var(--success); }
.badge-warning   { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-info      { background: rgba(59,130,246,0.15); color: var(--info); }
.badge-muted     { background: var(--surface-2); color: var(--text-muted); }

/* ── FORMS ─────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.form-group input,
.form-group textarea,
.form-group select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 9px 12px; font-size: 13px;
  transition: var(--transition); width: 100%;
  font-family: inherit;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(204,0,0,0.15); }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-group select { cursor: pointer; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.select-input {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary);
  padding: 7px 10px; font-size: 13px; cursor: pointer;
  font-family: inherit;
}
.select-input:focus { outline: none; border-color: var(--primary); }

.search-input {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary);
  padding: 7px 12px; font-size: 13px; min-width: 200px;
}
.search-input:focus { outline: none; border-color: var(--primary); }

/* ── STATS GRID ────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
  display: flex; flex-direction: column; gap: 8px;
  transition: var(--transition);
}
.stat-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.stat-card.accent { border-top: 3px solid var(--primary); }
.stat-card.success { border-top: 3px solid var(--success); }
.stat-card.info    { border-top: 3px solid var(--info); }
.stat-card.warning { border-top: 3px solid var(--warning); }
.stat-icon { font-size: 24px; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--text-primary); line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }

/* ── CHARTS GRID ───────────────────────────────── */
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.chart-wrap { height: 220px; }
.two-col-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── CARDS GRID ────────────────────────────────── */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }

/* ── COHORT CARD ───────────────────────────────── */
.cohort-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  cursor: pointer; transition: var(--transition);
  border-top: 4px solid var(--primary);
}
.cohort-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--primary); }
.cohort-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.cohort-icon { font-size: 28px; }
.cohort-name { font-size: 15px; font-weight: 700; }
.cohort-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; line-height: 1.5; }
.cohort-meta { display: flex; gap: 12px; font-size: 12px; color: var(--text-muted); }

/* ── COURSE CARD ───────────────────────────────── */
.courses-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.course-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  cursor: pointer; transition: var(--transition);
}
.course-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--primary); }
.course-card-thumb {
  height: 130px; display: flex; align-items: center; justify-content: center;
  font-size: 48px; position: relative;
}
.course-card-level {
  position: absolute; top: 10px; right: 10px;
  background: rgba(0,0,0,0.6); padding: 3px 8px;
  border-radius: 20px; font-size: 11px; color: white; font-weight: 600;
}
.course-card-body { padding: 16px; }
.course-card-title { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.course-card-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.course-card-meta { display: flex; gap: 8px; font-size: 11px; color: var(--text-muted); flex-wrap: wrap; }
.course-card-meta span { display: flex; align-items: center; gap: 4px; }
.course-progress-bar { height: 4px; background: var(--border); border-radius: 2px; margin-top: 10px; overflow: hidden; }
.course-progress-fill { height: 100%; background: var(--primary); border-radius: 2px; transition: width 0.4s ease; }

/* ── COURSE VIEW LAYOUT ────────────────────────── */
.course-view-layout { display: grid; grid-template-columns: 260px 1fr; gap: 20px; }
.course-sidebar-nav { display: flex; flex-direction: column; gap: 10px; }
.course-sidebar-nav .card { padding: 12px; }
.course-module-item { padding: 8px; }
.course-module-title { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.course-lesson-btn {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 8px 10px; border: none;
  background: transparent; color: var(--text-muted);
  border-radius: var(--radius-sm); cursor: pointer;
  font-size: 12px; text-align: left; transition: var(--transition);
  margin-bottom: 2px;
}
.course-lesson-btn:hover { background: var(--surface-2); color: var(--text-primary); }
.course-lesson-btn.active { background: rgba(204,0,0,0.1); color: var(--primary); }
.course-lesson-btn.completed { color: var(--success); }
.lesson-check { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 9px; }
.lesson-check.done { background: var(--success); border-color: var(--success); color: white; }
.course-content-area { min-width: 0; }

/* ── LESSON VIEW ───────────────────────────────── */
.lesson-content { line-height: 1.8; }
.lesson-content h1, .lesson-content h2, .lesson-content h3 { color: var(--text-primary); margin: 20px 0 10px; }
.lesson-content h2 { font-size: 20px; font-weight: 700; border-bottom: 2px solid var(--primary); padding-bottom: 8px; }
.lesson-content h3 { font-size: 16px; font-weight: 600; color: var(--primary); }
.lesson-content p { margin-bottom: 14px; color: var(--text-primary); }
.lesson-content ul, .lesson-content ol { padding-left: 24px; margin-bottom: 14px; }
.lesson-content li { margin-bottom: 8px; color: var(--text-primary); }
.lesson-content strong { color: var(--primary); }
.lesson-content blockquote { border-left: 4px solid var(--primary); padding: 12px 16px; background: var(--surface-2); border-radius: 0 8px 8px 0; margin: 16px 0; color: var(--text-muted); }

/* ── COURSE BUILDER ────────────────────────────── */
.builder-layout { display: grid; grid-template-columns: 320px 1fr; gap: 20px; }
.builder-meta { position: sticky; top: 0; }
.builder-module-item { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 12px; overflow: hidden; }
.builder-module-header { display: flex; align-items: center; gap: 10px; padding: 12px; background: var(--surface-2); cursor: pointer; }
.builder-module-title { flex: 1; font-weight: 600; font-size: 13px; }
.builder-lessons-list { padding: 8px 12px; }
.builder-lesson-item { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--text-muted); }
.builder-lesson-item:last-child { border-bottom: none; }

/* ── QUIZ ──────────────────────────────────────── */
.quiz-container { max-width: 700px; margin: 0 auto; }
.quiz-progress { margin-bottom: 20px; }
.quiz-q-counter { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.quiz-progress-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.quiz-progress-fill { height: 100%; background: var(--primary); transition: width 0.3s ease; }
.quiz-question-card { padding: 24px; }
.quiz-q-text { font-size: 17px; font-weight: 600; margin-bottom: 20px; line-height: 1.5; }
.quiz-option {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border: 2px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer;
  margin-bottom: 10px; transition: var(--transition);
  font-size: 14px; background: var(--surface-2);
}
.quiz-option:hover { border-color: var(--primary); background: rgba(204,0,0,0.05); }
.quiz-option.selected { border-color: var(--primary); background: rgba(204,0,0,0.1); }
.quiz-option.correct { border-color: var(--success); background: rgba(34,197,94,0.1); }
.quiz-option.wrong { border-color: var(--danger); background: rgba(239,68,68,0.1); }
.quiz-option-letter {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--border); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.quiz-option.selected .quiz-option-letter { background: var(--primary); color: white; }
.quiz-nav { display: flex; justify-content: space-between; margin-top: 20px; }
.quiz-result { text-align: center; padding: 40px; }
.quiz-result-score { font-size: 72px; font-weight: 900; color: var(--primary); }
.quiz-result-label { font-size: 16px; color: var(--text-muted); margin-top: 8px; }
.quiz-result-pass { color: var(--success); font-size: 18px; font-weight: 700; margin-top: 16px; }
.quiz-result-fail { color: var(--danger); font-size: 18px; font-weight: 700; margin-top: 16px; }
.quiz-timer { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 14px; font-size: 13px; font-weight: 700; color: var(--warning); }

/* ── DISCUSSIONS ───────────────────────────────── */
.discussions-layout { display: grid; grid-template-columns: 200px 1fr; gap: 20px; }
.discussions-course-filter-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13px; color: var(--text-muted);
  transition: var(--transition); margin-bottom: 4px;
}
.discussions-course-filter-item:hover { background: var(--surface-2); color: var(--text-primary); }
.discussions-course-filter-item.active { background: rgba(204,0,0,0.1); color: var(--primary); }
.discussion-post-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; margin-bottom: 12px;
  cursor: pointer; transition: var(--transition);
}
.discussion-post-card:hover { border-color: var(--primary); transform: translateX(3px); }
.post-title { font-size: 15px; font-weight: 600; margin-bottom: 6px; color: var(--text-primary); }
.post-meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.post-pinned { background: rgba(245,158,11,0.15); color: var(--warning); padding: 2px 8px; border-radius: 20px; font-size: 11px; }
.post-announcement { background: rgba(204,0,0,0.15); color: var(--primary); padding: 2px 8px; border-radius: 20px; font-size: 11px; }
.reply-card { background: var(--surface-2); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 10px; border-left: 3px solid var(--border); }
.reply-card.solution { border-left-color: var(--success); }
.reply-author { font-size: 12px; font-weight: 600; color: var(--primary); margin-bottom: 8px; }
.reply-body { font-size: 13px; line-height: 1.6; color: var(--text-primary); }
.reply-body p { margin-bottom: 8px; }

/* ── CERTIFICATES ──────────────────────────────── */
.certs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-bottom: 20px; }
.cert-card {
  background: linear-gradient(135deg, var(--surface) 0%, rgba(204,0,0,0.05) 100%);
  border: 1px solid rgba(204,0,0,0.3); border-radius: var(--radius);
  padding: 20px; text-align: center; cursor: pointer;
  transition: var(--transition);
}
.cert-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(204,0,0,0.2); }
.cert-card-icon { font-size: 36px; margin-bottom: 10px; }
.cert-card-title { font-size: 14px; font-weight: 700; margin-bottom: 6px; color: var(--text-primary); }
.cert-card-date { font-size: 12px; color: var(--text-muted); }
.cert-card-number { font-size: 11px; color: var(--primary); margin-top: 6px; font-family: monospace; }

/* Certificate frame */
.certificate-frame {
  background: white; color: #1A1A1A;
  border: 8px solid #CC0000; border-radius: 12px;
  max-width: 700px; margin: 0 auto;
  padding: 50px 60px; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  position: relative;
}
.certificate-frame::before {
  content: ''; position: absolute; inset: 12px;
  border: 2px solid rgba(204,0,0,0.2); border-radius: 6px; pointer-events: none;
}
.cert-header-logo { margin-bottom: 20px; }
.cert-brand { font-size: 26px; font-weight: 900; color: #1A1A1A; font-family: Georgia, serif; }
.cert-brand-sub { font-size: 13px; color: #666; margin-top: 4px; }
.cert-divider { width: 80px; height: 3px; background: #CC0000; margin: 20px auto; }
.cert-label { font-size: 14px; color: #888; letter-spacing: 2px; text-transform: uppercase; margin: 10px 0; }
.cert-name { font-size: 36px; font-weight: 800; color: #CC0000; font-family: Georgia, serif; margin: 8px 0; }
.cert-course { font-size: 20px; font-weight: 700; color: #1A1A1A; margin: 8px 0; font-family: Georgia, serif; }
.cert-meta { display: flex; justify-content: center; gap: 40px; font-size: 13px; color: #555; margin: 20px 0; flex-wrap: wrap; }
.cert-meta-label { font-weight: 600; color: #1A1A1A; }
.cert-signature { margin-top: 30px; }
.cert-sig-line { width: 200px; height: 1px; background: #999; margin: 0 auto 8px; }
.cert-sig-name { font-size: 15px; font-weight: 700; color: #1A1A1A; }
.cert-sig-title { font-size: 12px; color: #888; margin-top: 2px; }

/* ── REWARDS ───────────────────────────────────── */
.xp-bar-wrap { margin: 12px 0; }
.xp-bar-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.xp-bar-track { height: 12px; background: var(--border); border-radius: 6px; overflow: hidden; }
.xp-bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-light)); border-radius: 6px; transition: width 0.6s ease; }
.badges-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.badge-item {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; text-align: center;
  transition: var(--transition);
}
.badge-item:hover { border-color: var(--primary); }
.badge-item.earned { border-color: var(--warning); background: rgba(245,158,11,0.05); }
.badge-item-icon { font-size: 30px; margin-bottom: 8px; }
.badge-item-name { font-size: 12px; font-weight: 700; color: var(--text-primary); }
.badge-item-desc { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.badge-item-xp { font-size: 11px; color: var(--warning); margin-top: 4px; font-weight: 600; }
.badge-item.locked { opacity: 0.4; }
.leaderboard-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); margin-bottom: 8px;
  transition: var(--transition);
}
.leaderboard-item:hover { border-color: var(--primary); }
.leaderboard-item.me { border-color: var(--primary); background: rgba(204,0,0,0.05); }
.lb-rank { font-size: 18px; font-weight: 900; width: 32px; text-align: center; flex-shrink: 0; }
.lb-rank.gold   { color: #FFD700; }
.lb-rank.silver { color: #C0C0C0; }
.lb-rank.bronze { color: #CD7F32; }
.lb-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.lb-name { flex: 1; font-weight: 600; }
.lb-xp { font-size: 13px; font-weight: 700; color: var(--primary); }
.lb-level { font-size: 11px; color: var(--text-muted); }

/* ── TABLES ────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead { border-bottom: 2px solid var(--border); }
th { text-align: left; padding: 10px 12px; font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
td { padding: 11px 12px; font-size: 13px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-2); }
td .user-role-badge { font-size: 11px; padding: 2px 8px; border-radius: 20px; font-weight: 600; }

/* ── PROFILE ───────────────────────────────────── */
.profile-layout { display: grid; grid-template-columns: 260px 1fr; gap: 20px; }
.profile-card { text-align: center; }
.profile-avatar-wrap { padding: 20px 0; }
.profile-avatar { width: 80px; height: 80px; border-radius: 50%; background: var(--primary); color: white; font-size: 32px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.profile-avatar-name { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.profile-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.profile-stat { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px; text-align: center; }
.profile-stat-value { font-size: 20px; font-weight: 800; color: var(--primary); }
.profile-stat-label { font-size: 11px; color: var(--text-muted); }

/* ── SLIDE UPLOAD ──────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 40px 20px; text-align: center; cursor: pointer;
  transition: var(--transition);
}
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--primary); background: rgba(204,0,0,0.03); }
.upload-icon { font-size: 48px; margin-bottom: 12px; }
.upload-zone p { color: var(--text-muted); margin-bottom: 8px; }

/* ── AI ASSISTANT ──────────────────────────────── */
.ai-layout { display: grid; grid-template-columns: 340px 1fr; gap: 20px; }
.ai-input-card { position: sticky; top: 0; max-height: calc(100vh - 120px); overflow-y: auto; }
.ai-output-card { animation: fadeIn 0.3s ease; }
.ai-output h1, .ai-output h2, .ai-output h3 { color: var(--primary); margin: 16px 0 8px; }
.ai-output p { margin-bottom: 12px; line-height: 1.7; }
.ai-output ul, .ai-output ol { padding-left: 20px; margin-bottom: 12px; }
.ai-output li { margin-bottom: 6px; }
.ai-output .section { background: var(--surface-2); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 10px; }
.ai-output .section-heading { font-weight: 700; color: var(--primary); margin-bottom: 8px; font-size: 14px; }
.ai-history-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); cursor: pointer; font-size: 12px; color: var(--text-muted); transition: var(--transition); }
.ai-history-item:hover { background: var(--surface-2); color: var(--text-primary); }

/* ── PARENT PORTAL ─────────────────────────────── */
.student-overview-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
  cursor: pointer; transition: var(--transition);
}
.student-overview-card:hover { border-color: var(--primary); }
.student-card-header { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.student-card-avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--primary); color: white; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; }
.student-card-name { font-size: 16px; font-weight: 700; }
.student-card-cohort { font-size: 12px; color: var(--text-muted); }
.parent-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.parent-stat { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px; text-align: center; }
.parent-stat-value { font-size: 20px; font-weight: 800; color: var(--primary); }
.parent-stat-label { font-size: 11px; color: var(--text-muted); }

/* ── MODALS ────────────────────────────────────── */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
  z-index: 500; padding: 20px;
}
.modal.open { display: flex; }
.modal-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
  width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.2s ease;
}
.modal-box.modal-lg { max-width: 600px; }
@keyframes modalIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-header h3 { font-size: 17px; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 18px; cursor: pointer; padding: 4px; line-height: 1; }
.modal-close:hover { color: var(--danger); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ── TOASTS ────────────────────────────────────── */
#toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--surface-3); border: 1px solid var(--border);
  color: var(--text-primary); font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow); min-width: 260px; pointer-events: all;
  animation: slideIn 0.3s ease, fadeOut 0.3s ease 3.2s forwards;
}
.toast.success { border-color: var(--success); }
.toast.error   { border-color: var(--danger); }
.toast.warning { border-color: var(--warning); }
.toast-msg { flex: 1; }
.toast-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 14px; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; transform: translateX(100%); } }

/* ── EMPTY STATE ───────────────────────────────── */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ── PROGRESS BARS ─────────────────────────────── */
.progress-bar-wrap { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-light)); border-radius: 4px; transition: width 0.4s ease; }

/* ── MISC ──────────────────────────────────────── */
.flex-center { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.text-muted { color: var(--text-muted); }
.text-primary-c { color: var(--primary); }
.font-mono { font-family: 'Courier New', monospace; }
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── QUESTION BUILDER ──────────────────────────── */
.question-item { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 12px; }
.question-item-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.option-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.option-row input[type="text"] { flex: 1; }
.option-row input[type="radio"] { flex-shrink: 0; accent-color: var(--primary); }

/* ── MY LEARNING ───────────────────────────────── */
.my-learning-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; margin-bottom: 12px;
  display: flex; align-items: center; gap: 16px;
  transition: var(--transition);
}
.my-learning-card:hover { border-color: var(--primary); }
.my-learning-thumb { width: 56px; height: 56px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 28px; flex-shrink: 0; }
.my-learning-info { flex: 1; min-width: 0; }
.my-learning-title { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.my-learning-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }

/* ── ANNOUNCEMENT ──────────────────────────────── */
.announcement-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 12px; border-left: 4px solid var(--primary); }
.announcement-title { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.announcement-body { font-size: 13px; color: var(--text-muted); line-height: 1.6; }
.announcement-body p { margin-bottom: 8px; }
.announcement-meta { font-size: 11px; color: var(--text-dim); margin-top: 10px; }

/* ── RESPONSIVE ────────────────────────────────── */
@media (max-width: 900px) {
  .charts-grid { grid-template-columns: 1fr; }
  .two-col-grid { grid-template-columns: 1fr; }
  .course-view-layout { grid-template-columns: 1fr; }
  .builder-layout { grid-template-columns: 1fr; }
  .ai-layout { grid-template-columns: 1fr; }
  .discussions-layout { grid-template-columns: 1fr; }
  .profile-layout { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 200; transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: block; }
  #pages { padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .course-view-layout { grid-template-columns: 1fr; }
  .parent-stats { grid-template-columns: 1fr 1fr; }
}

/* ── PRINT (certificates) ──────────────────────── */
@media print {
  #sidebar, #topbar, #cert-viewer > div:last-child { display: none !important; }
  #main { overflow: visible; }
  #pages { padding: 0; }
  .certificate-frame { border: 8px solid #CC0000 !important; box-shadow: none !important; }
}
