/* ============================================================
   LMS Platform — style.css
   Design system modern: warna, tipografi, layout, komponen.
   Vanilla CSS murni, tanpa dependency/preprocessor.
   ============================================================ */

/* ---------- Font ---------- */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

/* ---------- Design Tokens ---------- */
:root {
  /* Warna utama */
  --color-primary: #0F172A;        /* Deep Slate Navy */
  --color-primary-2: #1E293B;
  --color-accent: #4F46E5;         /* Vibrant Indigo */
  --color-accent-dark: #4338CA;
  --color-accent-soft: #EEF2FF;
  --color-success: #10B981;        /* Emerald Green — CTA sekunder */
  --color-success-dark: #059669;
  --color-success-soft: #ECFDF5;

  /* Netral */
  --color-bg: #F8FAFC;
  --color-surface: #FFFFFF;
  --color-text: #334155;
  --color-text-strong: #0F172A;
  --color-muted: #64748B;
  --color-border: #E2E8F0;
  --color-border-soft: #EDF2F7;

  /* Status */
  --color-warning-bg: #FFFBEB;
  --color-warning-text: #92400E;
  --color-warning-border: #FDE68A;
  --color-danger: #DC2626;
  --color-danger-bg: #FEF2F2;
  --color-danger-border: #FECACA;

  /* Tipografi */
  --font-display: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Bentuk & elevasi */
  --radius-sm: 0.5rem;
  --radius: 0.75rem;
  --radius-lg: 1.25rem;
  --radius-full: 999px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 10px 20px -6px rgba(15, 23, 42, 0.08), 0 4px 8px -4px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 20px 40px -12px rgba(15, 23, 42, 0.16);

  /* Layout */
  --container-w: 1200px;
  --header-h: 72px;

  font-size: 16px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--color-text-strong);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(1.75rem, 1.4rem + 1.5vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 1.15rem + 0.8vw, 1.75rem); }
h3 { font-size: 1.15rem; }

p { color: var(--color-text); }

img { max-width: 100%; display: block; }

a { color: var(--color-accent); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--color-accent-dark); }

ul, ol { padding-left: 1.25rem; }

.container {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header / Navbar ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border-soft);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: 16px;
}
.brand {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.brand:hover { color: var(--color-primary); }
.brand::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--color-accent), var(--color-success));
  display: inline-block;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.main-nav a:not(.btn-nav) {
  color: var(--color-text);
  font-weight: 500;
  font-size: 0.94rem;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
}
.main-nav a:not(.btn-nav):hover {
  background: var(--color-accent-soft);
  color: var(--color-accent);
  text-decoration: none;
}
.btn-nav {
  background: var(--color-accent);
  color: #fff !important;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.92rem;
  margin-left: 6px;
  box-shadow: var(--shadow-xs);
}
.btn-nav:hover { background: var(--color-accent-dark); text-decoration: none; }

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  background: var(--color-text-strong);
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 99;
  opacity: 0;
  transition: opacity .2s ease;
}
.nav-overlay.is-open { display: block; opacity: 1; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 80px;
  padding: 32px 0;
  border-top: 1px solid var(--color-border-soft);
  color: var(--color-muted);
  font-size: 0.88rem;
  text-align: center;
  background: var(--color-surface);
}

/* ---------- Main / page wrapper ---------- */
main.container { padding-top: 24px; padding-bottom: 48px; min-height: 60vh; }

/* ---------- Alerts ---------- */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  margin: 0 0 20px;
  font-size: 0.92rem;
  border: 1px solid transparent;
}
.alert-success { background: var(--color-success-soft); color: #047857; border-color: #A7F3D0; }
.alert-error { background: var(--color-danger-bg); color: var(--color-danger); border-color: var(--color-danger-border); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--color-accent);
  color: #fff;
  padding: 12px 22px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.96rem;
  cursor: pointer;
  text-align: center;
  transition: background .15s ease, transform .1s ease, box-shadow .15s ease;
  box-shadow: var(--shadow-xs);
}
.btn:hover { background: var(--color-accent-dark); text-decoration: none; color: #fff; box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); }
.btn-cta { background: var(--color-success); }
.btn-cta:hover { background: var(--color-success-dark); }
.btn-secondary { background: var(--color-surface); color: var(--color-text-strong); border: 1px solid var(--color-border); box-shadow: none; }
.btn-secondary:hover { background: var(--color-bg); color: var(--color-text-strong); border-color: #CBD5E1; }
.btn-ghost { background: transparent; color: var(--color-text); box-shadow: none; padding: 10px 16px; }
.btn-ghost:hover { background: var(--color-bg); color: var(--color-text-strong); }
.btn-danger { background: var(--color-danger); }
.btn-danger:hover { background: #B91C1C; }
.btn-sm { padding: 7px 14px; font-size: 0.84rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 14px 28px; font-size: 1.02rem; }
.btn-block { display: flex; width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 18px; }
label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.88rem; color: var(--color-text-strong); }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=file], input[type=date], input[type=search], textarea, select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.96rem;
  background: var(--color-surface);
  color: var(--color-text-strong);
  font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}
