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

/* ── CSS Variables ───────────────────────────────────────────────────────── */
:root {
  --bg-base:      #F9FAFB;
  --bg-card:      #FFFFFF;
  --bg-sidebar:   #FFFFFF;
  --bg-input:     #F3F4F6;
  --teal:         #009688;
  --teal-dark:    #00796B;
  --teal-light:   #E0F2F1;
  --teal-glow:    rgba(0,150,136,.12);
  --purple:       #7c4dff;
  --danger:       #ef4444;
  --warning:      #f59e0b;
  --info:         #3b82f6;
  --info-light:   #eff6ff;
  --text:         #111827;
  --text-muted:   #6B7280;
  --text-light:   #9ca3af;
  --border:       #E5E7EB;
  --orange:       #F97316;
  --radius:       16px;
  --radius-sm:    12px;
  --radius-xs:    8px;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow:       0 4px 12px rgba(0,0,0,.08);
  --shadow-lg:    0 10px 30px rgba(0,0,0,.1);
  --sidebar-w:    280px;
  --topbar-h:     70px;
  --transition:   .2s ease;

  --fs-xs:    clamp(0.7rem,   0.68rem  + 0.1vw,  0.75rem);
  --fs-sm:    clamp(0.8rem,   0.78rem  + 0.1vw,  0.875rem);
  --fs-base:  clamp(0.875rem, 0.85rem  + 0.15vw, 1rem);
  --fs-md:    clamp(1rem,     0.95rem  + 0.25vw, 1.125rem);
  --fs-lg:    clamp(1.125rem, 1.05rem  + 0.375vw,1.375rem);
  --fs-xl:    clamp(1.25rem,  1.1rem   + 0.75vw, 1.75rem);
  --fs-2xl:   clamp(1.5rem,   1.25rem  + 1.25vw, 2.25rem);
}

[data-theme="dark"] {
  --bg-base:      #111827;
  --bg-card:      #1F2937;
  --bg-sidebar:   #1F2937;
  --bg-input:     #374151;
  --teal:         #0fc9b1;
  --teal-dark:    #0aa593;
  --teal-light:   rgba(15,201,177,.1);
  --teal-glow:    rgba(15,201,177,.15);
  --text:         #F9FAFB;
  --text-muted:   #9CA3AF;
  --text-light:   #6B7280;
  --border:       #374151;
  --info-light:   rgba(59,130,246,.1);
}

/* ── Reset ───────────────────────────────────────────────────────────────── */
*,*::before,*::after { box-sizing:border-box; margin:0; padding:0 }
html { scroll-behavior:smooth; font-size:16px }
body {
  font-family:'Inter', sans-serif;
  background:var(--bg-base);
  color:var(--text);
  min-height:100vh;
  font-size:var(--fs-base);
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
}
a { text-decoration:none; color:inherit }
img { max-width:100%; display:block }
button,input,select,textarea { font-family:inherit }

/* ── App Wrapper ─────────────────────────────────────────────────────────── */
.app-wrapper { display:flex; min-height:100vh }

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
  width:var(--sidebar-w);
  min-width:var(--sidebar-w);
  background:var(--bg-sidebar);
  border-right:1px solid var(--border);
  display:flex;
  flex-direction:column;
  position:fixed;
  top:0; left:0; bottom:0;
  z-index:200;
  transition:transform var(--transition);
  overflow-y:auto;
  overflow-x:hidden;
}

