/* ============================================================
   OCTANE EDU — DESIGN SYSTEM & PLATFORM STYLES
   Octane Informatic Solutions · Identity, Breathability & High Contrast
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@500;600;700&family=Space+Grotesk:wght@500;600;700&family=Manrope:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  /* ---- Brand violet ramp ---- */
  --violet-50:    #F6ECFF;
  --violet-100:   #EAD6FF;
  --violet-200:   #D6AFFF;
  --violet-300:   #BE83FF;
  --violet-400:   #A24BFF;   /* NEON accent */
  --violet-500:   #8B2FE0;
  --violet-600:   #7724C4;
  --violet-700:   #662D91;   /* CORE Octane purple */
  --violet-800:   #491E6B;
  --violet-900:   #2E1246;

  /* ---- Hot highlight ---- */
  --hot-pink:     #FFB4F3;
  --magenta:      #E064FF;

  /* ---- Deep Carbon & Neutral Slate Surfaces (Zero Purple Wash) ---- */
  --void:         #090A0F;
  --bg:           #0D0F16;
  --bg-2:         #11141D;
  --surface:      #131722;
  --surface-2:    #181D2A;
  --surface-3:    #1F2535;
  --input-bg:     #0E1118;

  /* ---- Crisp Neutral Lines ---- */
  --line:         rgba(255, 255, 255, 0.08);
  --line-strong:  rgba(255, 255, 255, 0.16);
  --line-faint:   rgba(255, 255, 255, 0.05);

  /* ---- High-Contrast Neutral Text on Dark ---- */
  --text:         #F3F4F6;
  --text-soft:    #CBD5E1;
  --text-mute:    #94A3B8;
  --text-faint:   #64748B;

  /* ---- Semantic Status ---- */
  --success:      #36E5A4;
  --warning:      #FFC24B;
  --danger:       #FF5470;
  --info:         #4BB8FF;
  --success-dim:  rgba(54, 229, 164, 0.14);
  --warning-dim:  rgba(255, 194, 75, 0.14);
  --danger-dim:   rgba(255, 84, 112, 0.14);

  /* ---- Brand Aliases & Gradients ---- */
  --brand:        var(--violet-700);
  --brand-neon:   var(--violet-400);
  --grad-neon:    linear-gradient(135deg, #662D91 0%, #A24BFF 55%, #FFB4F3 100%);
  --grad-violet:  linear-gradient(135deg, #7724C4 0%, #A24BFF 100%);
  --grad-surface: linear-gradient(155deg, rgba(24, 29, 42, 0.94) 0%, rgba(15, 18, 27, 0.98) 100%);
  --grad-text:    linear-gradient(120deg, #FFFFFF 0%, #E2E8F0 52%, #A24BFF 100%);
  --glow-radial:  radial-gradient(60% 50% at 50% 0%, rgba(124, 58, 237, 0.08) 0%, rgba(0, 0, 0, 0) 70%);

  /* ---- Typography ---- */
  --font-brand:   'Fredoka', system-ui, sans-serif;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body:    'Manrope', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  /* ---- Radii ---- */
  --radius-xs:    6px;
  --radius-sm:    10px;
  --radius-md:    12px;
  --radius-lg:    18px;
  --radius-xl:    24px;
  --radius-pill:  999px;

  /* ---- Balanced Shadows & Purposeful Glows ---- */
  --shadow-sm:    0 2px 8px rgba(0, 0, 0, 0.32);
  --shadow-md:    0 10px 28px rgba(0, 0, 0, 0.42);
  --shadow-lg:    0 22px 54px rgba(0, 0, 0, 0.52);
  --glow-sm:      0 0 14px rgba(162, 75, 255, 0.32);
  --glow-md:      0 0 24px rgba(162, 75, 255, 0.42);
  --glow-btn:     0 6px 20px rgba(0, 0, 0, 0.38), 0 0 22px rgba(162, 75, 255, 0.38);
  --glow-ring:    0 0 0 3px rgba(162, 75, 255, 0.4);

  /* ---- Glass & Motion ---- */
  --glass-bg:     rgba(13, 15, 22, 0.85);
  --glass-border: rgba(255, 255, 255, 0.09);
  --ease-out:     cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast:     150ms;
  --dur-base:     240ms;
}

/* ============================================================
   HIGH-CONTRAST LIGHT MODE (Carefully calibrated for readability)
   ============================================================ */
[data-theme="light"] {
  --void:         #F8FAFC;
  --bg:           #F1F5F9;
  --bg-2:         #E2E8F0;
  --surface:      #FFFFFF;
  --surface-2:    #F8FAFC;
  --surface-3:    #F1F5F9;
  --input-bg:     #FFFFFF;

  --line:         rgba(15, 23, 42, 0.10);
  --line-strong:  rgba(15, 23, 42, 0.18);
  --line-faint:   rgba(15, 23, 42, 0.06);

  --text:         #0F172A;
  --text-soft:    #334155;
  --text-mute:    #64748B;
  --text-faint:   #94A3B8;

  --brand-neon:   #7724C4;
  --hot-pink:     #662D91;

  --success:      #059669;
  --warning:      #D97706;
  --danger:       #DC2626;
  --info:         #2563EB;
  --success-dim:  rgba(5, 150, 105, 0.12);
  --warning-dim:  rgba(217, 119, 6, 0.12);
  --danger-dim:   rgba(220, 38, 38, 0.12);

  --grad-surface: linear-gradient(145deg, #FFFFFF 0%, #F5EEFF 100%);
  --grad-text:    linear-gradient(120deg, #2E1065 0%, #662D91 48%, #9333EA 100%);
  --glow-radial:  radial-gradient(60% 50% at 50% 0%, rgba(139, 47, 224, 0.10) 0%, rgba(139, 47, 224, 0) 70%);

  --glass-bg:     rgba(255, 255, 255, 0.88);
  --glass-border: rgba(102, 45, 145, 0.15);

  --shadow-sm:    0 2px 8px rgba(46, 18, 70, 0.06);
  --shadow-md:    0 10px 28px rgba(46, 18, 70, 0.09);
  --shadow-lg:    0 20px 48px rgba(46, 18, 70, 0.14);
  --glow-sm:      0 4px 16px rgba(119, 36, 196, 0.15);
  --glow-md:      0 6px 24px rgba(119, 36, 196, 0.22);
  --glow-btn:     0 6px 20px rgba(119, 36, 196, 0.28);
  --glow-ring:    0 0 0 3px rgba(119, 36, 196, 0.25);
}

/* ============================================================
   BASE & GAME OF LIFE CANVAS
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100%;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--void);
  background-image: var(--glow-radial);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
  touch-action: manipulation;
}

#golCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

::selection { background: rgba(162, 75, 255, 0.32); color: #fff; }

*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: var(--bg); }
*::-webkit-scrollbar-thumb {
  background: var(--violet-700);
  border-radius: 999px;
}

/* ============================================================
   TYPOGRAPHY HELPERS
   ============================================================ */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  color: var(--text);
  margin: 0;
  letter-spacing: -0.025em;
  line-height: 1.16;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand-neon);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: "";
  width: 16px;
  height: 1.5px;
  background: var(--brand-neon);
}
.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.mono { font-family: var(--font-mono); }

/* ============================================================
   NAVIGATION BAR (LARGER, COMMANDING LOGO)
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: var(--glass-bg);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
@media (max-width: 900px) {
  html.is-standalone-pwa .topbar {
    padding-top: 52px;
    padding-top: max(env(safe-area-inset-top, 52px), 52px);
  }
}
@media (display-mode: standalone) and (max-width: 900px) {
  .topbar {
    padding-top: 52px;
    padding-top: max(env(safe-area-inset-top, 52px), 52px);
  }
}
.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 28px;
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}
.brand-edu-hex {
  width: 36px;
  height: 36px;
  display: block;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35));
  transition: transform var(--dur-base) var(--ease-out);
}
.brand-lockup:hover .brand-edu-hex {
  transform: scale(1.06);
}
.btn-pwa-install {
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  color: var(--text);
  border-radius: var(--radius-pill);
  font-weight: 600;
  gap: 6px;
  padding: 6px 13px;
}
.btn-pwa-install:hover {
  background: var(--surface-3);
  border-color: var(--brand-neon);
  color: var(--text);
}
.btn-pwa-install svg {
  width: 15px;
  height: 15px;
  color: var(--brand-neon);
}
.brand-logo-img {
  height: 46px;
  width: auto;
  display: block;
  transition: transform var(--dur-base) var(--ease-out), filter var(--dur-base);
}
.brand-logo-dark {
  filter: drop-shadow(0 0 14px rgba(162, 75, 255, 0.35));
}
.brand-logo-light {
  height: 38px;
}
[data-theme="light"] .brand-logo-dark { display: none; }
html:not([data-theme="light"]) .brand-logo-light { display: none; }
.brand-lockup:hover .brand-logo-img {
  transform: scale(1.03);
}
.brand-divider {
  width: 1px;
  height: 24px;
  background: var(--line-strong);
}
.brand-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  background: rgba(162, 75, 255, 0.14);
  border: 1px solid var(--line-strong);
  color: var(--brand-neon);
}
html:not([data-theme="light"]) .brand-badge {
  color: var(--violet-200);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-soft);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 15px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}
.nav-btn svg { width: 16px; height: 16px; opacity: 0.85; flex-shrink: 0; }
.nav-lbl-short { display: none; }
.nav-btn:hover {
  color: var(--text);
  background: rgba(162, 75, 255, 0.09);
}
.nav-btn.active {
  color: var(--text);
  background: rgba(162, 75, 255, 0.16);
  border-color: var(--line-strong);
  box-shadow: var(--glow-sm);
}
.nav-btn.active svg {
  color: var(--brand-neon);
  opacity: 1;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 13px 5px 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
}
.hex-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--grad-violet);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.user-meta-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-meta-role {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand-neon);
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--dur-fast);
}
.icon-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
  box-shadow: var(--glow-sm);
}
.icon-btn svg { width: 17px; height: 17px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: all var(--dur-fast) var(--ease-out);
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; pointer-events: none; }

.btn-primary, button.primary {
  background: var(--grad-violet);
  color: #fff;
  box-shadow: var(--glow-btn);
  border-color: rgba(255, 255, 255, 0.14);
}
.btn-primary:hover, button.primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.07);
}

.btn-secondary, button.secondary {
  background: rgba(162, 75, 255, 0.09);
  color: var(--text);
  border: 1.5px solid var(--line-strong);
}
.btn-secondary:hover, button.secondary:hover {
  transform: translateY(-1px);
  border-color: var(--brand-neon);
  background: rgba(162, 75, 255, 0.16);
}

.btn-ghost {
  background: transparent;
  color: var(--text-soft);
}
.btn-ghost:hover {
  color: var(--text);
  background: rgba(162, 75, 255, 0.1);
}

.btn-success {
  background: var(--success-dim);
  color: var(--success);
  border: 1.5px solid rgba(54, 229, 164, 0.38);
}
[data-theme="light"] .btn-success {
  border-color: rgba(5, 150, 105, 0.4);
}
.btn-success:hover {
  filter: brightness(1.08);
}

.btn-danger, button.danger {
  background: var(--danger-dim);
  color: var(--danger);
  border: 1.5px solid rgba(255, 84, 112, 0.35);
}
.btn-danger:hover, button.danger:hover {
  background: var(--danger);
  color: #fff;
}

.btn-sm { padding: 8px 13px; font-size: 13px; border-radius: var(--radius-xs); }
.btn-lg { padding: 13px 24px; font-size: 15.5px; }
.btn-pill { border-radius: var(--radius-pill); }
.btn-full { width: 100%; }

/* ============================================================
   MAIN CONTAINER (GENEROUS BREATHING ROOM)
   ============================================================ */
main#app {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 36px 28px 88px;
}

/* ============================================================
   HERO BANNER (ANIMATED 3D OCTANE MARK, ORBITAL RINGS & CHIPS)
   ============================================================ */
.hero-banner {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: var(--grad-surface);
  border: 1px solid var(--line-strong);
  padding: clamp(34px, 4.8vw, 56px);
  margin-bottom: 42px;
  box-shadow: var(--shadow-lg), var(--glow-sm);
}
.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  opacity: 0.38;
}
[data-theme="light"] .hero-orb {
  opacity: 0.16;
}
.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 36px;
  align-items: center;
}
.hero-title {
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 700;
  line-height: 1.07;
  letter-spacing: -0.03em;
  margin: 14px 0 16px;
}
.hero-lead {
  color: var(--text-soft);
  font-size: clamp(15px, 1.35vw, 17.5px);
  line-height: 1.62;
  max-width: 560px;
  margin: 0 0 28px;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 34px;
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.hero-stat-val {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  line-height: 1;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-stat-lbl {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-mute);
  margin-top: 6px;
}

/* 3D Animated Hero Mark & Rings */
.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 270px;
}
.hero-ring {
  position: absolute;
  width: 248px;
  height: 248px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  animation: octSpin 26s linear infinite;
}
.hero-ring::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-neon);
  box-shadow: var(--glow-md);
  transform: translateX(-50%);
}
.hero-ring.r2 {
  width: 186px;
  height: 186px;
  border-style: dashed;
  animation-duration: 18s;
  animation-direction: reverse;
  opacity: 0.65;
}
.hero-mark {
  width: 136px;
  height: auto;
  filter: drop-shadow(0 0 38px rgba(162, 75, 255, 0.65));
  animation: octFloat 6s ease-in-out infinite;
  position: relative;
  z-index: 2;
}
[data-theme="light"] .hero-mark {
  filter: drop-shadow(0 10px 26px rgba(102, 45, 145, 0.32));
}
.hero-chip {
  position: absolute;
  z-index: 3;
  backdrop-filter: blur(12px);
  background: var(--glass-bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 8px 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text);
  box-shadow: var(--shadow-md);
  animation: octFloat 5.5s ease-in-out infinite;
}
.hero-chip svg { width: 15px; height: 15px; color: var(--brand-neon); flex-shrink: 0; }
.hero-chip.c1 { top: 8%; left: 2%; animation-delay: -1.2s; }
.hero-chip.c2 { bottom: 10%; right: 0%; animation-delay: -2.8s; }
.hero-chip .pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 10px var(--success);
}

