@charset "UTF-8";
/* ============================================================================
   LMS Advanced — design system (clean, light, Skool-inspired)
   ========================================================================= */
:root {
  --bg: #f5f6fa;
  --bg-soft: #ffffff;
  --surface: #ffffff;
  --surface-2: #f2f3f7;
  --surface-3: #e8e9f0;
  --border: rgba(20,22,31,0.08);
  --border-strong: rgba(20,22,31,0.14);

  --accent: #4f6bfb;
  --accent-2: #3d56e0;
  --accent-dark: #2f42b8;
  --accent-gradient: linear-gradient(135deg, #5b7bfd 0%, #3d56e0 100%);
  --accent-soft: rgba(79,107,251,0.10);

  --blue: #3b82f6;
  --gold: #b45309;
  --gold-soft: rgba(234,179,8,0.14);
  --green: #16a34a;
  --green-soft: rgba(22,163,74,0.12);
  --amber: #d97706;
  --red: #dc2626;
  --red-soft: rgba(220,38,38,0.10);

  --text: #14161f;
  --text-dim: #5b6072;
  --text-muted: #8b8fa3;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 18px;

  --shadow-sm: 0 1px 2px rgba(20,22,31,0.06);
  --shadow-md: 0 8px 22px rgba(20,22,31,0.08);
  --shadow-lg: 0 20px 46px rgba(20,22,31,0.14);
  --shadow-glow: 0 0 0 1px rgba(79,107,251,0.18), 0 8px 20px rgba(79,107,251,0.14);

  --sidebar-w: 260px;
  --journey-w: 292px;
  --topbar-h: 64px;

  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ─── Black & red premium theme (opt-in via the theme toggle button) ────── */
:root[data-theme="dark"] {
  --bg: #0b0c0f;
  --bg-soft: #101216;
  --surface: #16181e;
  --surface-2: #1c1f26;
  --surface-3: #22252d;
  --border: rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.14);

  --accent: #ff3b4e;
  --accent-2: #ff6a3d;
  --accent-dark: #c81e3a;
  --accent-gradient: linear-gradient(135deg, #ff4d5e 0%, #c81e3a 100%);
  --accent-soft: rgba(255,59,78,0.14);

  --blue: #3b82f6;
  --gold: #eab308;
  --gold-soft: rgba(234,179,8,0.15);
  --green: #22c55e;
  --green-soft: rgba(34,197,94,0.15);
  --amber: #f59e0b;
  --red: #ef4444;
  --red-soft: rgba(239,68,68,0.15);

  --text: #f4f5f7;
  --text-dim: #aeb4c0;
  --text-muted: #72798a;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.35);
  --shadow-lg: 0 20px 48px rgba(0,0,0,0.45);
  --shadow-glow: 0 0 0 1px rgba(255,59,78,0.25), 0 8px 24px rgba(255,59,78,0.18);
}
:root[data-theme="dark"] .auth-page {
  background: radial-gradient(circle at 20% 20%, rgba(255,59,78,0.1), transparent 40%), var(--bg);
}
/* A few shadow accents are hardcoded to the light theme's blue tint above —
   re-tint them to red so buttons/pills glow on-brand in the dark theme. */
:root[data-theme="dark"] .membership-pill { box-shadow: 0 3px 10px rgba(255,59,78,0.3); }
:root[data-theme="dark"] .watch-first-banner { box-shadow: 0 8px 18px rgba(255,59,78,0.25); }
:root[data-theme="dark"] .btn-primary { box-shadow: 0 4px 12px rgba(255,59,78,0.3); }
:root[data-theme="dark"] .btn-primary:hover { box-shadow: 0 6px 18px rgba(255,59,78,0.42); }

* { box-sizing: border-box; }
body, .btn, .sidebar-link, .course-card, .bonus-card, .thread-item, .task-item, .modal, .data-table, input, select, textarea {
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}
a { color: var(--accent); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent-2); }
h1, h2, h3 { margin: 0 0 12px; font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; color: var(--text); }
::selection { background: var(--accent); color: #fff; }
code { background: var(--surface-3); color: var(--gold); padding: 2px 7px; border-radius: 6px; font-size: 0.92em; }

/* scrollbars (webkit) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; border: 2px solid var(--bg); }

/* ─── Global mobile menu button (fixed, shown < 900px) ──────────────────── */
.hamburger-btn {
  display: none;
  position: fixed;
  top: 14px; left: 14px;
  z-index: 220;
  width: 42px; height: 42px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  align-items: center; justify-content: center;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}
.hamburger-btn span { width: 18px; height: 2px; background: var(--text); border-radius: 2px; }

/* ─── Theme toggle ─────────────────────────────────────────────────────────
   Floating version (#themeToggleBtn, from head.php) is the fallback for
   pages with no topbar (admin has none). Member-facing app pages get a
   small inline icon in the topbar instead (#themeToggleBtnBar) and hide
   the floating one to avoid showing both. */
.theme-toggle-btn {
  position: fixed;
  bottom: 22px; right: 22px;
  z-index: 999;
  width: 50px; height: 50px;
  border-radius: 50%;
  background: var(--accent-gradient);
  border: 2px solid #fff;
  box-shadow: 0 8px 22px rgba(79,107,251,0.45);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 21px;
  line-height: 1;
  transition: box-shadow .15s ease, transform .15s ease, background-color .2s ease, border-color .2s ease;
}
body:has(#themeToggleBtnBar) #themeToggleBtn { display: none; }
.theme-toggle-btn:hover { box-shadow: 0 10px 28px rgba(79,107,251,0.55); transform: translateY(-2px) scale(1.04); }
.theme-toggle-btn:active { transform: scale(0.96); }
.theme-icon-dark { display: none; }
:root[data-theme="dark"] .theme-icon-light { display: none; }
:root[data-theme="dark"] .theme-icon-dark { display: inline; }
:root[data-theme="dark"] .theme-toggle-btn { border-color: var(--bg); box-shadow: 0 8px 22px rgba(255,59,78,0.5); }
:root[data-theme="dark"] .theme-toggle-btn:hover { box-shadow: 0 10px 28px rgba(255,59,78,0.6); }

/* Inline topbar icon-button variant, reused for the theme toggle */
.topbar-icon-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--text-dim);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
  transition: all .15s ease;
}
.topbar-icon-btn:hover { background: var(--surface-3); color: var(--text); border-color: var(--border-strong); }

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15,17,24,0.5);
  backdrop-filter: blur(2px);
  z-index: 150;
}
.sidebar-overlay.open { display: block; }
body.sidebar-open-lock { overflow: hidden; }

