/* assets/css/style.css — BANKPEDIAA Niche Hunter */
@import url('variables.css');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&family=Space+Grotesk:wght@500;600;700&display=swap');

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

body {
  font-family: var(--font-family);
  background-color: var(--color-page-bg);
  color: var(--color-text-primary);
  line-height: 1.5;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ------------------------------------------------------------ app shell */
.app-container { display: flex; min-height: 100vh; }

.sidebar {
  width: 236px;
  flex-shrink: 0;
  background-color: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 100;
  overflow-y: auto;
}

.main-content {
  flex-grow: 1;
  margin-left: 236px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background-color: var(--color-page-bg);
}

.top-header {
  height: 64px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-4);
  padding: 0 var(--spacing-8);
  background-color: var(--color-surface);
  position: sticky;
  top: 0;
  z-index: 90;
}

.page-content {
  padding: var(--spacing-8);
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 99;
}
.sidebar-backdrop.show { display: block; }

/* --------------------------------------------------------------- brand */
.brand { padding: 20px 24px 16px; }
.brand-name { font-family: var(--font-display); font-size: 21px; font-weight: 700; letter-spacing: -0.035em; }
.brand-name .b1 { color: var(--brand-bank); }
.brand-name .b2 { color: var(--brand-pediaa); }
.brand-tagline { font-family: var(--font-mono); font-size: 9.5px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-text-muted); margin-top: 5px; line-height: 1.5; }

/* ------------------------------------------------------------ sidebar nav */
.sidebar-nav { padding: 0 12px; flex-grow: 1; }
.nav-section-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin: 20px 12px 8px;
}
.nav-section:first-child .nav-section-label { margin-top: 8px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  color: #526075;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-md);
  margin-bottom: 2px;
  border: 1px solid transparent;
  transition: background-color 140ms ease, color 140ms ease;
}
.nav-item svg, .nav-item i { width: 18px; height: 18px; flex-shrink: 0; color: var(--color-text-secondary); }
.nav-item:hover { background-color: var(--color-soft-bg); color: var(--color-text-primary); }
.nav-item.active {
  background-color: var(--color-primary-soft);
  color: var(--color-primary);
  border-color: var(--color-primary-border);
  font-weight: 600;
}
.nav-item.active svg, .nav-item.active i { color: var(--color-primary); }
.nav-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  background: var(--color-purple-soft);
  color: var(--color-purple);
}

/* ---------------------------------------------------------- upgrade card */
.sidebar-footer { padding: 16px 20px 24px; }
.upgrade-card {
  background: var(--color-primary-soft);
  border: 1px solid var(--color-primary-border);
  border-radius: var(--radius-lg);
  padding: 16px;
}
.upgrade-card h4 {
  font-size: 14px; font-weight: 700; color: var(--color-primary);
  display: flex; align-items: center; gap: 6px; margin-bottom: 6px;
}
.upgrade-card p { font-size: 12px; color: var(--color-text-secondary); margin-bottom: 12px; }

/* --------------------------------------------------------------- header */
.global-search { position: relative; width: 400px; max-width: 100%; }
.global-search input {
  width: 100%; height: 42px;
  padding: 0 40px 0 38px;
  border: 1px solid #DDE3EC;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  font-size: 14px; color: var(--color-text-primary);
  outline: none;
}
.global-search input:focus { border-color: var(--color-primary); }
.global-search .search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--color-text-muted); pointer-events: none;
}

.icon-btn {
  background: none; border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius-md);
  color: var(--color-text-secondary);
}
.icon-btn:hover { background: var(--color-soft-bg); color: var(--color-text-primary); }
.icon-btn svg { width: 18px; height: 18px; }

.plan-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius-pill);
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  background: var(--color-soft-bg);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  white-space: nowrap;
}
.plan-pill.is-pro {
  background: var(--color-primary-soft);
  color: var(--color-primary);
  border-color: var(--color-primary-border);
}

.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--color-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}

/* ----------------------------------------------------------- typography */
/* Display: Space Grotesk, bold + tight. Body/UI: Inter. Labels: JetBrains Mono, uppercase + tracked. */
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--color-text-primary); }
h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.035em; line-height: 1.15; }
h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.25; }
h3 { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
h4 { font-weight: 600; letter-spacing: -0.005em; }
code, pre, kbd, samp { font-family: var(--font-mono); }

/* Mono "eyebrow" label — small, uppercase, widely tracked. */
.eyebrow {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--color-text-muted);
}
.subtitle { color: var(--color-text-secondary); font-size: 14px; }
.muted { color: var(--color-text-muted); }

.page-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: var(--spacing-4); flex-wrap: wrap; margin-bottom: var(--spacing-6);
}

