/* css/main.css — Design System — Streaming Barrial */

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

/* ══════════════════════════════════════════════════════
   VARIABLES
══════════════════════════════════════════════════════ */
:root {
  /* Backgrounds */
  --bg:       #0b1326;
  --surface:  #131b2e;
  --surface2: #171f33;
  --surface3: #222a3d;
  --surface4: #2d3449;

  /* Borders */
  --border:        rgba(255, 255, 255, 0.1);
  --border-hover:  rgba(59, 130, 246, 0.45);
  --border-active: rgba(6, 182, 212, 0.7);

  /* Primary — Violeta / Electric Blue */
  --primary:       #3b82f6;
  --primary-light: #adc6ff;
  --primary-dark:  #004395;
  --primary-glow:  rgba(59, 130, 246, 0.18);
  --primary-glow2: rgba(59, 130, 246, 0.35);

  /* Accent — Cyan / Stream Cyan */
  --accent:       #06b6d4;
  --accent-light: #4cd7f6;
  --accent-dark:  #004e5c;
  --accent-glow:  rgba(6, 182, 212, 0.18);

  /* Status */
  --success:      #10b981;
  --success-glow: rgba(16, 185, 129, 0.18);
  --warning:      #f59e0b;
  --warning-glow: rgba(245, 158, 11, 0.18);
  --danger:       #ef4444;
  --danger-glow:  rgba(239, 68, 68, 0.18);

  /* Module colors */
  --mod1: #8b5cf6;
  --mod2: #06b6d4;
  --mod3: #10b981;
  --mod4: #f59e0b;

  /* Text */
  --text:        #dae2fd;
  --text-muted:  #c2c6d6;
  --text-subtle: #8c909f;

  /* Layout */
  --sidebar-w: 264px;
  --header-h:  64px;

  /* Radius */
  --radius-sm: 8px;
  --radius:    14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* Transitions */
  --t-fast:   0.15s ease;
  --t-base:   0.25s ease;
  --t-slow:   0.45s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Shadows */
  --shadow-sm:  0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow:     0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-lg:  0 20px 60px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px rgba(59, 130, 246, 0.2);
}

/* ══════════════════════════════════════════════════════
   RESET & BASE
══════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  line-height: 1.2;
  font-weight: 700;
}

a { color: inherit; text-decoration: none; transition: color var(--t-base); }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
input, textarea, select { font-family: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface4); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ══════════════════════════════════════════════════════
   APP LAYOUT
══════════════════════════════════════════════════════ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  padding: 44px 48px;
  max-width: calc(100vw - var(--sidebar-w));
}

/* ══════════════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════════════ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-logo {
  padding: 22px 18px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.logo-mark {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.logo-text {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 15px;
  color: var(--text);
  line-height: 1.2;
}

.logo-text span {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-light);
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sidebar-nav {
  padding: 14px 10px;
  flex: 1;
}

.nav-section {
  margin-bottom: 4px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-subtle);
  padding: 10px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--t-base);
  margin-bottom: 2px;
  position: relative;
}

.nav-item:hover {
  background: var(--surface2);
  color: var(--text);
}

.nav-item.active {
  background: var(--primary-glow);
  color: var(--primary-light);
  font-weight: 700;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 22px;
  background: linear-gradient(var(--primary), var(--accent));
  border-radius: 0 3px 3px 0;
}

.nav-icon { font-size: 17px; width: 20px; text-align: center; flex-shrink: 0; }

.sidebar-user {
  padding: 14px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  cursor: default;
  transition: background var(--t-base);
}

.user-card:hover { background: var(--surface2); }

.avatar {
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  font-size: 14px;
}

.avatar.lg { width: 56px; height: 56px; font-size: 22px; }
.avatar.xl { width: 72px; height: 72px; font-size: 28px; }

.user-info { flex: 1; min-width: 0; }

.user-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role { font-size: 11px; color: var(--text-muted); }

.logout-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-subtle);
  transition: all var(--t-base);
}

.logout-btn:hover {
  color: var(--danger);
  background: var(--danger-glow);
}

/* User menu chevron */
.user-menu-chevron {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text-subtle);
  transition: all var(--t-base);
  flex-shrink: 0;
  line-height: 1;
}