@keyframes octFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
@keyframes octSpin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   TOOLBAR, SEARCH & FILTER PILLS
   ============================================================ */
.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}
.section-title {
  font-size: clamp(22px, 2.8vw, 28px);
  font-weight: 700;
}
.section-subtitle {
  color: var(--text-soft);
  font-size: 14.5px;
  margin: 5px 0 0;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  margin-bottom: 30px;
  box-shadow: var(--shadow-sm);
}
.pill-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pill-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-soft);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.pill-tab svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.pill-tab:hover {
  border-color: var(--line-strong);
  color: var(--text);
}
.pill-tab.active {
  background: var(--grad-violet);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--glow-sm);
}
.pill-tab.active svg { color: #fff; }
.pill-count {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.22);
  color: inherit;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 230px;
  max-width: 340px;
}
.search-box svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-mute);
  pointer-events: none;
}
.search-box input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  margin: 0;
  border-radius: var(--radius-pill);
  background: var(--input-bg);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13.5px;
}

/* ============================================================
   COURSE CARDS & HIGH-CONTRAST BADGES
   ============================================================ */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 26px;
}
.course-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-base) var(--ease-out),
              border-color var(--dur-base),
              box-shadow var(--dur-base);
}
.course-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md), var(--glow-sm);
}

