/* Psychometrics Learning Lab - tampilan versi web */
:root {
  --page:#f4f6f9; --surface:#ffffff; --surface-2:#f7f9fb; --surface-3:#eef2f6;
  --ink:#14212d; --ink-2:#3b4b5a; --muted:#677a8b; --line:#e1e7ed; --line-2:#cbd5df;
  --brand:#2F6690; --brand-2:#1D9A8A; --brand-ink:#ffffff; --brand-soft:#e9f1f8; --brand-line:#c9dcea;
  --ok:#1d6a54; --ok-soft:#e9f5f0; --ok-line:#c4e1d6;
  --warn:#80590c; --warn-soft:#fbf4e4; --warn-line:#ecdcb2;
  --bad:#9c3b2a; --bad-soft:#fbeeea; --bad-line:#efd1c8;
  --code-bg:#0f1c27; --code-ink:#dbe7f1;
  --shadow-sm:0 1px 2px rgba(20,33,45,.05), 0 2px 8px rgba(20,33,45,.04);
  --shadow-md:0 2px 6px rgba(20,33,45,.06), 0 12px 32px rgba(20,33,45,.08);
  --radius:14px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* grafik */
  --chart-bg:#ffffff; --chart-fg:#14212d; --chart-text:#14212d; --chart-muted:#5b6d7d; --chart-grid:#e8edf2;
  --accent:#2F6690;
  --c1:#2F6690; --c2:#C0583F; --c3:#1D8A73; --c4:#7A5BA6; --c5:#B0841E; --c6:#4E6577; --c7:#D17FA6; --c8:#5C9BD1;
  --heat-lo:#eef4fb; --heat-hi:#0b3d78;
}
:root[data-theme="dark"] {
  --page:#0d151c; --surface:#141e27; --surface-2:#18242f; --surface-3:#1e2c38;
  --ink:#e4ebf1; --ink-2:#b9c6d1; --muted:#8a9bab; --line:#26333f; --line-2:#364553;
  --brand:#7fb0d6; --brand-2:#5fc6b5; --brand-ink:#0d151c; --brand-soft:#16293a; --brand-line:#28435a;
  --ok:#6cc3a6; --ok-soft:#132c25; --ok-line:#245043;
  --warn:#d9b56a; --warn-soft:#2a2416; --warn-line:#4a3d1e;
  --bad:#e1927e; --bad-soft:#2f1c17; --bad-line:#513027;
  --code-bg:#0a1117; --code-ink:#d6e2ec;
  --shadow-sm:0 1px 2px rgba(0,0,0,.35), 0 2px 8px rgba(0,0,0,.25);
  --shadow-md:0 2px 6px rgba(0,0,0,.4), 0 12px 32px rgba(0,0,0,.35);
  --chart-bg:#141e27; --chart-fg:#e4ebf1; --chart-text:#e4ebf1; --chart-muted:#a3b3c1; --chart-grid:#25323e;
  --accent:#7fb0d6;
  --c1:#7fb0d6; --c2:#ec9a83; --c3:#64c7aa; --c4:#c2a7ee; --c5:#e2c26a; --c6:#a9bccb; --c7:#f0a9c9; --c8:#9fd0ff;
  --heat-lo:#18222e; --heat-hi:#9fd0ff;
}
* { box-sizing:border-box; }
html { scroll-behavior:smooth; }
body { margin:0; background:var(--page); color:var(--ink); font-family:var(--font); font-size:15px; line-height:1.55;
  -webkit-font-smoothing:antialiased; }
a { color:var(--brand); }
h1, h2, h3, h4 { letter-spacing:-.015em; }
code { font-family:var(--mono); font-size:.9em; background:var(--surface-3); border-radius:5px; padding:1px 5px; }
.hidden { display:none !important; }
button { font-family:inherit; }

