/* ==========================================================================
   LMS Stylesheet — Clean, Corporate (Notion/Linear style)
   Font: Inter | Accent: #4f46e5 | Sidebar: #111827
   ========================================================================== */

/* ==========================================================================
   CSS Custom Properties
   ========================================================================== */

:root {
  /* =============================================================
     Tokens now live in css/tokens.css (loaded first).
     This block contains ONLY:
     - Tokens not covered by tokens.css
     - Legacy aliases for backward compatibility
     ============================================================= */

  /* Extra shadows not in tokens.css */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);

  /* Extra semantic bg tokens not in tokens.css */
  --color-success-bg: rgba(16, 185, 129, 0.08);
  --color-error-bg:   rgba(239, 68, 68, 0.06);

  /* Granular motion aliases (used by some components) */
  --duration-fast:   150ms;
  --duration-normal: 200ms;
  --duration-slow:   300ms;
  --transition: var(--duration-normal) var(--ease-out);

  /* =============================================================
     LEGACY ALIASES — old names → canonical tokens from tokens.css.
     Still referenced in ~340 places. Migrate later.
     ============================================================= */
  --color-bg:             var(--surface-card);
  --color-bg-subtle:      var(--surface-subtle);
  --color-bg-muted:       var(--surface-bg);
  --color-light-bg:       var(--surface-subtle);
  --color-card:           var(--surface-card);
  --color-dark:           var(--surface-sidebar);
  --color-text:           var(--text-primary);
  --color-text-secondary: var(--text-secondary);
  --color-text-muted:     var(--text-muted);
  --color-text-light:     var(--text-muted);
  --color-border:         var(--border-default);
  --color-border-strong:  var(--border-strong);
  --color-accent:         var(--brand-primary);
  --color-accent-light:   var(--brand-primary-mid);
  --color-accent-hover:   var(--brand-primary-hover);
  --color-accent-bg:      var(--brand-primary-light);

  /* Legacy spacing aliases */
  --space-xs:  var(--space-1);
  --space-sm:  var(--space-2);
  --space-md:  var(--space-4);
  --space-lg:  var(--space-6);
  --space-xl:  var(--space-8);
  --space-2xl: var(--space-12);
  --space-3xl: var(--space-16);
}

/* ==========================================================================
   GROUP 1 — Reset & Base
   ========================================================================== */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

/* Grote tekst modus voor senioren — schaalt alle rem-waarden op */
html.large-text {
  font-size: 20px;
}

body {
  font-family: var(--font-family);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

/* SVG icon utility */
.ico {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  fill: currentColor;
}

.ico-xs { width: 16px; height: 16px; }
.ico-sm { width: 24px; height: 24px; }
.ico-md { width: 32px; height: 32px; }
.ico-lg { width: 48px; height: 48px; }
.ico-xl { width: 80px; height: 80px; }
.ico-concept {
  width: 48px;
  height: 48px;
  filter: drop-shadow(0 4px 10px rgba(49,46,129,0.08));
}

/* Utility classes */
.text-muted { color: var(--color-text-light); }
.text-muted-sm { color: var(--color-text-light); font-size: 0.875rem; }
.text-center { text-align: center; }
.text-error { color: var(--color-error); }
.required-mark { color: var(--color-error); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 2rem; }
.cert-icon { font-size: 3rem; text-align: center; margin-bottom: 1rem; }

/* Level indicator dots (replace emoji 🟢🟡🔴) */
.level-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  vertical-align: middle;
  margin-right: 2px;
}
.level-beginner  { background-color: var(--color-success); }
.level-intermediate { background-color: var(--color-warning); }
.level-advanced  { background-color: var(--color-error); }

/* Auth form helpers */
.auth-form-center { text-align: center; }
.auth-form-message { padding: 12px; border-radius: 8px; margin-bottom: 15px; }
.auth-form-link { cursor: pointer; color: var(--brand-primary); }
.auth-form-subtitle { color: var(--text-secondary); text-align: center; margin-bottom: 20px; }

/* Skeleton dashboard loader */
.skeleton-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2rem; }
.skeleton-hero { height: 120px; border-radius: var(--radius-xl); margin-bottom: 1.5rem; }
.skeleton-stat { height: 80px; border-radius: var(--radius-lg); }
.skeleton-block { height: 200px; border-radius: var(--radius-lg); }

/* Admin/Teacher panel logo accent */
.sidebar-logo-accent { color: #818cf8; }

/* Reading-max — max-width for lesson text (principle #8: rustige dichtheid) */
.reading-max {
  max-width: var(--content-reading-max);
  margin-left: auto;
  margin-right: auto;
}

/* Skip-to-content — keyboard accessibility for screen readers and tab users */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 8px;
  background: var(--brand-primary);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: var(--font-weight-semibold);
  z-index: 10000;
  transition: top var(--transition-fast);
}

.skip-to-content:focus {
  top: 8px;
}

/* Grote tekst toggle-knop in topbar */
.text-size-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-default);
  background: var(--surface-card);
  color: var(--fg2);
  font-weight: var(--font-weight-bold);
  font-size: 14px;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
  font-family: var(--font-family);
}

.text-size-btn:hover {
  background: var(--surface-subtle);
  border-color: var(--border-strong);
}

.text-size-btn.active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}

/* Help-tooltips voor senioren */
.help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: var(--brand-primary-light);
  color: var(--brand-primary);
  font-size: 12px;
  font-weight: var(--font-weight-bold);
  cursor: pointer;
  vertical-align: middle;
  margin-left: 4px;
  flex-shrink: 0;
  transition: background var(--transition-fast);
}

.help-icon:hover {
  background: var(--brand-primary-muted);
}

.help-tooltip {
  position: absolute;
  z-index: 600;
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 14px 16px;
  max-width: 280px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--fg2);
}

.help-tooltip::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 20px;
  width: 12px;
  height: 12px;
  background: var(--surface-card);
  border-left: 1px solid var(--border-default);
  border-top: 1px solid var(--border-default);
  transform: rotate(45deg);
}

/* Welkom-tour overlay */
.welcome-tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
}

.welcome-tour-card {
  background: var(--surface-card);
  border-radius: var(--radius-xl);
  max-width: 520px;
  width: 100%;
  padding: 48px 40px 36px;
  text-align: center;
  box-shadow: var(--shadow-xl);
}

.welcome-tour-step {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-primary);
  margin-bottom: var(--space-4);
}

.welcome-tour-title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--fg1);
  margin-bottom: var(--space-4);
  line-height: var(--line-height-tight);
}

.welcome-tour-text {
  font-size: var(--font-size-md);
  line-height: 1.65;
  color: var(--fg2);
  margin-bottom: var(--space-8);
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}

.welcome-tour-btn {
  margin-bottom: var(--space-6);
}

.welcome-tour-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.welcome-tour-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--border-default);
  transition: background var(--transition-fast);
}

.welcome-tour-dot.active {
  background: var(--brand-primary);
  width: 24px;
}

/* Screen-reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   Badges & Chips (design system components)
   ========================================================================== */