.course-cover {
  position: relative;
  height: 120px;
  overflow: hidden;
  background: #140A28;
  border-bottom: 1px solid var(--line);
}
.course-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Full opacity rich artwork in both dark and light modes so covers never look washed out! */
.course-cover-art {
  position: absolute;
  inset: 0;
  opacity: 1;
}

.course-cover-hex {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(162, 75, 255, 0.16);
  border: 1px solid rgba(190, 131, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-neon);
}
.course-cover-hex svg { width: 24px; height: 24px; }

.course-cover-badges {
  position: absolute;
  top: 14px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  z-index: 2;
}

/* Badges: high-contrast in tables/cards AND guaranteed luminous contrast inside .course-cover */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: var(--radius-xs);
}
.badge svg { width: 12px; height: 12px; flex-shrink: 0; }

/* Default Badges on Dark surfaces */
.badge-comercial {
  background: rgba(162, 75, 255, 0.2);
  color: #EAD6FF;
  border: 1px solid rgba(162, 75, 255, 0.42);
}
.badge-academico {
  background: rgba(59, 130, 246, 0.2);
  color: #BAE6FD;
  border: 1px solid rgba(59, 130, 246, 0.42);
}
.badge-cliente {
  background: rgba(16, 185, 129, 0.2);
  color: #A7F3D0;
  border: 1px solid rgba(16, 185, 129, 0.42);
}
.badge-published {
  background: rgba(16, 185, 129, 0.2);
  color: #6EE7B7;
  border: 1px solid rgba(16, 185, 129, 0.42);
}
.badge-draft {
  background: rgba(245, 158, 11, 0.2);
  color: #FDE68A;
  border: 1px solid rgba(245, 158, 11, 0.42);
}