textarea { min-height: 140px; resize: vertical; }
.form-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-lg);
  padding: 36px;
  max-width: 460px;
  margin: 40px auto;
  box-shadow: var(--shadow-md);
}
.form-card h1 { margin-top: 0; font-size: 1.5rem; margin-bottom: 6px; }
.form-hint { font-size: 0.82rem; color: var(--color-muted); margin-top: 5px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  border-radius: var(--radius-lg);
  background: radial-gradient(120% 140% at 15% 0%, #1E293B 0%, var(--color-primary) 55%, #0B1220 100%);
  color: #fff;
  padding: clamp(40px, 6vw, 80px) clamp(24px, 5vw, 64px);
  margin: 8px 0 56px;
  overflow: hidden;
  display: grid;
  gap: 24px;
  text-align: center;
  justify-items: center;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px circle at 85% 20%, rgba(79,70,229,0.35), transparent 60%),
    radial-gradient(500px circle at 10% 90%, rgba(16,185,129,0.25), transparent 55%);
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.16);
  color: #E0E7FF;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.hero h1 { color: #fff; max-width: 720px; }
.hero p { color: #CBD5E1; max-width: 600px; font-size: 1.05rem; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.hero-stats { display: flex; gap: clamp(20px, 5vw, 48px); flex-wrap: wrap; justify-content: center; margin-top: 12px; }
.hero-stats .stat-num { font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; color: #fff; }
.hero-stats .stat-label { font-size: 0.82rem; color: #94A3B8; }

/* ---------- Search & filter bar ---------- */
.catalog-toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-xs);
}
.search-field { position: relative; flex: 1; min-width: 220px; }
.search-field svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--color-muted); pointer-events: none; }
.search-field input { padding-left: 42px; }
.filter-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-pill {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s ease;
}
.filter-pill:hover { border-color: var(--color-accent); color: var(--color-accent); text-decoration: none; }
.filter-pill.active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }

/* ---------- Section heading ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 8px 0 20px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head .link-more { font-weight: 600; font-size: 0.9rem; }

/* ---------- Course grid / cards ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 22px;
  margin: 24px 0;
}
.course-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  height: 100%;
}
.course-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-border);
  text-decoration: none;
}
.card-thumb-wrap { position: relative; }
.card-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: linear-gradient(135deg, var(--color-accent-soft), #E0F2FE);
}
.card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
}
.card-badge.free { background: var(--color-success); }
.card-body { padding: 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  color: var(--color-text-strong);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
  line-height: 1.3;
}
.card-desc { color: var(--color-muted); font-size: 0.86rem; flex: 1; }
.card-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.8rem;
  color: var(--color-muted);
  flex-wrap: wrap;
}
.card-meta .meta-item { display: inline-flex; align-items: center; gap: 4px; }
.card-meta svg { width: 14px; height: 14px; flex-shrink: 0; }
.rating-stars { color: #F59E0B; font-weight: 700; }
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border-soft);
  margin-top: auto;
}
.card-price { font-weight: 800; color: var(--color-text-strong); font-size: 1.05rem; font-family: var(--font-display); }
.card-price.free { color: var(--color-success-dark); }
.card-cta {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-accent);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ---------- Page header ---------- */
.page-header { margin: 8px 0 24px; }
.page-header h1 { margin-bottom: 6px; }
.page-header p { color: var(--color-muted); margin-top: 0; }