/* -------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px;
  font-size: 13px; font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background-color: var(--color-primary); color: #fff; }
.btn-primary:hover { background-color: var(--color-primary-hover); }

.btn-outline { background-color: #fff; border-color: var(--color-border-strong); color: var(--color-text-primary); }
.btn-outline:hover { background-color: var(--color-soft-bg); }

.btn-outline-primary { background-color: #fff; border-color: var(--color-primary); color: var(--color-primary); }
.btn-outline-primary:hover { background-color: var(--color-primary); color: #fff; }

.btn-ghost { background: none; color: var(--color-text-secondary); }
.btn-ghost:hover { background: var(--color-soft-bg); color: var(--color-text-primary); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; }

/* --------------------------------------------------------------- badges */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge-red     { background: var(--color-primary); color: #fff; }
.badge-success { background: var(--color-success-soft); color: #168457; }
.badge-warning { background: var(--color-warning-soft); color: #B77900; }
.badge-info    { background: var(--color-info-soft);    color: var(--color-info); }
.badge-purple  { background: var(--color-purple-soft);  color: var(--color-purple); }
.badge-orange  { background: var(--color-orange-soft);  color: #D86F12; }
.badge-pink    { background: var(--color-pink-soft);    color: var(--color-pink); }
.badge-soft    { background: var(--color-soft-bg); color: var(--color-text-secondary); border: 1px solid var(--color-border); }
.badge-redsoft { background: var(--color-primary-soft); color: var(--color-primary-hover); }
.badge svg { width: 13px; height: 13px; flex-shrink: 0; }

/* ----------------------------------------------------------------- tabs */
.tabs {
  display: flex; gap: 28px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--spacing-6);
  overflow-x: auto;
}
.tab {
  padding: 0 0 12px;
  font-size: 14px; font-weight: 500;
  color: var(--color-text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  cursor: pointer;
}
.tab:hover { color: var(--color-text-primary); }
.tab.active { color: var(--color-text-primary); font-weight: 600; border-bottom-color: var(--color-primary); }

/* -------------------------------------------------------------- filters */
.filter-bar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: var(--spacing-4); }
.filter-field { display: flex; flex-direction: column; gap: 4px; min-width: 150px; }
.filter-field label { font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-text-muted); }

.select, .input {
  height: 42px;
  padding: 0 12px;
  border: 1px solid #DDE3EC;
  border-radius: var(--radius-md);
  background: #fff;
  font-size: 13px;
  color: var(--color-text-primary);
  outline: none;
  width: 100%;
}
.select:focus, .input:focus { border-color: var(--color-primary); }
.select.is-set, .input.is-set { border-color: var(--color-primary); background: var(--color-primary-soft); }

textarea.input { height: auto; min-height: 90px; padding: 10px 12px; line-height: 1.6; resize: vertical; }

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: var(--spacing-6); }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 500;
  background: #fff; border: 1px solid var(--color-border);
  color: var(--color-text-secondary); cursor: pointer;
  transition: all 140ms ease;
}
.chip svg { width: 14px; height: 14px; }
.chip:hover { border-color: var(--color-border-strong); color: var(--color-text-primary); }
.chip.active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; font-weight: 600; }
.chip.active svg { color: #fff; }

/* ---------------------------------------------------------------- cards */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-default);
}
.card-pad { padding: var(--spacing-6); }

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

.channel-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.channel-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--color-primary-border);
}

.channel-thumb {
  position: relative;
  aspect-ratio: 16 / 6;
  background: linear-gradient(135deg, #E8EDF5 0%, #DDE3EC 100%);
  overflow: hidden;
}
.channel-thumb img { width: 100%; height: 100%; object-fit: cover; }
.channel-thumb .thumb-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: #94A0B2; font-size: 13px; font-weight: 600; letter-spacing: 0.04em;
}
.thumb-badge { position: absolute; top: 10px; left: 10px; }
.thumb-bookmark {
  position: absolute; top: 10px; right: 10px;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text-primary);
}
.thumb-bookmark svg { width: 14px; height: 14px; }
.thumb-bookmark.is-on { background: var(--color-primary); color: #fff; }

.channel-body { padding: 16px; display: flex; flex-direction: column; flex-grow: 1; }
.channel-identity { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.channel-avatar {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: var(--color-primary-soft); color: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px;
}
.channel-name { font-family: var(--font-display); font-size: 16px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
.channel-handle { font-size: 12px; color: #7B8798; margin-top: 1px; }

.metric-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 12px; color: var(--color-text-secondary); margin-bottom: 10px;
}
.metric-row .metric { display: inline-flex; align-items: center; gap: 5px; }
.metric-row svg { width: 13px; height: 13px; color: var(--color-text-muted); }
.metric-row .dot { color: var(--color-text-muted); }

.channel-desc {
  font-size: 13px; color: var(--color-text-secondary);
  line-height: 1.55; margin-bottom: 12px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }

.channel-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding-top: 12px; margin-top: auto;
  border-top: 1px solid var(--color-divider);
}
.channel-date { font-size: 12px; color: var(--color-text-muted); display: inline-flex; align-items: center; gap: 5px; }
.channel-date svg { width: 13px; height: 13px; }
.channel-actions { display: flex; align-items: center; gap: 6px; }

.act-btn {
  width: 32px; height: 32px; border-radius: var(--radius-md);
  border: 1px solid var(--color-border); background: #fff;
  color: var(--color-text-secondary); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.act-btn svg { width: 15px; height: 15px; }
.act-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
.act-btn.is-on { background: var(--color-primary-soft); border-color: var(--color-primary-border); color: var(--color-primary); }

/* ------------------------------------------------------ outlier videos */
.video-thumb { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; }
.video-thumb .thumb-fallback { width: 100%; height: 100%; }
.mult-pill {
  position: absolute; top: 10px; left: 10px;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: var(--radius-pill);
  background: rgba(22, 163, 106, 0.96); color: #fff;
  font-size: 13px; font-weight: 800;
}
.mult-pill svg { width: 14px; height: 14px; }
.video-play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; opacity: 0; transition: opacity 140ms ease; background: rgba(0,0,0,0.25);
}
.video-thumb:hover .video-play { opacity: 1; }
.video-play svg { width: 44px; height: 44px; }

/* ---------------------------------------------------- viral titles swipe */
.pattern-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-default); padding: 20px; }
.pattern-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.pattern-head h3 { font-size: 17px; }
.pattern-desc { font-size: 13px; color: var(--color-text-secondary); line-height: 1.6; margin-bottom: 14px; }
.tmpl-box {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  background: var(--color-soft-bg); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: 10px 12px; margin-bottom: 14px;
}
.tmpl-box code { font-family: var(--font-mono); font-size: 13px; color: var(--color-text-primary); overflow-wrap: anywhere; }
.copy-btn {
  display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0;
  border: 1px solid var(--color-border-strong); background: #fff; color: var(--color-text-secondary);
  border-radius: var(--radius-sm); padding: 4px 9px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.copy-btn svg { width: 13px; height: 13px; }
.copy-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
.copy-btn.copied { border-color: var(--color-success); color: var(--color-success); }

.ex-list { display: flex; flex-direction: column; gap: 8px; }
.ex-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px dashed var(--color-divider); }
.ex-row:first-child { border-top: none; }
.ex-title { flex: 1; min-width: 0; font-size: 13px; font-weight: 500; }
.ex-meta { font-size: 11px; color: var(--color-text-muted); white-space: nowrap; }