/* Light mode badges when placed on white cards/tables */
[data-theme="light"] .badge-comercial {
  background: #EDE9FE;
  color: #5B21B6;
  border-color: #C4B5FD;
}
[data-theme="light"] .badge-academico {
  background: #DBEAFE;
  color: #1E40AF;
  border-color: #93C5FD;
}
[data-theme="light"] .badge-cliente {
  background: #D1FAE5;
  color: #065F46;
  border-color: #6EE7B7;
}
[data-theme="light"] .badge-published {
  background: #D1FAE5;
  color: #065F46;
  border-color: #6EE7B7;
}
[data-theme="light"] .badge-draft {
  background: #FEF3C7;
  color: #92400E;
  border-color: #FCD34D;
}

/* Badges sitting on top of dark .course-cover MUST ALWAYS have high-contrast dark frosted glass in both themes! */
.course-cover-badges .badge {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.course-cover-badges .badge-comercial {
  background: rgba(18, 8, 36, 0.82);
  color: #EAD6FF;
  border-color: rgba(190, 131, 255, 0.5);
}
.course-cover-badges .badge-academico {
  background: rgba(8, 20, 38, 0.82);
  color: #BAE6FD;
  border-color: rgba(75, 184, 255, 0.5);
}
.course-cover-badges .badge-cliente {
  background: rgba(6, 28, 24, 0.82);
  color: #A7F3D0;
  border-color: rgba(54, 229, 164, 0.5);
}
.course-cover-badges .badge-published {
  background: rgba(6, 28, 24, 0.84);
  color: #6EE7B7;
  border-color: rgba(54, 229, 164, 0.55);
}
.course-cover-badges .badge-draft {
  background: rgba(32, 20, 6, 0.84);
  color: #FDE68A;
  border-color: rgba(255, 194, 75, 0.55);
}
.badge-price {
  background: rgba(10, 5, 22, 0.84);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-weight: 700;
}
.badge-price.free {
  color: #6EE7B7;
  border-color: rgba(54, 229, 164, 0.5);
}

.course-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.course-title {
  font-size: 18.5px;
  font-weight: 700;
  line-height: 1.28;
  margin-bottom: 8px;
  color: var(--text);
}
.course-desc {
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 18px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.course-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-mute);
}
.course-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.course-meta-item svg { width: 14px; height: 14px; color: var(--brand-neon); }

