/* ewarga.css (v84) -- gaya halaman eBankSampah & ePosyandu.
   Berdiri sendiri (tidak memakai output.css), dua tema lewat atribut body[data-tema]. */
:root {
  --bg: #f3f6f1; --surf: #ffffff; --ink: #14261f; --muted: #566860; --line: #dde6de;
  --brand: #0b6b4f; --brand-ink: #ffffff; --brand-soft: #e1f0e8; --brand-deep: #084b38;
  --accent: #b97a0a; --accent-soft: #fbf0d6;
  --bad: #b3261e; --bad-soft: #fde9e7; --ok: #17794f; --ok-soft: #e1f3ea;
  --shadow: 0 1px 2px rgba(20,38,31,.06), 0 6px 18px rgba(20,38,31,.06);
}
body[data-tema="posyandu"] {
  --bg: #fbf3f6; --ink: #2a1620; --muted: #6c5560; --line: #eedde3;
  --brand: #a3305c; --brand-soft: #f8e1e9; --brand-deep: #7a2145;
  --accent: #12787a; --accent-soft: #dcf1f0;
  --shadow: 0 1px 2px rgba(42,22,32,.06), 0 6px 18px rgba(42,22,32,.07);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1a15; --surf: #16251e; --ink: #e8f1ec; --muted: #9db3a8; --line: #25382f;
    --brand: #3fbf92; --brand-ink: #06231a; --brand-soft: #173a2d; --brand-deep: #0f2c22;
    --accent: #e3b04b; --accent-soft: #3a2f12;
    --bad: #ff8f86; --bad-soft: #3d1b19; --ok: #5fd6a2; --ok-soft: #173a2d;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
  }
  body[data-tema="posyandu"] {
    --bg: #1a0f14; --surf: #26161d; --ink: #f6e8ed; --muted: #c4a6b2; --line: #43252f;
    --brand: #f08ab0; --brand-ink: #3a0f21; --brand-soft: #46202f; --brand-deep: #2a1520;
    --accent: #55c9c9; --accent-soft: #123a3a;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px; line-height: 1.5; min-height: 100vh;
}
.ew-wrap { max-width: 520px; margin: 0 auto; padding: 0 16px 40px; }
.ew-num { font-variant-numeric: tabular-nums; }