/* -------------------------------------------------------- notes + calendar */
.notes-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }

.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.cal-nav { width: 30px; height: 30px; border-radius: var(--radius-md); border: 1px solid var(--color-border); background: #fff; display: inline-flex; align-items: center; justify-content: center; color: var(--color-text-secondary); }
.cal-nav:hover { border-color: var(--color-primary); color: var(--color-primary); }
.cal-nav svg { width: 16px; height: 16px; }
.cal-selects { display: flex; gap: 6px; }
.cal-selects .select { height: 34px; padding: 0 8px; font-size: 13px; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: 10px; font-weight: 700; color: var(--color-text-muted); text-transform: uppercase; padding-bottom: 4px; }
.cal-day {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  font-size: 12px; border-radius: var(--radius-sm); border: 1px solid var(--color-divider);
  color: var(--color-text-secondary); text-decoration: none;
}
.cal-day.empty { border: none; }
.cal-day.today { border-color: var(--color-border-strong); font-weight: 700; }
.cal-day.has-1 { background: var(--color-primary-soft); color: var(--color-primary); border-color: var(--color-primary-border); font-weight: 600; }
.cal-day.has-2 { background: #FFC9CD; color: var(--color-primary-dark); border-color: #FFC9CD; font-weight: 700; }
.cal-day.has-3 { background: var(--color-primary); color: #fff; border-color: var(--color-primary); font-weight: 700; }
.cal-day.sel { outline: 2px solid var(--color-primary); outline-offset: 1px; }
a.cal-day:hover { border-color: var(--color-primary); }
.cal-legend { display: flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 11px; color: var(--color-text-muted); }
.cal-legend .box { width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--color-divider); }

.note-card { width: 100%; text-align: left; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-default); padding: 16px 18px; cursor: pointer; display: block; }
.note-card:hover { border-color: var(--color-primary-border); box-shadow: var(--shadow-hover); }
.note-card .nc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.note-card .nc-title { font-size: 15px; font-weight: 650; }
.note-card .nc-date { font-size: 12px; color: var(--color-text-muted); white-space: nowrap; }
.note-card .nc-preview { font-size: 13px; color: var(--color-text-secondary); margin-top: 6px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

@media (max-width: 860px) {
  .notes-layout { grid-template-columns: minmax(0, 1fr); }
}

/* ------------------------------------------------------------- paywall */
.paywall {
  background: var(--color-soft-bg);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-lg);
  padding: var(--spacing-6);
  text-align: center;
}
.paywall .lock {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--color-primary-soft); color: var(--color-primary);
  display: inline-flex; align-items: center; justify-content: center; margin-bottom: 12px;
}
.paywall h4 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.paywall p { font-size: 13px; color: var(--color-text-secondary); margin-bottom: 16px; }

/* ------------------------------------------------------------- states */
.empty-state, .error-state {
  text-align: center;
  padding: 64px 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}
.empty-state .ico, .error-state .ico {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--color-soft-bg); color: var(--color-text-muted);
  display: inline-flex; align-items: center; justify-content: center; margin-bottom: 16px;
}
.empty-state h3 { font-size: 16px; margin-bottom: 6px; }
.empty-state p { color: var(--color-text-secondary); font-size: 14px; }