.sidebar-close-btn { display: none; }

/* ─── Topbar ─────────────────────────────────────────────────────────────── */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: var(--topbar-h);
  position: sticky; top: 0; z-index: 90;
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar-logo {
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.02em;
}
.topbar-logo:hover { color: var(--text); }
.topbar-right { display: flex; align-items: center; gap: 18px; }
.topbar-links { display: flex; align-items: center; gap: 18px; }
.topbar-links a { color: var(--text-dim); font-size: 13px; font-weight: 500; }
.topbar-links a:hover { color: var(--text); }

.membership-pill {
  background: var(--accent-gradient);
  color: #fff;
  padding: 7px 15px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.05em;
  box-shadow: 0 3px 10px rgba(79,107,251,0.25);
}
.avatar-badge {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12.5px;
  color: var(--text);
}

/* ─── App / Admin layout ─────────────────────────────────────────────────── */
.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr var(--journey-w);
  align-items: start;
  min-height: calc(100vh - var(--topbar-h));
}
.admin-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar-app, .sidebar-admin {
  background: var(--bg-soft);
  border-right: 1px solid var(--border);
  color: var(--text-dim);
  padding: 20px 0;
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
}
.admin-layout .sidebar-admin { top: 0; height: 100vh; }

.sidebar-admin-brand {
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15.5px;
  padding: 0 22px 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.sidebar-admin-brand-text span { color: var(--accent); }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; }
.sidebar-section-label {
  color: var(--text-muted);
  font-weight: 800;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 16px 14px 6px;
}
.sidebar-section-label:first-child { padding-top: 4px; }
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-dim);
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: var(--radius-sm);
}
.sidebar-link .nav-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.75; }
.sidebar-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.sidebar-link.active {
  background: var(--accent-soft);
  color: var(--accent-2);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent);
}
.sidebar-link.active .nav-icon { color: var(--accent); opacity: 1; }
.logout-link { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 16px; }
.sidebar-role-badge { margin: 20px 20px 0; padding-top: 16px; border-top: 1px solid var(--border); font-size: 11px; color: var(--text-muted); }
.sidebar-role-badge strong { color: var(--text-dim); }