/* ---------------- navbar ---------------- */
.topbar { position:sticky; top:0; z-index:100; backdrop-filter:saturate(1.4) blur(12px); -webkit-backdrop-filter:saturate(1.4) blur(12px);
  background:color-mix(in srgb, var(--surface) 86%, transparent); border-bottom:1px solid var(--line); }
.topbar-inner { max-width:1600px; margin:0 auto; display:flex; align-items:center; gap:16px; padding:0 18px; height:62px; }
.brand { display:flex; align-items:center; gap:10px; text-decoration:none; color:var(--ink); white-space:nowrap; flex-shrink:0; }
.brand img { width:34px; height:34px; border-radius:9px; display:block; }
.brand-name { font-weight:800; font-size:15.5px; line-height:1.1; }
.brand-sub { font-size:11px; color:var(--muted); font-weight:600; letter-spacing:.02em; }
.nav { display:flex; gap:4px; overflow-x:auto; scrollbar-width:none; flex:1; padding:4px 0; }
.nav::-webkit-scrollbar { display:none; }
.nav button { border:0; background:none; color:var(--muted); font-weight:650; font-size:14px; padding:8px 13px; border-radius:999px;
  cursor:pointer; white-space:nowrap; transition:background .15s, color .15s; }
.nav button:hover { color:var(--ink); background:var(--surface-3); }
.nav button.active { color:var(--brand-ink); background:var(--brand); }
.icon-btn { width:38px; height:38px; border-radius:11px; border:1px solid var(--line); background:var(--surface); color:var(--ink);
  display:inline-flex; align-items:center; justify-content:center; cursor:pointer; flex-shrink:0; }
.icon-btn:hover { background:var(--surface-3); }
.icon-btn svg { width:18px; height:18px; }
@media (max-width: 860px) {
  .topbar-inner { flex-wrap:wrap; height:auto; padding:8px 12px 6px; gap:8px; }
  .brand { flex:1; }
  .nav { order:3; flex-basis:100%; }
}

main { max-width:1600px; margin:0 auto; padding:0 18px 20px; }
.page { display:none; animation:fade .2s ease; }
.page.active { display:block; }
@keyframes fade { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:none; } }