.user-menu-chevron:hover {
  color: var(--primary-light);
  background: var(--primary-glow);
}

/* User dropdown */
.user-dropdown {
  display: none;
  flex-direction: column;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin: 6px 0 0;
  overflow: hidden;
  animation: dropdownIn 0.2s ease;
}

.user-dropdown.open { display: flex; }

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

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--t-fast);
  text-align: left;
  width: 100%;
}

.user-dropdown-item:hover {
  background: var(--surface4);
  color: var(--text);
}

.user-dropdown-item.danger:hover {
  background: var(--danger-glow);
  color: var(--danger);
}

.user-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 2px 0;
}

/* Profile modal */
.profile-modal { display: none; }
.profile-modal.show { display: flex; }

/* Scroll to top button */
.scroll-top-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--surface3);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: all var(--t-base);
  box-shadow: var(--shadow);
}

.scroll-top-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.scroll-top-btn:hover {
  background: var(--primary-glow);
  border-color: var(--primary);
  color: var(--primary-light);
  transform: translateY(-2px);
}

/* Mobile menu */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 200;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 1px solid var(--border);
  font-size: 20px;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 99;
  backdrop-filter: blur(4px);
}

.mobile-overlay.visible { display: block; }


/* ══════════════════════════════════════════════════════
   LOADING SPINNER
══════════════════════════════════════════════════════ */
.loading-spinner {
  display: flex;
  align-items: center;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

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

/* ══════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--t-base);
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--t-fast);
}

.btn:hover::after { background: rgba(255,255,255,0.05); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 4px 18px var(--primary-glow2);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px var(--primary-glow2);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  box-shadow: 0 4px 18px var(--accent-glow);
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px var(--accent-glow);
}

.btn-success {
  background: linear-gradient(135deg, var(--success), #059669);
  color: #fff;
  box-shadow: 0 4px 18px var(--success-glow);
}

.btn-success:hover { transform: translateY(-2px); }

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #b91c1c);
  color: #fff;
}

.btn-ghost {
  background: var(--surface2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--surface3);
  color: var(--text);
  border-color: var(--border-hover);
}

.btn-outline {
  background: transparent;
  color: var(--primary-light);
  border: 1px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary-glow);
}

.btn-lg { padding: 14px 32px; font-size: 16px; border-radius: var(--radius); }
.btn-sm { padding: 7px 16px; font-size: 13px; }
.btn-xs { padding: 5px 12px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-icon { padding: 10px; }

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ══════════════════════════════════════════════════════
   CARDS
══════════════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color var(--t-base), box-shadow var(--t-base), transform var(--t-base);
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow);
}

.card-glass {
  background: rgba(255,255,255,0.025);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius);
  padding: 24px;
}

.card-interactive {
  cursor: pointer;
  transition: all var(--t-base);
}

.card-interactive:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-hover);
}

/* ══════════════════════════════════════════════════════
   BADGES
══════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge-primary { background: var(--primary-glow); color: var(--primary-light); }
.badge-accent  { background: var(--accent-glow);  color: var(--accent-light); }
.badge-success { background: var(--success-glow); color: var(--success); }
.badge-warning { background: var(--warning-glow); color: var(--warning); }
.badge-danger  { background: var(--danger-glow);  color: var(--danger); }
.badge-muted   { background: var(--surface3);      color: var(--text-muted); }

/* ══════════════════════════════════════════════════════
   PROGRESS
══════════════════════════════════════════════════════ */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--surface3);
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.7s cubic-bezier(0.34,1.56,0.64,1);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-light);
  box-shadow: 0 0 8px var(--accent);
}

.progress-bar.lg { height: 10px; }
.progress-bar.lg .progress-fill::after { width: 14px; height: 14px; }

