/* ============================================================
   RuangTayang LMS — Sistem desain
   Struktur mengikuti DESIGN.md (Inter, kartu 16px, hairline border,
   elevasi halus). Warna utama = --accent (bawaan indigo, bisa diganti
   dari Pengaturan; preset "Warm Slate" oranye tersedia).
   ============================================================ */
:root {
  --accent: #4F46E5;
  --accent-hover: color-mix(in srgb, var(--accent) 86%, #000);
  --accent-soft: color-mix(in srgb, var(--accent) 9%, var(--surface));
  --accent-soft-2: color-mix(in srgb, var(--accent) 16%, var(--surface));
  --accent-ink: color-mix(in srgb, var(--accent) 78%, #000);
  --accent-ring: color-mix(in srgb, var(--accent) 35%, transparent);
  --on-accent: #FFFFFF;

  --bg: #F6F7FB;
  --surface: #FFFFFF;
  --surface-2: #F1F5F9;
  --surface-3: #E9EEF5;
  --text: #0F172A;
  --text-2: #475569;
  --text-3: #64748B;
  --text-4: #94A3B8;
  --border: #E2E8F0;
  --border-2: #CBD5E1;
  --divider: #F1F5F9;

  --ok: #15803D; --ok-bg: #DCFCE7;
  --warn: #B45309; --warn-bg: #FEF3C7;
  --bad: #B91C1C; --bad-bg: #FEE2E2;
  --info: #0369A1; --info-bg: #E0F2FE;

  --shadow-1: 0 1px 3px rgba(15, 23, 42, .04), 0 1px 2px rgba(15, 23, 42, .02);
  --shadow-2: 0 4px 12px -2px rgba(15, 23, 42, .07), 0 2px 6px -1px rgba(15, 23, 42, .03);
  --shadow-3: 0 18px 40px -8px rgba(15, 23, 42, .18), 0 4px 12px -2px rgba(15, 23, 42, .05);

  --r-sm: 6px; --r: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 24px;
  --sidebar: 248px; --topbar: 64px; --bottomnav: 64px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --accent-soft: color-mix(in srgb, var(--accent) 18%, var(--surface));
  --accent-soft-2: color-mix(in srgb, var(--accent) 28%, var(--surface));
  --accent-ink: color-mix(in srgb, var(--accent) 55%, #fff);
  --bg: #0B1120;
  --surface: #121A2B;
  --surface-2: #19233A;
  --surface-3: #212D47;
  --text: #E7ECF5;
  --text-2: #A9B4C7;
  --text-3: #8592A8;
  --text-4: #5E6B82;
  --border: #243049;
  --border-2: #33415E;
  --divider: #1C263C;
  --ok: #4ADE80; --ok-bg: rgba(34, 197, 94, .14);
  --warn: #FBBF24; --warn-bg: rgba(245, 158, 11, .14);
  --bad: #F87171; --bad-bg: rgba(239, 68, 68, .14);
  --info: #38BDF8; --info-bg: rgba(14, 165, 233, .14);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-2: 0 6px 16px -4px rgba(0, 0, 0, .45);
  --shadow-3: 0 24px 48px -12px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* ---------- Dasar ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01'; }
img { max-width: 100%; display: block; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -0.02em; }
h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.025em; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
.num, .tabular { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent-soft-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.text-2 { color: var(--text-2); }
.ok-text { color: var(--ok); } .bad-text { color: var(--bad); } .warn-text { color: var(--warn); }
.accent-text { color: var(--accent-ink); }
.clamp-1, .clamp-2, .clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-1 { -webkit-line-clamp: 1; } .clamp-2 { -webkit-line-clamp: 2; } .clamp-3 { -webkit-line-clamp: 3; }
.hidden { display: none !important; }
hr.sep { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }

/* ---------- Utilitas tata letak ---------- */
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.top { align-items: flex-start; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-lg { display: flex; flex-direction: column; gap: 24px; }
.grow { flex: 1 1 auto; min-width: 0; }
.gap-4 { gap: 4px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-cards { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.g-main-side { grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.g-side-main { grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 1100px) { .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-main-side { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .g-2, .g-3 { grid-template-columns: 1fr; } .g-side-main { grid-template-columns: 1fr; } }
@media (max-width: 420px) { .g-4 { grid-template-columns: 1fr 1fr; gap: 10px; } }

/* ---------- Tombol ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: var(--r); border: 1px solid transparent; font-weight: 600; font-size: 14px; letter-spacing: .005em; cursor: pointer; white-space: nowrap; background: transparent; transition: background .15s, border-color .15s, color .15s, box-shadow .15s; text-decoration: none !important; user-select: none; }
.btn svg { flex: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 1px 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
.btn-ghost { border-color: var(--border); color: var(--text); background: var(--surface); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border-2); }
.btn-soft { background: var(--accent-soft); color: var(--accent-ink); }
.btn-soft:hover { background: var(--accent-soft-2); }
.btn-quiet { color: var(--text-2); }
.btn-quiet:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger-soft { background: var(--bad-bg); color: var(--bad); }
.btn-ok-soft { background: var(--ok-bg); color: var(--ok); }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 13px; border-radius: 7px; }
.btn-lg { min-height: 48px; padding: 0 22px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { width: 38px; min-height: 38px; padding: 0; border-radius: var(--r); color: var(--text-2); }
.btn-icon:hover { background: var(--surface-2); color: var(--text); }
.btn-icon.sm { width: 32px; min-height: 32px; }
.btn[disabled], .btn.is-loading { opacity: .6; pointer-events: none; }
.btn.is-loading::after { content: ''; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Kartu ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.card-pad { padding: 20px; }
.card-pad-lg { padding: 28px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--divider); }
.card-head h3 { font-size: 15px; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--divider); }
.card.hoverable { transition: border-color .15s, box-shadow .15s, transform .15s; }
.card.hoverable:hover { border-color: var(--border-2); box-shadow: var(--shadow-2); }
.panel-soft { background: var(--surface-2); border-radius: var(--r-md); padding: 16px; }
.panel-accent { background: var(--accent-soft); border-radius: var(--r-md); padding: 16px; }
@media (max-width: 600px) { .card-pad { padding: 16px; } .card-pad-lg { padding: 20px; } .card-head { padding: 14px 16px; } }

/* ---------- Chip & lencana ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.chip.accent { background: var(--accent-soft); color: var(--accent-ink); }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.info { background: var(--info-bg); color: var(--info); }
.chip.dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.lg { height: 30px; padding: 0 14px; font-size: 13px; }
.tag-caps { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--surface-3); color: var(--text-2); }
.count.accent { background: var(--accent); color: var(--on-accent); }
.filter-chip { height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; font-weight: 500; color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.filter-chip:hover { border-color: var(--border-2); color: var(--text); }
.filter-chip.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.filter-chip .n { opacity: .75; font-variant-numeric: tabular-nums; }

/* ---------- Formulir ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--text); display: flex; justify-content: space-between; gap: 8px; }
.label .hint, .field > label .hint { font-weight: 500; color: var(--text-3); font-size: 12px; }
.input, .select, .textarea { width: 100%; min-height: 42px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); transition: border-color .15s, box-shadow .15s; }
.input::placeholder, .textarea::placeholder { color: var(--text-4); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-2); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.input[readonly] { background: var(--surface-2); color: var(--text-2); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.55; }
.select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2394A3B8' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.input-icon { position: relative; }
.input-icon > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-4); pointer-events: none; }
.input-icon > .input { padding-left: 38px; }
.input-icon > .trail { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.help { font-size: 12px; color: var(--text-3); }
.error-text { font-size: 12px; color: var(--bad); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.radio-card { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--border); cursor: pointer; background: var(--surface); }
.radio-card:hover { border-color: var(--border-2); }
.radio-card.active, .radio-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radio-card input { accent-color: var(--accent); margin-top: 3px; }
.switch { position: relative; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--border-2); transition: background .15s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-ring); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.strength { height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.strength i { display: block; height: 100%; width: 0; transition: width .2s, background .2s; }

/* ---------- Tab ---------- */
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { height: 36px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--text-2); font-weight: 600; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.tab.active .count { background: var(--accent); color: var(--on-accent); }
.tabs-line { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs-line::-webkit-scrollbar { display: none; }
.tabs-line .tab { border-radius: 0; height: 46px; border-bottom: 2px solid transparent; background: none; box-shadow: none; padding: 0 14px; }
.tabs-line .tab.active { color: var(--accent-ink); border-bottom-color: var(--accent); }

/* ---------- Progres ---------- */
.bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .4s ease; }
.bar.thin { height: 4px; }
.bar.ok > i { background: var(--ok); }
.ring { position: relative; display: inline-grid; place-items: center; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring .ring-label { position: absolute; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

/* ---------- Tabel ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); padding: 10px 14px; background: var(--surface-2); white-space: nowrap; }
.table th:first-child { border-top-left-radius: 10px; } .table th:last-child { border-top-right-radius: 10px; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--divider); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.table tr.selected td { background: var(--accent-soft); }
.table .th-sort { cursor: pointer; user-select: none; }
.table .th-sort:hover { color: var(--text); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; flex-wrap: wrap; }
.pager .pages { display: flex; gap: 4px; }
.pager .pg { min-width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 13px; }
.pager .pg.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* ---------- Avatar ---------- */
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; flex: none; overflow: hidden; background: var(--accent); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.lg { width: 56px; height: 56px; font-size: 18px; }
.avatar.xl { width: 88px; height: 88px; font-size: 28px; }

/* ---------- Skeleton & kosong ---------- */
.sk { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: 8px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.sk-line { height: 12px; margin: 8px 0; } .sk-title { height: 26px; width: 40%; } .sk-block { height: 160px; border-radius: var(--r-lg); }
.empty { text-align: center; padding: 48px 20px; color: var(--text-3); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .ico { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.empty h3 { color: var(--text); }

/* ---------- Toast ---------- */
.toast-stack { position: fixed; z-index: 1000; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; max-width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--text); color: var(--surface); box-shadow: var(--shadow-3); font-size: 13.5px; animation: toastIn .25s ease; }
:root[data-theme="dark"] .toast { background: #F1F5F9; color: #0F172A; }
.toast .t-ico { flex: none; margin-top: 1px; }
.toast.ok .t-ico { color: #4ADE80; } .toast.bad .t-ico { color: #F87171; } .toast.info .t-ico { color: #93C5FD; }
:root[data-theme="dark"] .toast.ok .t-ico { color: #15803D; } :root[data-theme="dark"] .toast.bad .t-ico { color: #B91C1C; }
.toast.out { animation: toastOut .2s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }
@media (max-width: 1023px) { .toast-stack { left: 16px; right: 16px; bottom: calc(var(--bottomnav) + 16px + env(safe-area-inset-bottom)); max-width: none; } }

/* ---------- Modal & laci ---------- */
.overlay { position: fixed; inset: 0; z-index: 900; background: rgba(15, 23, 42, .5); backdrop-filter: blur(2px); display: grid; place-items: center; padding: 20px; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(560px, 100%); max-height: calc(100vh - 40px); background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-3); display: flex; flex-direction: column; animation: pop .18s ease; border: 1px solid var(--border); }
.modal.wide { width: min(880px, 100%); }
.modal.xwide { width: min(1080px, 100%); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 14px; }
.modal-head h3 { font-size: 17px; }
.modal-head .mi { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); flex: none; }
.modal-body { padding: 4px 22px 18px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--divider); flex-wrap: wrap; }
.overlay.drawer { place-items: stretch end; padding: 0; }
.overlay.drawer .modal { width: min(480px, 100%); max-height: 100vh; height: 100%; border-radius: 0; animation: slideIn .22s ease; }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } }
@media (max-width: 600px) {
  .overlay { padding: 0; place-items: end stretch; }
  .modal { width: 100%; max-height: 92vh; border-radius: 20px 20px 0 0; }
  .modal.wide, .modal.xwide { width: 100%; }
  .modal-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
}

/* ---------- Shell aplikasi ---------- */
.shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 18px 14px; z-index: 50; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: var(--text); text-decoration: none !important; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 800; font-size: 13px; letter-spacing: -.02em; overflow: hidden; flex: none; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -.02em; line-height: 1.1; }
.brand-sub { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; color: var(--text-3); text-transform: uppercase; }
.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-label { font-size: 11px; font-weight: 700; color: var(--text-4); letter-spacing: .06em; text-transform: uppercase; padding: 14px 12px 6px; }
.nav a { display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px; border-radius: 10px; color: var(--text-2); font-weight: 500; text-decoration: none !important; position: relative; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.nav a.active::before { content: ''; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav a .count { margin-left: auto; }
.nav a.active .count { background: var(--accent); color: var(--on-accent); }
.side-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--surface-2); }
.side-user .who { min-width: 0; flex: 1; }
.side-user .who b { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-chip { font-size: 11px; font-weight: 700; color: var(--accent-ink); }
.main { margin-left: var(--sidebar); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 40; height: var(--topbar); display: flex; align-items: center; gap: 12px; padding: 0 28px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid transparent; }
.topbar.scrolled { border-bottom-color: var(--border); }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-3); min-width: 0; }
.crumbs b { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-search { margin-left: auto; width: min(340px, 34vw); }
.top-search .input { height: 40px; min-height: 40px; background: var(--surface); }
.bell { position: relative; }
.bell .dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); }
.content { padding: 8px 28px 48px; width: 100%; max-width: 1280px; margin: 0 auto; flex: 1; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 12px 0 24px; flex-wrap: wrap; }
.page-head .eyebrow { font-size: 12px; font-weight: 600; color: var(--accent-ink); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.page-head p { color: var(--text-2); margin-top: 6px; max-width: 64ch; }
.bottomnav { display: none; }
.mobile-brand { display: none; }

@media (max-width: 1023px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding-bottom: calc(var(--bottomnav) + env(safe-area-inset-bottom)); }
  .topbar { padding: 0 16px; }
  .top-search { display: none; }
  .mobile-brand { display: flex; }
  .crumbs { display: none; }
  .content { padding: 4px 16px 32px; }
  .bottomnav { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; height: calc(var(--bottomnav) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--border); }
  .bottomnav a, .bottomnav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--text-3); text-decoration: none !important; border: 0; background: none; position: relative; min-height: 44px; }
  .bottomnav a.active { color: var(--accent-ink); }
  .bottomnav a.active svg { stroke-width: 2.4; }
  .bottomnav .count { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 16px; height: 16px; font-size: 10px; background: var(--accent); color: var(--on-accent); }
  h1 { font-size: 24px; }
}

/* ---------- Shell publik ---------- */
.pub-top { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.pub-top .inner { max-width: 1240px; margin: 0 auto; height: 64px; display: flex; align-items: center; gap: 24px; padding: 0 24px; }
.pub-nav { display: flex; gap: 4px; margin: 0 auto; }
.pub-nav a { padding: 8px 12px; border-radius: 8px; color: var(--text-2); font-weight: 500; text-decoration: none !important; }
.pub-nav a:hover { color: var(--text); background: var(--surface-2); }
.pub-nav a.active { color: var(--accent-ink); font-weight: 600; }
.pub-main { max-width: 1240px; margin: 0 auto; padding: 0 24px 64px; }
.footer { background: var(--surface); border-top: 1px solid var(--border); }
.footer .inner { max-width: 1240px; margin: 0 auto; padding: 40px 24px 28px; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.footer h4 { font-size: 13px; margin-bottom: 10px; }
.footer .brand { display: flex; }
.footer a:not(.brand) { display: block; color: var(--text-2); padding: 3px 0; font-size: 13px; }
.footer .legal { max-width: 1240px; margin: 0 auto; padding: 16px 24px 28px; font-size: 12px; color: var(--text-3); display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--divider); flex-wrap: wrap; }
@media (max-width: 860px) {
  .pub-nav { display: none; }
  .pub-top .inner { padding: 0 16px; gap: 10px; }
  .pub-main { padding: 0 16px 48px; }
  .footer .inner { grid-template-columns: 1fr 1fr; }
  .pub-shell { padding-bottom: calc(var(--bottomnav) + env(safe-area-inset-bottom)); }
  .pub-shell .bottomnav { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; height: calc(var(--bottomnav) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--border); }
  .pub-shell .bottomnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--text-3); text-decoration: none !important; }
  .pub-shell .bottomnav a.active { color: var(--accent-ink); }
  .hide-sm { display: none !important; }
}

/* ---------- Katalog ---------- */
.hero { padding: 56px 0 36px; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(30px, 4.4vw, 46px); line-height: 1.08; letter-spacing: -.035em; }
.hero p.lead { font-size: 16px; color: var(--text-2); margin-top: 16px; max-width: 54ch; }
.hero-search { margin-top: 28px; display: flex; gap: 8px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-2); max-width: 560px; }
.hero-search .input { border: 0; box-shadow: none !important; background: transparent; }
.hero-art { position: relative; aspect-ratio: 5/4; border-radius: 24px; background: var(--accent-soft); overflow: hidden; border: 1px solid var(--border); }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 28px; max-width: 560px; }
.hero-stats div { padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.hero-stats b { display: block; font-size: 20px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hero-stats span { font-size: 12px; color: var(--text-3); }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; padding: 28px 0 20px; gap: 24px; } .hero-art { display: none; } }
.course-card { display: flex; flex-direction: column; overflow: hidden; color: inherit; text-decoration: none !important; }
.thumb { position: relative; aspect-ratio: 16/9; background: var(--surface-3); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.course-card:hover .thumb img { transform: scale(1.03); }
.thumb .play { position: absolute; inset: 0; margin: auto; width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.94); color: var(--accent); display: grid; place-items: center; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.thumb .meta { position: absolute; right: 8px; bottom: 8px; padding: 3px 8px; border-radius: 6px; background: rgba(15,23,42,.78); color: #fff; font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.thumb .tl { position: absolute; left: 8px; top: 8px; }
.thumb .shade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(15,23,42,.35)); }
.thumb.ph { display: grid; place-items: center; color: var(--accent-ink); background: linear-gradient(135deg, var(--accent-soft), var(--accent-soft-2)); }
.course-card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.course-card h3 { font-size: 15px; line-height: 1.35; }
.course-card .desc { font-size: 13px; color: var(--text-2); }
.course-card .foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--divider); display: flex; align-items: center; gap: 8px; font-size: 12.5px; }

/* ---------- Detail kursus ---------- */
.detail-hero { padding: 28px 0 8px; }
.breadcrumb { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--text-3); flex-wrap: wrap; margin-bottom: 16px; }
.breadcrumb a { color: var(--text-2); }
.chapter { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.chapter + .chapter { margin-top: 12px; }
.chapter-head { display: flex; align-items: center; gap: 14px; padding: 16px 18px; cursor: pointer; background: var(--surface); border: 0; width: 100%; text-align: left; }
.chapter-head:hover { background: var(--surface-2); }
.chapter-num { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; flex: none; font-size: 13px; }
.chapter.open .chapter-head { border-bottom: 1px solid var(--divider); }
.chapter .chev { transition: transform .2s; color: var(--text-3); }
.chapter.open .chev { transform: rotate(180deg); }
.chapter-body { display: none; }
.chapter.open .chapter-body { display: block; }
.lesson-row { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-top: 1px solid var(--divider); color: inherit; text-decoration: none !important; }
.lesson-row:first-child { border-top: 0; }
a.lesson-row:hover { background: var(--surface-2); }
.lesson-row.locked { color: var(--text-3); }
.l-ico { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--text-3); }
.l-ico.open { background: var(--accent-soft); color: var(--accent-ink); }
.l-ico.done { background: var(--ok-bg); color: var(--ok); }
.l-ico.now { background: var(--accent); color: var(--on-accent); }
.lesson-row .dur { margin-left: auto; font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.side-sticky { position: sticky; top: 84px; }
.check-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.check-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--text-2); }
.check-list li svg { color: var(--ok); flex: none; margin-top: 2px; }
.prose { color: var(--text-2); font-size: 15px; line-height: 1.7; max-width: 72ch; }
.prose p + p, .prose ul, .prose ol { margin-top: 12px; }
.prose h3, .prose h4 { color: var(--text); margin: 20px 0 6px; }
.prose code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); padding: 2px 5px; border-radius: 5px; }

