:root {
  --bg: #fbf8f6;
  --surface: #ffffff;
  --surface-2: #f4eeeb;
  --text: #2a1f1d;
  --muted: #6f6360;
  --line: #e8dfdb;
  --brand: #b3261e;
  --brand-2: #8c1d18;
  --brand-soft: #fbe9e7;
  --ok: #2e7d4f;
  --ok-soft: #e3f3e9;
  --warn: #a35f00;
  --warn-soft: #fdf0dc;
  --info: #2b5fa8;
  --info-soft: #e5eefb;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(60, 30, 20, .06), 0 4px 16px rgba(60, 30, 20, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #181312; --surface: #221b1a; --surface-2: #2c2422; --text: #f3ebe8; --muted: #b3a6a2; --line: #3a302e;
    --brand: #ef6b5f; --brand-2: #ff8a7e; --brand-soft: #3a1f1c; --ok: #6cc890; --ok-soft: #1d3326;
    --warn: #f0b35a; --warn-soft: #3a2c16; --info: #7fb0f5; --info-soft: #1c2a40;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #181312; --surface: #221b1a; --surface-2: #2c2422; --text: #f3ebe8; --muted: #b3a6a2; --line: #3a302e;
  --brand: #ef6b5f; --brand-2: #ff8a7e; --brand-soft: #3a1f1c; --ok: #6cc890; --ok-soft: #1d3326;
  --warn: #f0b35a; --warn-soft: #3a2c16; --info: #7fb0f5; --info-soft: #1c2a40;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25); color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
img, svg { max-width: 100%; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.btn { display: inline-flex; align-items: center; gap: .4em; border: 1px solid transparent; background: var(--brand); color: #fff; padding: .6em 1.1em; border-radius: 999px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--brand-2); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.kecil { padding: .35em .8em; font-size: .875rem; }
.btn.bahaya { background: transparent; color: var(--brand); border-color: var(--brand); }
.btn:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .55em .75em; width: 100%; }
textarea { min-height: 8em; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
label { display: block; font-size: .875rem; font-weight: 600; margin: .8em 0 .3em; }
.muted { color: var(--muted); }
.kartu { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.lencana { display: inline-block; font-size: .75rem; font-weight: 700; padding: .15em .6em; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.lencana.ok { background: var(--ok-soft); color: var(--ok); }
.lencana.warn { background: var(--warn-soft); color: var(--warn); }
.lencana.bahaya { background: var(--brand-soft); color: var(--brand); }
.lencana.info { background: var(--info-soft); color: var(--info); }
[hidden] { display: none !important; }

/* ---------- landing ---------- */
.atas { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.atas .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; }
.logo { display: flex; align-items: center; gap: .5em; font-weight: 800; font-size: 1.15rem; color: var(--text); text-decoration: none; letter-spacing: .02em; }
.logo svg { width: 28px; height: 28px; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a.tautan { color: var(--muted); text-decoration: none; padding: .4em .7em; border-radius: 8px; font-size: .95rem; }
.nav a.tautan:hover { color: var(--text); background: var(--surface-2); }
@media (max-width: 760px) { .nav a.tautan { display: none; } }
.hero { padding: 56px 0 40px; }
.hero .wrap { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.1rem); letter-spacing: -.01em; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero p.lead { font-size: 1.125rem; color: var(--muted); max-width: 36em; }
.hero .aksi { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.hero-gambar { background: var(--brand-soft); border-radius: 28px; aspect-ratio: 1 / 1; display: grid; place-items: center; }
.hero-gambar svg { width: 70%; height: auto; }
@media (max-width: 760px) { .hero .wrap { grid-template-columns: 1fr; } .hero-gambar { max-width: 280px; margin: 0 auto; order: -1; } .hero { padding-top: 28px; } }
.angka { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 28px; }
.angka div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.angka b { display: block; font-size: 1.6rem; color: var(--brand); font-variant-numeric: tabular-nums; }
.angka span { font-size: .85rem; color: var(--muted); }
@media (max-width: 480px) { .angka { grid-template-columns: 1fr 1fr; } .angka div:last-child { grid-column: 1 / -1; } }
.bagian { padding: 56px 0; }
.bagian.alt { background: var(--surface-2); }
.bagian h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); }
.bagian .pengantar { color: var(--muted); max-width: 44em; margin-bottom: 28px; }
.kisi { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.kisi .kartu h3 { font-size: 1.1rem; }
.kisi .kartu p { margin: 0; color: var(--muted); }
.ikon { width: 42px; height: 42px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin-bottom: 12px; }
.ikon svg { width: 22px; height: 22px; }
.dua { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
@media (max-width: 760px) { .dua { grid-template-columns: 1fr; } }
.daftar-cek { list-style: none; padding: 0; margin: 0; }
.daftar-cek li { padding: .45em 0 .45em 1.8em; position: relative; border-bottom: 1px dashed var(--line); }
.daftar-cek li::before { content: ""; position: absolute; left: 0; top: .85em; width: 1em; height: 1em; border-radius: 50%; background: var(--brand-soft); box-shadow: inset 0 0 0 4px var(--brand); }
.tipe { display: grid; gap: 12px; }
.tipe .kartu { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; }
.tipe .tanda { font-weight: 800; color: var(--brand); background: var(--brand-soft); border-radius: 10px; padding: .3em .6em; font-size: .85rem; white-space: nowrap; }
.tipe p { margin: 0; color: var(--muted); }
.alur { counter-reset: n; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.alur .kartu { position: relative; padding-top: 44px; }
.alur .kartu::before { counter-increment: n; content: counter(n); position: absolute; top: 14px; left: 18px; width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; font-size: .85rem; display: grid; place-items: center; }
.sorot { background: var(--brand); color: #fff; border-radius: 24px; padding: 36px; display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; }
.sorot h2 { color: #fff; }
.sorot p { margin: 0; opacity: .9; }
.sorot .btn { background: #fff; color: var(--brand); }
@media (max-width: 760px) { .sorot { grid-template-columns: 1fr; padding: 24px; } }
details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 16px; margin-bottom: 10px; }
summary { cursor: pointer; font-weight: 600; padding: 14px 0; }
details p { margin: 0 0 14px; color: var(--muted); }
.kaki { padding: 32px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; }
.kaki .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }

/* ---------- login ---------- */
.tengah { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.kotak-login { width: 100%; max-width: 380px; }
.galat { color: var(--brand); font-size: .9rem; min-height: 1.4em; margin: .6em 0 0; }

/* ---------- admin ---------- */
.admin { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.sisi { background: var(--surface); border-right: 1px solid var(--line); padding: 16px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.sisi .logo { padding: 4px 8px 16px; }
.sisi a.menu { display: flex; align-items: center; gap: .6em; padding: .55em .75em; border-radius: 10px; color: var(--muted); text-decoration: none; font-size: .95rem; }
.sisi a.menu:hover { background: var(--surface-2); color: var(--text); }
.sisi a.menu.aktif { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.sisi .bawah { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--line); font-size: .85rem; }
.isi { padding: 24px; min-width: 0; }
.isi h1 { font-size: 1.5rem; }
.kepala-hal { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 18px; }
.kepala-hal p { margin: 0; }
.ponsel-atas { display: none; }
@media (max-width: 860px) {
  .admin { grid-template-columns: 1fr; }
  .sisi { position: fixed; inset: 0 30% 0 0; z-index: 30; transform: translateX(-105%); transition: transform .2s; height: 100vh; box-shadow: var(--shadow); }
  .sisi.buka { transform: none; }
  .ponsel-atas { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 20; }
  .isi { padding: 16px; }
}
.stat { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat .kartu { padding: 14px 16px; }
.stat b { display: block; font-size: 1.7rem; font-variant-numeric: tabular-nums; }
.stat span { font-size: .85rem; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 1000px) { .grid2 { grid-template-columns: 1fr; } }
.tabel-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: .6em .8em; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); position: sticky; top: 0; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tr.klik { cursor: pointer; }
tr.klik:hover td { background: var(--surface-2); }
td.angka-sel { font-variant-numeric: tabular-nums; white-space: nowrap; }
.alat { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: center; }
.alat input[type=search], .alat select { width: auto; flex: 1 1 180px; }
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 11px; }
.chart .batang { fill: var(--brand); }
.chart .batang:hover { fill: var(--brand-2); }
.chart .garis { stroke: var(--line); }
.bar-h { display: grid; grid-template-columns: 60px 1fr 40px; gap: 8px; align-items: center; margin: 6px 0; font-size: .9rem; }
.bar-h .isi-bar { height: 12px; border-radius: 6px; background: var(--brand); }
.bar-h .lintasan { background: var(--surface-2); border-radius: 6px; }
.modal { position: fixed; inset: 0; background: rgba(20, 10, 8, .45); z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal .kartu { width: 100%; max-width: 620px; max-height: 90vh; overflow-y: auto; }
.modal .tutup { float: right; }
.baris-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 560px) { .baris-form { grid-template-columns: 1fr; } }
.qr { background: #fff; padding: 12px; border-radius: 12px; display: inline-block; }
.qr img { display: block; width: 260px; height: 260px; }
.chat { display: flex; flex-direction: column; gap: 10px; min-height: 320px; max-height: 60vh; overflow-y: auto; padding: 12px; background: var(--surface-2); border-radius: 12px; margin-bottom: 10px; }
.gelembung { max-width: 85%; padding: .6em .9em; border-radius: 14px; white-space: pre-wrap; word-wrap: break-word; font-size: .95rem; }
.gelembung.saya { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.gelembung.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: .6em 1.1em; border-radius: 10px; z-index: 60; font-size: .9rem; box-shadow: var(--shadow); }
.pratinjau { white-space: pre-wrap; background: var(--surface-2); border-radius: 12px; padding: 12px; font-size: .92rem; }
.saklar { display: flex; align-items: center; gap: .6em; font-weight: 500; margin: .5em 0; font-size: .95rem; }
.saklar input { width: auto; }
.kosong { text-align: center; color: var(--muted); padding: 32px 12px; }
.chip { display: inline-flex; align-items: center; gap: .3em; padding: .15em .6em; border-radius: 999px; background: var(--surface-2); font-size: .82rem; margin: 2px; }
.chip button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 0 0 2px; font: inherit; }
code { background: var(--surface-2); padding: .1em .35em; border-radius: 6px; font-size: .88em; }