/* Level badge — pill with colored dot */
.badge-level {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
}
.badge-level .dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
}
.badge-level.beginner  { background: #ecfdf5; color: #047857; }
.badge-level.beginner .dot  { background: var(--color-success); }
.badge-level.middle    { background: #fffbeb; color: #b45309; }
.badge-level.middle .dot    { background: var(--brand-accent); }
.badge-level.advanced  { background: #fef2f2; color: #b91c1c; }
.badge-level.advanced .dot  { background: var(--color-error); }

/* Lesson type badge — colored chip per type (principle #9) */
.badge-type {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px 3px 5px;
  border-radius: 6px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  background: var(--surface-bg);
  color: var(--fg3);
}
.badge-type svg { width: 14px; height: 14px; }
.badge-type.video { background: #eff6ff; color: #1d4ed8; }
.badge-type.quiz  { background: var(--brand-accent-light); color: #92400e; }
.badge-type.text  { background: var(--surface-bg); color: var(--fg3); }
.badge-type.live  { background: #fee2e2; color: #991b1b; }
.badge-type.assignment { background: #e0e7ff; color: #3730a3; }

/* Status badge — done/active/locked/new */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px 3px 5px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
}
.badge-status svg { width: 14px; height: 14px; }
.badge-status.done   { background: var(--color-success-light); color: #065f46; padding: 3px 9px; }
.badge-status.active { background: var(--brand-primary-light); color: var(--brand-primary-hover); }
.badge-status.locked { background: var(--surface-bg); color: var(--fg4); }
.badge-status.new    { background: #fce7f3; color: #9d174d; padding: 3px 9px; }

/* Reward badge — streak/xp/cert */
.badge-reward {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px 5px 7px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  border: 1px solid;
}
.badge-reward svg { width: 16px; height: 16px; }
.badge-reward.streak { background: #fff7ed; color: #9a3412; border-color: #fed7aa; }
.badge-reward.xp     { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.badge-reward.cert   { background: #f5f3ff; color: #6d28d9; border-color: #ddd6fe; }

/* Continue-card now defined in components.css */

/* ==========================================================================
   Dashboard layout — 2-column grid (prototype)
   ========================================================================== */
.dashboard-cols {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}

@media (max-width: 900px) {
  .dashboard-cols {
    grid-template-columns: 1fr;
  }
}

/* Section headers */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}

.section-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--fg1);
}

.section-link {
  font-size: var(--font-size-sm);
  color: var(--brand-primary);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
}

.section-link:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Stat cards — dashboard (prototype)
   ========================================================================== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.stat-card-v2 {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}

.stat-card-v2 .stat-icon {
  margin-bottom: var(--space-3);
}

.stat-card-v2 .stat-value {
  font-size: 28px;
  font-weight: var(--font-weight-bold);
  color: var(--fg1);
  line-height: 1.1;
}

.stat-card-v2 .stat-label {
  font-size: var(--font-size-sm);
  color: var(--fg3);
  margin-top: 4px;
}

@media (max-width: 768px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================================
   Streak widget — dashboard sidebar (prototype)
   ========================================================================== */
.streak-widget {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-6);
}

.streak-widget-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: 14px;
}

.streak-widget-icon {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  background: #fff7ed;
  border-radius: 10px;
}

.streak-widget-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--fg1);
}

.streak-widget-sub {
  font-size: var(--font-size-xs);
  color: var(--fg3);
}

.streak-dots {
  display: flex;
  gap: 6px;
}

.streak-dot {
  flex: 1;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  color: var(--fg4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
}

.streak-dot.on {
  background: var(--brand-accent);
  color: #fff;
}

/* Landing page back link */
.back-to-main {
  text-align: center;
  padding: 2rem;
  background: var(--color-light-bg);
  border-top: 1px solid var(--color-border);
}
.back-to-main a {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 600;
}

.container {
  max-width: var(--content-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
  width: 100%;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--color-border-strong);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-border-strong) transparent;
}

/* ==========================================================================
   GROUP 2 — Typography
   ========================================================================== */

h1 {
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text);
  letter-spacing: -0.025em;
}

h2 {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-text);
  letter-spacing: -0.015em;
}

h4 {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-text);
}

h5 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-text);
}

h6 {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

p {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--color-text-secondary);
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  font-size: 1.0625rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: 2.5rem;
}

/* ==========================================================================
   GROUP 3 — Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  min-height: 44px;
  padding: 0 var(--space-5);
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  letter-spacing: -0.005em;
  line-height: 1;
  cursor: pointer;
  border: 1.5px solid transparent;
  text-decoration: none;
  transition: background-color var(--transition-fast), color var(--transition-fast),
    border-color var(--transition-fast), box-shadow var(--transition-fast);
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
}
.btn svg { flex-shrink: 0; }

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.45);
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  transform: none !important;
  box-shadow: none !important;
}

/* Primary */
.btn-primary {
  background-color: var(--color-accent);
  color: #ffffff;
  border-color: var(--color-accent);
}

.btn-primary:hover {
  background-color: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  color: #ffffff;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.18);
}

.btn-primary:active {
  background-color: #3730a3;
  border-color: #3730a3;
  box-shadow: none;
}

/* Secondary — white border/text for dark backgrounds */
.btn-secondary {
  background-color: transparent;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.5);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: #ffffff;
  color: #ffffff;
  text-decoration: none;
}

/* Secondary dark — dark border/text for light backgrounds */
.btn-secondary-dark {
  background-color: transparent;
  color: var(--color-dark);
  border-color: var(--color-border-strong);
}

.btn-secondary-dark:hover {
  background-color: var(--color-bg-subtle);
  border-color: var(--color-dark);
  color: var(--color-dark);
  text-decoration: none;
}

/* Ghost — for dismiss/skip actions */
.btn-ghost {
  background-color: transparent;
  color: var(--fg2);
  border-color: transparent;
}

.btn-ghost:hover {
  background-color: var(--surface-bg);
  color: var(--fg1);
}

.btn-ghost:focus-visible {
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.35);
}

/* Success — for "completed" / confirmation actions */
.btn-success {
  background-color: #059669;
  color: #ffffff;
  border-color: #059669;
}

.btn-success:hover {
  background-color: #047857;
  border-color: #047857;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.18);
}

.btn-success:focus-visible {
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.4);
}

/* Large */
.btn-large {
  min-height: 52px;
  padding: 0 1.75rem;
  font-size: 1rem;
  border-radius: var(--radius-lg);
}

/* Small */
.btn-small {
  min-height: 36px;
  padding: 0 0.875rem;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
}

/* Block */
.btn-block {
  display: flex;
  width: 100%;
}

/* Danger */
.btn-danger {
  background-color: var(--color-error);
  color: #ffffff;
  border-color: var(--color-error);
}

.btn-danger:hover {
  background-color: #b91c1c;
  border-color: #b91c1c;
  color: #ffffff;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.18);
}

.btn-danger:active {
  box-shadow: none;
}
.btn-danger:focus-visible {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.4);
}

/* ==========================================================================
   GROUP 4 — Forms
   ========================================================================== */

.input-group {
  margin-bottom: 1rem;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 0.4rem;
}

input,
select,
textarea {
  display: block;
  width: 100%;
  padding: 10px 14px;
  font-family: var(--font-family);
  font-size: 14px;
  color: var(--color-text);
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 150ms var(--ease-out), box-shadow 150ms var(--ease-out);
  appearance: none;
  -webkit-appearance: none;
}

/* Restore native rendering for radio buttons and checkboxes */
input[type="radio"],
input[type="checkbox"] {
  display: inline-block;
  width: auto;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  appearance: auto;
  -webkit-appearance: auto;
  cursor: pointer;
}

/* Prevent iOS zoom on input focus */
@media (max-width: 768px) {
  input, select, textarea { font-size: 16px; }
}

input::placeholder,
textarea::placeholder {
  color: var(--color-text-light);
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--color-border-strong);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
  cursor: pointer;
}

.admin-role-select {
  width: auto;
  min-width: 120px;
  padding: 0.3rem 2rem 0.3rem 0.6rem;
  font-size: 0.8rem;
  min-height: 32px;
}

/* ==========================================================================
   GROUP 5 — Landing Page
   ========================================================================== */

/* Header */
.landing-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.landing-header nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 64px;
  max-width: 1200px;
  margin: 0 auto;
  gap: 2rem;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
}

.logo:hover {
  color: #ffffff;
  text-decoration: none;
}

.logo-icon {
  font-size: 1.4rem;
  line-height: 1;
}

/* Nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background-color var(--transition);
  text-decoration: none;
}

.nav-links a:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

/* Nav actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Hero */
.hero {
  padding: 8rem 0 6rem;
  background: linear-gradient(135deg, #111827 0%, #1e1b4b 50%, #111827 100%);
  color: #ffffff;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(79, 70, 229, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.1;
  color: #ffffff;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.65);
  max-width: 560px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

.hero-ctas {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Stats section */
section.stats {
  padding: 4rem 0;
  background-color: var(--color-dark);
}

.stat-item {
  text-align: center;
  color: #ffffff;
}

.stat-item h3 {
  font-size: 2rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.25rem;
}

.stat-item p {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.9rem;
}

/* Content sections */
section.courses,
section.features,
section.testimonials,
section.pricing,
section.faq,
section.how-it-works,
section.modules {
  padding: 5rem 0;
}

/* 3-column grid */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

/* Cards */
.course-card,
.feature-card,
.testimonial-card,
.pricing-card {
  background-color: #ffffff;
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-lg);
  padding: 2rem;
  border: 1px solid var(--color-border);
  transition: box-shadow var(--transition), transform var(--transition);
}

.course-card:hover,
.feature-card:hover,
.testimonial-card:hover {
  box-shadow: var(--shadow-md);
}

.course-icon,
.feature-icon {
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 1rem;
  display: block;
}

/* Steps */
.step {
  text-align: center;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background-color: var(--color-accent);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

/* Modules grid */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.module-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--color-accent);
  background-color: var(--color-bg-subtle);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* Featured pricing card */
.pricing-card.featured {
  border: 2px solid var(--color-accent);
  transform: scale(1.02);
  position: relative;
}

.pricing-card.featured:hover {
  transform: scale(1.02);
}

.pricing-badge {
  display: inline-block;
  background-color: var(--color-accent-bg);
  color: var(--color-accent);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 1rem;
  letter-spacing: 0.02em;
}

.pricing-amount {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--color-text);
  line-height: 1;
  margin-bottom: 0.5rem;
  letter-spacing: -0.03em;
}

/* FAQ */
.faq-list {
  list-style: none;
  padding: 0;
}

.faq-item {
  border-bottom: 1px solid var(--color-border);
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 1.25rem 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
  user-select: none;
  -webkit-user-select: none;
  transition: color var(--transition);
  list-style: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-family);
}

.faq-question:hover {
  color: var(--color-accent);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-answer p {
  padding-bottom: 1.25rem;
  color: var(--color-text-muted);
}

.faq-item.active .faq-answer {
  max-height: 500px;
}

/* CTA section */
.cta-section {
  background-color: var(--color-accent);
  color: #ffffff;
  text-align: center;
  padding: 5rem 0;
}

.cta-section h2,
.cta-section h3 {
  color: #ffffff;
}

.cta-section p {
  color: rgba(255, 255, 255, 0.8);
}

/* Footer */
footer {
  background-color: var(--color-dark);
  color: #ffffff;
  padding: 4rem 0 2rem;
}

footer p {
  color: rgba(255, 255, 255, 0.5);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  margin-bottom: 3rem;
}

.footer-content h4 {
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.footer-content a {
  display: block;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  transition: color var(--transition);
  text-decoration: none;
}

.footer-content a:hover {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
}

.social-icons {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.9rem;
  transition: border-color var(--transition), color var(--transition),
    background-color var(--transition);
  text-decoration: none;
}

.social-icon:hover {
  border-color: rgba(255, 255, 255, 0.7);
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

/* ==========================================================================
   GROUP 6 — Auth
   ========================================================================== */

.auth-container {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.auth-left {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  background-color: var(--color-bg);
}

.auth-right {
  background-color: var(--color-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  color: #ffffff;
  position: relative;
  overflow: hidden;
}

.auth-right::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(79, 70, 229, 0.3) 0%, transparent 70%);
  pointer-events: none;
}

.auth-form {
  width: 100%;
  max-width: 400px;
}

.auth-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-bottom: 2rem;
  text-decoration: none;
  transition: color var(--transition);
}

.auth-back-link:hover {
  color: var(--color-text);
  text-decoration: none;
}

.auth-link {
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-top: 1.25rem;
}

.auth-illustration {
  font-size: 5rem;
  line-height: 1;
  display: block;
  text-align: center;
  margin-bottom: 1.5rem;
}

/* ==========================================================================
   GROUP 7 — Dashboard Layout
   ========================================================================== */

.dashboard-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background-color: var(--surface-sidebar);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: var(--z-sticky);
  transition: transform var(--transition-base);
}

.sidebar-logo {
  height: var(--header-height);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1.25rem;
  font-weight: var(--font-weight-bold);
  color: var(--text-inverse);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  text-decoration: none;
}

.sidebar-logo:hover {
  color: #ffffff;
  text-decoration: none;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 0.5rem;
  gap: 2px;
}

.sidebar-nav-item svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: background-color var(--transition-base), color var(--transition-base);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  text-decoration: none;
  user-select: none;
  -webkit-user-select: none;
  border: none;
  background: none;
  width: auto;
  margin: 2px 8px;
  text-align: left;
  font-family: var(--font-family);
}

.sidebar-nav-item:hover {
  background-color: var(--surface-sidebar-hover);
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
}

.sidebar-nav-item.active {
  background-color: var(--surface-sidebar-active);
  color: var(--text-inverse);
  font-weight: var(--font-weight-semibold);
}

.sidebar-logout {
  margin-top: auto;
  color: rgba(255, 255, 255, 0.5);
}

.sidebar-back-link {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.45);
  flex-shrink: 0;
}

.sidebar-back-link a {
  color: rgba(255, 255, 255, 0.45);
  text-decoration: none;
  transition: color var(--transition);
}

.sidebar-back-link a:hover {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
}

/* Main content */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  background-color: var(--surface-bg);
  display: flex;
  flex-direction: column;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  height: var(--header-height);
  background-color: var(--surface-card);
  border-bottom: 1px solid var(--border-default);
  padding: 0 var(--space-8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: var(--z-dropdown);
  flex-shrink: 0;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-width: 0;
}

.topbar-welcome {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Topbar search */
.topbar-search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--surface-bg);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  padding: 0 var(--space-4);
  height: 40px;
  flex: 0 1 360px;
  min-width: 0;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.topbar-search:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--brand-primary-light);
}

.topbar-search svg {
  flex-shrink: 0;
  color: var(--text-muted);
}

.topbar-search-input {
  border: none;
  background: transparent;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  width: 100%;
  padding: 0;
  outline: none;
  min-height: auto;
}

.topbar-search-input::placeholder {
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .topbar-search { display: none; }
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* Avatar dropdown */
.avatar-wrapper {
  position: relative;
}

.profile-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  background: var(--surface-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
  overflow: hidden;
}

.profile-dropdown.show {
  display: block;
}

.profile-dropdown-header {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-dropdown-header strong {
  font-size: var(--font-size-base);
  color: var(--text-primary);
}

.profile-dropdown-role {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: var(--font-weight-semibold);
}

.profile-dropdown-divider {
  height: 1px;
  background: var(--border-default);
}

.profile-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px var(--space-4);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition-fast);
  text-decoration: none;
}

.profile-dropdown-item:hover {
  background: var(--surface-bg);
  text-decoration: none;
}

.profile-dropdown-item svg {
  flex-shrink: 0;
  color: var(--text-muted);
}

.topbar-icon {
  cursor: pointer;
  position: relative;
  color: var(--text-muted);
  transition: color var(--transition-fast);
  line-height: 1;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-md);
}

.topbar-icon:hover {
  color: var(--text-primary);
  background: var(--surface-bg);
}

.topbar-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color var(--transition);
  position: relative;
}

.topbar-avatar:hover {
  background-color: var(--color-accent-hover);
}

.avatar-text {
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1;
}

.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background-color: rgba(217, 119, 6, 0.1);
  color: var(--color-warning);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

/* Main content area */
.content {
  padding: var(--space-xl);
  flex: 1;
}

/* ==========================================================================
   GROUP 8 — Welcome & Stats
   ========================================================================== */

.welcome-section {
  margin-bottom: 2rem;
}

.welcome-card {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  color: #ffffff;
  border-radius: var(--radius-xl);
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  overflow: hidden;
  position: relative;
}