.alert {
  padding: 12px 16px; border-radius: var(--radius-md);
  font-size: 13px; margin-bottom: 20px; border: 1px solid transparent;
}
.alert-error   { background: var(--color-primary-soft); color: var(--color-primary-dark); border-color: var(--color-primary-border); }
.alert-success { background: var(--color-success-soft); color: #168457; border-color: #BFE7D4; }
.alert-info    { background: var(--color-info-soft); color: var(--color-info); border-color: #C9DDFB; }

/* --------------------------------------------------------- pagination */
.pagination-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--spacing-4); flex-wrap: wrap;
  margin-top: var(--spacing-8); padding-top: var(--spacing-6);
  border-top: 1px solid var(--color-border);
  font-size: 13px; color: var(--color-text-secondary);
}
.pagination { display: flex; align-items: center; gap: 6px; }
.pagination a, .pagination span {
  min-width: 34px; height: 34px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  background: #fff; font-size: 13px; font-weight: 500;
  color: var(--color-text-secondary);
}
.pagination a:hover { border-color: var(--color-border-strong); color: var(--color-text-primary); }
.pagination .current { background: var(--color-primary); border-color: var(--color-primary); color: #fff; font-weight: 600; }
.pagination .gap { border: none; background: none; }
.pagination .disabled { opacity: 0.45; }

/* ------------------------------------------------------------- tables */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; padding: 10px 12px;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.12em;
  color: var(--color-text-muted); text-transform: uppercase;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}
.table td { padding: 12px; border-bottom: 1px solid var(--color-divider); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--color-soft-bg); }
.table-wrap { overflow-x: auto; }

/* --------------------------------------------------------------- forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label { font-size: 13px; font-weight: 600; color: var(--color-text-primary); }
.form-field .hint { font-size: 11px; color: var(--color-text-muted); }
.form-section { margin-bottom: 32px; }
.form-section > h3 {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.16em; color: var(--color-text-muted);
  padding-bottom: 10px; margin-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.checkbox-row input { width: 16px; height: 16px; accent-color: var(--color-primary); }

/* --------------------------------------------------------- auth pages */
.centered-page {
  background: var(--color-soft-bg);
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px;
}
.auth-card {
  background: #fff; padding: 40px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-default);
  border: 1px solid var(--color-border);
  width: 100%; max-width: 420px;
}

/* --------------------------------------------------------- key/value */
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--color-divider); }
.kv:last-child { border-bottom: none; }
.kv dt { font-size: 13px; color: var(--color-text-secondary); }
.kv dd { font-size: 13px; font-weight: 650; text-align: right; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.stat-card { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-default); }
.stat-card .label { font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-text-muted); margin-bottom: 8px; }
.stat-card .value { font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: -0.035em; }

/* --------------------------------------------------------- responsive */
@media (max-width: 1199px) {
  .channel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-content { padding: var(--spacing-6); }
  .top-header { padding: 0 var(--spacing-6); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar { transform: translateX(-100%); transition: transform 200ms ease; }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-modal); }
  .main-content { margin-left: 0; }
  .menu-toggle { display: inline-flex !important; }
  .global-search { width: 320px; }
}

@media (max-width: 767px) {
  .channel-grid { grid-template-columns: minmax(0, 1fr); }
  .top-header { padding: 0 var(--spacing-4); height: 60px; }
  .page-content { padding: var(--spacing-4); }
  .global-search { width: 100%; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .hide-sm { display: none !important; }
  .pagination-bar { justify-content: center; }
  h1 { font-size: 22px; }
}

/* ---------------------------------------------- channel detail hero */
.detail-hero { display: flex; flex-direction: column; gap: 24px; margin-bottom: 24px; }

.preview-card { padding: 16px; }
.preview-media {
  aspect-ratio: 16 / 6;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: linear-gradient(135deg, #E8EDF5 0%, #DDE3EC 100%);
  display: flex; align-items: center; justify-content: center;
}
.preview-media img { width: 100%; height: 100%; object-fit: cover; }
.preview-media .preview-empty { color: var(--color-text-muted); font-size: 13px; font-weight: 600; letter-spacing: 0.04em; }

.identity-card { padding: 24px; }
.identity-top { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; }
.identity-added {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--color-text-muted); margin-top: 10px;
}
.identity-added svg { width: 14px; height: 14px; }
.identity-head { display: flex; gap: 20px; align-items: center; }
.identity-avatar {
  width: 76px; height: 76px; border-radius: 50%; flex-shrink: 0;
  overflow: hidden; background: var(--color-primary-soft);
  border: 3px solid var(--color-surface); box-shadow: 0 0 0 1px var(--color-border);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-primary); font-weight: 700; font-size: 28px;
}
.identity-avatar img { width: 100%; height: 100%; object-fit: cover; }
.identity-meta { min-width: 0; }
.identity-name {
  font-size: 24px; font-weight: 700; letter-spacing: -0.4px; line-height: 1.2;
  overflow-wrap: anywhere;
}
.identity-handle {
  font-size: 14px; color: #7B8798; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.identity-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.identity-badges .badge { gap: 5px; }
.identity-badges .badge svg { width: 13px; height: 13px; opacity: 0.75; }
.identity-actions { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.identity-actions .btn { height: 42px; }

@media (max-width: 600px) {
  .identity-card { padding: 16px; }
  .identity-head { flex-direction: column; align-items: flex-start; gap: 14px; }
  .identity-name { font-size: 20px; }
  .identity-actions { flex-direction: column-reverse; gap: 10px; }
  .identity-actions .btn { width: 100%; }
}

/* ---------------------------------------- channel detail (Notion style) */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 24px; align-items: start; }
.detail-side { display: flex; flex-direction: column; gap: 20px; }
.detail-main { display: flex; flex-direction: column; gap: 20px; }

.section-title {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-size: 16px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 16px;
}
.section-title svg { width: 17px; height: 17px; color: var(--color-text-secondary); }
.section-sub { font-size: 13px; color: var(--color-text-secondary); margin: -10px 0 16px; }

/* metric list rows */
.mrow {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--color-divider);
}
.mrow:last-child { border-bottom: none; }
.mrow-l { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; color: var(--color-text-secondary); min-width: 0; }
.mrow-l svg { width: 15px; height: 15px; color: var(--color-text-muted); flex-shrink: 0; }
.mrow-v { font-size: 13px; font-weight: 650; text-align: right; white-space: nowrap; }

