:root {
  --forest: #06335a;      /* biru tua (turunan biru lambang) */
  --forest-2: #04243f;
  --jade: #0a86c8;        /* biru lambang */
  --sky: #00a2e9;
  --jade-soft: #d8f0fc;
  --paper: #eef7fc;
  --card: #ffffff;
  --gold: #ffd21f;        /* kuning lambang */
  --gold-soft: #fff1b0;
  --ink: #12222f;
  --muted: #5b7385;
  --line: #d3e6f1;
  --danger: #d9232b;      /* merah lambang */
  --danger-soft: #fde1e2;
  --ok: #1f9d4d;          /* hijau lambang */
  --ok-soft: #dff3e6;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(6, 51, 90, .06), 0 8px 24px rgba(6, 51, 90, .09);
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --body: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.45; }
body { min-height: 100vh; min-height: 100dvh; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, select { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- splash ---------- */
#splash { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; color: var(--paper);
  background: radial-gradient(110% 80% at 50% 30%, #0d5a99 0%, var(--forest) 55%, var(--forest-2) 100%);
  transition: opacity .5s ease, visibility .5s; }
#splash.hide { opacity: 0; visibility: hidden; }
.splash-inner { text-align: center; position: relative; animation: rise .8s cubic-bezier(.2, .8, .2, 1) both; }
.splash-logo { width: 150px; height: auto; filter: drop-shadow(0 14px 28px rgba(0, 0, 0, .35)); animation: pulse 2.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.045); } }
#splash h1 { font-family: var(--display); font-size: 34px; margin: 18px 0 2px; letter-spacing: .2px; }
#splash p { margin: 0; opacity: .75; letter-spacing: 2px; text-transform: uppercase; font-size: 11px; }
.splash-bar { width: 120px; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .18); margin: 28px auto 0; overflow: hidden; }
.splash-bar span { display: block; height: 100%; width: 40%; background: var(--gold); border-radius: 3px; animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- kerangka ---------- */
.shell { max-width: 560px; margin: 0 auto; min-height: 100dvh; padding: 0 16px calc(96px + var(--safe-b)); }
.topbar { display: flex; align-items: center; gap: 10px; padding: calc(14px + var(--safe-t)) 0 10px; }
.topbar .brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.topbar img { width: 38px; height: auto; filter: drop-shadow(0 2px 3px rgba(6, 51, 90, .25)); }
.topbar .t1 { font-family: var(--display); font-weight: 700; font-size: 18px; line-height: 1.1; }
.topbar .t2 { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--card); border: 1px solid var(--line); }
.icon-btn svg { width: 20px; height: 20px; }
.year-pill { height: 40px; padding: 0 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-weight: 600; appearance: none; -webkit-appearance: none; }

h2.section { font-family: var(--display); font-size: 20px; margin: 22px 0 10px; }
.sub { color: var(--muted); font-size: 13px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 16px; }