.welcome-card::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  pointer-events: none;
}

.welcome-content {
  flex: 1;
}

.welcome-content h2 {
  color: #ffffff;
  margin-bottom: 0.35rem;
}

.welcome-content p {
  color: rgba(255, 255, 255, 0.75);
}

.progress-ring-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  gap: 0.4rem;
}

.progress-ring {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-ring-background {
  stroke: rgba(255, 255, 255, 0.2);
  stroke-width: 6;
  fill: none;
}

.progress-ring-circle {
  stroke: #ffffff;
  stroke-width: 6;
  fill: none;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: center;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-ring-text {
  position: absolute;
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1;
}

.progress-label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.stat-card {
  background-color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--color-border);
}

.stat-card-number {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-dark);
  line-height: 1;
  margin-bottom: 0.35rem;
}

.stat-card-label {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* Continue section */
.continue-section {
  margin: 2rem 0;
}

.lesson-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--color-border);
  gap: 1rem;
  transition: box-shadow var(--transition);
}

.lesson-card:hover {
  box-shadow: var(--shadow-sm);
}

.lesson-info h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.25rem;
}

.lesson-meta {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* Courses section */
.courses-section {
  margin: 2rem 0;
}

.courses-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.dashboard-course-card {
  background-color: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--color-border);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition);
}

.dashboard-course-card:hover {
  box-shadow: var(--shadow-md);
}

.course-card-image {
  padding: 1.25rem;
  text-align: center;
  font-size: 2.5rem;
  line-height: 1;
  background-color: var(--color-bg-subtle);
}

/* Course card cover — gradient with icon */
.cc-cover {
  position: relative;
  aspect-ratio: 16 / 10;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  overflow: hidden;
}

.cc-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    135deg,
    rgba(255, 255, 255, 0) 0 14px,
    rgba(255, 255, 255, 0.06) 14px 15px
  );
  pointer-events: none;
}

.cc-tag {
  position: relative;
  z-index: 1;
  font-size: 11px;
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
}

.cc-seq {
  position: relative;
  z-index: 1;
  font-size: 13px;
  font-weight: var(--font-weight-bold);
  color: #fff;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cc-seq::before {
  content: '\2014';
  opacity: 0.6;
  font-weight: var(--font-weight-normal);
}

.cc-big {
  position: absolute;
  right: -12px;
  bottom: -32px;
  font-size: 220px;
  font-weight: var(--font-weight-black);
  letter-spacing: -0.04em;
  line-height: 1;
  color: rgba(255, 255, 255, 0.16);
  font-variant-numeric: tabular-nums;
}