.tier-tabs {
  display: flex;
  margin: 18px 18px 0;
  border-radius: 999px;
  background: var(--surface-2);
  padding: 4px;
  gap: 3px;
  box-shadow: inset 0 0 0 1px var(--border);
}
.tier-tab {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  padding: 10px 6px;
  border-radius: 999px;
  color: var(--text-dim);
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background-color .15s ease, color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.tier-tab.active {
  color: #fff;
  background: var(--tab-color, var(--accent-gradient));
  box-shadow: 0 4px 10px rgba(20,22,31,0.18), 0 0 0 3px var(--surface-2), 0 0 0 4px var(--tab-color, var(--accent-gradient));
  transform: translateY(-1px);
}
.tier-tab:hover { text-decoration: none; color: var(--text); background: var(--surface-3); }
.tier-tab.active:hover { color: #fff; background: var(--tab-color, var(--accent-gradient)); }

.category-tree { padding: 22px 14px 14px; }
.category-node { margin-bottom: 2px; }
.category-node + .category-node { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 2px; }
.category-node summary {
  cursor: pointer;
  color: var(--text-muted);
  font-weight: 800;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  padding: 12px 8px 8px;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.category-node summary::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  opacity: 0.6;
}
.category-node summary::-webkit-details-marker { display: none; }
.category-node ul { list-style: none; margin: 0; padding: 0 0 6px; }
.category-node li a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
  padding: 9px 10px 9px 16px;
  margin: 0 2px;
  border-radius: 9px;
}
.category-node li a::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--border-strong);
  flex-shrink: 0;
  transition: background-color .15s ease, transform .15s ease;
}
.category-node li a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.category-node li a:hover::before { background: var(--accent); transform: scale(1.35); }
.category-node li a.locked { color: var(--text-muted); }
.category-node li a.locked::before { background: var(--text-muted); }

/* ─── Content ────────────────────────────────────────────────────────────── */
.app-content { padding: 32px; max-width: 980px; }
.admin-layout .app-content { padding: 32px; max-width: none; width: 100%; }

/* Platform-operator pages have no sidebar at all — .admin-layout is a 2-column
   grid (sidebar | content) and squeezed a sidebar-less single child into the
   narrow first column. This is a plain full-width block instead. */
.platform-layout { min-height: 100vh; }
.platform-layout .app-content { padding: 32px; max-width: none; width: 100%; box-sizing: border-box; }
.page-heading { font-size: clamp(19px, 2.1vw, 23px); font-weight: 800; color: var(--text); }
.page-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }

.watch-first-banner {
  background: var(--accent-gradient);
  color: #fff;
  padding: 15px 22px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 8px 18px rgba(79,107,251,0.2);
}
.video-wrap {
  position: relative; padding-bottom: 56.25%; height: 0;
  background: #000;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-strong);
}
.video-wrap iframe, .video-wrap video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

.yt-protected { position: absolute; inset: 0; }
.yt-target { position: absolute; inset: 0; }
.yt-target iframe { width: 100%; height: 100%; border: 0; pointer-events: none; }
.yt-click-overlay { position: absolute; inset: 0; z-index: 6; cursor: pointer; background: transparent; }
.yt-controls {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 7;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(0deg, rgba(0,0,0,0.75), transparent);
}
.yt-play-btn, .yt-mute-btn, .yt-fullscreen-btn {
  background: rgba(255,255,255,0.14); border: none; color: #fff;
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  font-size: 12px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
}
.yt-play-btn:hover, .yt-mute-btn:hover, .yt-fullscreen-btn:hover { background: rgba(255,255,255,0.26); }
.yt-seek-bar { flex: 1; height: 5px; background: rgba(255,255,255,0.28); border-radius: 999px; cursor: pointer; position: relative; }
.yt-seek-fill { position: absolute; left: 0; top: 0; height: 100%; background: var(--accent); border-radius: 999px; width: 0%; }
.yt-time { color: #fff; font-size: 12px; font-weight: 600; flex-shrink: 0; white-space: nowrap; }

.yt-protected:fullscreen,
.yt-protected:-webkit-full-screen { width: 100%; height: 100%; background: #000; }
.yt-protected:fullscreen .yt-controls,
.yt-protected:-webkit-full-screen .yt-controls { padding: 18px 24px; }

.bonus-viewer-frame {
  position: relative;
  width: 100%;
  height: 72vh;
  min-height: 420px;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 18px 0;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-strong);
}
.bonus-viewer-frame iframe { width: 100%; height: 100%; border: 0; }
.bonus-viewer-frame:fullscreen,
.bonus-viewer-frame:-webkit-full-screen { width: 100%; height: 100%; background: #000; }

.pdf-fullscreen-btn {
  position: absolute; top: 12px; right: 12px; z-index: 8;
  background: rgba(0,0,0,0.55); border: none; color: #fff;
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
  font-size: 15px; display: flex; align-items: center; justify-content: center;
}
.pdf-fullscreen-btn:hover { background: rgba(0,0,0,0.75); }

.pdf-canvas-frame {
  position: relative;
  width: 100%;
  height: 72vh;
  min-height: 420px;
  background: #2b2b2b;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 18px 0;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-strong);
}
.pdf-canvas-frame:fullscreen,
.pdf-canvas-frame:-webkit-full-screen { width: 100%; height: 100%; }
.pdf-pages-scroll {
  position: absolute; inset: 0;
  overflow-y: auto; overflow-x: hidden;
  padding: 16px 0;
  text-align: center;
}
.pdf-pages-scroll canvas {
  display: block;
  margin: 0 auto 16px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.4);
  background: #fff;
  user-select: none;
}
.pdf-loading { color: #fff; padding: 40px; font-size: 14px; }

.media-watermark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 5;
  color: rgba(255,255,255,0.16);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  transform: rotate(-16deg);
  text-align: center;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  white-space: nowrap;
  user-select: none;
}

.journey-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-lg);
  margin: 32px 32px 32px 0;
  height: fit-content;
  padding: 22px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: calc(var(--topbar-h) + 24px);
}
.journey-header { font-family: var(--font-display); font-size: 16.5px; font-weight: 700; line-height: 1.3; margin-bottom: 16px; }
.journey-header strong { color: var(--accent); }
.journey-steps { list-style: none; margin: 0; padding: 0; }
.journey-step { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-dim); }
.journey-step:first-child { border-top: none; }
.journey-step .journey-check {
  flex-shrink: 0;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 1px;
}
.journey-step.done { color: var(--text); }
.journey-step.done .journey-check { background: var(--green); border-color: var(--green); color: #fff; }
.journey-mark-link { color: inherit; }
.journey-mark-link:hover { color: var(--accent); }

/* ─── Cards / grids ──────────────────────────────────────────────────────── */
.course-category-section { margin-bottom: 32px; }
.course-category-section h2 { font-size: 13.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); font-weight: 700; }
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.course-card, .plan-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--blue);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.course-card:hover, .plan-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.course-card h3 { font-size: 14.5px; }
.course-card p, .plan-card p { color: var(--text-dim); font-size: 13px; }
.course-card.locked { opacity: 0.6; }
.course-card.locked:hover { transform: none; }
.plan-card.current { border-color: var(--green); box-shadow: 0 0 0 1px rgba(22,163,74,0.25); }