/* ---------- Course detail ---------- */
.course-hero-media {
  width: 100%;
  max-height: 420px;
  aspect-ratio: 21/9;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: 32px;
  box-shadow: var(--shadow-md);
}
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; }
.detail-main h2 { margin-top: 32px; margin-bottom: 12px; }
.detail-main h2:first-child { margin-top: 0; }
.course-meta-row { display: flex; gap: 18px; flex-wrap: wrap; margin: 12px 0 24px; }
.meta-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--color-bg); border: 1px solid var(--color-border-soft);
  padding: 6px 14px; border-radius: var(--radius-full); font-size: 0.84rem; color: var(--color-text);
}

/* Accordion (syllabus) */
.accordion { border: 1px solid var(--color-border-soft); border-radius: var(--radius); overflow: hidden; }
.accordion-item { border-bottom: 1px solid var(--color-border-soft); }
.accordion-item:last-child { border-bottom: none; }
.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  background: var(--color-surface);
  border: none;
  text-align: left;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.96rem;
  color: var(--color-text-strong);
  cursor: pointer;
}
.accordion-trigger:hover { background: var(--color-bg); }
.accordion-trigger .accordion-icon {
  flex-shrink: 0;
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  transition: transform .2s ease;
  font-size: 0.9rem;
}
.accordion-item.is-open .accordion-icon { transform: rotate(45deg); }
.accordion-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease;
  background: var(--color-bg);
}
.accordion-item.is-open .accordion-panel { max-height: 800px; }
.accordion-panel-inner { padding: 4px 18px 16px 18px; }
.syllabus-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; font-size: 0.9rem; color: var(--color-text); border-bottom: 1px dashed var(--color-border-soft); }
.syllabus-row:last-child { border-bottom: none; }
.syllabus-row .num { width: 24px; height: 24px; border-radius: 50%; background: var(--color-surface); border: 1px solid var(--color-border); display: inline-flex; align-items: center; justify-content: center; font-size: 0.74rem; font-weight: 700; color: var(--color-muted); flex-shrink: 0; }

/* Sticky purchase sidebar */
.detail-sidebar { position: sticky; top: calc(var(--header-h) + 20px); }
.purchase-card { background: var(--color-surface); border: 1px solid var(--color-border-soft); border-radius: var(--radius-lg); padding: 26px; box-shadow: var(--shadow-md); }
.purchase-card .card-price { font-size: 1.7rem; margin-bottom: 4px; }
.purchase-card .form-hint { margin-bottom: 18px; }
.purchase-perks { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.purchase-perks li { display: flex; align-items: center; gap: 10px; font-size: 0.88rem; color: var(--color-text); }
.purchase-perks li svg { color: var(--color-success); width: 18px; height: 18px; flex-shrink: 0; }

/* ---------- Tables (admin) ---------- */
table { width: 100%; border-collapse: collapse; background: var(--color-surface); }
table th, table td { padding: 12px 14px; border-bottom: 1px solid var(--color-border-soft); text-align: left; font-size: 0.88rem; }
table th { background: var(--color-bg); font-weight: 700; color: var(--color-text-strong); font-family: var(--font-display); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }
table tbody tr:hover { background: var(--color-bg); }
.table-wrap { overflow-x: auto; border: 1px solid var(--color-border-soft); border-radius: var(--radius); box-shadow: var(--shadow-xs); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border-radius: var(--radius-full); font-size: 0.76rem; font-weight: 700; }
.badge-pending { background: var(--color-warning-bg); color: var(--color-warning-text); }
.badge-active, .badge-verified { background: var(--color-success-soft); color: var(--color-success-dark); }
.badge-rejected { background: var(--color-danger-bg); color: var(--color-danger); }

/* ---------- Admin layout ---------- */
.admin-wrap { display: flex; gap: 24px; align-items: flex-start; margin: 8px 0; }
.admin-sidebar {
  width: 220px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-lg);
  padding: 14px;
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--header-h) + 20px);
}
.admin-sidebar a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-weight: 500;
  font-size: 0.92rem;
  margin-bottom: 2px;
}
.admin-sidebar a:hover, .admin-sidebar a.active {
  background: var(--color-primary);
  color: #fff;
  text-decoration: none;
}
.admin-content { flex: 1; min-width: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 16px; margin-bottom: 24px; }
.stat-box { background: var(--color-surface); border: 1px solid var(--color-border-soft); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-xs); }
.stat-box .num { font-family: var(--font-display); font-size: 1.9rem; font-weight: 800; color: var(--color-text-strong); }
.stat-box .label { color: var(--color-muted); font-size: 0.84rem; margin-top: 2px; }