.progress-bar.sm { height: 4px; }
.progress-bar.sm .progress-fill::after { display: none; }

/* ══════════════════════════════════════════════════════
   FORMS
══════════════════════════════════════════════════════ */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 7px;
  letter-spacing: 0.02em;
}

.form-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text);
  font-size: 14px;
  transition: all var(--t-base);
  outline: none;
  appearance: none;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: var(--surface3);
}

.form-input::placeholder { color: var(--text-subtle); }
.form-input:disabled { opacity: 0.5; cursor: not-allowed; }
textarea.form-input { resize: vertical; min-height: 110px; line-height: 1.6; }
select.form-input { cursor: pointer; }

.form-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ══════════════════════════════════════════════════════
   PAGE HEADER
══════════════════════════════════════════════════════ */
.page-header {
  margin-bottom: 36px;
}

.page-header .breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-subtle);
  margin-bottom: 8px;
}

.page-header .breadcrumb a { color: var(--primary-light); }
.page-header .breadcrumb a:hover { color: var(--text); }

.page-title {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.page-title .gradient-text {
  background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ══════════════════════════════════════════════════════
   STAT CARDS
══════════════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 18px;
  margin-bottom: 36px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  position: relative;
  overflow: hidden;
  transition: all var(--t-base);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
}

.stat-card.col-primary::before { background: linear-gradient(90deg, var(--primary), var(--primary-light)); }
.stat-card.col-accent::before  { background: linear-gradient(90deg, var(--accent),  var(--accent-light)); }
.stat-card.col-success::before { background: linear-gradient(90deg, var(--success), #34d399); }
.stat-card.col-warning::before { background: linear-gradient(90deg, var(--warning), #fcd34d); }

.stat-card::after {
  content: attr(data-icon);
  position: absolute;
  right: 16px;
  top: 16px;
  font-size: 32px;
  opacity: 0.15;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--border-hover);
}

.stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 5px;
}

.stat-label { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.stat-sub   { font-size: 12px; color: var(--text-subtle); margin-top: 2px; }

/* ══════════════════════════════════════════════════════
   MODULE CARDS
══════════════════════════════════════════════════════ */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.module-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--t-slow);
  display: flex;
  flex-direction: column;
}

.module-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
  border-color: var(--border-hover);
}

.module-card.locked {
  opacity: 0.55;
  filter: grayscale(0.4);
  pointer-events: none;
}

.module-header {
  padding: 28px 24px 20px;
  position: relative;
  overflow: hidden;
}

.module-header-bg {
  position: absolute;
  inset: 0;
  opacity: 0.07;
}

.module-number {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.8;
  margin-bottom: 6px;
}

.module-icon-wrap {
  font-size: 44px;
  margin-bottom: 14px;
  display: block;
  line-height: 1;
}

.module-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 0;
  position: relative;
  z-index: 1;
}

.module-body {
  padding: 0 24px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.module-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 18px;
  line-height: 1.65;
}

.module-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.module-progress-pct { font-weight: 700; color: var(--text); }

.lesson-list { margin-top: 18px; flex: 1; }

.lesson-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  cursor: pointer;
  transition: color var(--t-base);
  text-decoration: none;
  color: var(--text-muted);
}

.lesson-item:last-child { border-bottom: none; }
.lesson-item:hover { color: var(--primary-light); }

.lesson-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--surface4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
  transition: all var(--t-base);
  background: var(--surface2);
}

.lesson-check.done {
  background: var(--success);
  border-color: var(--success);
  color: white;
  box-shadow: 0 0 10px var(--success-glow);
}

.lesson-title-wrap { flex: 1; min-width: 0; }
.lesson-title-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lesson-duration { font-size: 11px; color: var(--text-subtle); flex-shrink: 0; }

/* ══════════════════════════════════════════════════════
   LESSON PAGE
══════════════════════════════════════════════════════ */
.lesson-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  align-items: start;
}

.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow-lg);
}

.video-container iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

.lesson-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.lesson-description {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 28px;
}

.objectives-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-muted);
}