/* ---------- Dasbor ---------- */
.stat { padding: 18px 18px 16px; display: flex; gap: 12px; align-items: flex-start; }
.stat .k { font-size: 12px; color: var(--text-3); font-weight: 600; }
.stat .v { font-size: 28px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.15; margin-top: 4px; }
.stat .v small { font-size: 13px; font-weight: 500; color: var(--text-3); letter-spacing: 0; margin-left: 4px; }
.stat .s { font-size: 12px; margin-top: 4px; color: var(--text-3); }
.stat .ico { margin-left: auto; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); flex: none; }
.stat .ico.ok { background: var(--ok-bg); color: var(--ok); } .stat .ico.info { background: var(--info-bg); color: var(--info); } .stat .ico.warn { background: var(--warn-bg); color: var(--warn); }
@media (max-width: 600px) { .stat { padding: 14px; } .stat .v { font-size: 22px; } .stat .ico { width: 34px; height: 34px; border-radius: 10px; } }
.continue { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 24px; padding: 20px; align-items: center; }
.continue .thumb { border-radius: 12px; }
.continue .thumb .prog { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.35); }
.continue .thumb .prog i { display: block; height: 100%; background: var(--accent); }
@media (max-width: 760px) { .continue { grid-template-columns: 1fr; padding: 14px; gap: 14px; } }
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; background: var(--accent-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent); }
.banner.warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.banner.bad { background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.banner.ok { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.mini-course { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 16px; padding: 14px; align-items: center; color: inherit; text-decoration: none !important; }
.mini-course .thumb { border-radius: 10px; }
@media (max-width: 520px) { .mini-course { grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 12px; } }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { display: flex; gap: 12px; position: relative; padding-bottom: 18px; }
.timeline li:not(:last-child)::before { content: ''; position: absolute; left: 17px; top: 38px; bottom: 4px; width: 2px; background: var(--divider); }
.timeline .t-ico { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--text-2); }

/* ---------- Ruang tonton ---------- */
.focus-top { position: sticky; top: 0; z-index: 40; height: 60px; display: flex; align-items: center; gap: 16px; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.focus-top .title { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.watch { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; padding: 20px; max-width: 1480px; margin: 0 auto; align-items: start; }
.player-box { position: relative; aspect-ratio: 16/9; background: #000; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-2); }
.player-box iframe, .player-box > div { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-overlay { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; background: rgba(2, 6, 23, .55); padding: 16px; }
.player-overlay .box { background: var(--surface); color: var(--text); border-radius: 14px; padding: 18px; box-shadow: var(--shadow-3); display: flex; align-items: center; gap: 14px; max-width: 520px; width: 100%; flex-wrap: wrap; }
.player-msg { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; text-align: center; color: #E2E8F0; padding: 24px; background: #0B1120; }
.lesson-nav { position: sticky; top: 80px; max-height: calc(100vh - 100px); display: flex; flex-direction: column; }
.lesson-nav .list { overflow-y: auto; padding: 8px; }
.nav-lesson { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 10px; color: var(--text); text-decoration: none !important; font-size: 13.5px; }
.nav-lesson:hover { background: var(--surface-2); }
.nav-lesson.current { background: var(--accent-soft); }
.nav-lesson.current .t { color: var(--accent-ink); font-weight: 600; }
.nav-lesson.locked { color: var(--text-4); pointer-events: none; }
.nav-lesson .d { margin-left: auto; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.nav-chapter { font-size: 12px; font-weight: 700; color: var(--text-3); padding: 12px 10px 6px; display: flex; justify-content: space-between; }
.kbd { font-family: var(--mono); font-size: 11.5px; padding: 2px 6px; border-radius: 5px; border: 1px solid var(--border); background: var(--surface-2); }
.note-item { display: flex; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); align-items: flex-start; }
.ts-btn { flex: none; height: 26px; padding: 0 8px; border-radius: 7px; border: 0; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: 12px; cursor: pointer; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 4px; }
.post { display: flex; gap: 12px; }
.post .bubble { flex: 1; min-width: 0; }
.post .replies { margin-top: 12px; padding-left: 14px; border-left: 2px solid var(--divider); display: flex; flex-direction: column; gap: 12px; }
.post.hidden-post { opacity: .55; }
.countdown { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; background: rgba(2, 6, 23, .7); color: #fff; text-align: center; }
@media (max-width: 1023px) {
  .watch { grid-template-columns: 1fr; padding: 0 0 24px; gap: 16px; }
  .player-box { border-radius: 0; }
  .watch-main { display: flex; flex-direction: column; gap: 16px; }
  .watch-main > :not(.player-box) { margin: 0 16px; }
  .lesson-nav { position: static; max-height: none; margin: 0 16px; }
  .focus-top { padding: 0 12px; gap: 10px; }
  .focus-top .prog-top { display: none; }
}

/* ---------- Kuis ---------- */
.q-steps { display: flex; gap: 6px; }
.q-steps i { flex: 1; height: 6px; border-radius: 6px; background: var(--surface-3); }
.q-steps i.done { background: var(--ok); }
.q-steps i.now { background: var(--accent); }
.q-steps i.flag { background: var(--warn); }
.option { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; text-align: left; width: 100%; transition: border-color .15s, background .15s; }
.option:hover { border-color: var(--border-2); }
.option.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-ring); }
.option .key { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--surface-2); flex: none; }
.option.selected .key { background: var(--accent); color: var(--on-accent); }
.option.right { border-color: var(--ok); background: var(--ok-bg); }
.option.wrong { border-color: var(--bad); background: var(--bad-bg); }
.result-row { display: flex; gap: 12px; padding: 14px; border-radius: 12px; background: var(--surface-2); align-items: flex-start; }
.result-row.wrong { background: var(--bad-bg); }

/* ---------- Editor kursus ---------- */
.ed-chapter { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.ed-chapter + .ed-chapter { margin-top: 14px; }
.ed-chapter-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--surface-2); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.ed-lessons { padding: 8px; display: flex; flex-direction: column; gap: 6px; min-height: 48px; }
.ed-lesson { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.ed-lesson .thumb { width: 92px; flex: none; border-radius: 8px; }
.ed-lesson.dragging, .ed-chapter.dragging { opacity: .45; }
.ed-lesson.drop-before { box-shadow: 0 -3px 0 var(--accent); }
.ed-lessons.drop-into { background: var(--accent-soft); border-radius: 12px; }
.grip { cursor: grab; color: var(--text-4); display: grid; place-items: center; width: 22px; flex: none; touch-action: none; }
.grip:active { cursor: grabbing; }
@media (max-width: 600px) { .ed-lesson .thumb { display: none; } }
.check-row { display: flex; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); align-items: flex-start; }
.check-row .ci { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--ok-bg); color: var(--ok); }
.check-row.no .ci { background: var(--warn-bg); color: var(--warn); }
.check-row.no { background: var(--warn-bg); }
.dropzone { border: 1.5px dashed var(--border-2); border-radius: 12px; padding: 16px; display: flex; align-items: center; gap: 14px; background: var(--surface-2); }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- Grafik ---------- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--text-3); font-size: 11px; font-family: var(--font); }
.chart .grid-line { stroke: var(--divider); stroke-width: 1; }
.hbar { display: flex; flex-direction: column; gap: 6px; }
.hbar .lbl { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.funnel-row { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px; align-items: center; font-size: 12.5px; }
.funnel-row .fb { height: 26px; border-radius: 8px; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: space-between; padding: 0 10px; font-weight: 600; font-size: 12px; min-width: 46px; white-space: nowrap; overflow: hidden; justify-content: flex-end; }
.funnel-row.critical .fb { background: var(--bad); }

/* ---------- Sertifikat ---------- */
.cert-preview { position: relative; aspect-ratio: 1.414/1; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); padding: 7%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; overflow: hidden; box-shadow: inset 0 0 0 6px var(--surface), inset 0 0 0 7px color-mix(in srgb, var(--accent) 40%, transparent); }
.cert-preview::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--accent); }
.cert-preview .who { font-size: clamp(16px, 2vw, 22px); font-weight: 700; letter-spacing: -.02em; margin: 4px 0; }
.cert-preview .what { color: var(--accent-ink); font-weight: 600; font-size: 13px; }
.cert-preview .lbl { font-size: 9px; letter-spacing: .14em; color: var(--text-3); text-transform: uppercase; }
.verify-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 760px) { .verify-grid { grid-template-columns: 1fr; } }
.kv { padding: 14px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.kv .k { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.kv .v { font-weight: 600; margin-top: 4px; }

/* ---------- Sumber belajar ---------- */
.res-card { display: flex; flex-direction: column; overflow: hidden; }
.res-cover { aspect-ratio: 16/10; display: grid; place-items: center; background: var(--surface-2); position: relative; overflow: hidden; }
.res-cover img { width: 100%; height: 100%; object-fit: cover; }
.res-cover .ri { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--surface); box-shadow: var(--shadow-2); }
.res-card .body { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.res-card .foot { padding: 12px 16px 16px; display: flex; gap: 8px; }

/* ---------- Autentikasi ---------- */
.auth-wrap { min-height: calc(100vh - 64px); display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 32px 24px; max-width: 1240px; margin: 0 auto; align-items: stretch; }
.auth-aside { border-radius: 24px; padding: 40px; background: linear-gradient(160deg, var(--accent-soft-2), var(--accent-soft) 55%, var(--surface)); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 28px; position: relative; overflow: hidden; }
.auth-card { padding: 32px; align-self: center; width: 100%; max-width: 520px; justify-self: center; }
@media (max-width: 900px) { .auth-wrap { grid-template-columns: 1fr; padding: 16px; } .auth-aside { display: none; } .auth-card { padding: 22px; } }

/* ---------- Misc ---------- */
.kbd-hint { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--text-3); }
.divider-text { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--text-3); font-weight: 600; }
.divider-text::before, .divider-text::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.swatch { width: 32px; height: 32px; border-radius: 9px; border: 2px solid transparent; cursor: pointer; display: grid; place-items: center; color: #fff; }
.swatch.active { border-color: var(--text); }
.code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); padding: 3px 7px; border-radius: 6px; }
.offline-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 1100; background: var(--warn); color: #fff; text-align: center; font-size: 12.5px; font-weight: 600; padding: 4px; }
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot .brand-mark { width: 52px; height: 52px; border-radius: 15px; font-size: 18px; animation: pulse 1.2s ease infinite; }
@keyframes pulse { 50% { opacity: .55; transform: scale(.96); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; } }
.ed-lesson .thumb-wrap { width: 92px; flex: none; }
.ed-lesson .thumb-wrap .thumb { width: 100%; }
@media (max-width: 600px) { .ed-lesson .thumb-wrap { display: none; } .ed-lesson { flex-wrap: wrap; } }
.sr-only:checked + * { }
.tabs label.tab { cursor: pointer; }
details > summary { list-style: none; } details > summary::-webkit-details-marker { display: none; }
.mv-stack { display: inline-flex; flex-direction: column; flex: none; }
.mv-stack .btn-icon.sm { width: 28px; min-height: 20px; height: 20px; }
.ed-chapter-head { flex-wrap: wrap; row-gap: 6px; }
.ed-lesson { gap: 10px; }
.ed-lesson .btn-icon.sm { width: 30px; }
.overlay.drawer .modal-body { flex: 1; }
.crumbs span { white-space: nowrap; }
.crumbs svg { flex: none; }