.course-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.course-footer .btn { flex: 1; }

/* Progress bar */
.progress-wrap {
  margin: 8px 0 16px;
}
.progress-head {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 12px;
  margin-bottom: 6px;
  color: var(--text-soft);
}
.progress-bar {
  background: var(--surface-3);
  border-radius: var(--radius-pill);
  height: 7px;
  overflow: hidden;
}
.progress-fill {
  background: var(--grad-neon);
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width 0.45s var(--ease-out);
}
.progress-fill.complete {
  background: linear-gradient(90deg, #059669, #36E5A4);
}

/* ============================================================
   KPI STAT CARDS ("EST APARTE ESTA AL 100" — KEPT CLEAN!)
   ============================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 32px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--dur-fast), transform var(--dur-fast);
}
.kpi-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}
.hex-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(162, 75, 255, 0.12);
  border: 1px solid var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-neon);
  flex-shrink: 0;
}
.hex-icon svg { width: 20px; height: 20px; }
.kpi-val {
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 700;
  line-height: 1.08;
  color: var(--text);
}
.kpi-lbl {
  font-size: 12.5px;
  color: var(--text-mute);
  margin-top: 3px;
}

/* ============================================================
   CLASSROOM / COURSE PLAYER VIEW
   ============================================================ */
.classroom-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.classroom-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 385px;
  gap: 24px;
  align-items: start;
  width: 100%;
  max-width: 100%;
}
.classroom-stage {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  min-width: 0;
  width: 100%;
  max-width: 100%;
}
.video-stage {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.video-stage iframe,
.video-stage video {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain;
  border: 0;
  display: block;
  background: #000000;
}
.video-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #090A0F;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  color: #F5F2FF;
  overflow: hidden;
}
.video-thumb-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.72;
  transition: transform 0.45s var(--ease-out), opacity 0.35s var(--ease-out);
  z-index: 0;
}
.video-placeholder::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 4, 18, 0.35) 0%, rgba(8, 4, 18, 0.86) 100%);
  z-index: 1;
}
.video-placeholder > *:not(.video-thumb-bg) {
  position: relative;
  z-index: 2;
}
.video-placeholder:hover .video-thumb-bg {
  transform: scale(1.03);
  opacity: 0.65;
}
.video-play-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--grad-violet);
  border: 2px solid rgba(255, 255, 255, 0.45);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.55), 0 0 28px rgba(162, 75, 255, 0.65);
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base);
  margin-bottom: 16px;
}
.video-play-circle svg {
  width: 28px;
  height: 28px;
  margin-left: 3px;
}
.video-play-circle:hover {
  transform: scale(1.08);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 38px rgba(162, 75, 255, 0.9);
}

.lesson-thumb {
  width: 68px;
  height: 40px;
  border-radius: 7px;
  overflow: hidden;
  background: #120924;
  border: 1px solid var(--line-strong);
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
}
.lesson-thumb.lesson-thumb-lg {
  width: 82px;
  height: 48px;
  border-radius: 8px;
}
.lesson-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.lesson-thumb-play {
  position: absolute;
  inset: 0;
  background: rgba(8, 4, 18, 0.32);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: background var(--dur-fast);
}
.lesson-thumb-play svg {
  width: 14px;
  height: 14px;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.7));
}
.lesson-title-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
  font-size: 13.5px;
}
.syllabus-modal-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.syllabus-module-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  flex-shrink: 0;
}
.syllabus-module-head {
  padding: 13px 16px;
  font-family: var(--font-display);
  font-size: 14.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-3);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.syllabus-module-body {
  padding: 6px 12px;
  display: flex;
  flex-direction: column;
}
.syllabus-lesson-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line-faint);
  border-radius: var(--radius-sm);
  transition: background var(--dur-fast);
}
.syllabus-lesson-row:last-child {
  border-bottom: 0;
}
.syllabus-lesson-row:hover {
  background: var(--surface-3);
}
.syllabus-lesson-row:hover .lesson-thumb-play {
  background: rgba(162, 75, 255, 0.45);
}
.syllabus-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  position: sticky;
  bottom: -30px;
  background: var(--surface);
  padding-bottom: 4px;
  z-index: 5;
}
.Lesson-stage-body {
  padding: clamp(26px, 3.8vw, 40px);
}
.lesson-stage-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 26px;
}
.lesson-stage-title {
  font-size: clamp(20px, 2.4vw, 27px);
  font-weight: 700;
  margin-top: 6px;
}