/* Cover color themes */
.cover-indigo  { background: linear-gradient(135deg, #4f46e5 0%, #312e81 100%); }
.cover-emerald { background: linear-gradient(135deg, #10b981 0%, #047857 100%); }
.cover-amber   { background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%); }
.cover-rose    { background: linear-gradient(135deg, #f43f5e 0%, #9f1239 100%); }
.cover-sky     { background: linear-gradient(135deg, #0ea5e9 0%, #075985 100%); }
.cover-slate   { background: linear-gradient(135deg, #334155 0%, #0f172a 100%); }

.course-card-content {
  padding: 0 1.25rem 1.25rem;
}

.course-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-top: 1rem;
  margin-bottom: 0.25rem;
}

.course-card-meta {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin: 0.25rem 0;
}

.course-card-progress {
  margin-top: 0.75rem;
}

.course-progress-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.progress-bar {
  height: 3px;
  background-color: var(--border-default);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-light));
  border-radius: 999px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   GROUP 9 — Course Page
   ========================================================================== */

.course-hero {
  background: linear-gradient(135deg, #1e1b4b 0%, #4f46e5 100%);
  color: #ffffff;
  padding: 2.5rem 2rem;
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
}

.course-hero h1,
.course-hero h2,
.course-hero h3,
.course-hero h4 {
  color: #ffffff;
}

.course-hero p {
  color: rgba(255, 255, 255, 0.7);
}

.course-hero-content {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.course-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.course-info-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
}

/* Module accordion */
.module-accordion {
  background-color: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--color-border);
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem;
  cursor: pointer;
  transition: background-color var(--transition);
  user-select: none;
  -webkit-user-select: none;
}

.module-header:hover {
  background-color: var(--color-bg-subtle);
}

.module-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.module-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--color-accent-bg);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  flex-shrink: 0;
}

.module-info h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.module-meta {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.module-toggle {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  transition: transform var(--transition);
  flex-shrink: 0;
}

.module-accordion.open .module-toggle {
  transform: rotate(180deg);
}

.module-lessons {
  border-top: 1px solid var(--color-border);
}

/* Lesson items inside modules */
/* Lesson row — grid layout with number, type-chip, content, duration, status */
.lesson-item {
  display: grid;
  grid-template-columns: 28px 36px 1fr auto 28px;
  align-items: center;
  gap: var(--space-3);
  padding: 12px 16px;
  min-height: 56px;
  cursor: pointer;
  transition: background-color var(--transition-fast);
  border-bottom: 1px solid var(--color-border);
}

.lesson-item:hover {
  background-color: var(--color-bg-subtle);
}

.lesson-item:last-child {
  border-bottom: none;
}

.lesson-item.completed .lesson-item-title {
  color: var(--fg3);
}

/* Lesson number */
.lesson-item-num {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  color: var(--fg4);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

/* Type chip — colored tile */
.lesson-item-chip {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.lesson-item-chip.video { background: #eef2ff; }
.lesson-item-chip.text  { background: var(--surface-bg); }
.lesson-item-chip.quiz  { background: var(--brand-accent-light); }
.lesson-item-chip.live  { background: #fce7f3; }
.lesson-item-chip.assignment { background: #e0e7ff; }

/* Legacy class — kept for backward compat */
.lesson-type {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

.lesson-item-content {
  flex: 1;
  min-width: 0;
}

.lesson-item-title {
  font-size: 15px;
  font-weight: var(--font-weight-medium);
  color: var(--fg1);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lesson-item-meta {
  font-size: var(--font-size-xs);
  color: var(--fg3);
}

.lesson-item-type-label {
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
  color: var(--fg3);
}

/* Duration column */
.lesson-item-dur {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--fg2);
  font-variant-numeric: tabular-nums;
  min-width: 48px;
  text-align: right;
}
.lesson-item.completed .lesson-item-dur {
  color: var(--fg4);
}

/* Status icon */
.lesson-item-status {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-success);
  flex-shrink: 0;
}

/* ==========================================================================
   GROUP 10 — Lesson Page
   ========================================================================== */

.lesson-container {
  display: flex;
  gap: 0;
  min-height: calc(100vh - 70px);
}

.lesson-sidebar {
  width: 280px;
  background-color: #ffffff;
  border-right: 1px solid var(--color-border);
  overflow-y: auto;
  flex-shrink: 0;
  padding: 1.5rem;
}

.lesson-sidebar h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.lesson-sidebar-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lesson-sidebar-item {
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background-color var(--transition), color var(--transition);
  color: var(--color-text-secondary);
  text-decoration: none;
  display: block;
}

.lesson-sidebar-item:hover {
  background-color: var(--color-bg-subtle);
  text-decoration: none;
  color: var(--color-text);
}

.lesson-sidebar-item.active {
  background-color: var(--color-accent);
  color: #ffffff;
  font-weight: 600;
}

.lesson-sidebar-item.completed {
  color: var(--color-success);
}

.lesson-content {
  flex: 1;
  padding: 2rem;
  max-width: var(--content-reading-max);
}

.lesson-header {
  margin-bottom: 2rem;
}

.lesson-breadcrumb {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.lesson-meta-info {
  display: flex;
  gap: 1rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 0.5rem;
}

/* Video */
.video-placeholder {
  background-color: rgba(17, 24, 39, 0.05);
  border-radius: var(--radius-lg);
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
}

.video-play-button {
  font-size: 3rem;
  line-height: 1;
  opacity: 0.6;
}

.video-container {
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 1.5rem 0;
}

.video-container iframe,
.video-container video {
  display: block;
  width: 100%;
}

/* Lesson body */
.lesson-body {
  font-size: 0.9375rem;
  line-height: 1.8;
  color: var(--color-text-secondary);
}

.lesson-body h2 {
  margin: 2rem 0 1rem;
}

.lesson-body h3 {
  margin: 1.5rem 0 0.75rem;
}

.lesson-body ul,
.lesson-body ol {
  padding-left: 1.5rem;
  margin: 1rem 0;
}

.lesson-body li {
  margin: 0.35rem 0;
}

/* Info box */
.info-box {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
  border-left: 4px solid var(--color-accent);
}

.info-box.tip {
  background-color: var(--color-accent-bg);
  border-left-color: var(--color-accent);
}

.info-box-title {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--color-accent);
}

/* Key takeaway */
.key-takeaway {
  background-color: rgba(5, 150, 105, 0.05);
  border-left: 4px solid var(--color-success);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
}

.key-takeaway-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-success);
  margin-bottom: 0.35rem;
}

/* Lesson actions */
.lesson-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

/* ==========================================================================
   GROUP 11 — Quiz
   ========================================================================== */

.quiz-section {
  background-color: var(--color-bg-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin: 2rem 0;
  border: 1px solid var(--color-border);
}

.quiz-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 1.5rem;
}

.quiz-question {
  margin-bottom: 1.5rem;
}

.quiz-question-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.75rem;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  margin: 0.35rem 0;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: background-color var(--transition), border-color var(--transition);
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

.quiz-option:hover {
  background-color: #ffffff;
  border-color: var(--color-border);
}

.quiz-option.correct {
  background-color: rgba(5, 150, 105, 0.1);
  border-color: var(--color-success);
  color: var(--color-success);
}

/* Fout antwoord: amber, niet rood (design principle #3: niet-bestraffend) */
.quiz-option.almost {
  background-color: #fffbeb;
  border-color: var(--brand-accent);
  color: #92400e;
}

/* Restore native radio/checkbox rendering inside quiz options */
.quiz-option input[type="radio"],
.quiz-option input[type="checkbox"] {
  appearance: auto;
  -webkit-appearance: auto;
  accent-color: var(--color-accent);
  width: auto;
  flex-shrink: 0;
  cursor: pointer;
}

/* Lesson-type chips — color-coded per design principle #9 */
.lesson-chip {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.lesson-chip.video { background: #eef2ff; color: var(--lesson-video); }
.lesson-chip.text  { background: #f1f5f9; color: var(--lesson-text); }
.lesson-chip.quiz  { background: #fef3c7; color: var(--lesson-quiz); }
.lesson-chip.live  { background: #fce7f3; color: var(--lesson-live); }

.lesson-chip svg {
  width: 16px;
  height: 16px;
}

/* ==========================================================================
   GROUP 12 — Generic / Utility Cards
   ========================================================================== */

.card {
  background-color: #ffffff;
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--color-border);
  transition: box-shadow var(--transition), transform var(--transition);
}

.certificate-card {
  background-color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--color-border);
}

.catalog-card {
  background-color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--color-border);
  transition: box-shadow var(--transition), transform var(--transition);
  cursor: pointer;
}

.catalog-card:hover {
  box-shadow: var(--shadow-md);
}

.empty-state {
  text-align: center;
  padding: 3rem 2rem;
}

.empty-state h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0.5rem 0;
}

.empty-state p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* Spinner */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Inline button spinner */
.btn-spinner {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.admin-error {
  text-align: center;
  padding: 2rem;
  color: var(--color-error);
}

/* ==========================================================================
   GROUP 13 — Badges
   ========================================================================== */

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: 0.02em;
}

.badge-success {
  background-color: rgba(5, 150, 105, 0.1);
  color: var(--color-success);
}

.badge-warning {
  background-color: rgba(217, 119, 6, 0.1);
  color: var(--color-warning);
}

.badge-danger {
  background-color: rgba(220, 38, 38, 0.1);
  color: var(--color-error);
}

/* ==========================================================================
   GROUP 14 — Toast Notifications
   ========================================================================== */

.lms-toast {
  position: fixed;
  top: 24px;
  right: 24px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  color: var(--color-text);
  background: #ffffff;
  font-size: 0.875rem;
  font-weight: 500;
  z-index: var(--z-toast);
  opacity: 0;
  transform: translateX(40px);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
  pointer-events: none;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--color-text-muted);
}

.lms-toast.show {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.toast-success {
  border-left-color: var(--color-success);
}

.toast-error {
  border-left-color: var(--color-error);
}

/* ==========================================================================
   GROUP 15 — Modal
   ========================================================================== */

.lms-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: var(--z-modal-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity var(--duration-slow) var(--ease-out);
  pointer-events: none;
}

.lms-modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.lms-modal {
  background-color: var(--surface-elevated);
  border-radius: var(--radius-xl);
  max-width: 560px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  padding: var(--space-8);
  z-index: var(--z-modal);
  transform: scale(0.95);
  opacity: 0;
  transition: transform var(--transition-base),
              opacity var(--transition-base);
}

.lms-modal-overlay.show .lms-modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.lms-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.lms-modal-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
}

.lms-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-text-muted);
  line-height: 1;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background-color var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-family);
}

.lms-modal-close:hover {
  color: var(--color-dark);
  background-color: var(--color-bg-subtle);
}

.lms-modal-body {
  padding: 1.5rem;
}

.lms-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
}

/* ==========================================================================
   GROUP 16 — Dropdowns
   ========================================================================== */

.profile-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background-color: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--color-border);
  min-width: 200px;
  z-index: 9999;
  opacity: 0;
  transform: translateY(-6px) scale(0.97);
  pointer-events: none;
  transition: opacity var(--duration-normal) var(--ease-out),
              transform var(--duration-normal) var(--ease-out);
}

.profile-dropdown.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.dd-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-bg-subtle);
}

.dd-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text);
}

.dd-role {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 0.1rem;
}

.dd-item {
  display: block;
  padding: 0.6rem 1.25rem;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: background-color var(--transition);
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-family);
}

.dd-item:hover {
  background-color: var(--color-bg-subtle);
  text-decoration: none;
  color: var(--color-text);
}

.dd-divider {
  height: 1px;
  background-color: var(--color-border);
  margin: 0.25rem 0;
}

.dd-logout {
  color: var(--color-error);
}

.dd-logout:hover {
  color: var(--color-error);
  background-color: rgba(220, 38, 38, 0.05);
}

/* Notification wrapper & dropdown */
.notif-wrapper {
  position: relative;
  display: inline-block;
}

.notif-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background-color: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--color-border);
  min-width: 300px;
  z-index: 9999;
  opacity: 0;
  transform: translateY(-6px) scale(0.97);
  pointer-events: none;
  transition: opacity var(--duration-normal) var(--ease-out),
              transform var(--duration-normal) var(--ease-out);
}

.notif-dropdown.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* ==========================================================================
   GROUP 17 — Admin
   ========================================================================== */

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.admin-stat-card {
  background-color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--color-border);
}

.admin-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1;
  margin-bottom: 0.3rem;
}

.admin-stat-label {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.admin-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background-color: #ffffff;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.admin-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  background-color: var(--color-bg-subtle);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.admin-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
  color: var(--color-text-secondary);
  transition: background-color var(--duration-fast) var(--ease-out);
}

/* Right-align numeric & action columns */
.admin-table th:last-child,
.admin-table td:last-child {
  text-align: right;
}

.admin-table th:nth-last-child(2),
.admin-table td:nth-last-child(2) {
  text-align: center;
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

.admin-table tbody tr:hover td {
  background-color: var(--color-bg-subtle);
}

/* ==========================================================================
   GROUP 18 — Responsive / Mobile
   ========================================================================== */

/* Mobile menu button — hidden on desktop */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: background-color var(--transition);
  flex-shrink: 0;
}