/* ---------- Mode demo ---------- */
:root { --demo-h: 0px; }
body.is-demo { --demo-h: 34px; padding-top: var(--demo-h); }
.demo-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 950; height: var(--demo-h); display: flex; align-items: center; gap: 12px; padding: 0 16px; background: #1E1B4B; color: #E0E7FF; font-size: 12.5px; }
.demo-bar .tag-caps { background: #FBBF24; color: #1E1B4B; padding: 3px 8px; border-radius: 999px; }
.demo-bar button, .demo-bar a { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 7px; border: 1px solid rgba(224, 231, 255, .25); background: transparent; color: #E0E7FF; font-size: 12px; font-weight: 600; cursor: pointer; text-decoration: none !important; }
.demo-bar button:hover, .demo-bar a:hover { background: rgba(224, 231, 255, .12); }
body.is-demo .sidebar { top: var(--demo-h); }
body.is-demo .topbar, body.is-demo .pub-top, body.is-demo .focus-top { top: var(--demo-h); }
body.is-demo .side-sticky { top: calc(84px + var(--demo-h)); }
body.is-demo .offline-bar { top: var(--demo-h); }
@media (max-width: 600px) { .demo-bar { gap: 6px; padding: 0 8px; } .demo-bar button { padding: 0 7px; } }

/* ---------- Cetak sertifikat ---------- */
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body > *:not(.overlay) { display: none !important; }
  body { padding: 0 !important; background: #fff !important; }
  .overlay { position: static !important; background: none !important; backdrop-filter: none !important; padding: 0 !important; display: block !important; }
  .overlay .modal { box-shadow: none !important; border: 0 !important; width: 100% !important; max-height: none !important; }
  .modal-head, .modal-foot { display: none !important; }
  .modal-body { padding: 0 !important; overflow: visible !important; }
  .cert-preview { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.print-cert .cert-preview { max-width: 780px; margin: 0 auto; }
@media print { .print-cert .cert-preview { max-width: none; } }