/* ---- kepala halaman ---- */
.ew-head { background: var(--brand-deep); color: #fff; padding: 22px 16px 54px; }
.ew-head-in { max-width: 520px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.ew-logo { width: 52px; height: 52px; border-radius: 14px; background: #fff; padding: 5px; object-fit: contain; flex: none; }
.ew-head h1 { margin: 0; font-size: 20px; line-height: 1.15; letter-spacing: -.01em; font-weight: 800; }
.ew-head p { margin: 2px 0 0; font-size: 12px; opacity: .8; }
.ew-main { margin-top: -34px; display: grid; gap: 14px; }

/* ---- kartu & form ---- */
.ew-card { background: var(--surf); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 16px; }
.ew-card h2 { margin: 0 0 10px; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.ew-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--brand-soft); padding: 4px; border-radius: 12px; margin-bottom: 14px; }
.ew-tab { border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 700; font-size: 12.5px; padding: 9px 6px; border-radius: 9px; cursor: pointer; line-height: 1.25; }
.ew-tab[aria-selected="true"] { background: var(--surf); color: var(--brand); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.ew-field { display: block; margin-bottom: 12px; }
.ew-field > span { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.ew-input { width: 100%; font: inherit; font-size: 16px; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 11px; background: var(--surf); color: var(--ink); }
.ew-input:focus-visible, .ew-btn:focus-visible, .ew-tab:focus-visible, summary:focus-visible, .ew-link:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.ew-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; }
.ew-btn { width: 100%; border: 0; font: inherit; font-weight: 800; font-size: 14.5px; padding: 13px 14px; border-radius: 12px; background: var(--brand); color: var(--brand-ink); cursor: pointer; }
.ew-btn[disabled] { opacity: .6; cursor: wait; }
.ew-btn-ghost { background: transparent; color: var(--brand); border: 1.5px solid var(--line); }
.ew-hint { font-size: 12px; color: var(--muted); margin: 10px 0 0; }
.ew-alert { padding: 10px 12px; border-radius: 11px; font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.ew-alert.salah { background: var(--bad-soft); color: var(--bad); }
.ew-alert.info { background: var(--accent-soft); color: var(--ink); }
.ew-link { color: var(--brand); font-weight: 700; }
.hidden { display: none !important; }

/* ---- identitas ---- */
.ew-id { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ew-id strong { display: block; font-size: 15px; text-transform: uppercase; letter-spacing: .01em; }
.ew-id small { color: var(--muted); font-size: 12px; }
.ew-badge { display: inline-block; font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.ew-badge.ok { background: var(--ok-soft); color: var(--ok); }
.ew-badge.bad { background: var(--bad-soft); color: var(--bad); }
.ew-keluar { background: none; border: 0; font: inherit; font-size: 12px; font-weight: 700; color: var(--muted); cursor: pointer; text-decoration: underline; padding: 4px; }

/* ---- kartu profil (v84) ---- */
.ew-profil-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.ew-profil-h h2 { margin: 0; }
.ew-dl { margin: 0; display: grid; gap: 0; }
.ew-dl > div { display: grid; grid-template-columns: 118px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.ew-dl > div:first-child { border-top: 0; }
.ew-dl dt { color: var(--muted); font-weight: 600; font-size: 12px; }
.ew-dl dd { margin: 0; font-weight: 700; word-break: break-word; }
.ew-dl dd.kosong { color: var(--muted); font-weight: 500; }
.ew-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.ew-actions .ew-wide { grid-column: 1 / -1; }
.ew-btn.sm { padding: 10px 10px; font-size: 13px; border-radius: 11px; text-align: center; text-decoration: none; display: block; }
.ew-panel { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.ew-panel h3 { margin: 0 0 8px; font-size: 14px; }
.ew-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ew-notice { margin-top: 12px; padding: 10px 12px; border-radius: 11px; background: var(--accent-soft); font-size: 12.5px; }
.ew-notice b { display: block; margin-bottom: 2px; }

/* ---- eBankSampah ---- */
.ew-hero { background: var(--brand); color: var(--brand-ink); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); }
.ew-hero small { opacity: .85; font-size: 12px; font-weight: 600; }
.ew-hero .ew-big { font-size: 34px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin: 2px 0 4px; }
.ew-hero .ew-sub { font-size: 12px; opacity: .85; }
.ew-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ew-tile { background: var(--surf); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.ew-tile small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.ew-tile b { display: block; font-size: 18px; margin-top: 2px; letter-spacing: -.01em; }
.ew-trx { border: 1px solid var(--line); border-radius: 13px; background: var(--surf); }
.ew-trx + .ew-trx { margin-top: 8px; }
.ew-trx summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center; padding: 11px 12px; }
.ew-trx summary::-webkit-details-marker { display: none; }
.ew-ico { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-size: 15px; }
.ew-ico.tarik { background: var(--accent-soft); color: var(--accent); }
.ew-trx .t1 { font-weight: 700; font-size: 13.5px; }
.ew-trx .t2 { color: var(--muted); font-size: 11.5px; }
.ew-trx .amt { font-weight: 800; font-size: 14px; text-align: right; }
.ew-trx .amt.plus { color: var(--ok); }
.ew-trx .amt.minus { color: var(--accent); }
.ew-detail { border-top: 1px dashed var(--line); padding: 10px 12px 12px; font-size: 12.5px; display: grid; gap: 6px; }
.ew-detail .row { display: flex; justify-content: space-between; gap: 10px; }
.ew-detail .row span:first-child { color: var(--muted); }

/* ---- ePosyandu ---- */
.ew-child { border: 1px solid var(--line); border-radius: 16px; background: var(--surf); overflow: hidden; }
.ew-child + .ew-child { margin-top: 12px; }
.ew-child-h { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 13px 14px; background: var(--brand-soft); }
.ew-child-h strong { text-transform: uppercase; font-size: 14px; }
.ew-child-h small { color: var(--muted); display: block; font-size: 12px; }
.ew-last { padding: 12px 14px 4px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ew-last div { background: var(--bg); border-radius: 11px; padding: 8px 10px; }
.ew-last small { display: block; color: var(--muted); font-size: 11px; font-weight: 600; }
.ew-last b { font-size: 16px; }
.ew-visit { padding: 11px 14px; border-top: 1px solid var(--line); }
.ew-visit .d { font-weight: 800; font-size: 12.5px; margin-bottom: 6px; }
.ew-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ew-chip { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--bg); color: var(--ink); border: 1px solid var(--line); }
.ew-chip.gizi { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.ew-chip.vit { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.ew-chip.warn { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.ew-note { margin-top: 8px; font-size: 12.5px; background: var(--accent-soft); border-radius: 10px; padding: 8px 10px; white-space: pre-line; }
.ew-more { margin: 0 14px 12px; }
.ew-empty { text-align: center; color: var(--muted); padding: 22px 10px; font-size: 13px; }
.ew-foot { text-align: center; color: var(--muted); font-size: 11.5px; margin-top: 18px; }
@media (min-width: 560px) { .ew-head { border-radius: 0 0 22px 22px; } }
@media (prefers-reduced-motion: no-preference) { .ew-card, .ew-hero { animation: ewmasuk .25s ease-out both; } }
@keyframes ewmasuk { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