/* Logo */
.sidebar-logo {
  padding:20px 24px 16px;
  border-bottom:1px solid var(--border);
  flex-shrink:0;
}
.sidebar-logo a { display:flex; align-items:center; gap:10px }
.logo-mark {
  width:36px; height:36px;
  background:var(--teal);
  border-radius:10px;
  display:flex; align-items:center; justify-content:center;
  flex-shrink:0; color:#fff; font-size:16px;
}
.logo-mark svg { width:20px; height:20px; fill:#fff }
.logo-text { line-height:1.1 }
.logo-name {
  font-size:16px; font-weight:800;
  color:var(--text);
  letter-spacing:-.2px;
}
.logo-name span { color:var(--teal) }
.logo-sub {
  font-size:10px; font-weight:600;
  color:var(--text-muted);
  letter-spacing:1px;
  text-transform:uppercase;
  margin-top:2px;
}

/* Nav */
.nav-section { padding:16px 12px; flex:1 }
.nav-label {
  font-size:11px; font-weight:700;
  color:var(--text-light);
  text-transform:uppercase; letter-spacing:1px;
  padding:0 12px; margin:20px 0 8px;
}
.nav-item {
  display:flex; align-items:center; gap:12px;
  padding:10px 14px; margin-bottom:4px;
  border-radius:var(--radius-sm);
  color:var(--text-muted);
  font-weight:500; font-size:var(--fs-sm);
  transition:all var(--transition);
  position:relative;
}
.nav-item:hover {
  background:var(--bg-base);
  color:var(--text);
}
.nav-item.active {
  background:var(--teal-light);
  color:var(--teal);
  font-weight:600;
}
.nav-item.active .nav-icon { color:var(--teal) }
.nav-icon {
  width:20px; height:20px;
  display:flex; align-items:center; justify-content:center;
  flex-shrink:0;
  font-size:16px;
}

/* Sidebar Footer */
.sidebar-footer {
  padding:12px 10px 20px;
  border-top:1px solid var(--border);
  flex-shrink:0;
}
.sidebar-footer .nav-item { color:var(--danger) }
.sidebar-footer .nav-item:hover { background:rgba(239,68,68,.08); color:var(--danger) }

.btn-bantuan {
  display:flex; align-items:center; justify-content:center; gap:8px;
  background:var(--teal);
  color:#fff;
  padding:10px 16px;
  border-radius:99px;
  font-weight:600; font-size:var(--fs-sm);
  box-shadow:0 4px 12px var(--teal-glow);
  transition:all var(--transition);
  margin-top:10px;
  width:100%;
}
.btn-bantuan:hover { transform:translateY(-1px); background:var(--teal-dark) }
.btn-bantuan i { font-size:13px }

/* ── Main Content ────────────────────────────────────────────────────────── */
.main-content {
  margin-left:var(--sidebar-w);
  flex:1;
  display:flex;
  flex-direction:column;
  min-height:100vh;
  min-width:0;
}

/* ── Topbar ──────────────────────────────────────────────────────────────── */
.topbar {
  background:var(--bg-card);
  border-bottom:1px solid var(--border);
  padding:0 32px;
  height:var(--topbar-h);
  display:flex; align-items:center; justify-content:space-between;
  position:sticky; top:0; z-index:100;
  gap:12px;
}
.topbar-left { display:flex; align-items:center; gap:16px; min-width:0 }
.topbar-title {
  font-size:18px;
  font-weight:700;
  color:var(--text);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.topbar-right { display:flex; align-items:center; gap:16px; flex-shrink:0 }
.topbar-btn {
  width:40px; height:40px;
  border-radius:50%;
  background:transparent;
  border:none;
  color:var(--text-muted);
  display:flex; align-items:center; justify-content:center;
  cursor:pointer; font-size:18px;
  transition:all var(--transition);
  position:relative;
}
.topbar-btn:hover { background:var(--bg-base); color:var(--text) }
.topbar-btn .badge {
  position:absolute; top:2px; right:2px;
  width:18px; height:18px;
  background:var(--danger); border-radius:50%;
  font-size:10px; color:#fff; font-weight:700;
  display:flex; align-items:center; justify-content:center;
}
.topbar-avatar {
  width:40px; height:40px;
  border-radius:50%;
  object-fit:cover;
  border:2px solid var(--border);
  cursor:pointer;
  transition:all var(--transition);
}
.topbar-avatar:hover { border-color:var(--teal) }

/* ── Hamburger ───────────────────────────────────────────────────────────── */
.hamburger {
  display:none;
  width:38px; height:38px;
  background:transparent;
  border:1px solid var(--border);
  border-radius:var(--radius-xs);
  align-items:center; justify-content:center;
  cursor:pointer; font-size:17px;
  color:var(--text-muted);
  transition:all var(--transition);
}
.hamburger:hover { border-color:var(--teal); color:var(--teal) }

/* Sidebar Overlay (mobile) */
.sidebar-overlay {
  display:none;
  position:fixed; inset:0;
  background:rgba(0,0,0,.4);
  z-index:199;
}
.sidebar-overlay.show { display:block }

/* ── Page Content ────────────────────────────────────────────────────────── */
.page-content { padding:24px; flex:1 }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background:var(--bg-card);
  border:1px solid var(--border);
  border-radius:var(--radius);
}
.card-header {
  padding:16px 20px;
  border-bottom:1px solid var(--border);
  display:flex; align-items:center; justify-content:space-between;
}
.card-title { font-weight:700; font-size:15px }
.card-body { padding:20px }

/* ── Stats Grid ──────────────────────────────────────────────────────────── */
.stats-row {
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:0;
  background:var(--bg-card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  margin-bottom:24px;
  overflow:hidden;
}
.stat-cell {
  padding:20px 24px;
  border-right:1px solid var(--border);
}
.stat-cell:last-child { border-right:none }
.stat-cell-label { font-size:var(--fs-sm); color:var(--text-muted); margin-bottom:4px }
.stat-cell-value { font-size:32px; font-weight:800; color:var(--text); line-height:1 }
.stat-cell-value.teal { color:var(--teal) }

/* Old stat cards (admin) */
.stats-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(160px,1fr));
  gap:16px; margin-bottom:24px;
}
.stat-card {
  background:var(--bg-card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:20px;
  transition:border-color var(--transition), transform var(--transition);
}
.stat-card:hover { border-color:var(--teal); transform:translateY(-2px) }
.stat-label { font-size:var(--fs-xs); color:var(--text-muted); font-weight:600; text-transform:uppercase; letter-spacing:.5px; margin-bottom:6px }
.stat-value { font-size:26px; font-weight:800; color:var(--teal) }
.stat-icon { font-size:20px; margin-bottom:10px; color:var(--text-muted) }

/* ── Profile Strip ───────────────────────────────────────────────────────── */
.profile-strip {
  display:flex;
  align-items:center;
  gap:16px;
  background:var(--bg-card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:16px 20px;
  margin-bottom:20px;
  flex-wrap:wrap;
}
.profile-strip-avatar {
  width:52px; height:52px;
  border-radius:50%; object-fit:cover;
  border:2px solid var(--teal);
  flex-shrink:0;
}
.profile-strip-name { font-size:var(--fs-md); font-weight:700; line-height:1.2 }
.profile-strip-sub { font-size:var(--fs-sm); color:var(--text-muted) }

/* ── Warning / Alert Banners ─────────────────────────────────────────────── */
.warning-banner {
  background:#f9a825;
  color:#fff;
  padding:14px 20px;
  border-radius:var(--radius-sm);
  margin-bottom:20px;
  font-size:var(--fs-sm);
  font-weight:500;
  line-height:1.5;
}

.info-banner {
  background:var(--info-light);
  border:1px solid #dbeafe;
  color:#1e40af;
  padding:14px 20px;
  border-radius:var(--radius-sm);
  margin-bottom:20px;
  font-size:var(--fs-sm);
  display:flex; align-items:flex-start; gap:12px;
}
[data-theme="dark"] .info-banner { color:var(--teal); border-color:var(--teal-glow) }
.info-banner-icon {
  width:28px; height:28px;
  background:var(--info); border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  color:#fff; font-size:13px; font-weight:700;
  flex-shrink:0;
}
.info-banner-close {
  margin-left:auto; background:none; border:none;
  color:var(--info); font-size:18px; cursor:pointer; flex-shrink:0;
  padding:0 4px;
}

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.tab-nav {
  display:flex; gap:6px;
  margin-bottom:20px;
  background:var(--bg-card);
  padding:4px; border-radius:var(--radius-sm); border:1px solid var(--border);
  width:max-content; align-items:center;
}
.tab-btn {
  padding:8px 16px;
  border-radius:var(--radius-sm);
  border:none;
  background:transparent;
  color:var(--text-muted);
  font-size:var(--fs-sm); font-weight:500;
  cursor:pointer; transition:all var(--transition);
}
.tab-btn:hover { color:var(--text) }
.tab-btn.active {
  background:var(--bg-base);
  color:var(--text); font-weight:600; box-shadow:var(--shadow-sm);
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:9px 18px;
  border-radius:var(--radius-sm);
  font-size:var(--fs-sm); font-weight:600;
  cursor:pointer; border:none;
  transition:all var(--transition);
  text-decoration:none; white-space:nowrap;
}
.btn-primary {
  background:var(--teal);
  color:#fff;
}
.btn-primary:hover { background:var(--teal-dark); transform:translateY(-1px) }
.btn-outline {
  background:transparent;
  border:1px solid var(--border);
  color:var(--text-muted);
}
.btn-outline:hover { border-color:var(--teal); color:var(--teal) }
.btn-danger { background:var(--danger); color:#fff }
.btn-warning { background:var(--warning); color:#fff }
.btn-sm { padding:6px 12px; font-size:var(--fs-xs) }
.btn-lg { padding:12px 24px; font-size:var(--fs-base) }
.btn-block { width:100% }
.btn-icon {
  width:34px; height:34px; padding:0;
  border-radius:var(--radius-xs);
}

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-group { margin-bottom:16px }
.form-label {
  display:block; font-size:var(--fs-sm); font-weight:600;
  color:var(--text); margin-bottom:6px;
}
.form-control {
  width:100%; padding:10px 14px;
  background:var(--bg-card);
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  color:var(--text); font-family:inherit; font-size:var(--fs-sm);
  transition:border-color var(--transition);
  outline:none;
}
.form-control:focus { border-color:var(--teal); box-shadow:0 0 0 3px var(--teal-glow) }
.form-control::placeholder { color:var(--text-light) }
textarea.form-control { resize:vertical; min-height:90px }
select.form-control { cursor:pointer; appearance:none; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 10px center; background-size:16px; padding-right:32px }

.input-icon-wrap { position:relative }
.input-icon-wrap .form-control { padding-left:38px }
.input-icon-wrap .input-icon {
  position:absolute; left:12px; top:50%; transform:translateY(-50%);
  color:var(--text-light); font-size:14px;
}

/* ── Tables ──────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x:auto; border-radius:var(--radius) }
table { width:100%; border-collapse:collapse }
thead tr { background:var(--bg-base) }
th {
  text-align:left; padding:11px 16px;
  font-size:var(--fs-xs); font-weight:700;
  color:var(--text-muted);
  text-transform:uppercase; letter-spacing:1px;
  border-bottom:1px solid var(--border);
  white-space:nowrap;
}
td {
  padding:13px 16px;
  border-bottom:1px solid var(--border);
  font-size:var(--fs-sm);
  vertical-align:middle;
}
tr:last-child td { border-bottom:none }
tbody tr:hover td { background:rgba(0,0,0,.015) }
[data-theme="dark"] tbody tr:hover td { background:rgba(255,255,255,.02) }

/* ── Badges / Tags ───────────────────────────────────────────────────────── */
.badge {
  display:inline-flex; align-items:center; justify-content:center;
  padding:3px 10px;
  border-radius:99px;
  font-size:var(--fs-xs); font-weight:600;
  letter-spacing:.2px;
}
.badge-success { background:#dcfce7; color:#15803d; border:1px solid #bbf7d0 }
.badge-pending { background:#fef3c7; color:#d97706; border:1px solid #fde68a }
.badge-danger  { background:#fee2e2; color:#dc2626; border:1px solid #fecaca }
.badge-info    { background:#dbeafe; color:#1d4ed8; border:1px solid #bfdbfe }
[data-theme="dark"] .badge-success { background:rgba(21,128,61,.2);  color:#4ade80; border-color:rgba(74,222,128,.3) }
[data-theme="dark"] .badge-pending { background:rgba(217,119,6,.2);  color:#fbbf24; border-color:rgba(251,191,36,.3) }
[data-theme="dark"] .badge-danger  { background:rgba(220,38,38,.2);  color:#f87171; border-color:rgba(248,113,113,.3) }

/* Action ⋮ button */
.action-dots-btn {
  width:30px; height:30px; border-radius:var(--radius-xs);
  background:transparent; border:1px solid var(--border);
  color:var(--text-muted); cursor:pointer; font-size:16px;
  display:flex; align-items:center; justify-content:center;
  transition:all var(--transition);
}
.action-dots-btn:hover { border-color:var(--teal); color:var(--teal) }

/* ── Course Grid & Cards ─────────────────────────────────────────────────── */
.course-grid {
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(260px,1fr));
  gap:18px;
}
.course-card {
  background:var(--bg-card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  overflow:hidden;
  transition:all var(--transition);
  display:block; color:inherit;
}
.course-card:hover {
  transform:translateY(-3px);
  border-color:var(--teal);
  box-shadow:var(--shadow);
}
.course-thumbnail { width:100%; aspect-ratio:16/9; object-fit:cover; display:block }
.course-thumb-placeholder {
  width:100%; aspect-ratio:16/9;
  display:flex; align-items:center; justify-content:center;
  background:linear-gradient(135deg,#1a1a2e,#16213e);
  font-size:36px;
}
.course-info { padding:14px 16px }
.course-category {
  font-size:var(--fs-xs); font-weight:700; color:var(--teal);
  text-transform:uppercase; letter-spacing:.5px; margin-bottom:6px;
}
.course-title { font-weight:700; font-size:15px; margin-bottom:10px; line-height:1.35 }
.course-price-original { font-size:var(--fs-xs); color:var(--danger); text-decoration:line-through; margin-bottom:2px }
.course-price { font-size:17px; font-weight:800; color:var(--teal) }
.course-price.free { color:#16a34a }
.coming-soon-text { font-size:var(--fs-sm); color:var(--text-muted); font-weight:500 }

/* Progress */
.progress {
  height:5px; background:var(--bg-input); border-radius:99px; overflow:hidden;
}
.progress-bar {
  height:100%;
  background:#f59e0b;
  border-radius:99px; transition:width .5s ease;
}

/* Progress label row */
.progress-row {
  display:flex; align-items:center; justify-content:space-between;
  font-size:var(--fs-xs); color:var(--text-muted); margin-bottom:5px;
}

/* ── Section Header ──────────────────────────────────────────────────────── */
.section-header {
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom:16px;
}
.section-title {
  font-size:var(--fs-lg); font-weight:700; color:var(--text); margin-bottom:0;
}

/* ── Alert / Flash ───────────────────────────────────────────────────────── */
.alert {
  padding:12px 16px; border-radius:var(--radius-sm);
  font-size:var(--fs-sm); font-weight:500; margin-bottom:16px;
  display:flex; align-items:center; gap:10px;
}
.alert-success { background:#f0fdf4; border:1px solid #bbf7d0; color:#15803d }
.alert-danger   { background:#fef2f2; border:1px solid #fecaca; color:#dc2626 }
.alert-info     { background:var(--info-light); border:1px solid #bfdbfe; color:#1d4ed8 }
.alert-warning  { background:#fffbeb; border:1px solid #fde68a; color:#d97706 }

/* ── Auth Pages ──────────────────────────────────────────────────────────── */
.auth-page {
  min-height:100vh;
  display:flex; align-items:center; justify-content:center;
  background:var(--bg-base);
  padding:24px;
}
.auth-card {
  width:100%; max-width:420px;
  background:var(--bg-card);
  border:1px solid var(--border);
  border-radius:20px; padding:36px 40px;
}
.auth-logo { text-align:center; margin-bottom:28px }
.auth-logo-mark {
  width:50px; height:50px;
  background:var(--teal);
  border-radius:12px;
  display:flex; align-items:center; justify-content:center;
  margin:0 auto 12px;
}
.auth-logo-mark svg { width:30px; height:30px; fill:#fff }
.auth-app-name {
  font-size:20px; font-weight:800; color:var(--text);
}
.auth-app-name span { color:var(--teal) }
.auth-title { font-size:var(--fs-lg); font-weight:700; margin-bottom:4px }
.auth-sub { color:var(--text-muted); font-size:var(--fs-sm); margin-bottom:24px }

/* ── Profile Settings ────────────────────────────────────────────────────── */
.profile-avatar-wrap { position:relative; display:inline-block; margin-bottom:12px }
.profile-avatar {
  width:90px; height:90px; border-radius:50%; object-fit:cover;
  border:2px solid var(--teal);
}
.avatar-edit-btn {
  position:absolute; bottom:2px; right:2px;
  width:26px; height:26px; border-radius:50%;
  background:var(--teal); color:#fff;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer; font-size:12px; border:none;
}

/* ── Empty State ─────────────────────────────────────────────────────────── */
.empty-state {
  text-align:center; padding:48px 24px;
  color:var(--text-muted);
}
.empty-state .icon { font-size:40px; margin-bottom:12px; opacity:.5 }
.empty-state p { font-size:var(--fs-sm) }

/* ── Feed Posts ──────────────────────────────────────────────────────────── */
.post-card {
  background:var(--bg-card); border:1px solid var(--border);
  border-radius:var(--radius); overflow:hidden;
  transition:border-color var(--transition);
}
.post-card:hover { border-color:var(--teal) }
.post-header { display:flex; align-items:center; gap:10px; padding:12px 16px }
.post-avatar { width:38px; height:38px; border-radius:50%; object-fit:cover; border:2px solid var(--teal) }
.post-author { font-weight:700; font-size:var(--fs-sm) }
.post-time { font-size:var(--fs-xs); color:var(--text-muted) }
.post-image { width:100%; aspect-ratio:4/3; object-fit:cover }
.post-body { padding:12px 16px }
.post-question { font-weight:700; font-size:14px; margin-bottom:6px }
.post-caption { font-size:var(--fs-sm); color:var(--text-muted); line-height:1.5 }
.post-actions { display:flex; gap:4px; padding:6px 16px 12px }
.action-btn {
  display:flex; align-items:center; gap:6px;
  padding:7px 12px; border-radius:var(--radius-xs);
  background:transparent; border:none;
  color:var(--text-muted); cursor:pointer;
  font-size:13px; font-weight:500;
  transition:all var(--transition); font-family:inherit;
}
.action-btn:hover { background:var(--bg-input); color:var(--text) }
.action-btn.liked { color:var(--danger) }

/* ── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width:5px; height:5px }
::-webkit-scrollbar-track { background:transparent }
::-webkit-scrollbar-thumb { background:var(--border); border-radius:99px }
::-webkit-scrollbar-thumb:hover { background:var(--text-light) }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width:900px) {
  .stats-row { grid-template-columns:repeat(3,1fr) }
}

@media (max-width:768px) {
  :root { --sidebar-w:220px; --topbar-h:58px }

  .sidebar {
    transform:translateX(-100%);
    box-shadow:var(--shadow-lg);
  }
  .sidebar.open { transform:translateX(0) }

  .hamburger { display:flex }
  .main-content { margin-left:0 }
  .page-content { padding:16px }

  .stats-row { grid-template-columns:1fr }
  .stat-cell { border-right:none; border-bottom:1px solid var(--border); padding:14px 18px }
  .stat-cell:last-child { border-bottom:none }

  .course-grid { grid-template-columns:1fr }

  .topbar { padding:0 16px }
  .topbar-title { font-size:var(--fs-base) }

  /* Dashboard two-col */
  .dashboard-cols { grid-template-columns:1fr !important }
}

@media (max-width:440px) {
  .auth-card { padding:28px 20px }
  .course-grid { grid-template-columns:1fr }
}
/* ── Admin Command Center ────────────────────────────────────────────────── */
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; gap: 20px; }
.admin-header-title { flex: 1; }
.admin-header-title h1 { font-size: 24px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.admin-header-title p { color: var(--text-muted); font-size: 14px; }

.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; margin-bottom: 32px; }
.admin-section-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; padding: 0 4px; }
.admin-section-header h2 { font-size: 16px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.admin-section-header i { color: var(--teal); }

.glass-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: all 0.3s; overflow: hidden; position: relative; }
.glass-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.glass-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--teal); opacity: 0; transition: opacity 0.3s; }
.glass-card:hover::before { opacity: 1; }

.action-hub { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.action-card { display: flex; align-items: center; gap: 16px; padding: 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); transition: all 0.2s; cursor: pointer; }
.action-card:hover { background: var(--teal-light); border-color: var(--teal); }
.action-card i { font-size: 20px; color: var(--teal); transition: all 0.2s; }
.action-card:hover i { transform: scale(1.1); }
.action-card-text { font-weight: 600; font-size: 14px; color: var(--text); }

/* Unified Badge Colors */
.badge-premium { padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.badge-revenue { background: #DCFCE7; color: #166534; }
.badge-content { background: #DBEAFE; color: #1E40AF; }
.badge-community { background: #FEF3C7; color: #92400E; }

/* ── Admin Dashboard Refinements ───────────────────────────────────────────── */
.nav-item.active .nav-icon i { color: var(--teal); }
.badge-unread { 
    background: var(--danger); color: #fff; font-size: 10px; font-weight: 800; 
    padding: 2px 6px; border-radius: 10px; min-width: 18px; text-align: center; 
    box-shadow: 0 2px 5px rgba(239, 68, 68, 0.4); margin-left: 6px;
}

/* ── Centered Modals (Dialogs) ────────────────────────────────────────────── */
dialog { 
    border: none; padding: 0; background: transparent; 
    width: min(600px, 95vw); max-height: 92vh;
    margin: auto;
    overflow: visible;
}
dialog::backdrop { background: rgba(0,0,0,0.6); backdrop-filter: blur(8px); }

dialog[open] { 
    display: flex; flex-direction: column; 
    animation: modalScaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Inner container scroll — header tetap di atas, body scroll, footer tetap di bawah */
dialog > .glass-card, 
dialog > .modal-content {
    max-height: 92vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
}

@keyframes modalScaleIn { 
    from { opacity: 0; transform: scale(0.95) translateY(10px); } 
    to { opacity: 1; transform: scale(1) translateY(0); } 
}
dialog .modal-header { padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
dialog .modal-title { font-size: 20px; font-weight: 800; color: var(--text); }

/* ── Live Meeting Global Banner ────────────────────────────────────────────── */
.live-banner { 
    display: none; 
    background: linear-gradient(135deg, #ff4b6d, #ff9068); 
    color: white; 
    padding: 16px 24px; 
    border-radius: 16px; 
    margin-bottom: 24px; 
    justify-content: space-between; 
    align-items: center; 
    box-shadow: 0 10px 20px rgba(255,75,109,0.2); 
    animation: slideDown 0.5s ease forwards;
    position: relative;
    z-index: 100;
}
.live-banner.show { display: flex; }
.live-banner-info { display: flex; align-items: center; gap: 12px; }
.live-pulse { width: 12px; height: 12px; background: white; border-radius: 50%; animation: pulse-white 2s infinite; }
.btn-join-live { 
    background: white; 
    color: #ff4b6d; 
    border: none; 
    padding: 8px 16px; 
    border-radius: 12px; 
    font-weight: 800; 
    font-size: 13px; 
    cursor: pointer; 
    transition: 0.3s; 
    text-decoration: none;
}
.btn-join-live:hover { transform: scale(1.05); box-shadow: 0 4px 12px rgba(255,255,255,0.3); }

@keyframes slideDown { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes pulse-white {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}