/* research overview fields */
.research-field { margin-bottom: 20px; }
.research-field:last-child { margin-bottom: 0; }
.research-field h4 {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 700; margin-bottom: 6px; color: var(--color-text-primary);
}
.research-field h4 svg { width: 14px; height: 14px; color: var(--color-text-muted); }
.research-field p { font-size: 14px; color: var(--color-text-secondary); line-height: 1.7; white-space: pre-line; }

.badge-danger { background: var(--color-danger-soft); color: var(--color-danger); }

/* colored icon chips (Notion style) */
.ic { width: 32px; height: 32px; border-radius: var(--radius-md); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ic svg { width: 16px; height: 16px; color: inherit; }
.ic-red    { background: var(--color-primary-soft); color: var(--color-primary); }
.ic-blue   { background: var(--color-info-soft);    color: var(--color-info); }
.ic-green  { background: var(--color-success-soft); color: var(--color-success); }
.ic-orange { background: var(--color-orange-soft);  color: var(--color-orange); }
.ic-purple { background: var(--color-purple-soft);  color: var(--color-purple); }
.ic-pink   { background: var(--color-pink-soft);    color: var(--color-pink); }
.ic-teal   { background: var(--color-teal-soft);    color: var(--color-teal); }
.ic-amber  { background: var(--color-warning-soft); color: #B77900; }

/* section title with chip */
.section-title.with-chip { gap: 10px; }

/* metric stat tiles */
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 22px 18px; }
.stat-tile { display: flex; gap: 12px; align-items: center; min-width: 0; }
.stat-tile .st-body { min-width: 0; }
.stat-tile .st-label { font-size: 12px; color: var(--color-text-secondary); margin-bottom: 3px; }
.stat-tile .st-value { font-size: 18px; font-weight: 700; letter-spacing: -0.3px; line-height: 1.15; overflow-wrap: anywhere; }

/* two-column scores / overview */
.detail-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 20px; align-items: start; }

/* score rows */
.score-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--color-divider); }
.score-row:last-child { border-bottom: none; }
.score-row .sr-label { flex: 1; min-width: 0; font-size: 14px; font-weight: 500; }
.score-row .sr-val { font-size: 14px; font-weight: 700; white-space: nowrap; }

/* overview tappable rows */
.ov-list { display: flex; flex-direction: column; }
.ov-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: none; border: none; cursor: pointer; padding: 12px 8px;
  border-radius: var(--radius-md); border-bottom: 1px solid var(--color-divider);
}
.ov-row:last-child { border-bottom: none; }
.ov-row:hover { background: var(--color-soft-bg); }
.ov-row .ov-title { font-size: 14px; font-weight: 600; flex-shrink: 0; }
.ov-row .ov-prev { flex: 1; min-width: 0; font-size: 12px; color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-row .ov-caret { width: 16px; height: 16px; color: var(--color-text-muted); flex-shrink: 0; }

/* read modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.5); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 200; }
.modal-overlay[hidden] { display: none; }
.modal-box { background: var(--color-surface); border-radius: var(--radius-lg); max-width: 640px; width: 100%; max-height: 85vh; display: flex; flex-direction: column; box-shadow: var(--shadow-modal); overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--color-border); }
.modal-head h3 { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.modal-body { padding: 20px; overflow: auto; font-size: 14px; line-height: 1.75; color: var(--color-text-secondary); white-space: pre-line; }

@media (max-width: 900px) {
  .detail-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .stat-tiles { grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); gap: 18px 14px; }
  .ov-row .ov-prev { display: none; }
}

@media (max-width: 1023px) {
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  /* On mobile show the research overview first, metrics below it. */
  .detail-main { order: 1; }
  .detail-side { order: 2; }
}

