:root {
    --bg: #f4f1ea;
    --paper: #ffffff;
    --ink: #1f2a24;
    --muted: #6b746e;
    --line: #e6e1d6;
    --brand: #1f6f50;
    --brand-soft: #e3f1ea;

    --ok: #1f7a4d;   --ok-bg: #e2f4e9;
    --late: #b45309; --late-bg: #fff1dc; --late-line: #f2b766;
    --due: #b42318;  --due-bg: #fde8e6;
    --wait: #5b6470; --wait-bg: #eef0f2;

    --radius: 14px;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.45; }
a { color: var(--brand); text-decoration: none; }
h1 { font-size: 24px; margin: 0; }
h2 { font-size: 17px; margin: 0 0 14px; }
.muted { color: var(--muted); font-weight: 400; }
.wrap { max-width: 560px; margin: 0 auto; padding: 0 16px; }

/* ---------- top bar ---------- */
.topbar { background: var(--brand); color: #fff; padding: calc(12px + env(safe-area-inset-top)) 0 12px; position: sticky; top: 0; z-index: 10; }
.topbar .wrap { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.topbar strong { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar small { color: #cfe6da; font-size: 13px; white-space: nowrap; }

main.wrap { padding-top: 16px; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

/* ---------- bottom nav ---------- */
.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 10px; font-size: 12px; color: var(--muted); }
.bottomnav svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bottomnav a.on { color: var(--brand); font-weight: 700; }

/* ---------- alerts ---------- */
.alert { padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; font-size: 15px; border: 1px solid; }
.a-ok { background: var(--ok-bg); border-color: #b4dec5; color: #145236; }
.a-warn { background: var(--late-bg); border-color: var(--late-line); color: #7a3a06; font-weight: 600; }
.a-error { background: var(--due-bg); border-color: #f2b8b2; color: #8a1c12; }

/* ---------- month switcher ---------- */
.month { display: flex; align-items: center; gap: 8px; }
.arrow { width: 48px; height: 48px; border-radius: 12px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; font-size: 26px; color: var(--ink); flex: none; }
.month-pick { flex: 1; position: relative; height: 48px; display: grid; place-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; font-weight: 700; font-size: 18px; }
.month-pick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.due { text-align: center; font-size: 14px; font-weight: 600; margin: 8px 0 14px; }
.due-lewat { color: var(--due); }
.due-hari-ini { color: var(--late); }
.due-aman { color: var(--ok); }

/* ---------- summary ---------- */
.summary { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.sum-top span { font-size: 13px; color: var(--muted); display: block; }
.sum-top strong { font-size: 28px; font-variant-numeric: tabular-nums; }
.sum-top small { color: var(--muted); font-size: 13px; margin-left: 4px; }
.bar { height: 8px; background: var(--brand-soft); border-radius: 4px; margin: 10px 0 14px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--brand); }
.chips4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.chips4 a { display: flex; flex-direction: column; align-items: center; padding: 8px 2px; border-radius: 10px; font-size: 12px; color: var(--muted); border: 2px solid transparent; background: #f6f4ee; }
.chips4 b { font-size: 20px; line-height: 1.2; }
.chips4 .c-tepat b { color: var(--ok); }
.chips4 .c-terlambat b { color: var(--late); }
.chips4 .c-tunggakan b { color: var(--due); }
.chips4 .c-semua b { color: var(--ink); }
.chips4 a.on { border-color: var(--ink); background: #fff; color: var(--ink); }

/* ---------- list ---------- */
.list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.list > li { min-width: 0; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); min-height: 64px; }
a.item:active { transform: scale(.99); background: #faf8f3; }
.item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.item-main strong { font-size: 17px; letter-spacing: .02em; }
.item-main small { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item.nonaktif { opacity: .55; }

/* tanda khusus terlambat */
.item-terlambat { background: var(--late-bg); border-color: var(--late-line); border-left: 5px solid var(--late); }
.item-tunggakan { border-left: 5px solid var(--due); }
.item-tepat { border-left: 5px solid var(--ok); }

.avatar { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 16px; }
.avatar.big { width: 56px; height: 56px; font-size: 22px; }
.st-K { background: #dbeafe; color: #1e4fa3; }
.st-P { background: #fce7f3; color: #a3195b; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px 4px 4px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; flex: none; }
.badge i { font-style: normal; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; color: #fff; }
.b-tepat { background: var(--ok-bg); color: var(--ok); }        .b-tepat i { background: var(--ok); }
.b-terlambat { background: var(--late); color: #fff; }          .b-terlambat i { background: #fff; color: var(--late); }
.b-tunggakan { background: var(--due-bg); color: var(--due); }  .b-tunggakan i { background: var(--due); }
.b-belum { background: var(--wait-bg); color: var(--wait); }    .b-belum i { background: #9aa3ad; }
.pill { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--wait-bg); color: var(--muted); }

/* ---------- card & form ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px; margin-bottom: 16px; }
.section-title { margin: 22px 0 10px; }
.form { display: grid; gap: 14px; }
.form label, .field-label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: #3c4740; }
.form input:not([type=radio]) { font: inherit; font-size: 17px; padding: 12px 14px; border: 1px solid #d8d2c4; border-radius: 10px; background: #fff; color: var(--ink); width: 100%; min-height: 50px; }
.form input:focus { outline: 3px solid var(--brand-soft); border-color: var(--brand); }
.form small { font-weight: 400; font-size: 13px; }
.field { display: grid; gap: 6px; }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg label { display: block; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: grid; place-items: center; height: 54px; border: 2px solid #d8d2c4; border-radius: 12px; font-size: 22px; font-weight: 800; color: var(--muted); background: #fff; cursor: pointer; }
.seg input:checked + span { border-color: var(--brand); background: var(--brand); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid var(--brand-soft); }

.btn { display: inline-flex; align-items: center; justify-content: center; padding: 12px 18px; min-height: 50px; border-radius: 12px; border: 1px solid var(--brand); background: var(--brand); color: #fff; font: inherit; font-weight: 700; font-size: 16px; cursor: pointer; }
.btn.block { width: 100%; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.danger { background: #fff; color: var(--due); border-color: #f0c4bf; margin-top: 10px; }

.preview { font-size: 14px; border-radius: 10px; margin-top: -4px; }
.preview.ok { padding: 10px 12px; background: var(--ok-bg); color: var(--ok); }
.preview.late { padding: 10px 12px; background: var(--late-bg); color: var(--late); border: 1px solid var(--late-line); }

.back { display: inline-block; padding: 6px 0 12px; font-weight: 600; font-size: 16px; }
.who { display: flex; align-items: center; gap: 14px; }
.who p { margin: 2px 0 0; font-size: 14px; }
.who-status { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 14px 0 18px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }

/* ---------- menu titik tiga ---------- */
.menu { position: relative; flex: none; }
.menu summary { list-style: none; width: 40px; height: 40px; display: grid; place-items: center; font-size: 22px; border-radius: 10px; cursor: pointer; color: var(--muted); }
.menu summary::-webkit-details-marker { display: none; }
.menu[open] summary { background: #f3efe6; }
.menu-pop { position: absolute; right: 0; top: 44px; z-index: 5; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); min-width: 160px; overflow: hidden; }
.menu-pop a, .menu-pop button { display: block; width: 100%; text-align: left; padding: 13px 16px; font: inherit; font-size: 15px; background: none; border: 0; color: var(--ink); cursor: pointer; }
.menu-pop > * + * { border-top: 1px solid var(--line); }
.menu-pop .red { color: var(--due); }

.empty { color: var(--muted); padding: 24px 0; text-align: center; margin: 0; }
.empty .btn { margin-top: 10px; }
.hint { text-align: center; color: var(--muted); font-size: 13px; margin-top: 14px; }
.legend ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 14px; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- infak ---------- */
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.total { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; background: var(--brand-soft); border-radius: 10px; font-size: 15px; color: var(--brand); }
.total b { font-size: 20px; }
.rinci { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: -4px 0 14px; }
.rinci div { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); }
.rinci b { font-size: 14px; color: var(--ink); white-space: nowrap; }

/* ---------- tombol PDF ---------- */
.pdf-btn { margin-top: 14px; gap: 8px; background: #fff; color: var(--brand); border: 2px solid var(--brand); }
.pdf-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- tombol kecil PDF ---------- */
.summary { position: relative; }
.mini-btn { position: absolute; top: 12px; right: 12px; display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border: 1px solid var(--brand); border-radius: 8px; font-size: 13px; font-weight: 700; color: var(--brand); background: #fff; }
.mini-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.mini-btn:active { background: var(--brand-soft); }

/* ---------- rekap ---------- */
.year { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.year .ttl { flex: 1; height: 48px; display: grid; place-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; font-weight: 700; font-size: 18px; }
.rk-total { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 12px; }
.rk-total div { background: #f6f4ee; border-radius: 10px; padding: 8px 10px; }
.rk-total span { display: block; font-size: 12px; color: var(--muted); }
.rk-total b { font-size: 15px; white-space: nowrap; }
.rk-row { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.rk-row.kosong { opacity: .5; }
.rk-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.rk-head strong { font-size: 16px; }
.rk-head b { font-size: 16px; color: var(--brand); white-space: nowrap; }
.rk-sub { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.rk-sub em { font-style: normal; display: block; color: var(--ink); font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.rk-meta { font-size: 12px; color: var(--muted); margin-top: 6px; }
.rk-meta .late { color: var(--late); font-weight: 700; }
.seg2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: #e9e4d8; padding: 4px; border-radius: 12px; margin: 18px 0 12px; }
.seg2 a { text-align: center; padding: 9px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--muted); }
.seg2 a.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* ---------- rekap bulan berjalan (beranda) ---------- */
.rekap-bln h2 { margin-bottom: 10px; }
.rb-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.rb-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.rb-top span { font-weight: 600; font-size: 15px; }
.rb-top b { font-size: 17px; font-variant-numeric: tabular-nums; }
.bar.sm { height: 6px; margin: 6px 0 4px; }
.rb-sub { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--muted); }
.rb-sub .kurang { color: var(--due); font-weight: 600; }
.rb-sub .pas { color: var(--ok); font-weight: 600; }
.rb-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 12px; }
.rb-total span { font-weight: 700; }
.rb-total b { font-size: 20px; color: var(--brand); }

/* ---------- rekap ringkas satu baris ---------- */
.rekap-mini { display: grid; grid-template-columns: repeat(3, 1fr); background: #fff; border: 1px solid var(--line); border-radius: 12px; margin: -6px 0 16px; padding: 8px 4px; }
.rekap-mini div { text-align: center; padding: 0 4px; min-width: 0; }
.rekap-mini div + div { border-left: 1px solid var(--line); }
.rekap-mini span { display: block; font-size: 11px; color: var(--muted); line-height: 1.2; }
.rekap-mini b { font-size: 13.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* =========================================================
 *  MODE RINGKAS — semua ukuran diperkecil untuk ponsel
 * ========================================================= */
body { font-size: 14px; }
.wrap { padding: 0 12px; }
main.wrap { padding-top: 10px; padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
h1 { font-size: 20px; }
h2 { font-size: 15px; margin-bottom: 10px; }

.topbar { padding: calc(8px + env(safe-area-inset-top)) 0 8px; }
.topbar strong { font-size: 15px; }
.topbar small { font-size: 11.5px; }

.bottomnav a { padding: 5px 0 6px; font-size: 10.5px; gap: 1px; }
.bottomnav svg { width: 20px; height: 20px; }

.alert { padding: 8px 10px; font-size: 13px; margin-bottom: 10px; border-radius: 10px; }

.month { gap: 6px; }
.arrow { width: 36px; height: 36px; font-size: 20px; border-radius: 10px; }
.month-pick { height: 36px; font-size: 15px; border-radius: 10px; }
.due { font-size: 12px; margin: 5px 0 8px; }

.summary { padding: 10px 12px; margin-bottom: 8px; border-radius: 12px; }
.sum-top span { font-size: 11.5px; }
.sum-top strong { font-size: 20px; }
.sum-top small { font-size: 11.5px; }
.bar { height: 5px; margin: 6px 0 8px; }
.chips4 { gap: 4px; }
.chips4 a { padding: 4px 2px; font-size: 10.5px; border-radius: 8px; border-width: 1.5px; }
.chips4 b { font-size: 15px; }
.mini-btn { top: 8px; right: 8px; padding: 3px 8px; font-size: 11.5px; border-radius: 7px; }
.mini-btn svg { width: 13px; height: 13px; }

.rekap-mini { margin: 0 0 8px; padding: 4px 2px; border-radius: 10px; }
.rekap-mini span { font-size: 10px; }
.rekap-mini b { font-size: 12px; }

.list { gap: 5px; }
.item { padding: 7px 10px; gap: 9px; min-height: 0; border-radius: 10px; }
.item-terlambat, .item-tunggakan, .item-tepat { border-left-width: 4px; }
.item-main strong { font-size: 14px; }
.item-main small { font-size: 11.5px; }
.avatar { width: 30px; height: 30px; font-size: 13px; }
.avatar.big { width: 42px; height: 42px; font-size: 17px; }
.badge { font-size: 11px; padding: 2px 7px 2px 3px; gap: 4px; }
.badge i { width: 15px; height: 15px; font-size: 9.5px; }
.hint { font-size: 11.5px; margin-top: 8px; }

.card { padding: 12px; margin-bottom: 10px; border-radius: 12px; }
.form { gap: 10px; }
.form label, .field-label { font-size: 12.5px; gap: 4px; }
.form input:not([type=radio]) { font-size: 15px; padding: 8px 10px; min-height: 40px; border-radius: 8px; }
.form small { font-size: 11.5px; }
.seg span { height: 40px; font-size: 17px; border-radius: 9px; }
.btn { min-height: 40px; padding: 8px 14px; font-size: 14px; border-radius: 9px; }
.btn.danger { margin-top: 8px; }
.preview.ok, .preview.late { padding: 7px 10px; font-size: 12.5px; }
.total { padding: 8px 10px; font-size: 13px; }
.total b { font-size: 16px; }
.row2 { gap: 8px; }
.back { padding: 2px 0 8px; font-size: 14px; }
.who { gap: 10px; }
.who h1 { font-size: 19px; }
.who p { font-size: 12.5px; }
.who-status { margin: 10px 0 12px; padding-bottom: 10px; }
.section-title { margin: 14px 0 8px; }
.menu summary { width: 32px; height: 32px; font-size: 18px; }
.menu-pop { top: 36px; }
.menu-pop a, .menu-pop button { padding: 10px 14px; font-size: 14px; }

.year { margin-bottom: 8px; gap: 6px; }
.year .ttl { height: 36px; font-size: 15px; border-radius: 10px; }
.rk-total { gap: 5px; margin-top: 8px; }
.rk-total div { padding: 5px 8px; border-radius: 8px; }
.rk-total span { font-size: 10.5px; }
.rk-total b { font-size: 12.5px; }
.seg2 { margin: 10px 0 8px; padding: 3px; border-radius: 10px; }
.seg2 a { padding: 6px; font-size: 13px; border-radius: 8px; }
.rk-row { padding: 8px 10px; border-radius: 10px; }
.rk-head strong, .rk-head b { font-size: 14px; }
.rk-sub { font-size: 10.5px; margin-top: 3px; }
.rk-sub em { font-size: 12px; }
.rk-meta { font-size: 11px; margin-top: 3px; }
.legend ul { font-size: 12.5px; gap: 8px; }

/* ---------- form anggota ringkas ---------- */
.card.compact-form { padding: 10px 12px; }
.compact-form h2 { font-size: 14px; margin-bottom: 8px; }
.compact-form .form { gap: 8px; }
.cf-row { display: grid; gap: 8px; }
.cf-top { grid-template-columns: 1fr 112px; align-items: end; }
.cf-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cf-btns { grid-template-columns: 1fr; }
.cf-btns:has(.ghost) { grid-template-columns: 2fr 1fr; }
.compact-form label, .compact-form .field-label { font-size: 11.5px; gap: 3px; }
.compact-form label small { font-size: 10.5px; }
.compact-form .form input:not([type=radio]) { font-size: 14px; padding: 6px 8px; min-height: 34px; border-radius: 7px; }
.cf-status { display: grid; gap: 3px; }
.seg.mini { gap: 4px; }
.seg.mini span { height: 34px; font-size: 14px; border-radius: 7px; border-width: 1.5px; }
.compact-form .btn { min-height: 36px; padding: 6px 12px; font-size: 13.5px; border-radius: 8px; }
.compact-form .cf-row > label { display: block; }
.compact-form .cf-row > label input { display: block; margin-top: 3px; }
.compact-form .cf-status .field-label { display: block; }

/* ---------- PWA ---------- */
.pasang { margin-left: auto; margin-right: 8px; font: inherit; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 7px; border: 1px solid #f2c14e; background: #f2c14e; color: #1f2a24; cursor: pointer; }
.pasang[hidden] { display: none; }
@media (display-mode: standalone) { .topbar { padding-top: calc(10px + env(safe-area-inset-top)); } }

/* ---------- pengaturan lengkap ---------- */
.cf-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.compact-form select { font: inherit; font-size: 14px; padding: 6px 8px; min-height: 34px; border: 1px solid #d8d2c4; border-radius: 7px; background: #fff; width: 100%; margin-top: 3px; display: block; color: var(--ink); }
.compact-form .form > small, .compact-form > small { display: block; font-size: 11px; line-height: 1.35; margin-top: 2px; }
.compact-form .cf-row + small { margin-top: 0; }
.compact-form .btn { min-height: 36px; padding: 6px 12px; font-size: 13.5px; border-radius: 8px; }
.compact-form h2 { display: flex; align-items: center; gap: 6px; }
.save-bar { position: sticky; bottom: calc(52px + env(safe-area-inset-bottom)); z-index: 5; padding: 4px 0 10px; background: linear-gradient(transparent, var(--bg) 35%); }
.save-bar .btn { min-height: 40px; box-shadow: 0 4px 12px rgba(31, 111, 80, .25); }
.mt8 { margin-top: 8px; }
.restore { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.restore input[type=file] { font-size: 12.5px; padding: 6px; }
.check { display: flex !important; align-items: flex-start; gap: 6px; font-weight: 400 !important; font-size: 12px !important; color: var(--muted); }
.check input { margin-top: 2px; }
.compact-form .btn.danger { margin-top: 0; }
.info { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; margin: 0; font-size: 12.5px; }
.info dt { color: var(--muted); }
.info dd { margin: 0; text-align: right; font-weight: 600; word-break: break-all; }
.info code { font-size: 12px; background: #f3efe6; padding: 1px 5px; border-radius: 5px; }
.cf-arti { display: block; font-size: 11px; margin-top: -4px; }

/* ---------- halaman PIN ---------- */
.masuk-body { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.masuk { width: 100%; max-width: 320px; text-align: center; display: grid; gap: 10px; justify-items: center; }
.masuk h1 { font-size: 18px; }
.masuk p { margin: 0; font-size: 13px; }
.pin-input { width: 100%; text-align: center; font-size: 26px; letter-spacing: .4em; padding: 8px; border: 1px solid #d8d2c4; border-radius: 10px; font-family: inherit; }
.masuk .alert { width: 100%; margin: 0; }
.compact-form .form > label { display: block; }
.compact-form .form > label > input:not([type=checkbox]) { display: block; margin-top: 3px; }
.compact-form .form .check { display: flex !important; }
.compact-form .form .check input[type=checkbox] { width: 16px; height: 16px; min-height: 0; padding: 0; margin: 1px 0 0; flex: none; accent-color: var(--due); }
.compact-form .form .check span { flex: 1; }

/* ---------- login & pengguna ---------- */
.who-chip { color: #e3f1ea; font-size: 11.5px; background: rgba(255,255,255,.12); padding: 2px 8px; border-radius: 999px; white-space: nowrap; text-decoration: none; }
.who-chip:hover { text-decoration: none; background: rgba(255,255,255,.2); }
.login-fields { width: 100%; text-align: left; }
.masuk.compact-form .btn { min-height: 40px; }
.masuk small.muted { font-size: 11.5px; }
.st-adm { background: #fdf3d4; color: #7a5a00; }
.st-ptg { background: var(--brand-soft); color: var(--brand); }
.small-p { font-size: 12px; margin: -4px 0 8px; }
.item-main strong .pill { margin-left: 4px; vertical-align: middle; }

/* ---------- login PIN & tombol keluar ---------- */
.topbar .wrap { align-items: center; }
.logout-form { margin: 0; }
.logout-btn { display: inline-flex; align-items: center; gap: 4px; font: inherit; font-size: 11.5px; font-weight: 700; color: #fff; background: rgba(0,0,0,.18); border: 1px solid rgba(255,255,255,.25); border-radius: 7px; padding: 3px 8px; cursor: pointer; }
.logout-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.logout-btn:active { background: rgba(0,0,0,.3); }
.topbar strong { flex: 1; min-width: 0; }
.who-chip { max-width: 40vw; overflow: hidden; text-overflow: ellipsis; }
.pasang { margin-left: 0; margin-right: 0; }
.topbar .wrap { gap: 6px; }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; margin-top: 4px; }
.pinpad button { font: inherit; font-size: 22px; font-weight: 600; height: 54px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
.pinpad button:active { background: var(--brand-soft); }
.pinpad .pp-del { font-size: 20px; color: var(--muted); }
.pinpad .pp-ok { background: var(--brand); color: #fff; border-color: var(--brand); font-size: 15px; font-weight: 700; }
.pin-input { letter-spacing: .5em; }

/* ---------- pilihan lembar kerja (admin) ---------- */
.ws-bar { display: flex; align-items: center; gap: 8px; background: #fdf3d4; border: 1px solid #efd98f; border-radius: 10px; padding: 5px 6px 5px 10px; margin-bottom: 8px; }
.ws-bar label { font-size: 11.5px; font-weight: 700; color: #7a5a00; white-space: nowrap; }
.ws-bar select { flex: 1; min-width: 0; font: inherit; font-size: 13.5px; font-weight: 600; padding: 5px 8px; border: 1px solid #e3c96f; border-radius: 7px; background: #fff; color: var(--ink); }
b.owner { color: #7a5a00; font-weight: 600; }

/* ---------- hak akses lembar kerja ---------- */
.akses-box { border: 1px solid var(--line); border-radius: 9px; padding: 6px 10px 8px; margin: 0; }
.akses-box legend { font-size: 11.5px; font-weight: 700; color: #3c4740; padding: 0 4px; }
.akses-box > small { display: block; font-size: 10.5px; margin-bottom: 6px; }
.akses-list { display: flex; flex-wrap: wrap; gap: 5px; }
.akses-item { display: inline-flex !important; align-items: center; gap: 0 !important; cursor: pointer; }
.akses-item input { position: absolute; opacity: 0; pointer-events: none; }
.akses-item span { display: inline-block; padding: 4px 10px; border: 1.5px solid #d8d2c4; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--muted); background: #fff; }
.akses-item input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.akses-item input:checked + span::before { content: "✓ "; }
.pill.ro { background: #eef0f2; color: var(--muted); flex: none; }
.ro-note { font-size: 12.5px; background: #eef0f2; color: var(--wait); padding: 8px 10px; border-radius: 8px; margin-bottom: 10px; }
.user-input { width: 100%; font: inherit; font-size: 17px; padding: 9px 12px; border: 1px solid #d8d2c4; border-radius: 10px; text-align: center; }
.user-input:focus, .pin-input:focus { outline: 3px solid var(--brand-soft); border-color: var(--brand); }

/* ---------- 5 pos uang ---------- */
.rekap-mini.pos5, .rk-total.pos5, .rk-sub.pos5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.rekap-mini.pos5 b { font-size: 12px; }
.rk-total.pos5 div { padding: 5px 4px; text-align: center; }
.rk-total.pos5 b { font-size: 12px; }
.rk-sub.pos5 em { font-size: 11.5px; }
.cf-pos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cf-pos label:first-child { grid-column: 1 / -1; }

/* ---------- kelompok per pengguna ---------- */
.grp-tools { display: flex; align-items: center; gap: 6px; margin: 2px 0 6px; font-size: 12px; }
.grp-tools .muted { flex: 1; }
.grp-tools button { font: inherit; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 7px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
.grp { background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 7px; overflow: hidden; }
.grp > summary { list-style: none; cursor: pointer; padding: 9px 11px 8px; display: block; }
.grp > summary::-webkit-details-marker { display: none; }
.grp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.grp-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; font-weight: 700; font-size: 14.5px; min-width: 0; }
.grp-name small.muted { font-weight: 400; font-size: 11.5px; width: 100%; padding-left: 16px; }
.grp-caret { display: inline-block; width: 12px; color: var(--muted); transition: transform .15s; font-size: 15px; }
.grp[open] .grp-caret { transform: rotate(90deg); }
.grp-amt { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.grp-amt b { font-size: 14px; color: var(--brand); font-variant-numeric: tabular-nums; }
.grp-amt small { font-size: 10.5px; color: var(--muted); }
.grp > summary .bar.sm { display: block; margin: 6px 0 5px; height: 4px; }
.grp-stat { display: flex; gap: 10px; font-size: 11.5px; font-weight: 600; flex-wrap: wrap; }
.gs-tepat { color: var(--ok); } .gs-telat { color: var(--late); } .gs-belum { color: var(--due); }
.grp-body { padding: 0 8px 8px; border-top: 1px solid var(--line); background: #faf8f3; }
.grp-body .grp-pos { margin: 8px 0 6px; }
.grp-body .list .item { box-shadow: none; }
.empty.small { padding: 8px 0; font-size: 12px; }
.grp-actions { display: flex; justify-content: flex-end; padding-top: 8px; }
.mini-btn.static { position: static; }

/* ---------- tombol Lihat laporan + PDF ---------- */
.mini-btns { position: absolute; top: 8px; right: 8px; display: flex; gap: 5px; }
.grp-actions { gap: 6px; flex-wrap: wrap; }
button.mini-btn { font: inherit; font-size: 11.5px; font-weight: 700; cursor: pointer; }

/* ---------- halaman Lihat laporan ---------- */
.pg-laporan .wrap { max-width: 980px; }
.lap-bar { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.lap-back { flex: 1; font-weight: 700; font-size: 13.5px; color: var(--brand); }
.lap-month { margin-bottom: 8px; }
.lap-paper { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; padding: 0 10px 12px; margin-bottom: 10px; }
.lap-head { background: var(--brand); color: #fff; margin: 0 -10px 10px; padding: 10px 12px 9px; }
.lap-head h1 { font-size: 16px; margin: 0; line-height: 1.25; }
.lap-head p { margin: 1px 0 0; font-size: 13px; font-weight: 600; }
.lap-head small { font-size: 11px; opacity: .85; }
.lap-sum { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 5px; margin-bottom: 8px; }
.lap-sum div { border: 1px solid var(--line); border-radius: 9px; padding: 5px 7px; min-width: 0; }
.lap-sum span { display: block; font-size: 10.5px; color: var(--muted); }
.lap-sum b { display: block; font-size: 16px; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lap-sum div:first-child b { font-size: 13.5px; }
.lap-sum small { display: block; font-size: 9.5px; color: var(--muted); line-height: 1.25; }
.lap-sum .s-late b { color: var(--late); }
.lap-sum .s-due b { color: var(--due); }
.lap-pos { margin-bottom: 8px; }
.lap-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 9px; }
.lap-tbl { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lap-tbl th { background: var(--ink); color: #fff; font-weight: 700; font-size: 11px; padding: 6px 8px; text-align: left; }
.lap-tbl td { padding: 5px 8px; border-bottom: 1px solid var(--line); background: #fff; }
.lap-tbl .c { text-align: center; }
.lap-tbl .r { text-align: right; }
.lap-tbl .b { font-weight: 700; }
.lap-tbl .nm { position: sticky; left: 0; z-index: 1; box-shadow: 1px 0 0 var(--line); }
.lap-tbl th.nm { background: var(--ink); z-index: 2; }
.lap-tbl td.nm i { display: inline-block; min-width: 16px; font-style: normal; font-size: 10.5px; color: var(--muted); }
.lap-tbl td.nm a { font-weight: 700; color: var(--ink); }
.lap-tbl .tg { color: var(--muted); }
.lap-tbl .ket { font-weight: 700; font-size: 11px; }
.lr-tepat .ket { color: var(--ok); }
.lr-belum .ket { color: var(--wait); }
.lr-terlambat td { background: var(--late-bg); }
.lr-terlambat .ket { color: var(--late); }
.lr-tunggakan td { background: var(--due-bg); }
.lr-tunggakan .ket { color: var(--due); }
.lr-grp td { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.lr-grp small { font-weight: 400; }
.lr-sub td { background: #f6f4ee; font-weight: 700; font-size: 11.5px; }
.lr-sub td.nm { text-align: right; }
.lr-sub .ket { font-weight: 400; color: var(--muted); }
.lap-tbl tfoot td { background: var(--brand-soft); font-weight: 800; border-bottom: 0; border-top: 2px solid var(--brand); }
.lap-tbl tfoot td.nm { text-align: right; }
.lap-hint { font-size: 10.5px; color: var(--muted); margin: 4px 2px 0; }
.lap-ttd { margin-top: 14px; font-size: 12px; }
.lap-tgl { text-align: right; margin: 0 0 2px; padding-right: 4%; }
.lap-ttd-row { display: grid; grid-template-columns: 1fr 1fr; text-align: center; }
.lap-ttd-row div:only-child { grid-column: 2; }
.lap-ttd-row b { display: block; margin-top: 44px; text-decoration: underline; }
@media (min-width: 760px) { .lap-hint { display: none; } }
@media (max-width: 380px) { .lap-sum { grid-template-columns: 1fr 1fr; } }

@media print {
    @page { size: A4; margin: 10mm; }
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    body { background: #fff; }
    .topbar, .bottomnav, .lap-bar, .lap-month, .lap-hint, .ws-bar, .alert { display: none !important; }
    main.wrap, .pg-laporan .wrap { max-width: none; padding: 0; }
    .lap-paper { border: 0; border-radius: 0; padding: 0; }
    .lap-head { margin: 0 0 10px; border-radius: 6px; }
    .lap-scroll { overflow: visible; border: 0; }
    .lap-tbl { font-size: 10px; }
    .lap-tbl .nm { position: static; box-shadow: none; }
    .lap-tbl td.nm a { color: inherit; text-decoration: none; }
}