.bonus-stats-row { display: flex; gap: 28px; margin-bottom: 24px; flex-wrap: wrap; }
.bonus-stat { display: flex; flex-direction: column; }
.bonus-stat-value { font-family: var(--font-display); font-size: 21px; font-weight: 800; color: var(--text); }
.bonus-stat-label { font-size: 11.5px; color: var(--text-muted); }

.bonus-hero {
  display: grid;
  grid-template-columns: 280px 1fr;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}
.bonus-hero-media {
  position: relative;
  min-height: 180px;
  background-size: cover; background-position: center;
  background-color: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
}
.bonus-hero-media svg { width: 56px; height: 56px; opacity: 0.5; }
.bonus-hero-body { padding: 24px; display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.bonus-hero-body h2 { font-size: 19px; margin: 0; }
.bonus-hero-body p { color: var(--text-dim); margin: 0; }
.bonus-hero-body .btn { align-self: flex-start; margin-top: 4px; }
.bonus-hero.locked .bonus-hero-media { filter: blur(3px) brightness(0.8); }

.bonus-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.bonus-toolbar input { max-width: 240px; margin: 0; }
.bonus-filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.bonus-filter-tab {
  background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text-dim);
  padding: 7px 14px; border-radius: 999px; font-size: 12px; font-weight: 700; cursor: pointer; font-family: inherit;
}
.bonus-filter-tab:hover { color: var(--text); }
.bonus-filter-tab.active { background: var(--accent-gradient); border-color: transparent; color: #fff; }

.bonus-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.bonus-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.bonus-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.bonus-card.locked { opacity: 0.75; }
.bonus-card.locked .bonus-thumb { filter: blur(2px) brightness(0.85); }
.bonus-card.locked:hover { transform: none; }
.bonus-thumb {
  position: relative;
  height: 130px;
  background-size: cover; background-position: center;
  background-color: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
}
.bonus-thumb svg { width: 32px; height: 32px; opacity: 0.5; }
.bonus-new-badge { position: absolute; top: 10px; left: 10px; background: var(--green); color: #fff; font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: 999px; letter-spacing: 0.04em; }
.bonus-claimed-badge { position: absolute; top: 10px; right: 10px; width: 24px; height: 24px; border-radius: 50%; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; }
.bonus-lock-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 26px; background: rgba(255,255,255,0.35); }
.bonus-card-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.bonus-card-body h3 { font-size: 14.5px; margin: 0; }
.bonus-card-body p { color: var(--text-dim); font-size: 12.5px; margin: 0; flex: 1; }
.bonus-card-body .btn { align-self: flex-start; }
.bonus-empty-state { text-align: center; color: var(--text-muted); padding: 40px 0; }

.field-hint { font-size: 12px; color: var(--text-muted); margin: -10px 0 14px; word-break: break-all; }

/* ─── Planner: Calendar ──────────────────────────────────────────────────── */
.calendar-layout { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.calendar-panel, .calendar-day-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px; box-shadow: var(--shadow-sm); }
.calendar-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.calendar-dow { text-align: center; font-size: 10.5px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; padding-bottom: 6px; }
.calendar-cell {
  aspect-ratio: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 12.5px;
  gap: 4px;
}
.calendar-cell:not(.empty):hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.calendar-cell.empty { visibility: hidden; }
.calendar-cell.today .calendar-day-num { color: var(--accent); font-weight: 800; }
.calendar-cell.selected { background: var(--accent-soft); border: 1px solid var(--accent); color: var(--text); }
.calendar-dot-row { display: flex; gap: 2px; }
.calendar-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }

.event-list { list-style: none; margin: 0; padding: 0; }
.event-item { display: flex; justify-content: space-between; gap: 10px; padding: 12px 0; border-top: 1px solid var(--border); }
.event-item:first-child { border-top: none; }
.event-item p { margin: 4px 0 0; color: var(--text-dim); font-size: 12.5px; }

/* ─── Planner: Tasks ─────────────────────────────────────────────────────── */
.task-list { list-style: none; margin: 0; padding: 0; }
.task-item {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}
.task-item.priority-high { border-left-color: var(--red); }
.task-item.priority-medium { border-left-color: var(--gold); }
.task-item.priority-low { border-left-color: var(--green); }
.task-item.completed { opacity: 0.6; }
.task-item.completed .task-body strong { text-decoration: line-through; }
.task-check {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--green);
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
}
.task-body { flex: 1; min-width: 0; }
.task-body p { margin: 6px 0 0; color: var(--text-dim); font-size: 12.5px; }

/* ─── Planner: Goals ─────────────────────────────────────────────────────── */
.goal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.goal-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 18px; box-shadow: var(--shadow-sm); }
.goal-card.achieved { border-color: var(--green); }
.goal-card h3 { font-size: 14.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.goal-card p { color: var(--text-dim); font-size: 12.5px; }
.goal-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; gap: 10px; flex-wrap: wrap; }
.goal-progress-form { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-dim); }
.goal-progress-form input[type=number] { margin: 0; }

@media (max-width: 900px) {
  .calendar-layout { grid-template-columns: 1fr; }
}
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 28px; }
.plan-price { font-size: 25px; font-weight: 800; font-family: var(--font-display); color: var(--text); }

.locked-card {
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 30px;
  text-align: center;
  color: var(--text-dim);
}

.module-section { margin-bottom: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 18px; box-shadow: var(--shadow-sm); }
.module-section h2 { font-size: 14.5px; }
.lesson-list { list-style: none; margin: 0; padding: 0; }
.lesson-list li { padding: 11px 4px; border-bottom: 1px solid var(--border); }
.lesson-list li:last-child { border-bottom: none; }
.lesson-list li a { color: var(--text); display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.lesson-list li a:hover { color: var(--accent); }

.lesson-notes { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 18px; margin-bottom: 18px; color: var(--text-dim); font-size: 14px; box-shadow: var(--shadow-sm); }
.lesson-actions { margin-bottom: 18px; }
.lesson-nav { display: flex; justify-content: space-between; margin-top: 20px; font-size: 13.5px; gap: 12px; }

.progress-bar-wrap { background: var(--surface-2); border-radius: 999px; height: 8px; overflow: hidden; margin-bottom: 8px; border: 1px solid var(--border); }
.progress-bar { background: var(--accent-gradient); height: 100%; border-radius: 999px; }

.resource-list { list-style: none; margin: 0; padding: 0; }
.resource-item { display: flex; justify-content: space-between; align-items: center; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px 18px; margin-bottom: 12px; box-shadow: var(--shadow-sm); }
.resource-item.locked { opacity: 0.6; }
.resource-item p { margin: 4px 0 0; color: var(--text-dim); font-size: 12.5px; }

/* ─── Community ──────────────────────────────────────────────────────────── */
.community-category-card { display: flex; flex-direction: column; gap: 10px; }
.community-category-meta { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-muted); }

.thread-list { list-style: none; margin: 0; padding: 0; }
.thread-item { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px 18px; margin-bottom: 10px; box-shadow: var(--shadow-sm); }
.thread-item-body { flex: 1; min-width: 0; }
.thread-title { color: var(--text); font-weight: 700; font-size: 14.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.thread-title:hover { color: var(--accent); }
.thread-meta { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 12px; margin-top: 4px; }
.badge-pinned { background: var(--gold-soft); color: var(--gold); }
.priority-badge-low { background: var(--green-soft); color: var(--green); }
.priority-badge-medium { background: rgba(59,130,246,0.12); color: var(--blue); }
.priority-badge-high { background: var(--gold-soft); color: var(--gold); }
.priority-badge-urgent { background: var(--red-soft); color: var(--red); }

.unread-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 6px; box-shadow: 0 0 0 3px var(--accent-soft); }
.reply-item.internal-note { background: var(--gold-soft); border-radius: var(--radius-sm); padding-left: 10px; padding-right: 10px; }
.attachment-link { display: inline-block; margin-top: 10px; font-size: 12.5px; color: var(--accent); }
.attachment-link:hover { text-decoration: underline; }