/* --------------------------------------------- membership feature list */
.feat-list { display: flex; flex-direction: column; gap: 10px; }
.feat-row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--color-text-secondary); }
.feat-status {
  width: 22px; height: 22px; border-radius: var(--radius-sm); flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.feat-status svg { width: 14px; height: 14px; stroke-width: 2.5; }
.feat-status.on  { background: var(--color-success-soft); color: var(--color-success); }
.feat-status.off { background: var(--color-danger-soft);  color: var(--color-danger); }
.feat-row .feat-ico { width: 14px; height: 14px; color: var(--color-text-muted); flex-shrink: 0; opacity: 0.7; }
.feat-row.is-off { color: var(--color-text-muted); }

/* ------------------------------------------------------------- admin */
.admin-sidebar { background: #111827; border-right-color: #1F2937; }
.admin-sidebar .brand-name { color: #fff; }
.admin-sidebar .brand-tagline { color: #9CA3AF; }
.admin-sidebar .nav-item { color: #D1D5DB; }
.admin-sidebar .nav-item svg { color: #9CA3AF; }
.admin-sidebar .nav-item:hover { background: #1F2937; color: #fff; }
.admin-sidebar .nav-item:hover svg { color: #fff; }
.admin-sidebar .nav-item.active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.admin-sidebar .nav-item.active svg { color: #fff; }
.admin-sidebar .nav-section-label { color: #6B7280; }
.admin-main { background: #F3F4F6; }

/* ===================================================== learning center */
.learn-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.learn-hero h1 { font-size: 30px; letter-spacing: -0.04em; }

.chip-scroll { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; margin-bottom: 8px; scrollbar-width: none; }
.chip-scroll::-webkit-scrollbar { display: none; }
.chip-scroll .chip { white-space: nowrap; flex-shrink: 0; }

.learn-section { margin-bottom: 36px; }
.learn-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.learn-section-head h2 { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.learn-section-head h2 svg { width: 18px; height: 18px; color: var(--color-primary); }
.learn-section-head a { font-size: 13px; font-weight: 600; color: var(--color-primary); }

/* YouTube-style cards */
.yt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 28px 18px; }
.yt-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 300px); gap: 18px; overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: var(--color-border-strong) transparent; }
.yt-row::-webkit-scrollbar { height: 6px; }
.yt-row::-webkit-scrollbar-thumb { background: var(--color-border-strong); border-radius: 999px; }
.yt-row::-webkit-scrollbar-track { background: transparent; }
.yt-row > * { scroll-snap-align: start; }
.yt-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.yt-thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: var(--radius-lg); overflow: hidden; background: #0f0f0f; }
.yt-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 220ms ease; }
.yt-card:hover .yt-thumb img { transform: scale(1.04); }
.yt-thumb .thumb-fallback { width: 100%; height: 100%; background: linear-gradient(135deg, #1f2937, #111827); display: flex; align-items: center; justify-content: center; color: #9CA3AF; }
.yt-thumb .thumb-fallback svg { width: 34px; height: 34px; }
.yt-duration { position: absolute; right: 8px; bottom: 8px; background: rgba(0, 0, 0, 0.82); color: #fff; font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; padding: 2px 6px; border-radius: 4px; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.yt-flag { position: absolute; left: 8px; top: 8px; display: inline-flex; align-items: center; gap: 4px; background: rgba(0, 0, 0, 0.72); color: #fff; font-family: var(--font-mono); font-size: 10px; font-weight: 500; padding: 3px 8px; border-radius: var(--radius-pill); text-transform: uppercase; letter-spacing: 0.12em; }
.yt-flag svg { width: 12px; height: 12px; }
.yt-flag.is-done { background: rgba(22, 163, 106, 0.95); }
.yt-flag.is-free { background: var(--color-primary); }
.yt-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, 0.35); }
.yt-bar span { display: block; height: 100%; background: var(--color-primary); }
.yt-lock { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: rgba(15, 15, 15, 0.55); color: #fff; font-size: 12px; font-weight: 600; }
.yt-lock svg { width: 26px; height: 26px; }
.yt-meta { display: flex; gap: 12px; align-items: flex-start; }
.yt-avatar { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; background: var(--color-primary-soft); color: var(--color-primary); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.yt-text { min-width: 0; flex: 1; }
.yt-title { font-family: var(--font-display); font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; color: var(--color-text-primary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.yt-title:hover { color: var(--color-primary); }
.yt-sub { font-size: 13px; color: var(--color-text-secondary); margin-top: 4px; line-height: 1.4; }
.yt-sub .dot { margin: 0 4px; color: var(--color-text-muted); }
.yt-stack { position: absolute; right: 0; top: 0; bottom: 0; width: 38%; background: rgba(15, 15, 15, 0.78); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-weight: 700; font-size: 15px; }
.yt-stack svg { width: 22px; height: 22px; }
.yt-stack small { font-family: var(--font-mono); font-size: 9.5px; font-weight: 500; opacity: 0.85; text-transform: uppercase; letter-spacing: 0.14em; }

.progress-track { height: 6px; border-radius: var(--radius-pill); background: var(--color-divider); overflow: hidden; }
.progress-fill { height: 100%; background: var(--color-primary); border-radius: var(--radius-pill); transition: width 300ms ease; }
.progress-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--color-text-secondary); margin-bottom: 6px; font-weight: 600; }

/* Watch page */
.watch-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
.watch-player { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius-lg); overflow: hidden; }
.watch-player iframe, .watch-player #ytPlayer { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.watch-locked { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; color: #fff; padding: 24px; background: linear-gradient(135deg, #111827, #1f2937); }
.watch-locked svg { width: 36px; height: 36px; }
.watch-locked h3 { font-size: 18px; }
.watch-locked p { font-size: 14px; color: #D1D5DB; max-width: 420px; }
.watch-title { font-size: 22px; font-weight: 700; line-height: 1.25; margin: 16px 0 10px; letter-spacing: -0.025em; }
.watch-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.watch-creator { display: flex; align-items: center; gap: 10px; }
.watch-creator strong { font-size: 14px; display: block; }
.watch-creator span { font-size: 12px; color: var(--color-text-secondary); }
.watch-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pill-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: var(--radius-pill); border: 1px solid var(--color-border); background: var(--color-soft-bg); color: var(--color-text-primary); font-size: 13px; font-weight: 600; cursor: pointer; }
.pill-btn svg { width: 16px; height: 16px; }
.pill-btn:hover { border-color: var(--color-border-strong); background: #fff; }
.pill-btn.is-on { background: var(--color-success-soft); border-color: #BFE7D4; color: #168457; }
.pill-btn.is-primary { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.pill-btn.is-primary:hover { background: var(--color-primary-hover); }
.watch-desc { background: var(--color-soft-bg); border-radius: var(--radius-lg); padding: 14px 16px; font-size: 14px; line-height: 1.6; color: var(--color-text-primary); margin-bottom: 20px; }
.watch-desc .meta { font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.watch-desc .body { white-space: pre-line; overflow: hidden; max-height: 4.8em; word-break: break-word; }
.watch-desc.is-open .body { max-height: none; }
.watch-desc .more { margin-top: 6px; font-weight: 600; font-size: 13px; background: none; border: 0; padding: 0; cursor: pointer; color: var(--color-text-primary); }

.watch-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--color-border); margin-bottom: 16px; overflow-x: auto; }
.watch-tab { padding: 10px 14px; font-size: 14px; font-weight: 600; color: var(--color-text-secondary); border: 0; background: none; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.watch-tab svg { width: 15px; height: 15px; }
.watch-tab.active { color: var(--color-text-primary); border-bottom-color: var(--color-primary); }
.watch-tab .count { font-size: 11px; background: var(--color-divider); padding: 1px 7px; border-radius: var(--radius-pill); }
.watch-pane { display: none; }
.watch-pane.active { display: block; }

.chapter-list { display: flex; flex-direction: column; gap: 2px; }
.chapter { display: flex; gap: 12px; align-items: center; padding: 8px 10px; border-radius: var(--radius-md); cursor: pointer; border: 0; background: none; text-align: left; width: 100%; font-size: 14px; color: var(--color-text-primary); }
.chapter:hover { background: var(--color-soft-bg); }
.stamp { font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; color: var(--color-info); background: var(--color-info-soft); padding: 2px 8px; border-radius: var(--radius-pill); flex-shrink: 0; font-variant-numeric: tabular-nums; border: 0; cursor: pointer; }

/* Course playlist panel (watch page sidebar) */
.playlist { border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; background: var(--color-surface); }
.playlist-head { padding: 14px 16px; border-bottom: 1px solid var(--color-border); background: var(--color-soft-bg); }
.playlist-head h3 { font-size: 16px; font-weight: 700; line-height: 1.3; }
.playlist-head .sub { font-size: 12px; color: var(--color-text-secondary); margin: 4px 0 10px; }
.playlist-list { max-height: 520px; overflow-y: auto; }
.pl-item { display: grid; grid-template-columns: 22px 120px minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--color-divider); color: var(--color-text-primary); }
.pl-item:last-child { border-bottom: 0; }
.pl-item:hover { background: var(--color-soft-bg); }
.pl-item.current { background: var(--color-primary-soft); }
.pl-item.locked { opacity: 0.6; }
.pl-num { font-size: 12px; font-weight: 600; color: var(--color-text-muted); text-align: center; display: flex; justify-content: center; }
.pl-num svg { width: 16px; height: 16px; }
.pl-num .ok { color: var(--color-success); }
.pl-thumb { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-md); overflow: hidden; background: #111827; }
.pl-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pl-thumb .yt-duration { right: 4px; bottom: 4px; font-size: 11px; padding: 1px 4px; }
.pl-lock { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; background: rgba(15, 15, 15, 0.5); }
.pl-lock svg { width: 18px; height: 18px; }
.pl-title { font-size: 13px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pl-meta { font-size: 11px; color: var(--color-text-muted); margin-top: 3px; }
.side-list { display: flex; flex-direction: column; gap: 12px; }
.side-item { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 10px; color: var(--color-text-primary); }

/* Lesson extras: resources, quiz, notes, Q&A */
.res-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--color-border); border-radius: var(--radius-md); margin-bottom: 10px; background: var(--color-surface); }
.res-item h4 { font-size: 14px; font-weight: 600; }
.res-item p { font-size: 12px; color: var(--color-text-secondary); margin-top: 2px; word-break: break-all; }
.quiz-q { border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 16px; margin-bottom: 12px; }
.quiz-q h4 { font-size: 15px; font-weight: 600; margin-bottom: 10px; line-height: 1.4; }
.quiz-opt { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--color-border); border-radius: var(--radius-md); margin-bottom: 6px; cursor: pointer; font-size: 14px; }
.quiz-opt:hover { border-color: var(--color-border-strong); background: var(--color-soft-bg); }
.quiz-opt input { accent-color: var(--color-primary); }
.quiz-opt.is-right { border-color: #BFE7D4; background: var(--color-success-soft); }
.quiz-opt.is-wrong { border-color: var(--color-primary-border); background: var(--color-primary-soft); }
.quiz-exp { font-size: 13px; color: var(--color-text-secondary); margin-top: 8px; line-height: 1.5; }
.quiz-score { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius-lg); margin-bottom: 14px; }
.quiz-score.pass { background: var(--color-success-soft); color: #168457; }
.quiz-score.fail { background: var(--color-primary-soft); color: var(--color-primary-dark); }
.quiz-score strong { font-size: 22px; }
.note-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--color-divider); font-size: 14px; }
.note-row:last-child { border-bottom: 0; }
.note-row .body { white-space: pre-line; line-height: 1.5; word-break: break-word; }
.qa-item { padding: 14px 0; border-bottom: 1px solid var(--color-divider); }
.qa-item:last-child { border-bottom: 0; }
.qa-q { font-size: 14px; line-height: 1.5; white-space: pre-line; word-break: break-word; }
.qa-who { font-size: 12px; color: var(--color-text-muted); margin-bottom: 4px; white-space: normal; }
.qa-a { margin-top: 8px; padding: 10px 12px; border-left: 3px solid var(--color-primary); background: var(--color-soft-bg); border-radius: 0 var(--radius-md) var(--radius-md) 0; font-size: 14px; line-height: 1.5; white-space: pre-line; word-break: break-word; }
.qa-a .qa-who { font-weight: 700; color: var(--color-primary); }

/* Course page */
.course-hero { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: start; margin-bottom: 28px; }
.course-hero h1 { font-size: 34px; letter-spacing: -0.04em; line-height: 1.1; margin-bottom: 12px; }
.course-hero .desc { font-size: 15px; color: var(--color-text-secondary); line-height: 1.6; white-space: pre-line; margin-bottom: 16px; }
.course-facts { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--color-text-secondary); margin-bottom: 18px; }
.course-facts span { display: inline-flex; align-items: center; gap: 6px; }
.course-facts svg { width: 15px; height: 15px; color: var(--color-text-muted); }
.course-side { border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; background: var(--color-surface); box-shadow: var(--shadow-default); }
.course-side .body { padding: 16px; }
.curr-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--color-divider); color: var(--color-text-primary); }
.curr-item:last-child { border-bottom: 0; }
a.curr-item:hover { background: var(--color-soft-bg); }
.curr-item.locked { color: var(--color-text-secondary); }
.curr-idx { width: 30px; height: 30px; border-radius: 50%; background: var(--color-soft-bg); border: 1px solid var(--color-border); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.curr-idx svg { width: 15px; height: 15px; }
.curr-idx.done { background: var(--color-success); border-color: var(--color-success); color: #fff; }
.curr-title { font-size: 14px; font-weight: 600; line-height: 1.35; }
.curr-meta { font-size: 12px; color: var(--color-text-muted); margin-top: 2px; display: flex; gap: 8px; flex-wrap: wrap; }
.curr-right { font-size: 12px; color: var(--color-text-muted); white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.curr-right svg { width: 14px; height: 14px; }
.cert-box { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius-lg); border: 1px dashed var(--color-border-strong); background: var(--color-soft-bg); margin-top: 14px; }
.cert-box.issued { border: 1px solid #BFE7D4; background: var(--color-success-soft); }
.cert-box > svg { width: 28px; height: 28px; flex-shrink: 0; }
.cert-box h4 { font-size: 14px; font-weight: 700; }
.cert-box p { font-size: 12px; color: var(--color-text-secondary); margin-top: 2px; }

@media (max-width: 1199px) {
  .watch-layout, .course-hero { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767px) {
  .yt-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .yt-row { grid-auto-columns: 78%; }
  .watch-title { font-size: 17px; }
  .course-hero h1 { font-size: 22px; }
  .side-item { grid-template-columns: 140px minmax(0, 1fr); }
  .pl-item { grid-template-columns: 20px 100px minmax(0, 1fr); }
}

/* =============================================== collapsible sidebar (desktop) */
/* The ☰ button in the top bar toggles a slim YouTube-style icon rail on desktop
   (remembered per browser); below 1200px it still opens the slide-in drawer. */
.sidebar { scrollbar-width: thin; transition: width 180ms ease, transform 200ms ease; }
.main-content { transition: margin-left 180ms ease; }
@media (min-width: 1200px) {
  .menu-toggle { display: inline-flex !important; }
  body.sb-collapsed .sidebar { width: 76px; overflow-x: hidden; scrollbar-width: none; }
  body.sb-collapsed .sidebar::-webkit-scrollbar { display: none; }
  body.sb-collapsed .main-content { margin-left: 76px; }
  body.sb-collapsed .brand { padding: 20px 0 14px; text-align: center; }
  body.sb-collapsed .brand-name { display: block; font-size: 0; letter-spacing: 0; }
  body.sb-collapsed .brand-name::before { content: 'B'; font-size: 24px; letter-spacing: -0.04em; color: var(--brand-bank); }
  body.sb-collapsed .brand-name::after { content: 'P'; font-size: 24px; letter-spacing: -0.04em; color: var(--brand-pediaa); }
  body.sb-collapsed .brand-tagline,
  body.sb-collapsed .sidebar-footer { display: none; }
  body.sb-collapsed .sidebar-nav { padding: 0 12px; }
  body.sb-collapsed .nav-section-label { font-size: 0; height: 1px; margin: 12px 6px; background: var(--color-divider); }
  body.sb-collapsed .nav-section:first-child .nav-section-label { margin-top: 4px; }
  body.sb-collapsed .nav-item { position: relative; justify-content: center; gap: 0; padding: 10px 0; font-size: 0; }
  body.sb-collapsed .nav-badge { position: absolute; top: 3px; right: 5px; font-size: 9px; padding: 1px 5px; }
  body.sb-collapsed .admin-sidebar .nav-section-label { background: #1F2937; }
  body.sb-collapsed .admin-sidebar .brand-name::before { color: #fff; }
}