.mobile-menu-btn:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

/* Hamburger — 3-line icon */
.hamburger {
  display: block;
  width: 20px;
  height: 2px;
  background-color: #ffffff;
  border-radius: 2px;
  position: relative;
  transition: background-color var(--transition);
}

.hamburger::before,
.hamburger::after {
  content: '';
  display: block;
  width: 20px;
  height: 2px;
  background-color: #ffffff;
  border-radius: 2px;
  position: absolute;
  left: 0;
  transition: transform var(--transition), opacity var(--transition);
}

.hamburger::before {
  top: -6px;
}

.hamburger::after {
  top: 6px;
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 99;
  display: none;
}

.sidebar-overlay.active {
  display: block;
}

/* ---- max-width: 768px ---- */
@media (max-width: 768px) {
  /* Sidebar slides off-screen */
  .sidebar {
    transform: translateX(-100%);
    z-index: 200;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  /* Full-width content */
  .main-content {
    margin-left: 0;
  }

  /* Show hamburger button */
  .mobile-menu-btn {
    display: flex;
  }

  /* Responsive grids */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .courses-grid {
    grid-template-columns: 1fr;
  }

  .admin-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Course hero stacks */
  .course-hero-content {
    flex-direction: column;
  }

  .course-info-grid {
    grid-template-columns: 1fr;
  }

  /* Lesson page stacks */
  .lesson-container {
    flex-direction: column;
  }

  .lesson-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    max-height: 200px;
  }

  /* Auth */
  .auth-container {
    grid-template-columns: 1fr;
  }

  .auth-right {
    display: none;
  }

  /* Landing */
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .modules-grid {
    grid-template-columns: 1fr;
  }

  .footer-content {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Topbar & content spacing */
  .topbar {
    padding: 0.75rem 1rem;
  }

  .content {
    padding: 1rem;
  }

  /* Lesson actions stack */
  .lesson-actions {
    flex-direction: column;
  }

  .lesson-actions .btn {
    width: 100%;
  }

  /* Hero title */
  .hero-title {
    font-size: 2rem;
  }

  /* Pricing card */
  .pricing-card.featured {
    transform: scale(1);
  }

  /* Nav links hidden on mobile (hamburger replaces them) */
  .nav-links {
    display: none;
  }
}

/* ---- min-width: 769px — ensure desktop/tablet overrides mobile-only elements ---- */
@media (min-width: 769px) {
  .mobile-menu-btn {
    display: none !important;
  }

  .sidebar-overlay {
    display: none !important;
  }

  .sidebar {
    transform: none !important;
  }
}

/* ---- min-width: 1024px — restore full-size grids ---- */
@media (min-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .courses-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .admin-stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .footer-content {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ==========================================================================
   GROUP 19 — Print
   ========================================================================== */

@media print {
  .sidebar,
  .topbar,
  .mobile-menu-btn,
  .sidebar-overlay,
  .nav-actions,
  .lesson-actions,
  .btn {
    display: none !important;
  }

  .main-content {
    margin-left: 0 !important;
  }

  .content {
    padding: 0 !important;
  }

  * {
    box-shadow: none !important;
  }

  body {
    background-color: #ffffff !important;
    color: #000000 !important;
  }

  .card,
  .dashboard-course-card,
  .lesson-card,
  .stat-card,
  .module-accordion,
  .quiz-section {
    background-color: #ffffff !important;
    border: 1px solid #cccccc !important;
    box-shadow: none !important;
  }

  .welcome-card,
  .course-hero {
    background-color: #f0f0f0 !important;
    color: #000000 !important;
    print-color-adjust: exact;
  }

  a {
    color: #000000;
    text-decoration: underline;
  }
}

/* ==========================================================================
   COURSE PLAYER — Theater Mode (Student)
   ========================================================================== */

.cp {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--color-bg);
  overflow: hidden;
}

/* ---- Header bar ---- */
.cp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 1.25rem;
  background: var(--color-dark);
  color: #ffffff;
  flex-shrink: 0;
  z-index: 200;
  gap: 1rem;
}

.cp-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.cp-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.cp-menu-toggle:hover { background: rgba(255,255,255,0.1); color: #fff; }

.cp-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.cp-back:hover { background: rgba(255,255,255,0.1); color: #fff; }

.cp-course-title {
  font-size: 0.9375rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cp-header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.cp-progress-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.cp-progress-bar {
  width: 120px;
  height: 6px;
  background: rgba(255,255,255,0.15);
  border-radius: 3px;
  overflow: hidden;
}

.cp-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-light));
  border-radius: 3px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.cp-progress-text {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  min-width: 32px;
}

.cp-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}
.cp-close:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* ---- Sidebar ---- */
.cp-sidebar {
  position: fixed;
  top: 56px;
  left: 0;
  bottom: 0;
  width: 320px;
  background: #ffffff;
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  z-index: 150;
  overflow: hidden;
  transition: transform var(--duration-slow) var(--ease-out),
              box-shadow var(--duration-slow) var(--ease-out);
}

.cp-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
.cp-sidebar-head h3 {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin: 0;
}
.cp-sidebar-close {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.cp-sidebar-close:hover { background: var(--color-bg-subtle); }

.cp-syllabus {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0;
}

/* Module group in syllabus */
.cp-module-group { margin-bottom: 0.25rem; }

.cp-module-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  cursor: default;
}

/* cp-lesson-item now replaced by .lesson-row from components.css */

.cp-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 140;
}

/* ---- Main content ---- */
.cp-main {
  margin-left: 320px;
  margin-top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.cp-video-wrap {
  background: #000;
  width: 100%;
  flex-shrink: 0;
}
.cp-video-wrap iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
  border: none;
}

.cp-content-wrap {
  flex: 1;
  max-width: var(--content-reading-max);
  margin: 0 auto;
  padding: 2.5rem 2rem 4rem;
  width: 100%;
}

.cp-lesson-title {
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.cp-lesson-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

/* Rich content prose */
.cp-prose {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--color-text-secondary);
}
.cp-prose h2 { font-size: 1.375rem; font-weight: 700; color: var(--color-text); margin: 2.5rem 0 1rem; }
.cp-prose h3 { font-size: 1.125rem; font-weight: 600; color: var(--color-text); margin: 2rem 0 0.75rem; }
.cp-prose p { margin-bottom: 1.25rem; }
.cp-prose ul, .cp-prose ol { padding-left: 1.5rem; margin-bottom: 1.25rem; }
.cp-prose li { margin-bottom: 0.4rem; }
.cp-prose img { max-width: 100%; border-radius: var(--radius-md); margin: 1.5rem 0; }
.cp-prose blockquote {
  border-left: 3px solid var(--color-accent);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--color-bg-subtle);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--color-text-secondary);
}
.cp-prose code {
  background: var(--color-bg-muted);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.875em;
}
.cp-prose pre {
  background: var(--color-dark);
  color: #e2e8f0;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.875rem;
  line-height: 1.6;
}

/* "Complete & Continue" button area */
.cp-nav-bottom {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cp-btn-prev {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
  background: none;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}
.cp-btn-prev:hover { border-color: var(--color-border-strong); color: var(--color-text); }

.cp-btn-complete {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: var(--color-accent);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(79,70,229,0.25);
}
.cp-btn-complete:hover:not(:disabled) {
  background: var(--color-accent-hover, #4338ca);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}
.cp-btn-complete:active:not(:disabled) {
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.2);
}
.cp-btn-complete:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  background: var(--color-text-light);
  position: relative;
}
.cp-btn-complete:disabled::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-dark);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition);
}
.cp-btn-complete:disabled:hover::after {
  opacity: 1;
}

.cp-btn-complete svg { flex-shrink: 0; }