/* ============================================================
   Learning Dashboard — split-screen video player page
   ============================================================ */
.lesson-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  margin: 8px 0;
  align-items: start;
}
.lesson-layout.sidebar-collapsed { grid-template-columns: minmax(0, 1fr) 0px; }

.lesson-main {
  min-width: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}
.lesson-main-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.lesson-main-head h2 { margin: 0; }
.sidebar-toggle-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text);
  flex-shrink: 0;
}
.sidebar-toggle-btn:hover { background: var(--color-bg); }

.video-embed { position: relative; width: 100%; padding-top: 56.25%; margin-bottom: 20px; background: #0B1220; border-radius: var(--radius); overflow: hidden; }
.video-embed iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

/* Course progress bar */
.progress-wrap { margin: 4px 0 22px; }
.progress-labels { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--color-muted); margin-bottom: 6px; }
.progress-labels strong { color: var(--color-text-strong); }
.progress-track { height: 8px; background: var(--color-border-soft); border-radius: var(--radius-full); overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--color-accent), var(--color-success)); border-radius: var(--radius-full); transition: width .3s ease; }

/* Chapter sidebar */
.lesson-sidebar {
  width: 320px;
  flex-shrink: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: calc(var(--header-h) + 20px);
  max-height: calc(100vh - var(--header-h) - 40px);
  display: flex;
  flex-direction: column;
  transition: opacity .18s ease;
}
.lesson-layout.sidebar-collapsed .lesson-sidebar { display: none; }
.lesson-sidebar-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--color-border-soft);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--color-text-strong);
  display: flex; align-items: center; justify-content: space-between;
}
.lesson-sidebar-list { overflow-y: auto; padding: 8px; }
.lesson-sidebar-list a {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 12px;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 2px;
}
.lesson-sidebar-list a:hover { background: var(--color-bg); text-decoration: none; }
.lesson-sidebar-list a.active { background: var(--color-accent-soft); color: var(--color-accent-dark); font-weight: 700; }
.lesson-sidebar-list a.active .chapter-num { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }
.chapter-num {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-muted);
}

/* Floating reopen button when sidebar collapsed (mobile/desktop) */
.sidebar-reopen-btn {
  display: none;
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  border-radius: var(--radius-full);
  padding: 12px 18px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  align-items: center;
  gap: 8px;
}
/* Visibility tombol reopen dikendalikan JS (initLessonSidebarToggle) */

/* ---------- Notice / empty states ---------- */
.notice-box {
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  text-align: center;
  margin: 40px 0;
}
.notice-box h2 { margin-bottom: 8px; }
.notice-box p { color: var(--color-muted); margin-bottom: 18px; }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.text-muted { color: var(--color-muted); }
.mt-0 { margin-top: 0; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 960px) {
  .detail-layout { grid-template-columns: 1fr; }
  .detail-sidebar { position: static; order: -1; }
  .lesson-layout { grid-template-columns: 1fr; }
  .lesson-sidebar { position: static; width: 100%; max-height: none; }
  .lesson-layout.sidebar-collapsed .lesson-sidebar { display: none; }
}

@media (max-width: 720px) {
  .admin-wrap { flex-direction: column; }
  .admin-sidebar { width: 100%; position: static; display: flex; overflow-x: auto; gap: 4px; }
  .admin-sidebar a { white-space: nowrap; }
}

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .main-nav {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(78vw, 320px);
    background: var(--color-surface);
    flex-direction: column;
    align-items: stretch;
    padding: 88px 20px 24px;
    gap: 4px;
    transform: translateX(100%);
    transition: transform .25s ease;
    z-index: 100;
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
  }
  .main-nav.is-open { transform: translateX(0); }
  .main-nav a:not(.btn-nav) { padding: 12px 14px; font-size: 1rem; }
  .btn-nav { margin-left: 0; text-align: center; }
}

@media (max-width: 600px) {
  .container { padding: 0 16px; }
  .hero { border-radius: var(--radius); padding: 36px 20px; }
  .form-card { padding: 24px; margin: 24px auto; }
  .catalog-toolbar { flex-direction: column; align-items: stretch; }
}