/* ---------- hero beranda ---------- */
.hero { position: relative; overflow: hidden; border-radius: 26px; padding: 20px; color: var(--paper);
  background: radial-gradient(130% 120% at 100% 0%, #27b9f5 0%, var(--jade) 32%, var(--forest) 78%);
  box-shadow: 0 18px 40px rgba(6, 51, 90, .32); }
.hero::after { content: ''; position: absolute; right: -40px; bottom: -60px; width: 220px; height: 220px; border-radius: 50%;
  background: repeating-radial-gradient(circle, rgba(255, 255, 255, .07) 0 2px, transparent 2px 14px); }
.hero .label { font-size: 11.5px; letter-spacing: 1.6px; text-transform: uppercase; opacity: .8; }
.hero .big { font-family: var(--display); font-size: 31px; font-weight: 700; margin: 4px 0 2px; }
.hero .of { opacity: .8; font-size: 13px; }
.hero-row { display: flex; align-items: center; gap: 16px; position: relative; z-index: 1; }
.ring { width: 92px; height: 92px; flex: none; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .pct { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-size: 21px; font-weight: 700; }
.hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; position: relative; z-index: 1; }
.hero-stats div { background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .14); border-radius: 14px; padding: 10px 12px; backdrop-filter: blur(4px); }
.hero-stats b { display: block; font-size: 16px; }
.hero-stats span { font-size: 11.5px; opacity: .8; }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 16px; border-radius: 14px; font-weight: 700; transition: transform .08s ease, box-shadow .2s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--gold); color: #3a2d00; box-shadow: 0 6px 16px rgba(255, 210, 31, .45); }
.btn.dark { background: var(--forest); color: var(--paper); }
.btn.ghost { background: var(--card); border: 1px solid var(--line); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.sm { padding: 8px 12px; border-radius: 11px; font-size: 13px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn svg { width: 18px; height: 18px; }

/* ---------- daftar ---------- */
.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row .main { flex: 1; min-width: 0; }
.row .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .nop { font-size: 12px; color: var(--muted); letter-spacing: .2px; }
.row .amt { font-weight: 700; text-align: right; white-space: nowrap; }
.row .amt small { display: block; font-weight: 500; font-size: 11px; color: var(--muted); }
.row.tap { cursor: pointer; }
.row.tap:active { background: #e6f3fb; }
.badge { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; letter-spacing: .3px; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.no { background: var(--danger-soft); color: var(--danger); }

.check { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--ok); color: var(--ok); display: grid; place-items: center; flex: none; transition: all .15s; }
.check svg { width: 22px; height: 22px; }
.check:active { background: var(--ok); color: #fff; transform: scale(.92); }
.check.done { background: var(--ok); color: #fff; }
.check.undo { border-color: var(--danger); color: var(--danger); }

.group-h { position: sticky; top: 0; z-index: 3; background: var(--paper); padding: 8px 2px 6px; margin-top: 8px; display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--forest); }
.group-h span:last-child { color: var(--muted); font-weight: 500; text-transform: none; letter-spacing: 0; }

.search { position: relative; margin: 6px 0 10px; }
.search input { width: 100%; padding: 13px 14px 13px 42px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); outline: none; }
.search input:focus, .field input:focus, .field select:focus { border-color: var(--jade); box-shadow: 0 0 0 3px rgba(10, 134, 200, .18); }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 19px; height: 19px; color: var(--muted); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 13px; font-weight: 600; white-space: nowrap; }
.chip.on { background: var(--forest); color: var(--paper); border-color: var(--forest); }

.date-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.date-card label { font-size: 11.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); display: block; }
.date-card input { border: 0; background: none; font-family: var(--display); font-size: 20px; font-weight: 700; padding: 0; outline: none; width: 100%; }
.today-sum { margin-left: auto; text-align: right; white-space: nowrap; }
.today-sum b { display: block; font-size: 15px; }
.today-sum span { font-size: 11.5px; color: var(--muted); }

.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-family: var(--display); font-size: 18px; margin-bottom: 4px; }

/* ---------- laporan ---------- */
.rep { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-bottom: 1px solid var(--line); }
.rep:last-child { border-bottom: 0; }
.rep .d { width: 48px; height: 52px; border-radius: 12px; background: var(--forest); color: var(--paper); display: grid; place-items: center; text-align: center; line-height: 1.05; flex: none; }
.rep .d b { font-family: var(--display); font-size: 20px; display: block; }
.rep .d span { font-size: 10px; letter-spacing: 1px; text-transform: uppercase; opacity: .8; }
.rep .main { flex: 1; min-width: 0; }
.rep .main b { display: block; }
.rep .btns { display: flex; gap: 6px; }
.doc-card { display: flex; align-items: center; gap: 14px; padding: 14px; }
.doc-card .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--gold-soft); color: #7a5c00; flex: none; }
.doc-card .ic svg { width: 22px; height: 22px; }
.doc-card .main { flex: 1; }
.doc-card .main b { display: block; }

/* ---------- navigasi bawah ---------- */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: center; padding: 0 12px calc(10px + var(--safe-b)); pointer-events: none; }
.nav-inner { pointer-events: auto; width: 100%; max-width: 536px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 6px; border-radius: 22px;
  background: rgba(6, 51, 90, .96); backdrop-filter: blur(10px); box-shadow: 0 14px 34px rgba(4, 36, 63, .45); }
.nav button { display: grid; justify-items: center; gap: 2px; padding: 8px 0 7px; border-radius: 16px; color: rgba(246, 241, 231, .62); font-size: 11px; font-weight: 600; transition: all .15s; }
.nav button svg { width: 22px; height: 22px; }
.nav button.on { color: #3a2d00; background: var(--gold); }

/* ---------- sheet & form ---------- */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(4, 28, 48, .55); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s both; }
.sheet { width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto; background: var(--paper); border-radius: 26px 26px 0 0; padding: 10px 18px calc(22px + var(--safe-b)); animation: up .28s cubic-bezier(.2, .8, .2, 1) both; }
.sheet .grab { width: 42px; height: 5px; border-radius: 5px; background: var(--line); margin: 0 auto 12px; }
.sheet h3 { font-family: var(--display); font-size: 21px; margin: 4px 0 14px; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 5px; letter-spacing: .3px; }
.field input, .field select { width: 100%; padding: 12px 13px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); outline: none; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sheet .btns { display: flex; gap: 10px; margin-top: 16px; }
.sheet .btns .btn { flex: 1; }
.hint { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }
details.acc { border: 1px solid var(--line); border-radius: 14px; background: var(--card); margin-bottom: 10px; padding: 0 14px; }
details.acc summary { padding: 13px 0; font-weight: 700; cursor: pointer; }
details.acc[open] { padding-bottom: 6px; }