/* Rich Markdown Content Styling */
.markdown-body {
  color: var(--text-soft);
  font-size: 15.5px;
  line-height: 1.74;
}
.markdown-body h3, .markdown-body h4 {
  color: var(--text);
  margin: 24px 0 10px;
}
.markdown-body p { margin: 0 0 15px; }
.markdown-body ul, .markdown-body ol {
  margin: 0 0 18px;
  padding-left: 22px;
}
.markdown-body li { margin-bottom: 7px; }
.markdown-body strong { color: var(--text); font-weight: 700; }
.markdown-body code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--brand-neon);
}
.markdown-body pre {
  background: #080414;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  overflow-x: auto;
  margin: 18px 0;
}
.markdown-body pre code {
  background: none;
  border: 0;
  padding: 0;
  color: #EAD6FF;
  font-size: 13px;
  line-height: 1.65;
}
.markdown-body blockquote {
  margin: 18px 0;
  padding: 14px 18px;
  border-left: 3px solid var(--brand-neon);
  background: rgba(162, 75, 255, 0.08);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text);
}

.resource-callout {
  margin-top: 24px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.resources-section {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.resources-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.resources-section-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-soft);
}
.ext-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
.resource-row-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--text);
  transition: border-color var(--dur-fast), background var(--dur-fast), transform var(--dur-fast);
}
.resource-row-link:hover {
  background: var(--surface-3);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}
.resource-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid transparent;
}
.resource-icon-box.tone-amber {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.25);
  color: #FBBF24;
}
.resource-icon-box.tone-sky {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.25);
  color: #38BDF8;
}
.resource-icon-box.tone-emerald {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.25);
  color: #34D399;
}
.resource-icon-box.tone-slate {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.22);
  color: #CBD5E1;
}
[data-theme="light"] .resource-icon-box.tone-amber { color: #D97706; }
[data-theme="light"] .resource-icon-box.tone-sky { color: #0284C7; }
[data-theme="light"] .resource-icon-box.tone-emerald { color: #059669; }
[data-theme="light"] .resource-icon-box.tone-slate { color: #475569; }

.resource-row-meta {
  min-width: 0;
  flex: 1;
}
.resource-row-title {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.resource-row-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-mute);
  margin-top: 2px;
}
.resource-row-arrow {
  color: var(--text-mute);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--dur-fast), color var(--dur-fast);
}
.resource-row-link:hover .resource-row-arrow {
  color: var(--text);
  transform: translate(2px, -2px);
}
.ext-link-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--text);
  transition: all var(--dur-fast);
}
.ext-link-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}
.platform-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(162, 75, 255, 0.16);
  border: 1px solid var(--line-strong);
  color: var(--violet-200);
}
[data-theme="light"] .platform-pill {
  color: var(--violet-700);
}