/* Notes / Bookmarks area below lesson */
.cp-extras {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.cp-notes-box {
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}
.cp-notes-box h4 {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
}
.cp-notes-box textarea {
  width: 100%;
  min-height: 100px;
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
  background: #fff;
  transition: border-color var(--transition);
}
.cp-notes-box textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

/* ---- Player Responsive ---- */
@media (max-width: 1024px) {
  .cp-sidebar { width: 280px; }
  .cp-main { margin-left: 280px; }
}

@media (max-width: 768px) {
  .cp-menu-toggle { display: flex; }
  .cp-sidebar-close { display: flex; }

  .cp-sidebar {
    transform: translateX(-100%);
    width: 300px;
    box-shadow: none;
  }
  .cp-sidebar-open .cp-sidebar {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.12);
  }
  .cp-sidebar-open .cp-overlay { display: block; }

  .cp-main { margin-left: 0; }

  .cp-content-wrap { padding: 1.5rem 1rem 3rem; }
  .cp-lesson-title { font-size: 1.375rem; }
  .cp-progress-bar { width: 80px; }
  .cp-course-title { max-width: 140px; }

  .cp-nav-bottom { flex-direction: column; }
  .cp-btn-complete { width: 100%; justify-content: center; }
  .cp-btn-prev { width: 100%; justify-content: center; }
}


/* ==========================================================================
   COURSE BUILDER — Split Screen (Teacher/Admin)
   ========================================================================== */

.cb {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--color-bg-subtle);
  overflow: hidden;
}

/* ---- Header ---- */
.cb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 1.25rem;
  background: #ffffff;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
  z-index: 100;
  gap: 1rem;
}

.cb-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.cb-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}
.cb-back:hover { background: var(--color-bg-subtle); color: var(--color-text); }

.cb-course-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cb-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* ---- Split body ---- */
.cb-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ---- Left outline panel ---- */
.cb-outline {
  width: 320px;
  background: #ffffff;
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

.cb-outline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
.cb-outline-head h3 {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin: 0;
}

.cb-outline-tree {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0;
}

/* Module in outline */
.cb-module {
  margin-bottom: 0.25rem;
}

.cb-module-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-text);
  cursor: pointer;
  user-select: none;
  transition: background var(--transition);
}
.cb-module-header:hover { background: var(--color-bg-subtle); }

.cb-module-toggle {
  font-size: 0.65rem;
  color: var(--color-text-light);
  transition: transform var(--transition);
}
.cb-module.is-open .cb-module-toggle { transform: rotate(90deg); }

.cb-module-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cb-module-actions {
  display: flex;
  gap: 0.25rem;
  opacity: 0;
  transition: opacity var(--transition);
}
.cb-module-header:hover .cb-module-actions { opacity: 1; }

.cb-module-actions button {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}
.cb-module-actions button:hover { background: var(--color-bg-muted); color: var(--color-text); }

.cb-module-lessons {
  display: none;
}
.cb-module.is-open .cb-module-lessons { display: block; }

/* Lesson item in outline */
.cb-lesson-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem 0.5rem 2.25rem;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  border-left: 3px solid transparent;
}
.cb-lesson-item:hover { background: var(--color-bg-subtle); }
.cb-lesson-item.is-active {
  background: var(--color-accent-bg, #eef2ff);
  color: var(--color-accent);
  font-weight: 600;
  border-left-color: var(--color-accent);
}

.cb-lesson-icon {
  font-size: 0.75rem;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.cb-lesson-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cb-lesson-status {
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 10px;
  flex-shrink: 0;
}
.cb-lesson-status.is-draft { background: var(--color-bg-muted); color: var(--color-text-muted); }
.cb-lesson-status.is-published { background: rgba(5,150,105,0.1); color: var(--color-success); }

.cb-add-lesson {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 1.25rem 0.4rem 2.25rem;
  font-size: 0.75rem;
  color: var(--color-accent);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}
.cb-add-lesson:hover { background: var(--color-accent-bg, #eef2ff); }

/* ---- Editor area ---- */
.cb-editor {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
}

.cb-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  text-align: center;
  gap: 0.75rem;
}
.cb-empty-state h3 { font-size: 1.1rem; font-weight: 600; color: var(--color-text-secondary); }
.cb-empty-state p { font-size: 0.875rem; }

/* Editor form */
.cb-editor-form {
  max-width: 780px;
  width: 100%;
  margin: 0 auto;
}

.cb-title-input {
  width: 100%;
  font-size: 1.5rem;
  font-weight: 700;
  font-family: inherit;
  border: none;
  background: none;
  color: var(--color-text);
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color var(--transition);
  outline: none;
}
.cb-title-input::placeholder { color: var(--color-text-light); }
.cb-title-input:focus { border-bottom-color: var(--color-accent); }

.cb-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0;
  margin: 1rem 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  flex-wrap: wrap;
}

.cb-toolbar-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  transition: background var(--transition), color var(--transition);
}
.cb-toolbar-btn:hover { background: var(--color-bg-muted); color: var(--color-text); }
.cb-toolbar-btn.is-active { background: var(--color-accent-bg, #eef2ff); color: var(--color-accent); }

.cb-toolbar-sep {
  width: 1px;
  height: 20px;
  background: var(--color-border);
  margin: 0 0.35rem;
}

.cb-content-area {
  min-height: 300px;
  padding: 1rem 0;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--color-text-secondary);
  outline: none;
}
.cb-content-area:empty::before {
  content: 'Begin hier met typen...';
  color: var(--color-text-light);
}

/* Settings panel below editor */
.cb-settings {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.cb-setting-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.cb-setting-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

.cb-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.cb-toggle {
  position: relative;
  width: 40px;
  height: 22px;
  background: var(--color-border-strong);
  border-radius: 11px;
  cursor: pointer;
  transition: background var(--transition);
  flex-shrink: 0;
}
.cb-toggle.is-on { background: var(--color-accent); }
.cb-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.cb-toggle.is-on::after { transform: translateX(18px); }

.cb-toggle-text {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
}

.cb-file-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cb-file-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
}
.cb-file-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-file-remove {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--color-text-light);
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}
.cb-file-remove:hover { background: rgba(220,38,38,0.08); color: var(--color-error); }

/* ---- Builder Responsive ---- */
@media (max-width: 768px) {
  .cb-body { flex-direction: column; }
  .cb-outline {
    width: 100%;
    max-height: 40vh;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }
  .cb-editor { padding: 1.25rem; }
  .cb-settings { grid-template-columns: 1fr; }
  .cb-title-input { font-size: 1.25rem; }
  .cb-header-left span.cb-course-title { display: none; }
}


/* ==========================================================================
   LESSON EDITOR — Quill WYSIWYG Focus Mode
   ========================================================================== */

.le-overlay {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 10000;
  display: flex;
  flex-direction: column;
}
.le-overlay.hidden { display: none; }

.le-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
.le-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
  background: #fff;
}

.le-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  transition: background 200ms ease, color 200ms ease;
}
.le-back:hover { background: var(--color-bg-subtle); color: var(--color-text); }

.le-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.le-select {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  background: #fff;
  cursor: pointer;
}
.le-select:focus { outline: none; border-color: var(--color-accent); }

/* Body */
.le-body {
  flex: 1;
  max-width: 740px;
  margin: 0 auto;
  width: 100%;
  padding: 2.5rem 1.5rem 4rem;
  overflow-y: auto;
}

/* Notion-style title */
.le-title {
  width: 100%;
  border: none;
  outline: none;
  font-size: 2rem;
  font-weight: 700;
  font-family: inherit;
  color: var(--color-text);
  padding: 0;
  margin-bottom: 1.5rem;
  background: transparent;
}
.le-title::placeholder { color: #d1d5db; }

/* Quill overrides for clean Notion feel */
#le-toolbar {
  border: none !important;
  border-bottom: 1px solid var(--color-bg-muted) !important;
  padding: 0.5rem 0 !important;
  margin-bottom: 1.25rem;
  background: transparent !important;
}
#le-toolbar .ql-formats { margin-right: 12px; }

#le-editor {
  border: none !important;
  font-family: 'Inter', system-ui, sans-serif !important;
}