.thread-detail { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; margin-bottom: 8px; box-shadow: var(--shadow-sm); }
.thread-detail-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.thread-detail-head .page-heading { margin: 0; }
.thread-detail .thread-meta { margin: 12px 0 18px; }

.post-body { color: var(--text); font-size: 14px; line-height: 1.7; white-space: pre-line; }
.post-image { max-width: 100%; border-radius: var(--radius-md); margin-top: 14px; border: 1px solid var(--border); }
.mention { color: var(--accent-2); font-weight: 600; background: var(--accent-soft); padding: 1px 5px; border-radius: 5px; }

.post-actions { display: flex; align-items: center; gap: 18px; margin-top: 16px; }
.like-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  color: var(--text-dim); font-weight: 700; font-size: 12.5px;
  padding: 7px 14px; border-radius: 999px; cursor: pointer;
  transition: all .15s ease;
}
.like-btn:hover { border-color: var(--accent); color: var(--accent); }
.like-btn.liked { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.btn-link { background: none; border: none; color: var(--text-muted); font-size: 12.5px; cursor: pointer; font-family: inherit; padding: 0; }
.btn-link:hover { color: var(--text); text-decoration: underline; }
.btn-link-danger:hover { color: var(--red); }

.reply-list { list-style: none; margin: 0 0 24px; padding: 0; }
.reply-item { display: flex; gap: 14px; align-items: flex-start; padding: 18px 0; border-top: 1px solid var(--border); }
.reply-item:first-child { border-top: none; }
.reply-body-wrap { flex: 1; min-width: 0; }
.reply-form textarea { min-height: 80px; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 20px 0; font-size: 13px; color: var(--text-dim); }
.mod-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.kpi-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 28px; }
.kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 18px; text-align: center; box-shadow: var(--shadow-sm); }
.kpi-value { display: block; font-size: 24px; font-weight: 800; font-family: var(--font-display); color: var(--text); }
.kpi-label { color: var(--text-dim); font-size: 12px; margin-top: 4px; display: block; }

/* ─── Forms / tables / badges ────────────────────────────────────────────── */
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 22px; margin-bottom: 20px; max-width: 480px; box-shadow: var(--shadow-sm); }
label { display: block; margin-bottom: 15px; font-size: 12.5px; font-weight: 600; color: var(--text-dim); }
input, select, textarea {
  display: block;
  width: 100%;
  margin-top: 7px;
  padding: 10px 13px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--surface);
}
fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 16px; padding: 12px 14px; }
legend { padding: 0 6px; font-size: 12px; color: var(--text-dim); }
.checkbox-label { display: flex; align-items: center; gap: 10px; font-weight: 400; }
.checkbox-label input { width: auto; margin: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 13.5px;
  font-family: inherit;
  transition: transform .12s ease, box-shadow .12s ease, background .15s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent-gradient); color: #fff; box-shadow: 0 4px 12px rgba(79,107,251,0.28); }
.btn-primary:hover { box-shadow: 0 6px 18px rgba(79,107,251,0.38); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--border-strong); color: var(--text); }
.btn-outline:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--red-soft); color: var(--red); border: 1px solid rgba(220,38,38,0.25); }
.btn-danger:hover { background: rgba(220,38,38,0.16); color: var(--red); }
.btn-sm { padding: 6px 13px; font-size: 12px; }

.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--surface-3); color: var(--text-dim); font-size: 10.5px; font-weight: 700; letter-spacing: 0.02em; }
.badge-locked { background: var(--red-soft); color: var(--red); }
.badge-preview { background: rgba(59,130,246,0.12); color: var(--blue); }

.data-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; margin-bottom: 26px; box-shadow: var(--shadow-sm); }
.data-table th, .data-table td { text-align: left; padding: 12px 15px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text); }
.data-table tr:last-child td { border-bottom: none; }
.data-table th { background: var(--surface-2); font-weight: 700; color: var(--text-dim); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
.data-table tr:hover td { background: var(--surface-2); }

.filter-row { display: flex; gap: 10px; margin-bottom: 20px; max-width: 560px; flex-wrap: wrap; }
.filter-row input, .filter-row select { margin: 0; }

.alert { padding: 13px 17px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: 13.5px; border: 1px solid transparent; }
.alert-error { background: var(--red-soft); color: var(--red); border-color: rgba(220,38,38,0.2); }
.alert-success { background: var(--green-soft); color: var(--green); border-color: rgba(22,163,74,0.2); }

.tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab-btn { background: none; border: none; padding: 11px 17px; cursor: pointer; font-weight: 600; font-family: inherit; font-size: 13px; color: var(--text-dim); border-bottom: 2px solid transparent; white-space: nowrap; }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ─── Modals ─────────────────────────────────────────────────────────────── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(15,17,24,0.5); backdrop-filter: blur(3px); align-items: center; justify-content: center; z-index: 200; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); animation: modal-in .18s ease; }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 17px 22px; border-bottom: 1px solid var(--border); }
.modal-header h3 { margin: 0; font-size: 15px; }
.modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text-dim); line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal form { padding: 22px; }