/* ---------------- beranda ---------------- */
.home-hero { position:relative; overflow:hidden; margin:22px 0 22px; border-radius:24px; padding:46px 44px 40px; color:#fff;
  background:radial-gradient(1200px 400px at 90% -20%, rgba(255,255,255,.14), transparent 60%), linear-gradient(125deg, #173d5c 0%, #2F6690 52%, #1D9A8A 100%); }
:root[data-theme="dark"] .home-hero { background:radial-gradient(1200px 400px at 90% -20%, rgba(255,255,255,.08), transparent 60%), linear-gradient(125deg, #0f2a40 0%, #1f4a6b 55%, #146d63 100%); }
.home-hero svg.deco { position:absolute; right:-40px; bottom:-30px; width:520px; opacity:.18; pointer-events:none; }
.home-hero .eyebrow { display:inline-flex; align-items:center; gap:8px; font-size:12.5px; font-weight:700; letter-spacing:.06em; text-transform:uppercase;
  background:rgba(255,255,255,.14); padding:5px 11px; border-radius:999px; }
.home-hero h1 { font-size:clamp(28px, 4vw, 44px); line-height:1.08; margin:16px 0 12px; max-width:760px; }
.home-hero p { font-size:17px; line-height:1.6; max-width:720px; margin:0 0 22px; color:rgba(255,255,255,.88); }
.hero-actions { display:flex; gap:10px; flex-wrap:wrap; }
.btn-hero { background:#fff; color:#173d5c; border:0; border-radius:12px; padding:11px 18px; font-weight:750; font-size:15px; cursor:pointer; text-decoration:none; }
.btn-hero.ghost { background:rgba(255,255,255,.12); color:#fff; border:1px solid rgba(255,255,255,.35); }
.hero-stats { display:flex; gap:26px; flex-wrap:wrap; margin-top:28px; font-size:13.5px; color:rgba(255,255,255,.85); }
.hero-stats strong { display:block; font-size:22px; color:#fff; }
@media (max-width: 640px) { .home-hero { padding:30px 22px; border-radius:18px; } .home-hero svg.deco { width:320px; } }

.section-title { scroll-margin-top:90px; display:flex; align-items:baseline; justify-content:space-between; gap:10px; margin:30px 2px 12px; }
.section-title h2 { margin:0; font-size:21px; }
.section-title span { color:var(--muted); font-size:13.5px; text-align:right; }
@media (max-width: 640px) { .section-title span { display:none; } }
.module-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(280px, 1fr)); gap:16px; }
a.module-card { text-decoration:none; color:inherit; }
.module-card { background:var(--surface); border:1px solid var(--line); border-radius:18px; padding:20px; box-shadow:var(--shadow-sm);
  display:flex; flex-direction:column; gap:10px; cursor:pointer; transition:transform .15s, box-shadow .15s, border-color .15s; text-align:left; color:inherit; font:inherit; }
.module-card:hover { transform:translateY(-2px); box-shadow:var(--shadow-md); border-color:var(--brand-line); }
.module-icon { width:44px; height:44px; border-radius:12px; display:flex; align-items:center; justify-content:center; background:var(--brand-soft); color:var(--brand); }
.module-icon svg { width:24px; height:24px; }
.module-card h3 { margin:2px 0 0; font-size:17px; }
.module-card p { margin:0; color:var(--ink-2); font-size:14px; line-height:1.55; flex:1; }
.module-card .go { font-weight:700; color:var(--brand); font-size:14px; }
.module-card.external { background:linear-gradient(135deg, var(--brand-soft), var(--surface)); }
.guide-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(300px, 1fr)); gap:16px; }
.guide-card { background:var(--surface); border:1px solid var(--line); border-radius:18px; padding:20px 22px; box-shadow:var(--shadow-sm); }
.guide-card h3 { margin:0 0 10px; font-size:16.5px; }
.guide-card p, .guide-card li { color:var(--ink-2); font-size:14.2px; line-height:1.6; }
.guide-card ol, .guide-card ul { padding-left:20px; margin:6px 0 0; }
.guide-card li { margin-bottom:6px; }

/* ---------------- halaman modul ---------------- */
.module-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; flex-wrap:wrap; padding:24px 2px 16px; }
.module-head .t { display:flex; gap:14px; align-items:flex-start; }
.module-head .module-icon { width:48px; height:48px; flex-shrink:0; }
.module-head h1 { margin:0; font-size:26px; }
.module-head p { margin:4px 0 0; color:var(--ink-2); max-width:820px; font-size:15px; }
.head-actions { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.layout { display:grid; grid-template-columns:330px minmax(0, 1fr); gap:20px; align-items:start; }
@media (max-width: 1020px) { .layout { grid-template-columns:minmax(0, 1fr); } }
.layout > * { min-width:0; }
.sidebar { position:sticky; top:78px; max-height:calc(100vh - 92px); overflow-y:auto; scrollbar-width:thin; padding-right:2px; overscroll-behavior:contain; }
.sidebar.has-more { -webkit-mask-image:linear-gradient(to bottom, #000 calc(100% - 48px), transparent); mask-image:linear-gradient(to bottom, #000 calc(100% - 48px), transparent); }
@media (max-width: 1020px) { .sidebar { position:static; max-height:none; overflow:visible; } }
.panel { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:16px; box-shadow:var(--shadow-sm); margin-bottom:14px; }
.panel h3 { font-size:13px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); margin:0 0 12px; font-weight:800; }
.panel.accent { background:var(--brand-soft); border-color:var(--brand-line); }
.panel.accent h3 { color:var(--brand); }

details.help { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); margin-bottom:14px; box-shadow:var(--shadow-sm); }
details.help summary { list-style:none; cursor:pointer; padding:13px 16px; font-weight:750; font-size:14px; display:flex; align-items:center; gap:9px; }
details.help summary::-webkit-details-marker { display:none; }
details.help summary::before { content:""; width:8px; height:8px; border-right:2px solid var(--brand); border-bottom:2px solid var(--brand); transform:rotate(-45deg); transition:transform .15s; margin-left:2px; }
details.help[open] summary::before { transform:rotate(45deg); }
details.help .body { padding:0 16px 14px; color:var(--ink-2); font-size:13.8px; line-height:1.62; }
details.help .body p { margin:0 0 9px; }

/* ---------------- kontrol ---------------- */
.field { margin-bottom:14px; }
.field:last-child { margin-bottom:0; }
.field label, .field .label { display:flex; justify-content:space-between; align-items:baseline; gap:8px; font-weight:650; font-size:13.5px; margin-bottom:6px; color:var(--ink); }
.field .val { font-family:var(--mono); font-size:12.5px; font-weight:700; color:var(--brand); background:var(--brand-soft); padding:1px 8px; border-radius:999px; }
.field .hint { font-size:12px; color:var(--muted); margin-top:5px; line-height:1.45; }
select, input[type=number], input[type=text] { width:100%; font:inherit; font-size:14px; color:var(--ink); background:var(--surface);
  border:1px solid var(--line-2); border-radius:10px; padding:8px 10px; transition:border-color .15s, box-shadow .15s; }
select:focus, input[type=number]:focus, input[type=text]:focus { outline:0; border-color:var(--brand); box-shadow:0 0 0 3px var(--brand-soft); }
input[type=range] { -webkit-appearance:none; appearance:none; width:100%; height:22px; background:transparent; cursor:pointer; }
input[type=range]::-webkit-slider-runnable-track { height:6px; border-radius:999px; background:linear-gradient(to right, var(--brand) var(--pct, 50%), var(--surface-3) var(--pct, 50%)); }
input[type=range]::-moz-range-track { height:6px; border-radius:999px; background:var(--surface-3); }
input[type=range]::-moz-range-progress { height:6px; border-radius:999px; background:var(--brand); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance:none; width:18px; height:18px; border-radius:50%; background:var(--surface); border:3px solid var(--brand); margin-top:-6px; box-shadow:0 1px 3px rgba(0,0,0,.2); }
input[type=range]::-moz-range-thumb { width:13px; height:13px; border-radius:50%; background:var(--surface); border:3px solid var(--brand); }
.seg { display:flex; flex-direction:column; gap:6px; }
.seg label { display:flex; gap:9px; align-items:flex-start; font-weight:500; font-size:13.8px; cursor:pointer; padding:8px 10px; border:1px solid var(--line); border-radius:10px; margin:0; }
.seg label:has(input:checked) { border-color:var(--brand); background:var(--brand-soft); }
.seg input { margin-top:3px; accent-color:var(--brand); }
.seed-row { display:flex; gap:8px; }
.seed-row input { flex:1; }
.item-card { border:1px solid var(--line); border-radius:12px; margin-bottom:8px; background:var(--surface-2); }
.item-card summary { list-style:none; cursor:pointer; padding:9px 12px; display:flex; justify-content:space-between; gap:8px; align-items:center; font-size:13.5px; }
.item-card summary::-webkit-details-marker { display:none; }
.item-card summary strong { font-weight:750; }
.item-card summary span { font-family:var(--mono); font-size:11.5px; color:var(--muted); }
.item-card .inner { padding:4px 12px 12px; }
.item-card .field { margin-bottom:10px; }

.btn { font:inherit; font-weight:650; font-size:14px; border-radius:10px; border:1px solid var(--line-2); background:var(--surface); color:var(--ink);
  padding:8px 14px; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; gap:7px; text-decoration:none; transition:background .15s, border-color .15s; }
.btn:hover { background:var(--surface-3); }
.btn svg { width:16px; height:16px; }
.btn-primary { background:var(--brand); border-color:var(--brand); color:var(--brand-ink); }
.btn-primary:hover { background:color-mix(in srgb, var(--brand) 86%, #000); }
.btn-sm { font-size:12.5px; padding:5px 10px; border-radius:8px; }
.btn-block { width:100%; }

/* ---------------- metrik ---------------- */
.metrics { display:grid; grid-template-columns:repeat(auto-fit, minmax(132px, 1fr)); gap:12px; margin-bottom:16px; }
.metric { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:14px 16px; box-shadow:var(--shadow-sm); position:relative; overflow:hidden; }
.metric::before { content:""; position:absolute; left:0; top:0; bottom:0; width:4px; background:var(--brand); opacity:.85; }
.metric:nth-child(3n+2)::before { background:var(--brand-2); }
.metric:nth-child(3n)::before { background:var(--c2); }
.metric .k { font-size:11.5px; color:var(--muted); font-weight:750; text-transform:uppercase; letter-spacing:.05em; line-height:1.3; }
.metric .v { font-size:24px; font-weight:800; margin-top:4px; font-variant-numeric:tabular-nums; line-height:1.15; letter-spacing:-.02em; }
.metric .s { font-size:12px; color:var(--muted); margin-top:3px; line-height:1.4; }

/* ---------------- tab ---------------- */
.tabs { display:flex; gap:4px; padding:4px; background:var(--surface-3); border-radius:12px; margin-bottom:14px; overflow-x:auto; scrollbar-width:none; }
.tabs::-webkit-scrollbar { display:none; }
.tabs button { border:0; background:none; color:var(--muted); font-weight:650; font-size:13.8px; padding:8px 13px; border-radius:9px; cursor:pointer; white-space:nowrap; }
.tabs button:hover { color:var(--ink); }
.tabs button.active { background:var(--surface); color:var(--ink); box-shadow:var(--shadow-sm); }
.tabpage { display:none; }
.tabpage.active { display:block; animation:fade .18s ease; }
.grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.grid-3 { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:12px; }
@media (max-width: 1180px) { .grid-3 { grid-template-columns:1fr 1fr; } }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns:1fr; } }

/* ---------------- kartu konten ---------------- */
.card { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:18px 20px; box-shadow:var(--shadow-sm); margin-bottom:14px; }
.card h4 { margin:0 0 8px; font-size:16px; }
.card p { margin:0 0 9px; color:var(--ink-2); line-height:1.65; }
.card p:last-child { margin-bottom:0; }
.insight { background:var(--warn-soft); border:1px solid var(--warn-line); border-radius:var(--radius); padding:14px 18px; color:var(--ink-2); line-height:1.6; margin-bottom:14px; }
.note { border:1px solid var(--line); border-left:4px solid var(--brand); background:var(--surface-2); border-radius:10px; padding:12px 14px; font-size:13.8px; line-height:1.62; color:var(--ink-2); margin:0 0 14px; }
.note strong { color:var(--ink); }
.note .formula { display:block; margin-top:7px; font-family:var(--mono); font-size:12px; color:var(--muted); }
.status { border-radius:10px; padding:11px 14px; font-size:13.8px; line-height:1.55; margin:0 0 12px; border:1px solid; }
.status.ok { background:var(--ok-soft); border-color:var(--ok-line); }
.status.warn { background:var(--warn-soft); border-color:var(--warn-line); }
.status.bad { background:var(--bad-soft); border-color:var(--bad-line); }
.dl-row { display:flex; gap:8px; flex-wrap:wrap; margin:2px 0 14px; }
.mini-table { width:100%; border-collapse:collapse; font-size:13.5px; margin:8px 0 10px; }
.mini-table th, .mini-table td { padding:7px 9px; border-bottom:1px solid var(--line); text-align:left; }
.mini-table th { color:var(--muted); font-size:12px; text-transform:uppercase; letter-spacing:.04em; }

/* ---------------- grafik & tabel ---------------- */
.chart-card { position:relative; background:var(--chart-bg); border:1px solid var(--line); border-radius:var(--radius); padding:8px 8px 4px; margin-bottom:14px; min-height:120px; box-shadow:var(--shadow-sm); }
.chart-card svg { display:block; width:100%; height:auto; }
.chart-tools { position:absolute; top:9px; right:10px; display:flex; gap:6px; opacity:0; transition:opacity .15s; }
.chart-card:hover .chart-tools, .chart-card:focus-within .chart-tools { opacity:1; }
@media (hover: none) { .chart-tools { opacity:1; } }
.chart-tools .btn { font-size:12px; padding:4px 9px; border-radius:8px; }
.chart-empty { display:flex; align-items:center; justify-content:center; color:var(--muted); min-height:180px; font-size:14px; text-align:center; padding:20px; }
.table-wrap { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:10px 12px 8px; margin-bottom:14px; box-shadow:var(--shadow-sm); }
.table-head { display:flex; justify-content:space-between; align-items:center; gap:8px; flex-wrap:wrap; margin:2px 2px 8px; }
.table-head .title { font-weight:750; font-size:14.5px; }
.table-head .btn { font-size:12px; padding:4px 10px; border-radius:8px; }
.table-scroll { overflow-x:auto; }
table.dt { border-collapse:collapse; width:100%; font-size:13.5px; font-variant-numeric:tabular-nums; }
table.dt th, table.dt td { padding:8px 10px; border-bottom:1px solid var(--line); text-align:left; white-space:nowrap; }
table.dt th { font-weight:750; font-size:12px; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; }
table.dt th.sortable { cursor:pointer; }
table.dt td.num, table.dt th.num { text-align:right; }
table.dt tbody tr:hover { background:var(--surface-2); }
table.dt tbody tr.hl { background:var(--warn-soft); }
table.dt input.colfilter { width:100%; min-width:58px; font-size:12px; padding:4px 7px; border-radius:7px; }
.table-foot { display:flex; justify-content:space-between; align-items:center; gap:8px; flex-wrap:wrap; font-size:12.5px; color:var(--muted); margin-top:8px; }
.pager { display:flex; gap:4px; align-items:center; }
.pager .btn { font-size:12px; padding:3px 9px; }
.small-note { color:var(--muted); font-size:12.5px; line-height:1.5; }

/* ---------------- syntax R ---------------- */
.code-wrap { border-radius:var(--radius); overflow:hidden; border:1px solid var(--line); box-shadow:var(--shadow-sm); }
.code-head { display:flex; align-items:center; gap:8px; padding:10px 14px; background:var(--surface); border-bottom:1px solid var(--line); flex-wrap:wrap; }
.code-head span { font-size:12px; font-weight:800; letter-spacing:.05em; text-transform:uppercase; color:var(--muted); margin-right:auto; }
pre.code { margin:0; background:var(--code-bg); color:var(--code-ink); padding:16px 18px; overflow:auto; max-height:620px; font-family:var(--mono); font-size:12.8px; line-height:1.62; }
pre.code .c { color:#7f9bb0; font-style:italic; }
pre.code .s { color:#9ad4a1; }
pre.code .n { color:#f2c37f; }
pre.code .k { color:#8ec5ff; }

/* ---------------- toast & footer ---------------- */
#toasts { position:fixed; right:16px; bottom:16px; z-index:4000; display:flex; flex-direction:column; gap:8px; max-width:min(420px, calc(100vw - 32px)); }
.toast { background:var(--surface); color:var(--ink); border:1px solid var(--line); border-left:4px solid var(--brand); border-radius:12px; padding:11px 14px;
  box-shadow:var(--shadow-md); font-size:14px; animation:fade .18s ease; }
.toast.success { border-left-color:var(--ok); } .toast.warning { border-left-color:var(--warn); } .toast.error { border-left-color:var(--bad); }
.footer { max-width:1600px; margin:24px auto 0; padding:22px 18px 30px; color:var(--muted); font-size:13px; display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; border-top:1px solid var(--line); }
.footer a { color:var(--muted); }
