/* Aplikasi RT/RW — antarmuka responsif (seluler, tablet, desktop) */
:root {
  --bg: #f4f6f9; --card: #ffffff; --ink: #1b2733; --muted: #667585; --line: #e1e6ed; --line-strong: #c9d1db;
  --brand: #1d4f91; --brand-dark: #163d70; --brand-soft: #e8eff9; --brand-ink: #ffffff;
  --side: #0f2742; --side-ink: #cfdbea; --side-muted: #8fa5bf;
  --ok: #17703f; --ok-bg: #e2f4e9; --warn: #8a5a00; --warn-bg: #fdf0d2;
  --bad: #a3271f; --bad-bg: #fbe4e2; --info: #1d5a8f; --info-bg: #e1eefa;
  --radius: 10px; --shadow: 0 1px 2px rgba(15, 39, 66, .06), 0 1px 3px rgba(15, 39, 66, .05);
  --topbar-h: 56px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
/* Jejaring pengaman ukuran ikon SVG garis (icon()): 1em (ikut ukuran teks sekitarnya) kecuali
   ada aturan lebih spesifik (mis. .btn svg, .badge svg) yang menimpanya. */
svg[viewBox="0 0 24 24"] { width: 1em; height: 1em; flex-shrink: 0; vertical-align: -0.15em; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; color: #12202f; }
h1 svg, h2 svg, h3 svg, h4 svg, strong svg { width: 1em; height: 1em; vertical-align: -0.15em; flex-shrink: 0; }
h1 { font-size: 1.45rem; letter-spacing: -.01em; } h2 { font-size: 1.1rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .8em; }
code { background: #eef1f5; padding: 1px 5px; border-radius: 4px; font-size: .9em; }
.muted { color: var(--muted); font-size: .9em; }
.hint { color: var(--muted); font-size: .85em; margin-top: 4px; }

/* Bar tipis di atas layar saat pindah halaman/kirim form (umpan balik untuk halaman berat) */
.page-loading-bar { position: fixed; top: 0; left: 0; height: 3px; width: 0%; z-index: 999; pointer-events: none;
  background: linear-gradient(90deg, var(--brand), var(--brand-dark)); opacity: 0; }

/* ---------- Kerangka ---------- */
.shell { display: flex; min-height: 100vh; }
.side { width: 250px; background: var(--side); color: var(--side-ink); padding: 18px 12px; display: flex; flex-direction: column; flex-shrink: 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; color: #fff; padding: 2px 10px 18px; }
.brand-mark { width: 32px; height: 32px; border-radius: 8px; background: var(--brand); display: grid; place-items: center; flex-shrink: 0; }
.brand-mark svg { width: 18px; height: 18px; }
.side nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side nav a { display: flex; align-items: center; gap: 12px; color: var(--side-ink); text-decoration: none; padding: 10px 12px; border-radius: 8px; font-size: .95rem; }
.side nav a:hover { background: rgba(255, 255, 255, .07); }
.side nav a.active { background: var(--brand); color: #fff; }
.side nav svg { width: 19px; height: 19px; flex-shrink: 0; }

/* Kelompok menu (kategori): ringkasan seperti dropdown/accordion, terutama di layar sempit */
.nav-group { margin-top: 2px; }
.nav-group summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; list-style: none; cursor: pointer; margin: 10px 4px 2px; padding: 6px 8px; border-radius: 6px; font-size: .72rem; letter-spacing: .07em; text-transform: uppercase; color: var(--side-muted); user-select: none; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary:hover { color: var(--side-ink); background: rgba(255, 255, 255, .05); }
.nav-group summary::after { content: ''; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .15s ease; flex-shrink: 0; }
.nav-group[open] summary::after { transform: rotate(-135deg); }
.nav-group-list { display: flex; flex-direction: column; gap: 2px; }
.me { border-top: 1px solid rgba(255, 255, 255, .14); margin-top: 12px; padding: 14px 10px 0; display: flex; flex-direction: column; gap: 2px; }
.me strong { color: #fff; font-weight: 600; }
.me-link { text-decoration: none; }
.me-link:hover strong { text-decoration: underline; }
.nav-heading { margin: 14px 12px 4px; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--side-muted); }
.me .muted { color: var(--side-muted); }
.me form { margin-top: 8px; }
.me .install-btn { margin-top: 8px; background: var(--brand); color: #fff; width: 100%; padding: 8px 12px; font-weight: 600; }
.me button { background: rgba(255, 255, 255, .1); color: #fff; padding: 8px 12px; font-weight: 500; width: 100%; text-align: center; }
.me button:hover { background: rgba(255, 255, 255, .18); filter: none; }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.main { flex: 1; min-width: 0; width: 100%; padding: 22px 28px 40px; max-width: 1240px; }
.scrim { display: none; }
.topbar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 30; height: var(--topbar-h); padding: 0 28px; background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(1.4) blur(6px); border-bottom: 1px solid var(--line); }
.topbar .menu-btn, .topbar .brand-title { display: none; }
.topbar-space { flex: 1; }
.topbar-user { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; line-height: 1.2; color: var(--ink); text-decoration: none; max-width: 220px; overflow: hidden; }
.topbar-user strong { font-size: .88rem; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-user-peran { font-size: .72rem; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-user:hover strong { text-decoration: underline; }

/* Lonceng notifikasi */
.bell { position: relative; }
.bell-btn { position: relative; width: 42px; min-height: 42px; padding: 0; border-radius: 50%; background: transparent; color: var(--ink); }
.bell-btn:hover { background: #eef2f7; }
.bell-btn svg { width: 22px; height: 22px; }
.bell-badge { position: absolute; top: 2px; right: 1px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #d93025; color: #fff; font-size: .68rem; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px #fff; }
.bell-panel { color: var(--ink); position: absolute; right: 0; top: calc(100% + 8px); width: min(380px, 92vw); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 36px rgba(15, 39, 66, .22); z-index: 60; overflow: hidden; }
.bell-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.bell-list { max-height: min(420px, 60vh); overflow-y: auto; }
.bell-empty { padding: 22px 14px; text-align: center; margin: 0; }
.bell-item { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.bell-item:hover { background: #f5f8fc; }
.bell-item .notif-dot, .notif-row .notif-dot { flex: 0 0 9px; width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; background: transparent; }
.bell-item.unread .notif-dot, .notif-row.unread .notif-dot { background: var(--brand); }
.bell-item.unread { background: #f3f8ff; }
.bell-item .notif-body, .notif-row .notif-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.bell-item strong { font-size: .92rem; }
.bell-item .notif-text { font-size: .86rem; color: #445466; overflow-wrap: anywhere; }
.bell-item small { color: var(--muted); font-size: .76rem; }
.bell-foot { display: block; padding: 11px 14px; text-align: center; font-weight: 600; text-decoration: none; background: #f8fafc; }
.notif-page { padding: 0; overflow: hidden; }
.notif-row { display: flex; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.notif-row:hover { background: #f5f8fc; }
.notif-row.unread { background: #f3f8ff; }
.notif-row .notif-body span { overflow-wrap: anywhere; }
.notif-page > .pager, .notif-page > p { margin: 14px 18px; }

/* ---------- Komponen ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--shadow); }
.card > :last-child { margin-bottom: 0; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1, .page-head h2 { margin: 0; }
.page-head.compact { margin-bottom: 12px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }
.inline-form { display: inline; }
.flex-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.li-label { flex: 1; }
.list-row { padding: 10px 0; border-bottom: 1px solid #f1f5f9; }
.list-row:last-child { border-bottom: 0; }
.item-title { font-weight: 700; color: #0f2742; }
.btn-whatsapp { background: #25D366; color: #fff; }
.badge-info-alt { background: #e0f2fe; color: #0369a1; border: 1px solid #7dd3fc; font-size: .75rem; }

.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 1.55rem; line-height: 1.2; color: #12202f; }
.stat span { color: var(--muted); font-size: .88em; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #f8fafc; white-space: nowrap; }
tbody tr:hover td { background: #fafcfe; }
.table-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
td.num, th.num { text-align: right; white-space: nowrap; }
td form { margin: 0; }

label { display: block; font-weight: 600; margin: 14px 0 5px; font-size: .9rem; color: #2b3a4a; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=month], select, textarea {
  width: 100%; min-height: 40px; padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: 8px; font: inherit; color: var(--ink); background: #fff; }
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, .btn:focus-visible, a:focus-visible { outline: 3px solid rgba(29, 79, 145, .28); outline-offset: 1px; border-color: var(--brand); }
input[type=checkbox] { width: 17px; height: 17px; vertical-align: -3px; margin-right: 6px; accent-color: var(--brand); }
label:has(> input[type=checkbox]) { font-weight: 500; }
input:disabled { background: #f0f3f7; color: var(--muted); }

.form-grid { display: grid; gap: 0 18px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.form-inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.form-inline > div { flex: 1 1 150px; }
.form-inline > .fit { flex: 0 0 auto; }
.form-inline label { margin-top: 0; }

.btn, button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; background: var(--brand); color: var(--brand-ink); border: 0; border-radius: 8px;
  padding: 8px 16px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn svg, button svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn:hover, button:hover { background: var(--brand-dark); }
.btn.secondary, button.secondary { background: #fff; color: var(--brand); border: 1px solid var(--line-strong); }
.btn.secondary:hover, button.secondary:hover { background: var(--brand-soft); }
.btn.danger, button.danger { background: #fff; color: var(--bad); border: 1px solid #e5b9b5; }
.btn.danger:hover, button.danger:hover { background: var(--bad-bg); }
.btn.small, button.small { min-height: 32px; padding: 4px 11px; font-size: .85rem; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 99px; font-size: .77rem; font-weight: 600; white-space: nowrap; }
.badge svg { width: 12px; height: 12px; flex-shrink: 0; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--info); }

.alert { padding: 11px 15px; border-radius: 8px; margin-bottom: 16px; border: 1px solid transparent; overflow-wrap: anywhere; }
.alert.ok { background: var(--ok-bg); color: var(--ok); border-color: #bfe3cc; }
.alert.error { background: var(--bad-bg); color: var(--bad); border-color: #f0c4c0; }
.alert.info { background: var(--info-bg); color: var(--info); border-color: #bcd6ee; }

.pager { display: flex; gap: 4px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.pager a { min-width: 36px; text-align: center; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; background: #fff; }
.pager a.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.pager .muted { margin-left: 10px; }

.picker { display: flex; gap: 8px; flex-wrap: wrap; }
.picker select { flex: 1 1 180px; width: auto; }
.filter-bar { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.filter-bar > * { flex: 1 1 190px; }
.filter-bar > .grow { flex: 3 1 340px; }
.filter-bar > .fit { flex: 0 0 auto; }
.filter-bar label { margin-top: 0; }
.filter-on { margin-top: 10px; }

dl.kv { display: grid; grid-template-columns: 170px 1fr; gap: 8px 16px; margin: 0; }
dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; overflow-wrap: anywhere; }
.rw-block { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 10px; background: #fbfcfd; }
details { margin-top: 12px; }
details > summary { cursor: pointer; font-weight: 600; margin: 6px 0; color: var(--brand); }
article h3 { margin-bottom: .2em; }

/* ---------- Matriks hak akses ---------- */
.matrix-wrap { max-height: 72vh; overflow: auto; }
table.matrix { min-width: 640px; }
table.matrix th, table.matrix td { padding: 8px 10px; }
table.matrix thead th { position: sticky; top: 0; z-index: 2; background: #f8fafc; text-transform: none; letter-spacing: 0; font-size: .82rem; text-align: center; vertical-align: bottom; min-width: 96px; }
table.matrix thead th:first-child, table.matrix tbody td:first-child { position: sticky; left: 0; z-index: 1; background: #fff; text-align: left; min-width: 210px; box-shadow: 1px 0 0 var(--line); }
table.matrix thead th:first-child { z-index: 3; background: #f8fafc; }
table.matrix .matrix-cell { text-align: center; }
table.matrix .matrix-cell input { margin: 0; width: 18px; height: 18px; }
table.matrix tr.matrix-group td { background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; position: static; box-shadow: none; }
table.matrix code { font-size: .78em; color: var(--muted); }

/* ---------- Pilih warga (form pengguna) ---------- */
.warga-picker { margin-bottom: 8px; padding-bottom: 14px; border-bottom: 1px dashed var(--line); }
.warga-results { border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; margin-top: 6px; max-height: 260px; overflow-y: auto; box-shadow: var(--shadow); }
.warga-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; background: #fff; color: var(--ink); border-radius: 0; border-bottom: 1px solid var(--line); text-align: left; padding: 9px 12px; font-weight: 400; min-height: 0; }
.warga-item strong { font-weight: 600; }
.warga-item span { color: var(--muted); font-size: .85em; }
.warga-item:hover:not(:disabled) { background: var(--brand-soft); }
.warga-item:disabled { opacity: .55; cursor: not-allowed; }
.warga-empty { padding: 10px 12px; color: var(--muted); }
.link-btn { display: inline; min-height: 0; padding: 0; background: none; color: var(--brand); font-weight: 600; text-decoration: underline; border: 0; }
.link-btn:hover { background: none; }

/* ---------- Halaman masuk ---------- */
body.guest { display: grid; place-items: center; min-height: 100vh; padding: 16px; background: linear-gradient(160deg, #0f2742 0%, #1d4f91 100%); }
.guest-box { width: min(440px, 100%); background: #fff; border-radius: 14px; padding: 30px 28px; box-shadow: 0 10px 40px rgba(0, 0, 0, .25); }
.guest-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 18px; text-align: center; }
.guest-brand .brand-mark { width: 48px; height: 48px; border-radius: 12px; }
.guest-brand .brand-mark svg { width: 26px; height: 26px; }
.guest-brand h1 { margin: 0; font-size: 1.3rem; color: #12202f; }
.guest-brand p { margin: 0; color: var(--muted); font-size: .9rem; }

/* ---------- Tablet & seluler ---------- */
@media (max-width: 991px) {
  .topbar { padding: env(safe-area-inset-top) 10px 0 14px; height: calc(var(--topbar-h) + env(safe-area-inset-top)); background: var(--side); color: #fff; border-bottom: 0; backdrop-filter: none; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); }
  .topbar .menu-btn, .topbar .brand-title { display: block; }
  .topbar .brand-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex-shrink: 1; }
  .topbar-user { max-width: 92px; color: #fff; }
  .topbar-user-peran { color: rgba(255, 255, 255, .72); }
  .bell-btn { color: #fff; }
  .bell-btn:hover { background: rgba(255, 255, 255, .14); }
  .bell-badge { box-shadow: 0 0 0 2px var(--side); }
  .bell { position: static; }
  .bell-panel { position: fixed; left: 8px; right: 8px; width: auto; top: calc(var(--topbar-h) + env(safe-area-inset-top) + 6px); }
  .menu-btn { background: transparent; padding: 0; width: 44px; min-height: 44px; border-radius: 8px; color: #fff; }
  .menu-btn:hover { background: rgba(255, 255, 255, .12); }
  .menu-btn svg { width: 24px; height: 24px; }
  .side { position: fixed; inset: 0 auto 0 0; height: 100%; width: min(290px, 86vw); transform: translateX(-102%); transition: transform .22s ease; z-index: 50; box-shadow: none; }
  .side.open { transform: none; box-shadow: 4px 0 24px rgba(0, 0, 0, .35); }
  .scrim { position: fixed; inset: 0; background: rgba(10, 20, 35, .5); z-index: 40; }
  .scrim:not([hidden]) { display: block; }
  body.nav-open { overflow: hidden; }
  .main { padding: 18px 16px calc(32px + env(safe-area-inset-bottom)); }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  h1 { font-size: 1.3rem; }
  .card { padding: 15px 14px; border-radius: 12px; }
  .page-head { align-items: flex-start; }
  .page-head > .btn, .page-head > .actions { width: 100%; }
  .page-head > .actions .btn { flex: 1 1 auto; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat { padding: 12px; }
  .stat b { font-size: 1.25rem; }
  dl.kv { grid-template-columns: 1fr; gap: 2px 0; }
  dl.kv dt { margin-top: 8px; font-size: .85rem; }
  input[type=text], input[type=password], input[type=number], input[type=date], input[type=month], select, textarea { min-height: 46px; font-size: 16px; }
  .btn, button { min-height: 46px; }
  .btn.small, button.small { min-height: 40px; padding: 6px 14px; }
  .form-inline > div, .filter-bar > *, .filter-bar > .grow { flex: 1 1 100%; }
  .form-inline > .fit, .filter-bar > .fit { flex: 1 1 100%; }
  .form-inline > .fit button, .filter-bar > .fit button { width: 100%; }
  .picker select { flex: 1 1 100%; }
  .pager a { min-width: 42px; padding: 9px 12px; }

  /* Tabel menjadi kartu */
  .table-wrap { overflow: visible; margin: 0; padding: 0; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack thead { display: none; }
  .card:has(> .table-wrap), .card:has(> .pager) { background: transparent; border: 0; box-shadow: none; padding: 0; }
  table.stack tr { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px; padding: 4px 14px; background: #fff; box-shadow: var(--shadow); }
  table.stack tbody tr:hover td { background: transparent; }
  table.stack td { border: 0; border-bottom: 1px dashed var(--line); padding: 9px 0; display: flex; justify-content: space-between; gap: 14px; text-align: right; overflow-wrap: anywhere; }
  table.stack td:last-child { border-bottom: 0; }
  table.stack td::before { content: attr(data-label); flex: 0 0 38%; max-width: 38%; font-weight: 600; font-size: .82rem; color: var(--muted); text-align: left; text-transform: none; }
  table.stack td:not([data-label])::before { display: none; }
  table.stack td:not([data-label]) { justify-content: flex-start; text-align: left; flex-wrap: wrap; }
  table.stack td.num { text-align: right; }
  table.stack td .form-inline { width: 100%; }
  table.stack td.actions, table.stack td[data-label=""] { flex-wrap: wrap; justify-content: flex-start; }
  .hide-mobile { display: none !important; }
  .guest-box { padding: 24px 20px; }
}

@media (hover: none) { .btn:hover, button:hover { background: var(--brand); } .btn.secondary:hover, button.secondary:hover { background: #fff; } }

.pwa-steps { margin: 12px 0; padding-left: 20px; }
.pwa-steps li { margin-bottom: 6px; }

/* ---------- Mode demo (halaman masuk) ---------- */
.demo-box { margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--line-strong); }
.demo-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.demo-list { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.demo-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; background: #f8fafc; color: var(--ink); border: 1px solid var(--line-strong); text-align: left; padding: 8px 10px; font-weight: 400; min-height: 0; }
.demo-item strong { font-size: .88rem; }
.demo-item span { color: var(--muted); font-size: .72rem; overflow-wrap: anywhere; }
.demo-item:hover { background: var(--brand-soft); border-color: var(--brand); }
@media (max-width: 420px) { .demo-list { grid-template-columns: 1fr; } }

/* ---------- Verifikasi keaslian & TTE ---------- */
.approve-form { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; flex: 1 1 380px; }
.approve-form .pin-wrap { flex: 0 1 220px; }
.approve-form .pin-wrap label { margin-top: 0; }
fieldset.metode { border: 1px solid var(--line-strong); border-radius: 8px; padding: 6px 12px 8px; margin: 0; flex: 1 1 100%; }
fieldset.metode legend { font-size: .82rem; font-weight: 600; color: var(--muted); padding: 0 6px; }
fieldset.metode label.radio { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; margin: 6px 0; }
fieldset.metode input[type=radio] { width: 17px; height: 17px; margin: 3px 0 0; accent-color: var(--brand); }
fieldset.metode small { color: var(--muted); font-weight: 400; }
.guest-box.wide { width: min(760px, 100%); }
body.guest:has(.guest-box.wide) { place-items: start center; padding-top: 32px; }
.verif-hero { display: flex; gap: 16px; align-items: center; padding: 18px 20px; border-radius: 12px; margin-bottom: 16px; border: 1px solid transparent; }
.verif-hero svg { width: 44px; height: 44px; flex-shrink: 0; }
.verif-hero h2 { margin: 0 0 2px; font-size: 1.35rem; }
.verif-hero p { margin: 0; }
.verif-hero.sah { background: var(--ok-bg); color: var(--ok); border-color: #bfe3cc; }
.verif-hero.proses { background: var(--info-bg); color: var(--info); border-color: #bcd6ee; }
.verif-hero.dibatalkan, .verif-hero.tidak_valid, .verif-hero.tidak_ditemukan { background: var(--bad-bg); color: var(--bad); border-color: #f0c4c0; }
.verif-hero.belum_ttd { background: var(--warn-bg); color: var(--warn); border-color: #f0dba0; }
.cek-list { list-style: none; margin: 0; padding: 0; }
.cek-list li { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; }
.cek-list .ya { color: var(--ok); font-weight: 700; } .cek-list .tidak { color: var(--bad); font-weight: 700; }
.pin-form { max-width: 460px; }

/* ---------- Cetak & dokumen surat ---------- */
.surat-paper { background: #fff; max-width: 780px; margin: 0 auto; padding: 40px 50px; font-family: "Times New Roman", Times, serif; font-size: 12pt; line-height: 1.6; border: 1px solid var(--line); box-shadow: var(--shadow); }
.surat-paper .kop { text-align: center; border-bottom: 3px double #000; padding-bottom: 8px; margin-bottom: 18px; line-height: 1.35; }
.surat-paper .kop strong { font-size: 14pt; text-transform: uppercase; }
.surat-paper h3 { text-align: center; text-decoration: underline; margin: 0; text-transform: uppercase; color: #000; }
.surat-paper .nomor { text-align: center; margin-bottom: 18px; }
.surat-paper table.ident td { border: 0; padding: 1px 6px; }
.surat-paper table th, .surat-paper table td { background: transparent; }
@media (max-width: 720px) { .surat-paper { padding: 22px 16px; font-size: 11pt; overflow-x: auto; } .surat-paper .ttd { grid-template-columns: 1fr; gap: 26px; } }

@media print {
  .side, .topbar, .scrim, .no-print { display: none !important; }
  body { background: #fff; }
  .shell { display: block; }
  .main { padding: 0; max-width: none; }
  .card { border: 0; padding: 0; box-shadow: none; }
  .surat-paper { border: 0; padding: 0; max-width: none; box-shadow: none; }
  a { color: inherit; text-decoration: none; }
}

/* Blok tanda tangan pada surat */
.surat-paper .ttd { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; margin-top: 26px; text-align: center; break-inside: avoid; page-break-inside: avoid; }
.surat-paper .ttd-tanggal, .surat-paper .ttd-atas { min-height: 1.6em; }
.surat-paper .ttd-jabatan { margin-bottom: 4px; }
.surat-paper .ttd .space { height: 74px; }
.surat-paper .ttd-nama { display: block; margin-top: 6px; }
.surat-paper .ttd-box { display: block; margin: 6px auto 2px; line-height: 0; }
.surat-paper .ttd-box .ttd-qr { display: inline-block; line-height: 0; }
.surat-paper .ttd-box .ttd-qr svg { width: 132px; height: 132px; display: block; }
.surat-paper .ttd-img { display: block; margin: 2px auto 0; max-height: 46px; max-width: 150px; }
.surat-paper .ttd-catatan { margin: 18px 0 0; padding-top: 6px; border-top: 1px solid #999; font-size: 8.5pt; line-height: 1.4; color: #333; text-align: left; }

/* Badan surat: tabel identitas rapi, paragraf rata kiri-kanan, dan halaman cetak A4 */
.surat-paper table.ident { width: auto; }
.surat-paper table.ident td:first-child { white-space: nowrap; width: 170px; }
.surat-paper table.ident td:nth-child(2) { width: 14px; padding-left: 0; padding-right: 0; text-align: center; }
.surat-paper p { text-align: justify; margin: 0 0 .7em; }
.surat-paper .nomor { margin-bottom: 14px; }
@page { size: A4; margin: 16mm 20mm; }

/* ---------- Modul kegiatan (ronda, acara, posyandu) ---------- */
.nik-cari { position: relative; }
.nik-results { position: absolute; z-index: 30; left: 0; right: 0; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; margin-top: 4px; max-height: 260px; overflow-y: auto; box-shadow: var(--shadow); }
tr.row-mine td { background: var(--brand-soft); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 99px; border: 1px solid var(--line-strong); color: var(--ink); text-decoration: none; font-size: .92rem; background: #fff; }
.tabs a.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.tabs a svg { width: 16px; height: 16px; flex-shrink: 0; }
.tabs-select { display: none; }
@media (max-width: 720px) {
  .tabs { display: none; }
  .tabs-select { display: block; width: 100%; margin-bottom: 14px; font-weight: 600; min-height: 46px; }
}
@media (min-width: 768px) { .nowrap { white-space: nowrap; } }
.checks { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.checks label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; }
.mini-table td, .mini-table th { padding: 6px 10px; }
@media print { .nik-results { display: none !important; } }
ul.plain { list-style: none; margin: 0; padding: 0; } ul.plain li { padding: 5px 0; border-bottom: 1px solid var(--line); } ul.plain li:last-child { border-bottom: 0; }
.print-only { display: none; }
@media print { .print-only { display: block; } }
.app-foot { padding: 14px 20px 22px; font-size: .82rem; text-align: center; } .app-foot a { color: var(--muted); }

/* ---------- Grafik keuangan ---------- */
svg.chart { width: 100%; height: auto; display: block; }
.ch-grid { stroke: #e3e8ee; stroke-width: 1; } .ch-nol { stroke: #9aa7b5; stroke-width: 1.2; }
.ch-sumbu { fill: #5b6b7c; font-size: 11px; } .ch-nilai { fill: #33465a; font-size: 11px; font-weight: 600; }
rect.ch-masuk, .sw.ch-masuk, .mini-bar.ch-masuk { fill: #2e8b57; background: #2e8b57; }
rect.ch-keluar, .sw.ch-keluar, .mini-bar.ch-keluar { fill: #c0392b; background: #c0392b; }
rect.ch-sedang, .sw.ch-sedang { fill: #d98e04; background: #d98e04; }
.ch-saldo { stroke: #1d4f91; stroke-width: 2.4; stroke-linejoin: round; } .ch-saldo-titik { fill: #fff; stroke: #1d4f91; stroke-width: 2; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .86rem; color: var(--muted); margin-bottom: 8px; }
.chart-legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart-legend .sw-garis { display: inline-block; width: 18px; height: 0; border-top: 3px solid #1d4f91; margin-right: 6px; vertical-align: 3px; }
.grid2 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid2 > .card { margin-bottom: 14px; }
.donat { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.donat svg { width: 190px; max-width: 46%; flex: 0 0 auto; }
.ch-total-label { fill: #5b6b7c; font-size: 11px; } .ch-total { fill: #12202f; font-size: 16px; font-weight: 700; }
ul.legenda { list-style: none; margin: 0; padding: 0; flex: 1 1 180px; font-size: .88rem; }
ul.legenda li { display: flex; gap: 8px; align-items: baseline; padding: 4px 0; border-bottom: 1px solid var(--line); }
ul.legenda .sw { width: 11px; height: 11px; border-radius: 3px; flex: 0 0 auto; }
ul.legenda .lb { flex: 1; overflow-wrap: anywhere; } ul.legenda .nl { color: var(--muted); white-space: nowrap; }
.grafik-kol { min-width: 140px; } .mini-bar { display: block; height: 8px; border-radius: 4px; margin: 3px 0; min-width: 2px; }
tr.muted-row td { color: var(--muted); }
@media print { .grid2 { display: block; } .grid2 > .card { break-inside: avoid; } svg.chart { max-height: 300px; } }

/* ---------- Layar absen mandiri ---------- */
.absen-isi { display: flex; flex-wrap: wrap; gap: 28px; align-items: center; justify-content: center; padding: 10px 0; }
.absen-qr { width: 260px; max-width: 80vw; } .absen-qr svg { width: 100%; height: auto; display: block; }
.absen-kode { text-align: center; }
.absen-angka { font-size: clamp(2.6rem, 9vw, 4.6rem); font-weight: 800; letter-spacing: .14em; color: #12202f; font-variant-numeric: tabular-nums; margin: 6px 0; }
.absen-hitung { margin: 12px 0 6px; font-size: 1.05rem; }
.absen-layar.tutup .absen-isi { opacity: .35; }

/* Data pribadi tersamar + tombol Tampilkan */
.mask { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.mask-val { font-variant-numeric: tabular-nums; }
.mask-btn { background: transparent; color: var(--muted); border: 0; padding: 2px; min-height: 0; width: 24px; height: 24px; border-radius: 6px; line-height: 0; }
.mask-btn:hover:not(:disabled) { background: var(--brand-soft); color: var(--brand); }
.mask-btn svg { width: 16px; height: 16px; }
@media print { .mask-btn { display: none; } }

/* Pembayaran QRIS/transfer */
.qris-preview { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-start; }
.qris-qr { width: 250px; max-width: 100%; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: #fff; }
.qris-qr svg { width: 100%; height: auto; display: block; }
ol.langkah { margin: 0 0 8px; padding-left: 20px; } ol.langkah li { margin: 6px 0; }
.ch-sumbu-saldo { fill: #1d4f91; }

/* Paginasi tabel 10 baris (layar); cetak menampilkan semua baris */
.pager button { min-width: 36px; text-align: center; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font-weight: 400; min-height: 0; }
.pager button.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.pager button:disabled { opacity: .45; cursor: not-allowed; }
.pager .cetak-semua { margin-left: auto; font-size: .88rem; }
.hal-sembunyi { display: none !important; }
@media (max-width: 720px) {
  .pager { justify-content: center; gap: 6px; margin-top: 14px; }
  .pager button, .pager a { min-width: 44px; min-height: 44px; padding: 10px 12px; }
  .pager .muted { flex: 1 1 100%; text-align: center; margin: 2px 0 0; }
  .pager .cetak-semua { flex: 1 1 100%; margin: 4px 0 0; text-align: center; padding: 11px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; }
}
@media print {
  .hal-sembunyi { display: table-row !important; }
  .pager, .pager-js { display: none !important; }
}

/* ---------- Tombol aksi (ikon + label; ikon saja di ponsel) dan dialog ---------- */
.aksi-grup { display: flex; gap: 8px; justify-content: flex-end; align-items: center; flex-wrap: nowrap; }
.aksi-grup form { margin: 0; }
.btn-ikon { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 7px 13px; min-height: 36px; font-size: .86rem; font-weight: 600; border-radius: 8px; white-space: nowrap; }
.btn-ikon svg { width: 16px; height: 16px; flex: 0 0 auto; }
.btn-ikon.bahaya { color: var(--bad); border-color: #efc2be; }
.btn-ikon.bahaya:hover:not(:disabled) { background: var(--bad-bg); }
td .sub { margin-top: 3px; font-size: .82rem; }
dialog.modal { border: 0; border-radius: 14px; padding: 0; width: min(580px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: 0 18px 60px rgba(10, 20, 35, .35); color: var(--ink); background: #fff; }
dialog.modal[open] { display: flex; flex-direction: column; }
dialog.modal::backdrop { background: rgba(10, 20, 35, .5); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0 0 2px; font-size: 1.1rem; }
.modal-body { padding: 16px 18px 20px; overflow-y: auto; }
.modal-aksi { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }
.modal-sub { margin: 22px 0 8px; font-size: .95rem; }
.btn-ikon.tutup { padding: 6px; min-width: 36px; }
@media (max-width: 720px) {
  .btn-ikon { min-width: 44px; min-height: 44px; padding: 10px; }
  .btn-ikon .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .btn-ikon svg { width: 20px; height: 20px; }
  table.stack td .aksi-grup { justify-content: flex-end; }
  dialog.modal { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 16px 16px 0 0; max-height: 92vh; }
  .modal-aksi button { flex: 1 1 0; min-height: 46px; }
}
@media print { dialog.modal { display: none !important; } }

/* ---------- Rincian iuran per keluarga ---------- */
.hanya-cetak { display: none; }
@media print {
  .hanya-cetak { display: block; box-shadow: none; }
  .ringkas-layar { display: none !important; }
  .hanya-cetak table { font-size: 11px; }
}
.rinci-list { list-style: none; margin: 0; padding: 0; }
.rinci-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.rinci-item:last-child { border-bottom: 0; }
.rinci-atas { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.rinci-nom { text-align: right; font-weight: 600; white-space: nowrap; }
.rinci-nom .badge { margin-top: 4px; }
.rinci-bayar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.rinci-bayar input[type=date], .rinci-bayar select { width: auto; flex: 1 1 140px; margin: 0; }
.rinci-bayar button { margin: 0; }
@media (max-width: 720px) {
  .rinci-bayar input[type=date], .rinci-bayar select { flex: 1 1 100%; }
  .rinci-bayar button { flex: 1 1 100%; min-height: 46px; }
}

@media (max-width: 720px) {
  table.stack.ringkas td:first-child { display: block; text-align: left; padding-top: 12px; }
  table.stack.ringkas td:first-child::before { display: none; }
  table.stack.ringkas td:first-child strong { font-size: 1.02rem; }
  table.stack.ringkas td:last-child::before { display: none; }
  table.stack.ringkas td:last-child { justify-content: flex-end; }
  table.stack.ringkas tfoot { display: block; }
  table.stack.ringkas tfoot tr { display: block; border: 0; box-shadow: none; background: transparent; padding: 0 4px; }
  table.stack.ringkas tfoot th { display: block; padding: 2px 0; text-align: left; border: 0; }
}

.hanya-ponsel { display: none; }
@media (max-width: 720px) { .hanya-ponsel { display: inline; } table.stack.ringkas tfoot th:not(:first-child) { display: none; } }

.btn-cetak svg, .actions button svg { width: 16px; height: 16px; vertical-align: -3px; }
.kop-laporan { text-align: center; border-bottom: 2px solid #000; padding-bottom: 8px; margin-bottom: 10px; }
.kop-laporan h2 { margin: 0 0 4px; font-size: 1.25rem; }

tr.sorot td { background: #eef4fc; font-weight: 600; }
.stat small { font-size: .55em; font-weight: 500; color: var(--muted); }

/* ---------- Pilihan cara absen mandiri ---------- */
.pilihan-cara { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.cara { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line-strong, var(--line)); border-radius: 10px; background: #fff; cursor: pointer; margin: 0; font-weight: 400; }
.cara:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(29, 79, 145, .18); background: #f4f8fd; }
.cara input { margin-top: 4px; width: auto; flex: 0 0 auto; }
.cara span { display: block; }
.cara small { display: block; color: var(--muted); font-size: .84rem; margin-top: 3px; line-height: 1.4; }
.pilih-tombol { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.pilih-tombol button { flex: 1 1 160px; min-height: 48px; margin: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 1rem; }
.pilih-tombol svg { width: 20px; height: 20px; }
.btn-hadir { background: var(--ok, #2e8b57); border-color: var(--ok, #2e8b57); }
.pilih-tombol .terpilih { outline: 3px solid rgba(29, 79, 145, .35); outline-offset: 1px; }
.izin-box { margin-top: 10px; padding: 12px; background: #f6f8fb; border: 1px solid var(--line); border-radius: 10px; }
.izin-box input { margin-bottom: 10px; }
.absen-petunjuk { font-size: 1.25rem; margin: 10px 0 16px; }
.absen-tally { display: flex; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.absen-tally div { flex: 1 1 110px; text-align: center; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.absen-tally strong { display: block; font-size: 2.2rem; line-height: 1.1; }
.absen-tally span { color: var(--muted); font-size: .9rem; }
@media (max-width: 720px) { .pilihan-cara { grid-template-columns: 1fr; } }

h2.bagian { margin: 26px 0 10px; font-size: 1.2rem; padding-bottom: 6px; border-bottom: 2px solid var(--brand); }

/* Tombol mata pada isian kata sandi */
.pw-wrap { position: relative; display: block; width: 100%; }
.pw-wrap input { padding-right: 46px; }
.pw-toggle { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); width: 40px; height: 40px; min-height: 0; padding: 0; margin: 0; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 0; border-radius: 8px; color: var(--muted); cursor: pointer; }
.pw-toggle:hover:not(:disabled), .pw-toggle:focus-visible { background: var(--brand-soft); color: var(--brand); }
.pw-toggle svg { width: 20px; height: 20px; }
.pw-toggle[aria-pressed=true] { color: var(--brand); }

/* Rincian warga pada statistik kehadiran: baris ringkas (nama, persentase, detail H/I/A) */
table.rincian-warga td, table.rincian-warga th { padding: 8px 10px; }
table.rincian-warga td .muted { font-size: .8rem; }
.pct-baris { display: inline-block; width: 54px; height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; vertical-align: middle; margin-right: 6px; }
.pct-bar { display: block; height: 100%; border-radius: 4px; }
td.detail { white-space: nowrap; }
.dt { display: inline-block; min-width: 26px; padding: 2px 6px; margin-right: 4px; text-align: center; border-radius: 6px; font-size: .8rem; font-weight: 600; }
.dt.h { background: #e3f4ea; color: #1d6b3f; }
.dt.i { background: #fdf0d2; color: #8a5a00; }
.dt.a { background: #fbe4e1; color: #a12a1f; }
@media (max-width: 720px) {
  table.rincian-warga td, table.rincian-warga th { padding: 7px 6px; font-size: .88rem; }
  .pct-baris { width: 30px; margin-right: 4px; }
  .dt { min-width: 22px; padding: 2px 4px; margin-right: 2px; }
}

th.detail, td.detail { text-align: center; width: 1%; white-space: nowrap; }
td.detail .btn-ikon { padding: 5px 9px; min-height: 34px; }
.detail-tingkat { font-size: 1.05rem; margin-bottom: 12px; }
.detail-daftar { list-style: none; margin: 0; padding: 0; }
.detail-daftar li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.detail-daftar li:last-child { border-bottom: 0; }
.detail-daftar li span:nth-child(2) { flex: 1; }
.detail-daftar strong { font-size: 1.3rem; }
.detail-daftar .dt { min-width: 32px; padding: 4px 8px; font-size: .9rem; }
td.detail .btn-ikon .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.detail-cetak { display: none; }
@media print { td.detail .btn-ikon { display: none; } .detail-cetak { display: inline; font-size: 11px; } }

/* Berita acara serah terima jabatan */
.ba-jabatan { max-width: 780px; margin: 0 auto; }
.ba-judul { text-align: center; margin: 0 0 4px; font-size: 1.25rem; letter-spacing: .03em; }
.ba-sub { text-align: center; margin: 0 0 22px; font-weight: 600; }
.ba-tabel { border-collapse: collapse; margin: 10px 0 14px; }
.ba-tabel td { padding: 4px 10px 4px 0; vertical-align: top; }
.ba-tabel td:first-child { width: 210px; }
.ba-ttd { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 30px; text-align: center; }
.ttd-ruang { height: 70px; }
@media (max-width: 720px) { .ba-ttd { grid-template-columns: 1fr; } .ba-tabel td:first-child { width: 120px; } }
label.cek { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; margin-top: 8px; }
label.cek input { margin-top: 3px; }

fieldset.verif-mandiri { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px 4px; margin: 16px 0 6px; }
fieldset.verif-mandiri legend { font-weight: 700; padding: 0 6px; font-size: .95rem; }

/* Kwitansi iuran */
.kwitansi { max-width: 720px; }
.kw-tabel { border-collapse: collapse; margin: 14px 0; width: 100%; }
.kw-tabel td { padding: 5px 8px 5px 0; vertical-align: top; }
.kw-tabel td:first-child { width: 190px; white-space: nowrap; }
.kw-ttd { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 24px; gap: 20px; }
.kw-jumlah { border: 2px solid #000; padding: 8px 18px; font-size: 1.3rem; font-weight: 700; }
.kw-penerima { text-align: center; min-width: 220px; }
.kw-catatan { font-size: .8rem; margin-top: 26px; color: #444; }
.kw-rinci { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: .93rem; }
.kw-rinci th, .kw-rinci td { border: 1px solid #bbb; padding: 5px 8px; text-align: left; }
.kw-rinci th { background: #f0f2f5; font-weight: 600; }
.kw-rinci tfoot th { border-top: 2px solid #333; }
.bayar-semua { background: var(--brand-soft); border: 1px solid var(--brand); border-radius: 10px; padding: 10px 14px; margin-top: 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rinci-cek { display: flex; align-items: center; margin-right: 6px; }
.rinci-cek input { width: 18px; height: 18px; cursor: pointer; }
.bayar-semua button { white-space: normal; }
@media (max-width: 720px) { .kwitansi { padding: 22px 16px; } .kw-tabel td:first-child { white-space: normal; width: 110px; } .kw-ttd { flex-direction: column; align-items: stretch; } }

.ingatkan { padding: 12px 14px; margin-bottom: 8px; background: #fff8e6; border: 1px solid #f0dca0; border-radius: 10px; }
.ingatkan-aksi { justify-content: flex-start; flex-wrap: wrap; margin: 8px 0 4px; }
.ingatkan-massal form { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.ingatkan-massal button svg { width: 16px; height: 16px; vertical-align: -3px; }

rect.ch-laki, .sw.ch-laki { fill: #1d4f91; background: #1d4f91; }
rect.ch-perempuan, .sw.ch-perempuan { fill: #d1478f; background: #d1478f; }

/* Bantuan */
details.bantuan { padding: 0; margin-bottom: 10px; }
details.bantuan summary { cursor: pointer; padding: 14px 16px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
details.bantuan summary::-webkit-details-marker { display: none; }
details.bantuan summary::after { content: '+'; font-size: 1.3rem; color: var(--brand); font-weight: 400; }
details.bantuan[open] summary::after { content: '−'; }
details.bantuan[open] summary { border-bottom: 1px solid var(--line); }
details.bantuan ol, details.bantuan p { margin: 0; padding: 14px 18px 16px 36px; }
details.bantuan p { padding-left: 18px; }
details.bantuan li { margin-bottom: 8px; line-height: 1.55; }
details.bantuan[hidden] { display: none; }
@media print { details.bantuan { break-inside: avoid; } details.bantuan summary::after { content: ''; } }

/* KMS grafik garis */
.chart-garis .ch-garis-line { stroke: #1d4f91; }
.chart-garis .ch-garis-line.ch-hijau { stroke: #2e8b57; }
.chart-garis .ch-garis-line.ch-oranye { stroke: #d98e04; }
.chart-garis .ch-garis-line.ch-merah { stroke: #c0392b; }
.chart-garis .ch-titik { fill: #1d4f91; stroke: #fff; stroke-width: 1.6; }
.chart-garis .ch-titik.ch-hijau, .sw.ch-hijau { fill: #2e8b57; background: #2e8b57; }
.chart-garis .ch-titik.ch-oranye, .sw.ch-oranye { fill: #d98e04; background: #d98e04; }
.chart-garis .ch-titik.ch-merah, .sw.ch-merah { fill: #c0392b; background: #c0392b; }
.kms-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 720px) { .kms-grid { grid-template-columns: 1fr; } }

/* KMS zona WHO */
.chart-kms { max-width: 100%; height: auto; }
.kms-bgm { fill: #ef9a9a; opacity: .55; }
.kms-kurang { fill: #fff59d; opacity: .55; }
.kms-normal-b { fill: #a5d6a7; opacity: .55; }
.kms-normal-a { fill: #66bb6a; opacity: .45; }
.kms-lebih { fill: #ffcc80; opacity: .55; }
.kms-sd { stroke: #888; stroke-width: 1; stroke-dasharray: 5 3; }
.kms-sd.kms-median { stroke: #2e7d32; stroke-width: 1.5; stroke-dasharray: none; }
.kms-sd.kms-sd2 { stroke: #e65100; }
.kms-sd.kms-sd3 { stroke: #b71c1c; }
.kms-label { font-size: 9px; fill: #666; }
.kms-data-line { stroke: #1a237e; stroke-width: 2.2; }
.kms-titik { stroke: #fff; stroke-width: 1.8; }
.kms-t-normal { fill: #2e7d32; }
.kms-t-kurang { fill: #e65100; }
.kms-t-bgm { fill: #b71c1c; }
.kms-t-lebih { fill: #e65100; }
.kms-sw-normal { background: #66bb6a; }
.kms-sw-kurang { background: #fff59d; }
.kms-sw-bgm { background: #ef9a9a; }
.kms-sw-lebih { background: #ffcc80; }
@media print { .kms-bgm, .kms-kurang, .kms-normal-b, .kms-normal-a, .kms-lebih { opacity: .7; } }