/* ─── Auth pages ─────────────────────────────────────────────────────────── */
.auth-page {
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
  background: radial-gradient(circle at 20% 20%, rgba(79,107,251,0.08), transparent 40%), var(--bg);
  padding: 20px;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 34px;
  width: 100%; max-width: 400px;
  box-shadow: var(--shadow-lg);
}
.auth-card h1 { font-size: 20px; margin-bottom: 20px; }
.auth-links { display: flex; justify-content: space-between; margin-top: 18px; font-size: 12.5px; flex-wrap: wrap; gap: 8px; }

/* ============================================================================
   Responsive breakpoints
   ========================================================================= */

/* Tablet: journey widget drops below content */
@media (max-width: 1200px) {
  .app-layout { grid-template-columns: var(--sidebar-w) 1fr; }
  .journey-widget { grid-column: 2; margin: 0 32px 32px; position: static; }
}

/* Mobile: off-canvas sidebar */
@media (max-width: 900px) {
  .hamburger-btn { display: flex; }

  .app-layout, .admin-layout { grid-template-columns: 1fr; }
  .journey-widget { grid-column: 1; margin: 0 20px 24px; }

  .sidebar-app, .sidebar-admin {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    width: min(300px, 84vw);
    z-index: 200;
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar-app.open, .sidebar-admin.open { transform: translateX(0); }
  .sidebar-close-btn {
    display: flex;
    align-items: center; justify-content: center;
    position: absolute; top: 14px; right: 14px;
    width: 32px; height: 32px;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    color: var(--text);
    font-size: 18px;
    cursor: pointer;
  }

  .topbar { padding: 0 16px 0 64px; }
  .topbar-links { display: none; }
  .membership-pill { font-size: 9.5px; padding: 6px 10px; }

  .app-content { padding: 20px 16px; }
  .admin-layout .app-content { padding: 76px 16px 20px; }

  .plan-grid, .course-grid, .kpi-row, .bonus-grid { grid-template-columns: 1fr 1fr; }
  .form-card { max-width: none; }

  .data-table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }

  .bonus-hero { grid-template-columns: 1fr; }
  .bonus-hero-media { min-height: 140px; }
  .bonus-toolbar { flex-direction: column; align-items: stretch; }
  .bonus-toolbar input { max-width: none; }
}

/* Small phone */
@media (max-width: 560px) {
  .topbar { height: 58px; }
  .topbar-right { gap: 10px; }
  .avatar-badge { width: 30px; height: 30px; font-size: 11.5px; }
  .app-content { padding: 16px 14px; }
  .page-header-row { align-items: flex-start; }
  .page-heading { font-size: 18px; }

  .plan-grid, .course-grid, .kpi-row, .bonus-grid { grid-template-columns: 1fr; }
  .bonus-stats-row { gap: 18px; }
  .resource-item { flex-direction: column; align-items: flex-start; }
  .lesson-nav { flex-direction: column; align-items: flex-start; }
  .auth-card { padding: 24px 20px; }
  .filter-row { flex-direction: column; }
  .filter-row input, .filter-row select, .filter-row button { width: 100%; }
  .auth-card .btn, .form-card .btn, .modal form .btn { width: 100%; }
  .modal form { padding: 18px; }

  .thread-detail { padding: 18px; }
  .thread-item { padding: 14px; gap: 10px; }
  .reply-item { gap: 10px; }
  .post-actions { flex-wrap: wrap; gap: 12px; }
  .mod-actions { flex-direction: column; align-items: flex-start; }
}

/* ─── Community Advanced Feature Pack ───────────────────────────────────── */
.notification-bell-link { position: relative; font-size: 16px; line-height: 1; }
.notification-badge {
  position: absolute; top: -7px; right: -9px; background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 999px; line-height: 1.4;
}
.notification-unread { border-left: 3px solid var(--accent); }

.community-search-form { display: flex; gap: 8px; align-items: center; }
.community-search-form input {
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 8px 12px; color: var(--text); font-size: 13px; min-width: 200px;
}

.announcement-block {
  background: var(--gold-soft); border: 1px solid rgba(234,179,8,0.3);
  border-radius: var(--radius-md); padding: 16px 18px; margin-bottom: 20px;
}
.announcement-block h3 { margin: 0 0 10px; font-size: 13px; color: var(--gold); }
.announcement-item { display: block; padding: 8px 0; border-top: 1px solid rgba(234,179,8,0.2); }
.announcement-item:first-of-type { border-top: none; }
.announcement-item strong { display: block; color: var(--text); }