.objectives-list li:last-child { border-bottom: none; }

.objectives-list li::before {
  content: '✓';
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--success-glow);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Resources */
.resource-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--t-base);
  margin-bottom: 8px;
}

.resource-item:hover {
  border-color: var(--border-hover);
  background: var(--surface3);
  transform: translateX(4px);
}

.resource-icon { font-size: 20px; flex-shrink: 0; }
.resource-name { flex: 1; font-weight: 500; }
.resource-type {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--surface4);
  padding: 2px 8px;
  border-radius: 10px;
  color: var(--text-muted);
}

/* Lesson sidebar */
.lesson-sidebar-card { margin-bottom: 16px; }

.lesson-nav-list { list-style: none; }

.lesson-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--t-base);
  color: var(--text-muted);
  margin-bottom: 2px;
}

.lesson-nav-item:hover { background: var(--surface2); color: var(--text); }
.lesson-nav-item.current { background: var(--primary-glow); color: var(--primary-light); font-weight: 600; }
.lesson-nav-item.done-item { color: var(--success); }

/* ══════════════════════════════════════════════════════
   FORUM
══════════════════════════════════════════════════════ */
.forum-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 28px;
  align-items: start;
}

.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 16px;
  transition: border-color var(--t-base);
}

.post-card:hover { border-color: var(--border-hover); }
.post-card.pinned { border-color: var(--warning); background: linear-gradient(to right, rgba(245,158,11,0.04), transparent); }

.post-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-subtle);
  margin-top: 3px;
  flex-wrap: wrap;
}

.post-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 4px;
  cursor: pointer;
  transition: color var(--t-base);
}

.post-title:hover { color: var(--primary-light); }
.post-content { font-size: 14px; color: var(--text-muted); line-height: 1.7; white-space: pre-wrap; word-break: break-word; }

.post-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.post-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-subtle);
  padding: 5px 10px;
  border-radius: 6px;
  transition: all var(--t-base);
  cursor: pointer;
}

.post-action-btn:hover { color: var(--text); background: var(--surface2); }
.post-action-btn.liked { color: var(--primary-light); }

/* Reply */
.reply-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.reply-item:last-child { border-bottom: none; }
.reply-content { font-size: 13.5px; color: var(--text-muted); line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.reply-meta { font-size: 11px; color: var(--text-subtle); margin-top: 2px; }

/* ══════════════════════════════════════════════════════
   ADMIN TABLE
══════════════════════════════════════════════════════ */
.table-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table thead { background: var(--surface2); }

.table th {
  text-align: left;
  padding: 13px 18px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-subtle);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: var(--surface2); }

/* ══════════════════════════════════════════════════════
   AUTH PAGES
══════════════════════════════════════════════════════ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

/* Animated BG */
.auth-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  animation: orbFloat 8s ease-in-out infinite;
}

.auth-orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
  top: -150px; left: -150px;
  opacity: 0.2;
  animation-delay: 0s;
}

.auth-orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  bottom: -120px; right: -100px;
  opacity: 0.15;
  animation-delay: -4s;
}

.auth-orb-3 {
  width: 200px; height: 200px;
  background: radial-gradient(circle, var(--primary-light) 0%, transparent 70%);
  top: 50%; left: 50%;
  opacity: 0.1;
  animation-delay: -2s;
}

@keyframes orbFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-30px) scale(1.05); }
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 44px;
  width: 100%;
  max-width: 460px;
  position: relative;
  z-index: 1;
  box-shadow: 0 40px 80px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.06);
  animation: authFadeIn 0.5s ease;
}

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

.auth-logo {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 36px;
}

.auth-logo-icon {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 8px 24px var(--primary-glow2);
}

.auth-logo-text { font-family: 'Outfit', sans-serif; }
.auth-logo-title { font-size: 20px; font-weight: 800; line-height: 1.1; }
.auth-logo-sub { font-size: 12px; color: var(--text-subtle); font-weight: 400; }