.compact-media-banner {
  padding: 20px 24px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.lesson-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.notes-box {
  margin-top: 30px;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.notes-box textarea {
  min-height: 88px;
  margin-top: 10px;
  background: var(--input-bg);
}

/* Curriculum Sidebar */
.curriculum-sidebar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: sticky;
  top: 92px;
  box-shadow: var(--shadow-sm);
}
.curriculum-head {
  padding: 18px 20px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.module-group {
  border-bottom: 1px solid var(--line);
}
.module-group:last-child { border-bottom: 0; }
.module-header {
  width: 100%;
  padding: 14px 18px;
  background: rgba(162, 75, 255, 0.04);
  border: 0;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
}
.module-num-hex {
  min-width: 26px;
  height: 24px;
  padding: 0 7px;
  border-radius: 6px;
  background: rgba(162, 75, 255, 0.14);
  border: 1px solid var(--line-strong);
  color: var(--brand-neon);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.lesson-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  border-top: 1px solid var(--line-faint);
  cursor: pointer;
  transition: all var(--dur-fast);
  color: var(--text-soft);
  font-size: 13.5px;
  border-left: 3px solid transparent;
}
.lesson-item:hover {
  background: var(--surface-2);
  color: var(--text);
}
.lesson-item.active {
  background: rgba(162, 75, 255, 0.12);
  color: var(--text);
  font-weight: 600;
  border-left-color: var(--brand-neon);
}
.lesson-check {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: transparent;
}
.lesson-item.done .lesson-check {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.lesson-check svg { width: 11px; height: 11px; stroke-width: 3; }

/* ============================================================
   CARDS, FORMS & TABLES
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 15px;
}
.field label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
  font-weight: 600;
}
input, textarea, select {
  width: 100%;
  padding: 11px 14px;
  margin: 2px 0;
  background: var(--input-bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14.5px;
  outline: none;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
input:focus, textarea:focus, select:focus {
  border-color: var(--brand-neon);
  box-shadow: var(--glow-ring);
}
textarea { resize: vertical; min-height: 90px; }

/* Data Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}
table.oct-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}
.oct-table th {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-mute);
  background: var(--surface-2);
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.oct-table td {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line-faint);
  color: var(--text-soft);
  vertical-align: middle;
}
.oct-table tr:last-child td { border-bottom: 0; }
.oct-table tbody tr:hover td { background: rgba(162, 75, 255, 0.04); }

/* ============================================================
   AUTH CARDS (LOGIN & REGISTER)
   ============================================================ */
.auth-wrapper {
  max-width: 450px;
  margin: 36px auto;
}
.auth-card {
  background: var(--grad-surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xl);
  padding: 38px 34px;
  box-shadow: var(--shadow-lg), var(--glow-sm);
}
.demo-access-box {
  margin-top: 22px;
  padding: 15px;
  border-radius: var(--radius-md);
  background: rgba(162, 75, 255, 0.08);
  border: 1px dashed var(--line-strong);
}

/* ============================================================
   MODALS & TOAST NOTIFICATIONS
   ============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(7, 4, 18, 0.76);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(20px + env(safe-area-inset-top, 0px)) 20px calc(20px + env(safe-area-inset-bottom, 0px));
  animation: octFadeIn 160ms var(--ease-out);
}
.modal-panel {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 680px;
  max-height: calc(88vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  padding: 30px;
  box-shadow: var(--shadow-lg), var(--glow-sm);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}

.toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 370px;
}
.toast {
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--brand-neon);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  animation: octSlideUp 200ms var(--ease-out);
}
.toast svg { width: 17px; height: 17px; flex-shrink: 0; }
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }

@keyframes octFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes octSlideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ============================================================
   CERTIFICATE VIEW
   ============================================================ */
.cert-frame {
  background: linear-gradient(135deg, #0D0620 0%, #1B0C38 55%, #0A0518 100%);
  border: 2px solid #A24BFF;
  border-radius: var(--radius-lg);
  padding: 42px 34px;
  text-align: center;
  color: #F3EEFF;
  box-shadow: inset 0 0 50px rgba(162, 75, 255, 0.22);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  background: var(--bg);
  padding: 32px 28px calc(32px + env(safe-area-inset-bottom, 0px));
  margin-top: auto;
}
.site-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--text-mute);
  font-size: 13px;
}

/* ============================================================
   RESPONSIVE & MOBILE-FIRST UX BREAKPOINTS
   ============================================================ */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 24px; }
  .hero-grid > *, .classroom-layout > *, .course-grid > *, .kpi-grid > * { min-width: 0; max-width: 100%; }
  .hero-visual { min-height: 210px; order: -1; }
  .classroom-layout { grid-template-columns: 1fr; gap: 20px; }
  .curriculum-sidebar { position: static; }
}

