/* ===== CSS Variables & Reset ===== */
:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #818cf8;
  --secondary: #06b6d4;
  --accent: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --sidebar-bg: #1e1b4b;
  --sidebar-text: #c7d2fe;
  --sidebar-active: #4f46e5;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.2s ease;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --bg-card: #1e293b;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #334155;
  --sidebar-bg: #0f172a;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; }
button { cursor: pointer; }
ul, ol { list-style: none; }

/* ===== Layout ===== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
  overflow-y: auto;
}

.sidebar-logo {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo .logo-icon {
  width: 40px; height: 40px;
  background: var(--primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.sidebar-logo h1 {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.sidebar-logo span {
  font-size: 11px;
  color: var(--sidebar-text);
  font-weight: 400;
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
}

.nav-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(199,210,254,.4);
  padding: 16px 8px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--sidebar-text);
  font-size: 14px;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  margin-bottom: 2px;
}

.nav-item:hover {
  background: rgba(255,255,255,.07);
  color: #fff;
}

.nav-item.active {
  background: var(--primary);
  color: #fff;
}

.nav-item .nav-icon {
  font-size: 18px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--transition);
}
.user-card:hover { background: rgba(255,255,255,.07); }

.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 14px;
  flex-shrink: 0;
}

.user-info .user-name { font-size: 13px; font-weight: 600; color: #fff; }
.user-info .user-role { font-size: 11px; color: var(--sidebar-text); }

/* ===== Main Content ===== */
.main-content {
  margin-left: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== Topbar ===== */
.topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text);
  padding: 4px;
}

.page-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  gap: 8px;
  width: 240px;
  transition: border-color var(--transition);
}
.search-box:focus-within { border-color: var(--primary); }
.search-box input {
  background: none;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--text);
  width: 100%;
}
.search-box input::placeholder { color: var(--text-muted); }
.search-box span { color: var(--text-muted); font-size: 16px; }

.icon-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 38px; height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-muted);
  transition: all var(--transition);
  position: relative;
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }

.notif-badge {
  position: absolute;
  top: 4px; right: 4px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 1.5px solid var(--bg-card);
}

/* ===== Page Body ===== */
.page-body {
  padding: 24px;
  flex: 1;
}

/* ===== Cards ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ===== Stats Grid ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-icon.purple { background: rgba(79,70,229,.12); }
.stat-icon.cyan { background: rgba(6,182,212,.12); }
.stat-icon.amber { background: rgba(245,158,11,.12); }
.stat-icon.green { background: rgba(16,185,129,.12); }

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.stat-change {
  font-size: 12px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ===== Grid Layouts ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }

/* ===== Progress ===== */
.progress-bar {
  background: var(--border);
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--primary);
  transition: width 0.6s ease;
}
.progress-fill.green { background: var(--success); }
.progress-fill.amber { background: var(--warning); }
.progress-fill.cyan { background: var(--secondary); }

/* ===== Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
}
.badge-purple { background: rgba(79,70,229,.12); color: var(--primary); }
.badge-green { background: rgba(16,185,129,.12); color: var(--success); }
.badge-amber { background: rgba(245,158,11,.12); color: var(--warning); }
.badge-cyan { background: rgba(6,182,212,.12); color: var(--secondary); }
.badge-red { background: rgba(239,68,68,.12); color: var(--danger); }
.badge-gray { background: var(--border); color: var(--text-muted); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  transition: all var(--transition);
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-secondary { background: var(--bg); border: 1px solid var(--border); color: var(--text); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 16px; }

/* ===== Lesson Cards ===== */
.lesson-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow-sm);
}
.lesson-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.lesson-thumb {
  position: relative;
  padding-top: 56.25%;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  overflow: hidden;
}
.lesson-thumb-inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}
.lesson-thumb .play-btn {
  position: absolute;
  bottom: 10px; right: 10px;
  background: rgba(255,255,255,.2);
  backdrop-filter: blur(8px);
  border: 1.5px solid rgba(255,255,255,.4);
  border-radius: 50%;
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
}
.lesson-thumb .duration {
  position: absolute;
  bottom: 10px; left: 10px;
  background: rgba(0,0,0,.5);
  color: #fff;
  font-size: 12px;
  padding: 2px 7px;
  border-radius: 4px;
}

