:root {
  --forest: #0f3d2e;
  --forest-2: #0b2f23;
  --jade: #1f7a5a;
  --jade-soft: #dcefe6;
  --paper: #f6f1e7;
  --card: #fffdf8;
  --gold: #c99a2e;
  --gold-soft: #f4e6c0;
  --ink: #1b1f1d;
  --muted: #6c746f;
  --line: #e4ddcc;
  --danger: #b5483a;
  --danger-soft: #f6dfda;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(15, 61, 46, .06), 0 8px 24px rgba(15, 61, 46, .08);
  --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(120% 90% at 50% 0%, #1f7a5a 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; animation: rise .8s cubic-bezier(.2, .8, .2, 1) both; }
.splash-logo { width: 96px; height: 96px; border-radius: 26px; box-shadow: 0 18px 40px rgba(0, 0, 0, .35); }
#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: 34px; height: 34px; border-radius: 10px; }
.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%, #2c9a73 0%, var(--jade) 30%, var(--forest) 75%);
  box-shadow: 0 18px 40px rgba(15, 61, 46, .28); }
.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: #2a2008; box-shadow: 0 6px 16px rgba(201, 154, 46, .35); }
.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: #f3ecdc; }
.badge { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; letter-spacing: .3px; }
.badge.ok { background: var(--jade-soft); color: var(--jade); }
.badge.no { background: var(--danger-soft); color: var(--danger); }

.check { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--jade); color: var(--jade); display: grid; place-items: center; flex: none; transition: all .15s; }
.check svg { width: 22px; height: 22px; }
.check:active { background: var(--jade); color: #fff; transform: scale(.92); }
.check.done { background: var(--jade); 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(31, 122, 90, .15); }
.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: #7a5a10; 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(15, 61, 46, .96); backdrop-filter: blur(10px); box-shadow: 0 14px 34px rgba(11, 47, 35, .4); }
.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: #2a2008; background: var(--gold); }

/* ---------- sheet & form ---------- */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(11, 30, 23, .5); 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: #2a2008; display: grid; place-items: center; box-shadow: 0 10px 24px rgba(201, 154, 46, .45); }
.fab svg { width: 26px; height: 26px; }

/* ---------- layar masuk / setup ---------- */
.gate { min-height: 100dvh; display: grid; place-items: center; padding: 20px; background: radial-gradient(120% 90% at 50% 0%, #1f7a5a 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 { width: 58px; height: 58px; border-radius: 16px; display: block; margin-bottom: 12px; }
.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; } }