@media (max-width: 780px) {
  .hide-xs, .nav-lbl-full { display: none !important; }
  .nav-lbl-short { display: inline !important; }

  /* Two-row mobile header: Zero horizontal overflow on 320px-430px screens */
  .topbar {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }
  .topbar-inner {
    height: auto;
    padding: 8px 12px;
    flex-wrap: wrap;
    gap: 7px 8px;
    width: 100%;
    max-width: 100%;
  }
  .brand-lockup { order: 1; gap: 6px; min-width: 0; }
  .brand-edu-hex { width: 26px; height: 26px; }
  .brand-logo-img { height: 22px; }
  .brand-logo-light { height: 20px; }
  .brand-badge, .brand-divider, .user-meta { display: none !important; }

  .nav-right {
    order: 2;
    margin-left: auto;
    gap: 5px;
    flex-shrink: 0;
  }
  .nav-right .btn-sm {
    padding: 6px 9px;
    font-size: 11.5px;
    gap: 4px;
  }
  .nav-right .btn-sm svg {
    width: 13px;
    height: 13px;
  }
  .user-pill {
    padding: 2px;
    background: transparent;
    border-color: transparent;
  }
  .hex-avatar {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }
  .icon-btn {
    width: 32px;
    height: 32px;
  }
  .icon-btn svg {
    width: 15px;
    height: 15px;
  }

  .nav-links {
    order: 3;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 5px;
    padding-top: 7px;
    border-top: 1px solid var(--line-faint);
    overflow: hidden;
  }
  .nav-btn {
    width: 100%;
    min-width: 0;
    justify-content: center;
    padding: 7px 6px;
    font-size: 12px;
    gap: 5px;
    border-radius: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .nav-btn svg {
    width: 14px;
    height: 14px;
  }

  main#app {
    padding: 16px 12px 52px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  /* Compact 2x2 KPI Grid on mobile so courses appear immediately above the fold */
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 20px;
  }
  .kpi-card {
    padding: 12px 10px;
    gap: 8px;
    border-radius: var(--radius-md);
  }
  .hex-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
  }
  .hex-icon svg { width: 16px; height: 16px; }
  .kpi-val { font-size: 19px; }
  .kpi-lbl { font-size: 10.5px; line-height: 1.2; }

  /* Section Headers & Filter Bar */
  .section-header {
    gap: 10px;
    margin-bottom: 16px;
  }
  .section-title { font-size: 21px; }
  .section-subtitle { font-size: 13px; }
  .section-header > .btn {
    width: 100%;
    justify-content: center;
  }

  .filter-bar {
    padding: 10px;
    gap: 8px;
    margin-bottom: 18px;
    border-radius: var(--radius-md);
  }
  .pill-tabs {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    gap: 6px;
    overflow: visible;
  }
  .pill-tab {
    flex: 1 1 auto;
    justify-content: center;
    padding: 6px 10px;
    font-size: 12px;
  }
  .search-box {
    width: 100%;
    max-width: none;
    min-width: 0;
  }
  input, select, textarea, .search-box input {
    font-size: 16px !important;
  }

  /* Hero Banner on Mobile */
  .hero-banner {
    padding: 22px 16px;
    margin-bottom: 26px;
    border-radius: var(--radius-lg);
  }
  .hero-visual { min-height: 170px; }
  .hero-ring { width: 172px; height: 172px; }
  .hero-ring.r2 { width: 128px; height: 128px; }
  .hero-mark { width: 92px; }
  .hero-chip { font-size: 10px; padding: 5px 9px; }
  .hero-chip.c1 { top: 2%; left: 0; }
  .hero-chip.c2 { bottom: 2%; right: 0; }
  .hero-title { font-size: 26px; line-height: 1.12; margin: 10px 0 12px; }
  .hero-lead { font-size: 14px; margin-bottom: 18px; }
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }
  .hero-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-top: 22px;
    padding-top: 18px;
  }
  .hero-stat-val { font-size: 22px; }

  /* Course Cards */
  .course-grid { grid-template-columns: 1fr; gap: 16px; }
  .course-body { padding: 18px 16px; }
  .course-title { font-size: 17px; }

  /* Classroom & Lesson Player on Mobile */
  .classroom-topbar {
    padding: 14px 16px;
    gap: 12px;
  }
  .video-play-circle {
    width: 56px;
    height: 56px;
    margin-bottom: 10px;
  }
  .video-play-circle svg {
    width: 22px;
    height: 22px;
  }
  .compact-media-banner {
    padding: 14px 16px;
    flex-direction: column;
    align-items: stretch;
  }
  .compact-media-banner > div:last-child {
    width: 100%;
    display: flex;
  }
  .compact-media-banner > div:last-child .btn {
    flex: 1;
  }
  .Lesson-stage-body {
    padding: 18px 16px;
  }
  .lesson-stage-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding-bottom: 16px;
    margin-bottom: 18px;
  }
  .lesson-stage-header .btn {
    width: 100%;
    justify-content: center;
  }
  .ext-links-grid { grid-template-columns: 1fr; }
  .ext-link-card {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .ext-link-card > div:last-child {
    display: flex;
    width: 100%;
  }
  .ext-link-card > div:last-child .btn {
    flex: 1;
  }
  .lesson-nav-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .lesson-nav-bar .btn {
    width: 100%;
    justify-content: center;
  }

  /* Auth, Cards, Tables & Modals */
  .card { padding: 18px 16px; }
  .auth-wrapper { margin: 16px auto; }
  .auth-card { padding: 26px 18px; border-radius: var(--radius-lg); }
  .modal-backdrop {
    padding: 10px;
    align-items: flex-end;
  }
  .modal-panel {
    padding: 20px 16px;
    border-radius: var(--radius-lg);
    max-height: 90vh;
  }
  .lesson-thumb.lesson-thumb-lg {
    width: 68px;
    height: 40px;
  }
  .syllabus-lesson-row .badge {
    display: none;
  }
  .toast-stack {
    left: 14px;
    right: 14px;
    bottom: 14px;
    max-width: none;
  }
  .cert-frame { padding: 24px 14px; }
  .site-footer { padding: 22px 16px; text-align: center; }
  .site-footer-inner { justify-content: center; gap: 12px; }
}