#toast { position: fixed; left: 50%; width: max-content; bottom: calc(92px + var(--safe-b)); transform: translate(-50%, 20px); z-index: 80; background: var(--ink); color: #fff; padding: 11px 14px; border-radius: 14px; max-width: min(92vw, 500px); display: flex; gap: 14px; align-items: center; opacity: 0; pointer-events: none; transition: all .25s; font-size: 13.5px; box-shadow: 0 10px 28px rgba(0, 0, 0, .3); }
#toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#toast button { color: var(--gold); font-weight: 700; white-space: nowrap; }
#toast.err { background: var(--danger); }

.fab { position: fixed; right: max(16px, calc(50% - 272px)); bottom: calc(96px + var(--safe-b)); z-index: 15; width: 56px; height: 56px; border-radius: 18px; background: var(--gold); color: #3a2d00; display: grid; place-items: center; box-shadow: 0 10px 24px rgba(255, 210, 31, .5); }
.fab svg { width: 26px; height: 26px; }

/* ---------- layar masuk / setup ---------- */
.gate { min-height: 100dvh; display: grid; place-items: center; padding: 20px; background: radial-gradient(110% 80% at 50% 30%, #0d5a99 0%, var(--forest) 55%, var(--forest-2) 100%); }
.gate .box { width: 100%; max-width: 400px; background: var(--paper); border-radius: 26px; padding: 26px 22px; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }
.gate img.gate-logo { width: 74px; height: auto; display: block; margin: 0 0 12px; filter: drop-shadow(0 6px 10px rgba(6, 51, 90, .25)); }
.gate h1 { font-family: var(--display); font-size: 26px; margin: 0 0 4px; }
.gate p { margin: 0 0 18px; color: var(--muted); }
.gate .btn { width: 100%; margin-top: 6px; }
.gate .link { display: block; text-align: center; margin-top: 14px; font-size: 13px; color: var(--jade); font-weight: 600; }
.err-msg { color: var(--danger); font-size: 13px; margin-top: 8px; min-height: 18px; }

@media (min-width: 700px) { .shell { padding-top: 10px; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- tambahan v2 ---------- */
.pp { margin-bottom: 13px; }
.pp:last-child { margin-bottom: 0; }
.pp[data-act] { cursor: pointer; }
.bar { height: 7px; border-radius: 7px; background: var(--line); margin-top: 5px; overflow: hidden; }
.bar div { height: 100%; background: linear-gradient(90deg, var(--sky), var(--ok)); border-radius: 7px; }
.me-card { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); margin-bottom: 10px; }
.me-card img { width: 40px; height: auto; }
.me-card b { display: block; }
select { font: inherit; color: inherit; }
[data-act="kopak-sel"], [data-act="lap-kopak"] { width: 100%; padding: 12px 13px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-weight: 600; }
.imp-k { border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px; background: var(--card); margin: 6px 0; }
.imp-k select { padding: 7px 8px; border-radius: 9px; border: 1px solid var(--line); background: var(--card); }
#splash h1 { text-shadow: 0 2px 12px rgba(0, 0, 0, .25); }

.splash-inner::before { content: ''; position: absolute; left: 50%; top: 0; width: 260px; height: 260px; transform: translate(-50%, -22px); border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .26) 0%, rgba(255, 255, 255, .08) 45%, transparent 70%); z-index: -1; }


/* ---------- tambahan v3: pilih banyak, rincian, audit ---------- */
.search-row { display: flex; gap: 8px; align-items: stretch; margin: 6px 0 10px; }
.search-row .search { flex: 1; margin: 0; }
.sel-btn { width: 48px; height: auto; border-radius: 14px; }
.sel-btn.on { background: var(--gold); border-color: var(--gold); color: #3a2d00; }
.shell.pilih { padding-bottom: calc(176px + var(--safe-b)); }
.cb { width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--line); flex: none; display: grid; place-items: center; color: transparent; background: var(--card); transition: all .12s; }
.cb svg { width: 15px; height: 15px; }
.cb.on { background: var(--jade); border-color: var(--jade); color: #fff; }
.row.picked { background: #e6f3fb; }
.selbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(86px + var(--safe-b)); z-index: 18; width: min(calc(100% - 24px), 536px);
  display: flex; align-items: center; gap: 8px; padding: 9px 10px 9px 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 12px 30px rgba(6, 51, 90, .28); }
.selbar .info { flex: 1; min-width: 0; line-height: 1.2; }
.selbar .info b { display: block; font-size: 14px; }
.selbar .info span { font-size: 12px; color: var(--muted); }
.rep .main.tap { cursor: pointer; }
.rep .main.tap:active { opacity: .6; }
.hint.audit { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; color: var(--ink); }
.field input[readonly] { background: #f1f6fa; color: var(--muted); }