#le-editor .ql-editor {
  padding: 0 !important;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.85;
  color: var(--color-text-secondary);
  min-height: 350px;
}
#le-editor .ql-editor.ql-blank::before {
  color: #d1d5db;
  font-style: normal;
  font-size: 1rem;
  left: 0;
}

#le-editor .ql-editor h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
  color: var(--color-text);
}
#le-editor .ql-editor h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
  color: var(--color-text);
}
#le-editor .ql-editor p { margin-bottom: 1rem; }
#le-editor .ql-editor blockquote {
  border-left: 3px solid var(--color-accent);
  padding-left: 1rem;
  margin: 1.25rem 0;
  color: var(--color-text-muted);
}
#le-editor .ql-editor ul, #le-editor .ql-editor ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}
#le-editor .ql-editor li { margin-bottom: 0.3rem; }
#le-editor .ql-editor img {
  max-width: 100%;
  border-radius: var(--radius-md);
  margin: 1rem 0;
}
#le-editor .ql-editor .ql-video {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
  border: none;
}
#le-editor .ql-editor a { color: var(--color-accent); }

/* Settings panel */
.le-settings {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.le-setting label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin-bottom: 0.35rem;
}

.le-input {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  transition: border-color 200ms ease;
}
.le-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.08);
}

@media (max-width: 768px) {
  .le-body { padding: 1.5rem 1rem 3rem; }
  .le-title { font-size: 1.5rem; }
  .le-settings { grid-template-columns: 1fr; }
}

/* ==========================================================================
   PHASE 2 — Save button states (Teacher/Builder)
   ========================================================================== */

.btn-save-loading {
  position: relative;
  pointer-events: none;
}

.btn-save-loading .btn-spinner {
  animation: spin 0.7s linear infinite;
}

.btn.btn-saved {
  background-color: var(--color-success);
  border-color: var(--color-success);
  color: #ffffff;
  pointer-events: none;
  transition: background-color var(--duration-slow) var(--ease-out),
              border-color var(--duration-slow) var(--ease-out);
}

/* ==========================================================================
   PHASE 2 — Destructive confirmation modal (Admin)
   ========================================================================== */

.lms-modal-overlay.is-destructive .lms-modal {
  border-top: 3px solid var(--color-error);
}

.lms-modal-overlay.is-destructive .lms-modal-save {
  background-color: var(--color-error);
  border-color: var(--color-error);
}

.lms-modal-overlay.is-destructive .lms-modal-save:hover {
  background-color: #b91c1c;
  border-color: #b91c1c;
}

/* ==========================================================================
   Skeleton Loading States
   ========================================================================== */

.skeleton {
  background: linear-gradient(90deg, var(--color-bg-muted) 25%, var(--color-bg-subtle) 50%, var(--color-bg-muted) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
  border-radius: 4px;
}

.skeleton-text.w-75 { width: 75%; }
.skeleton-text.w-50 { width: 50%; }
.skeleton-text.w-25 { width: 25%; }

.skeleton-card {
  height: 200px;
  border-radius: var(--radius-lg);
}

.skeleton-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ==========================================================================
   Mobile Bottom Navigation
   ========================================================================== */

.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  border-top: 1px solid var(--color-border);
  z-index: 200;
  padding-bottom: env(safe-area-inset-bottom, 0);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
}

.mobile-bottom-nav-inner {
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  height: 56px;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 0;
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.6rem;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out);
  border: none;
  background: none;
  font-family: inherit;
  min-width: 48px;
  min-height: 44px;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav-item svg {
  flex-shrink: 0;
  transition: transform var(--duration-fast) var(--ease-out);
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
  color: var(--color-accent);
  text-decoration: none;
}

.mobile-nav-item.active svg {
  transform: scale(1.1);
}

.mobile-nav-item .notif-dot {
  position: absolute;
  top: 4px;
  right: calc(50% - 14px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-error);
  border: 2px solid #ffffff;
}

@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: block;
  }

  /* Add bottom padding to content so it's not hidden behind bottom nav */
  .main-content .content {
    padding-bottom: 80px;
  }

  .dashboard-container .content {
    padding-bottom: 80px;
  }
}

/* ==========================================================================
   Tablet breakpoint — collapsed sidebar (icons only)
   ========================================================================== */

@media (min-width: 769px) and (max-width: 1024px) {
  .sidebar {
    width: var(--sidebar-collapsed);
    overflow: visible;
  }

  .sidebar-logo {
    padding: 1.25rem 0;
    justify-content: center;
  }

  .sidebar-logo .logo-text,
  .sidebar-nav-item .nav-label {
    display: none;
  }

  /* Hide any raw text nodes in admin/teacher sidebar nav items */
  .sidebar-nav-item {
    justify-content: center;
    padding: 0.65rem;
    width: 44px;
    height: 44px;
    font-size: 0;
    gap: 0;
    position: relative;
    overflow: hidden;
  }

  .sidebar-nav-item svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
  }

  /* Tooltip on hover */
  .sidebar-nav-item[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--color-dark);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--duration-fast) var(--ease-out);
    z-index: 300;
  }

  .sidebar-nav-item[data-tooltip]:hover::after {
    opacity: 1;
  }

  .sidebar-back-link {
    font-size: 0;
    padding: 0.75rem;
    text-align: center;
  }

  .sidebar-back-link a {
    font-size: 0;
  }

  .sidebar-back-link::before {
    content: '←';
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.45);
  }

  .main-content {
    margin-left: var(--sidebar-collapsed);
  }

  /* 2-column grids on tablet */
  .courses-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .topbar {
    padding: 0.85rem 1.25rem;
  }
}

/* ==========================================================================
   Touch targets — ensure 44px minimum everywhere
   ========================================================================== */

.sidebar-nav-item {
  min-height: 44px;
}

.btn {
  min-height: 44px;
}

.btn-small {
  min-height: 36px;
}

.topbar-icon {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.topbar-avatar {
  min-width: 44px;
  min-height: 44px;
}

/* ==========================================================================
   Responsive tables — horizontal scroll + sticky first column
   ========================================================================== */

@media (max-width: 768px) {
  .admin-table-wrap {
    position: relative;
    -webkit-overflow-scrolling: touch;
  }

  .admin-table th:first-child,
  .admin-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background-color: #ffffff;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.04);
  }

  .admin-table th:first-child {
    background-color: var(--color-bg-subtle);
    z-index: 3;
  }

  .admin-table tbody tr:nth-child(even) td:first-child {
    background-color: var(--color-bg-subtle);
  }

  .admin-table tbody tr:hover td:first-child {
    background-color: var(--color-bg-muted);
  }
}

/* ==========================================================================
   Hamburger icon color fix for light topbar
   ========================================================================== */

.topbar .mobile-menu-btn .hamburger,
.topbar .mobile-menu-btn .hamburger::before,
.topbar .mobile-menu-btn .hamburger::after {
  background-color: var(--color-text);
}

/* Landing page mobile menu */
@media (max-width: 768px) {
  .landing-header .nav-actions {
    gap: 0.5rem;
  }

  .landing-header .nav-actions .btn {
    padding: 0.5rem 0.85rem;
    font-size: 0.8rem;
  }
}

/* ==========================================================================
   Admin trend charts responsive
   ========================================================================== */

@media (max-width: 768px) {
  .admin-trends-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .admin-trends-grid {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* ==========================================================================
   Alternating table rows
   ========================================================================== */

.admin-table tbody tr:nth-child(even) td {
  background-color: var(--color-bg-subtle);
}

.admin-table tbody tr:hover td {
  background-color: var(--color-bg-muted);
}

/* ==========================================================================
   Button press effect
   ========================================================================== */

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

/* ==========================================================================
   Notification badge
   ========================================================================== */

.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--color-error);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}

/* ==========================================================================
   Page fade-in animation
   ========================================================================== */

.content {
  animation: fadeIn var(--duration-normal) var(--ease-out);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