.auth-heading { font-size: 24px; font-weight: 800; margin-bottom: 6px; }
.auth-subheading { font-size: 14px; color: var(--text-muted); margin-bottom: 28px; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 20px 0;
  font-size: 12px;
  color: var(--text-subtle);
}

.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-switch {
  text-align: center;
  margin-top: 22px;
  font-size: 13.5px;
  color: var(--text-muted);
}

.auth-switch a { color: var(--primary-light); font-weight: 600; }
.auth-switch a:hover { color: var(--accent-light); }

/* Demo credentials box */
.demo-box {
  background: var(--primary-glow);
  border: 1px solid rgba(139,92,246,0.25);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 12.5px;
  color: var(--primary-light);
  margin-bottom: 24px;
}

.demo-box strong { display: block; margin-bottom: 4px; font-size: 13px; }

/* ══════════════════════════════════════════════════════
   TOAST
══════════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow);
  max-width: 340px;
  animation: toastIn 0.35s cubic-bezier(0.34,1.56,0.64,1);
  pointer-events: auto;
}

.toast.success { border-color: rgba(16,185,129,0.4); }
.toast.error   { border-color: rgba(239,68,68,0.4); }
.toast.info    { border-color: rgba(6,182,212,0.4); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(16px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ══════════════════════════════════════════════════════
   MODAL / OVERLAY
══════════════════════════════════════════════════════ */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.93) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-title { font-size: 20px; font-weight: 700; }

.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: background var(--t-fast);
  flex-shrink: 0;
}

.modal-close:hover { background: var(--surface4); }

/* ══════════════════════════════════════════════════════
   MISC
══════════════════════════════════════════════════════ */

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Live indicator */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.3);
  color: var(--danger);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--danger);
  animation: livePulse 1.5s ease infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.7); }
}

/* Divider */
.divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state .empty-title { font-size: 20px; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.empty-state .empty-desc { font-size: 14px; max-width: 360px; margin: 0 auto 24px; }

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

.section-title { font-size: 18px; font-weight: 700; }

/* ══════════════════════════════════════════════════════
   ANIMATIONS
══════════════════════════════════════════════════════ */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}

.fade-up   { animation: fadeUp 0.45s ease both; }
.delay-1   { animation-delay: 0.08s; }
.delay-2   { animation-delay: 0.16s; }
.delay-3   { animation-delay: 0.24s; }
.delay-4   { animation-delay: 0.32s; }
.delay-5   { animation-delay: 0.40s; }

/* ══════════════════════════════════════════════════════
   UTILITIES
══════════════════════════════════════════════════════ */
.flex       { display: flex; }
.flex-col   { flex-direction: column; }
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-4  { gap: 4px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.gap-32 { gap: 32px; }
.flex-1 { flex: 1; }
.min-w-0 { min-width: 0; }

.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.ml-auto { margin-left: auto; }

.text-muted  { color: var(--text-muted); }
.text-subtle { color: var(--text-subtle); }
.text-sm   { font-size: 13px; }
.text-xs   { font-size: 12px; }
.text-lg   { font-size: 18px; }
.text-xl   { font-size: 22px; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.text-center { text-align: center; }
.w-full  { width: 100%; }
.hidden  { display: none !important; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* ══════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
  .lesson-layout { grid-template-columns: 1fr; }
  .forum-layout { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .modules-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  .sidebar.open { transform: translateX(0); }

  .main-content {
    margin-left: 0;
    padding: 24px 18px;
    padding-top: 72px;
    max-width: 100vw;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-title { font-size: 24px; }
  .auth-card { padding: 28px 24px; }
}

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

/* ══════════════════════════════════════════════════════
   MODALES Y OVERLAYS
   ══════════════════════════════════════════════════════ */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(11, 19, 38, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s;
}

.overlay.show {
  opacity: 1;
  visibility: visible;
}

.overlay .modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 480px;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  transform: scale(0.92);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
  padding: 24px;
}

.overlay.show .modal {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  font-size: 20px;
  color: var(--text-subtle);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all var(--t-base);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