.lesson-body { padding: 16px; }
.lesson-subject { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--primary); margin-bottom: 6px; }
.lesson-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 6px; line-height: 1.3; }
.lesson-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lesson-meta { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--text-muted); }
.lesson-meta span { display: flex; align-items: center; gap: 4px; }
.lesson-footer { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }

/* ===== Quiz ===== */
.quiz-container {
  max-width: 720px;
  margin: 0 auto;
}

.quiz-header {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius);
  padding: 28px;
  color: #fff;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.quiz-header::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 150px; height: 150px;
  background: rgba(255,255,255,.08);
  border-radius: 50%;
}

.quiz-progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 14px;
}

.quiz-question-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 16px;
}

.question-text {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
  line-height: 1.4;
}

.options-list { display: flex; flex-direction: column; gap: 10px; }

.option-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--transition);
}
.option-item:hover { border-color: var(--primary); background: rgba(79,70,229,.04); }
.option-item.selected { border-color: var(--primary); background: rgba(79,70,229,.08); }
.option-item.correct { border-color: var(--success); background: rgba(16,185,129,.08); }
.option-item.incorrect { border-color: var(--danger); background: rgba(239,68,68,.08); }

.option-letter {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
  transition: all var(--transition);
}
.option-item.selected .option-letter { background: var(--primary); border-color: var(--primary); color: #fff; }
.option-item.correct .option-letter { background: var(--success); border-color: var(--success); color: #fff; }
.option-item.incorrect .option-letter { background: var(--danger); border-color: var(--danger); color: #fff; }

.option-text { font-size: 15px; color: var(--text); flex: 1; }

.quiz-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.quiz-result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  box-shadow: var(--shadow);
}

.result-circle {
  width: 120px; height: 120px;
  border-radius: 50%;
  background: conic-gradient(var(--primary) var(--pct), var(--border) 0);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  position: relative;
}
.result-circle-inner {
  width: 90px; height: 90px;
  background: var(--bg-card);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.result-score { font-size: 26px; font-weight: 700; color: var(--text); line-height: 1; }
.result-total { font-size: 13px; color: var(--text-muted); }

/* ===== Calendar ===== */
.calendar-container { }

.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.calendar-month { font-size: 18px; font-weight: 600; }
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-header {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 8px 4px;
}
.cal-day {
  min-height: 72px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: background var(--transition);
}
.cal-day:hover { background: rgba(79,70,229,.05); border-color: var(--primary); }
.cal-day.today { border-color: var(--primary); background: rgba(79,70,229,.06); }
.cal-day.today .day-num { background: var(--primary); color: #fff; border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.cal-day.other-month { opacity: .4; }
.day-num { font-weight: 600; color: var(--text); margin-bottom: 4px; display: inline-block; }
.cal-event {
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 3px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.cal-event.green { background: var(--success); }
.cal-event.amber { background: var(--warning); }
.cal-event.cyan { background: var(--secondary); }

.event-list { display: flex; flex-direction: column; gap: 12px; }
.event-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  transition: background var(--transition);
}
.event-item:hover { background: rgba(79,70,229,.04); }
.event-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.event-dot.purple { background: var(--primary); }
.event-dot.green { background: var(--success); }
.event-dot.amber { background: var(--warning); }
.event-dot.cyan { background: var(--secondary); }

.event-info .event-title { font-size: 14px; font-weight: 600; color: var(--text); }
.event-info .event-time { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ===== Tutoring ===== */
.tutor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.tutor-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.tutor-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.tutor-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
}

.tutor-name { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.tutor-subject { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.tutor-rating { display: flex; align-items: center; justify-content: center; gap: 4px; margin-bottom: 12px; }
.stars { color: var(--warning); font-size: 14px; }
.tutor-rating .rating-num { font-size: 13px; color: var(--text-muted); }
.tutor-status { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; margin-bottom: 14px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; }
.status-dot.online { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-dot.busy { background: var(--warning); }
.status-dot.offline { background: var(--text-muted); }

.video-room {
  background: #1a1a2e;
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.video-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.video-feed {
  background: #0d0d1a;
  border-radius: 10px;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.video-feed.main { background: linear-gradient(135deg, #1a1a3e, #0f3460); }
.video-feed.self { background: linear-gradient(135deg, #1e3a5f, #0d2137); }
.video-placeholder { text-align: center; color: rgba(255,255,255,.6); }
.video-placeholder .avatar-big {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin: 0 auto 8px;
}
.video-label {
  position: absolute;
  bottom: 8px; left: 8px;
  background: rgba(0,0,0,.5);
  color: #fff;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
}
.video-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
}
.ctrl-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: all var(--transition);
}
.ctrl-btn.mic { background: rgba(255,255,255,.15); color: #fff; }
.ctrl-btn.cam { background: rgba(255,255,255,.15); color: #fff; }
.ctrl-btn.end { background: var(--danger); color: #fff; }
.ctrl-btn.screen { background: rgba(255,255,255,.15); color: #fff; }
.ctrl-btn:hover { transform: scale(1.1); }

/* ===== Materials ===== */
.material-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  transition: all var(--transition);
  margin-bottom: 10px;
}
.material-item:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }

.file-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.file-icon.pdf { background: rgba(239,68,68,.12); }
.file-icon.doc { background: rgba(79,70,229,.12); }
.file-icon.ppt { background: rgba(245,158,11,.12); }
.file-icon.zip { background: rgba(16,185,129,.12); }
.file-icon.mp4 { background: rgba(6,182,212,.12); }

.material-info { flex: 1; }
.material-name { font-size: 14px; font-weight: 600; color: var(--text); }
.material-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.material-actions { display: flex; gap: 8px; }

/* ===== Activity Feed ===== */
.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.activity-text { font-size: 13px; color: var(--text); }
.activity-text strong { color: var(--text); }
.activity-time { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

/* ===== Course List ===== */
.course-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.course-item:last-child { border-bottom: none; }
.course-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.course-info { flex: 1; }
.course-name { font-size: 14px; font-weight: 600; color: var(--text); }
.course-chapter { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.course-progress-wrap { width: 100px; }
.course-pct { font-size: 12px; color: var(--text-muted); text-align: right; margin-bottom: 4px; }

/* ===== Tabs ===== */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}
.tab-btn {
  padding: 10px 16px;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: color var(--transition);
}
.tab-btn.active { color: var(--primary); }
.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0; right: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 2px 2px 0 0;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ===== Code Block ===== */
.code-block {
  background: #1e293b;
  border-radius: 8px;
  padding: 16px;
  margin: 12px 0;
  overflow-x: auto;
}
.code-block pre {
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 13px;
  color: #e2e8f0;
  white-space: pre;
  line-height: 1.6;
}
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.code-lang {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--primary-light);
}

/* ===== Notifications Panel ===== */
.notification-panel {
  position: fixed;
  top: 64px; right: 0;
  width: 340px;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  height: calc(100vh - 64px);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform var(--transition);
  z-index: 200;
  box-shadow: var(--shadow-lg);
}
.notification-panel.open { transform: translateX(0); }
.notif-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.notif-item { padding: 14px 20px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background var(--transition); }
.notif-item:hover { background: var(--bg); }
.notif-item.unread { border-left: 3px solid var(--primary); }
.notif-title { font-size: 13px; font-weight: 600; color: var(--text); }
.notif-desc { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.notif-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease, slideOut 0.3s ease 2.7s forwards;
  min-width: 280px;
  border-left: 4px solid var(--primary);
}
.toast.success { border-left-color: var(--success); }
.toast.warning { border-left-color: var(--warning); }
.toast.error { border-left-color: var(--danger); }
.toast-icon { font-size: 18px; }
.toast-text { font-size: 13px; color: var(--text); flex: 1; }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(100%); }
}

/* ===== Loading ===== */
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, rgba(226,232,240,.5) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .video-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }
  .hamburger {
    display: flex;
  }
  .search-box { width: 160px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; }
  .page-body { padding: 16px; }
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 99;
    display: none;
  }
  .sidebar-overlay.visible { display: block; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .search-box { display: none; }
}

/* ===== Utility ===== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.text-muted { color: var(--text-muted); }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.hidden { display: none; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.rounded-full { border-radius: 99px; }