.community-sort-bar { display: flex; gap: 4px; margin-bottom: 16px; }
.community-sort-bar .tab-btn { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 7px 14px; }
.community-sort-bar .tab-btn.active { background: var(--accent-soft); border-color: var(--accent); }

.reply-item.best-answer { background: var(--green-soft); border-radius: var(--radius-sm); padding-left: 10px; padding-right: 10px; border-top-color: transparent; }

@media (max-width: 720px) {
  .community-search-form input { min-width: 0; flex: 1; }
}

/* ─── Course detail page ─────────────────────────────────────────────────── */
.course-hero {
  display: grid;
  grid-template-columns: 320px 1fr;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 28px;
}
.course-hero-media {
  position: relative;
  background: var(--accent-gradient);
  background-size: cover;
  background-position: center;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.course-hero-media svg { width: 64px; height: 64px; color: rgba(255,255,255,0.85); }
.course-hero-fade {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 60%, var(--surface) 100%);
}
.course-hero.locked .course-hero-media { filter: blur(3px) brightness(0.75); }
.course-hero-body { padding: 30px 32px; display: flex; flex-direction: column; gap: 12px; }
.course-hero-badges { display: flex; gap: 8px; }
.badge-category { background: var(--accent-soft); color: var(--accent-2); }
.badge-continue { background: var(--green-soft); color: var(--green); }
.course-hero-body h1 { font-size: 26px; font-weight: 800; margin: 0; color: var(--text); }
.course-hero-desc { color: var(--text-dim); font-size: 14.5px; line-height: 1.6; margin: 0; max-width: 62ch; }
.course-hero-meta { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.course-hero-meta .meta-dot { opacity: 0.5; }
.course-hero-lock { display: flex; align-items: center; gap: 10px; color: var(--text-dim); font-size: 14px; font-weight: 600; }
.course-hero-lock .lock-icon { font-size: 20px; }

.course-hero-progress { display: flex; align-items: center; gap: 18px; margin-top: 6px; }
.progress-ring {
  --pct: 0;
  position: relative;
  width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0;
  background: conic-gradient(var(--accent) calc(var(--pct) * 1%), var(--surface-3) 0);
  display: flex; align-items: center; justify-content: center;
}
.progress-ring::before {
  content: '';
  position: absolute; inset: 6px;
  border-radius: 50%;
  background: var(--surface);
}
.progress-ring span { position: relative; font-size: 13px; font-weight: 800; color: var(--text); }
.course-hero-progress-text { color: var(--text-dim); font-size: 13.5px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.course-hero-progress-text strong { color: var(--text); font-size: 15px; }

.module-accordion { display: flex; flex-direction: column; gap: 12px; }
.module-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.module-card summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  font-weight: 700;
  font-size: 14.5px;
  color: var(--text);
}
.module-card summary::-webkit-details-marker { display: none; }
.module-card summary::before {
  content: '';
  width: 8px; height: 8px;
  margin-right: 2px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(-45deg);
  transition: transform .15s ease;
  flex-shrink: 0;
}
.module-card[open] summary::before { transform: rotate(45deg); }
.module-card-title { flex: 1; }
.module-card-meta { display: flex; align-items: center; gap: 10px; font-size: 11.5px; font-weight: 700; color: var(--text-muted); }
.module-progress-pill { background: var(--surface-3); color: var(--text-dim); padding: 3px 9px; border-radius: 999px; }
.module-progress-pill.complete { background: var(--green-soft); color: var(--green); }
.module-card .lesson-list { border-top: 1px solid var(--border); }
.module-card .lesson-list li { padding: 0; border-bottom: 1px solid var(--border); }
.module-card .lesson-list li:last-child { border-bottom: none; }

.lesson-list .lesson-row a { padding: 13px 20px; gap: 12px; }
.lesson-list .lesson-row a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.lesson-status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--surface-3); border: 2px solid var(--border-strong); flex-shrink: 0; }
.lesson-row.status-completed .lesson-status-dot { background: var(--green); border-color: var(--green); }
.lesson-row.status-in_progress .lesson-status-dot { background: var(--accent); border-color: var(--accent); }
.lesson-type-icon { color: var(--text-muted); flex-shrink: 0; display: flex; }
.lesson-type-icon svg { width: 15px; height: 15px; }
.lesson-title { flex: 1; }
.lesson-row.status-completed .lesson-title { color: var(--text-dim); }
.lesson-duration { color: var(--text-muted); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.lesson-row.is-current { background: var(--accent-soft); }
.lesson-row.is-current a:hover { background: var(--accent-soft); }

@media (max-width: 720px) {
  .course-hero { grid-template-columns: 1fr; }
  .course-hero-media { min-height: 140px; }
  .course-hero-body { padding: 22px; }
}
