/* =========================================================
   Arisan Pemuda Grogol — Design system v2
   Token semantik, Plus Jakarta Sans, ikon Lucide (sprite di index.html)
   ========================================================= */
:root {
  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Warna dasar */
  --bg: #f3f5f9;
  --bg-elev: #e8ecf3;
  --card: #ffffff;
  --text: #141c2b;
  --muted: #556070;
  --faint: #8591a3;
  --line: #e1e6ee;
  --line-strong: #c7d0dd;

  /* Brand */
  --primary: #1f5fd1;
  --primary-deep: #163f8f;
  --primary-ink: #0f2f6b;
  --primary-soft: #e6eefc;
  --primary-soft-ink: #1f4fa8;
  --on-primary: #ffffff;
  --gold: #f6c448;
  --gold-deep: #d9a52b;
  --on-gold: #24402f;

  /* Status */
  --ok: #236a48;        --ok-bg: #e6f4ea;
  --warn: #875d00;      --warn-bg: #fff2cf;
  --bad: #b5473e;       --bad-bg: #fce8e6;
  --info: #2d53a8;      --info-bg: #e8eefc;
  --orange: #b4500f;    --orange-bg: #fdebdd;

  /* Aksen warna (chart + tile), tervalidasi CVD: hijau, kuning, merah, biru, ungu */
  --c-green: #15a36f;  --c-green-bg: #e3f6ed;  /* primer chart = --c-blue */
  --c-blue: #2a78d6;   --c-blue-bg: #e6f0fc;
  --c-amber: #eda100;  --c-amber-bg: #fff3d6;
  --c-red: #e34948;    --c-red-bg: #fde7e6;
  --c-violet: #6250d6; --c-violet-bg: #ebe8fa;
  --c-teal: #0f8f9f;   --c-teal-bg: #e1f4f6;
  --c-pink: #d6448f;   --c-pink-bg: #fbe6f1;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow: 0 1px 2px rgba(15, 30, 60, .04), 0 6px 18px rgba(15, 30, 60, .06);
  --shadow-sheet: 0 -8px 40px rgba(0, 0, 0, .18);
  --tab-h: 64px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --focus: 0 0 0 3px rgba(31, 95, 209, .35);
  color-scheme: light;
}
html { background: var(--bg); }

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 16px; line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 8px);
  overscroll-behavior-y: none;
  font-variant-numeric: tabular-nums;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--primary); }
[hidden] { display: none !important; }
:focus-visible { outline: none; box-shadow: var(--focus); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Ikon (Lucide, sprite di index.html) */
.ico { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -4px; }
.ico.sm { width: 16px; height: 16px; vertical-align: -3px; }
.ico.lg { width: 24px; height: 24px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(180deg, var(--primary-deep), var(--primary));
  color: var(--on-primary);
  padding-top: env(safe-area-inset-top);
}
.topbar-inner {
  max-width: 640px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 16px;
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-logo { width: 40px; height: 40px; flex: none; border-radius: 10px; display: block; box-shadow: 0 0 0 1.5px rgba(255,255,255,.35); }
.brand-title { font-weight: 700; font-size: 16px; line-height: 1.2; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: 12px; opacity: .85; display: flex; align-items: center; gap: 4px; margin-top: 1px; }
.brand-sub .ico { width: 14px; height: 14px; }

/* ---------- Layout ---------- */
.view { max-width: 640px; margin: 0 auto; padding: 14px 16px 28px; }
.section-title {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin: 20px 0 8px; font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
}
.section-title .btn { text-transform: none; letter-spacing: 0; }
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px;
}
.card p { margin: 8px 0 0; }

/* Hero */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--primary-deep) 0%, var(--primary) 65%, #3b82f6 100%);
  color: #fff; padding: 18px 18px 16px;
}
.hero::after {
  content: ""; position: absolute; right: -40px; top: -60px; width: 200px; height: 200px;
  border-radius: 50%; background: radial-gradient(circle, rgba(246, 196, 72, .32), rgba(246, 196, 72, 0) 70%);
  pointer-events: none;
}
.hero .eyebrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; opacity: .9; }
.hero .eyebrow a { color: #fff; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; background: rgba(255,255,255,.14); padding: 4px 10px; border-radius: 99px; }
.hero .title { font-size: 24px; font-weight: 700; line-height: 1.25; margin: 2px 0 10px; letter-spacing: -.02em; }
.hero .recipient { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.hero .recipient .avatar { width: 48px; height: 48px; background: var(--gold); color: var(--on-gold); font-size: 16px; box-shadow: 0 0 0 3px rgba(255,255,255,.25); }
.hero .recipient .avatar.photo { box-shadow: 0 0 0 2px var(--gold), 0 0 0 4px rgba(255,255,255,.35); }
.hero .recipient .lbl { font-size: 12px; opacity: .85; display: flex; align-items: center; gap: 4px; }
.hero .recipient .lbl .ico { width: 14px; height: 14px; }
.hero .recipient .name { font-size: 18px; font-weight: 700; line-height: 1.2; }
.hero .meta { display: flex; justify-content: space-between; align-items: flex-end; font-size: 13px; opacity: .95; }
.hero .meta b { font-size: 15px; }
.hero .meta .sum { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.hero .meta .sum b { font-size: 24px; font-weight: 800; color: var(--gold); letter-spacing: -.02em; text-shadow: 0 1px 2px rgba(0,0,0,.15); }
.hero .meta .sum small { font-size: 12px; opacity: .85; margin-top: 2px; }
.hero .big { font-size: 30px; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; margin: 2px 0 4px; }
.hero .sub { font-size: 13px; opacity: .9; }
.progress { height: 8px; background: rgba(255,255,255,.22); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.progress > div { height: 100%; background: var(--gold); border-radius: 99px; transition: width .25s var(--ease); }

/* Stat tiles */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.stat {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 14px; min-width: 0;
}
.stat .label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat .label .ico { width: 15px; height: 15px; color: var(--faint); }
.stat .value { font-size: 18px; font-weight: 700; margin-top: 4px; letter-spacing: -.01em; overflow-wrap: anywhere; line-height: 1.25; }
.stat .value.neg { color: var(--bad); }
.stat .value.pos { color: var(--ok); }
.stat .foot { font-size: 12px; color: var(--faint); margin-top: 2px; }

/* ---------- Lists & rows ---------- */
.list { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 12px; }
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
  width: 100%; text-align: left; background: none; border-left: 0; border-right: 0; border-top: 0;
  min-height: 60px; transition: background .15s var(--ease);
}
.row:last-child { border-bottom: 0; }
.row.clickable { cursor: pointer; }
.row.clickable:active { background: var(--bg-elev); }
@media (hover: hover) { .row.clickable:hover { background: var(--bg-elev); } }
.row.split { padding: 0; }
.row.split > .row-hit { flex: 1; display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-width: 0; background: none; border: 0; text-align: left; }
.row.split > .row-hit:active { background: var(--bg-elev); }
.row.split > .row-tools { padding: 0 10px 0 0; display: flex; gap: 4px; }
.avatar {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary-soft-ink);
  display: grid; place-items: center; font-weight: 700; font-size: 14px; letter-spacing: .02em;
}
.avatar.gold { background: var(--gold); color: var(--on-gold); }
.avatar.dim { background: var(--bg-elev); color: var(--faint); }
.avatar.bad { background: var(--bad-bg); color: var(--bad); }
.avatar.warn { background: var(--warn-bg); color: var(--warn); }
.avatar.orange { background: var(--orange-bg); color: var(--orange); }
.avatar.ok { background: var(--ok-bg); color: var(--ok); }
.avatar .ico { width: 18px; height: 18px; }
.avatar.photo { overflow: hidden; background: var(--bg-elev); box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--line-strong); }
.avatar.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.photo.bad { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--bad); }
.avatar.photo.warn { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--warn); }
.avatar.photo.orange { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--orange); }
.avatar.photo.ok { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--ok); }
.avatar.photo.dim img { filter: grayscale(1); opacity: .7; }
.avatar.photo.gold { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--gold); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; font-size: 15px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row-sub { font-size: 13px; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.row-sub.warn, .row-sub .warn { color: var(--warn); font-weight: 600; }
.row-sub .bad { color: var(--bad); font-weight: 600; }
.row-sub .orange { color: var(--orange); font-weight: 600; }
.row-sub .ok { color: var(--ok); font-weight: 600; }
.row-sub .ok .ico { width: 13px; height: 13px; }
.row-end .amt.orange { color: var(--orange); }
.row-end { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.row-end .amt { font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.row-end .amt.pos { color: var(--ok); }
.row-end .amt.neg { color: var(--bad); }
.row-chev { color: var(--faint); margin-left: -6px; }
.badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700;
  padding: 3px 9px; border-radius: 99px; white-space: nowrap; line-height: 1.3;
}
.badge .ico { width: 13px; height: 13px; }
.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.orange { background: var(--orange-bg); color: var(--orange); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.gold { background: var(--gold); color: var(--on-gold); }
.badge.muted { background: var(--bg-elev); color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 28px 16px; font-size: 14px; line-height: 1.5; }
.empty .ico { width: 36px; height: 36px; color: var(--faint); stroke-width: 1.5; display: block; margin: 0 auto 8px; }
.empty b { color: var(--text); display: block; font-size: 15px; margin-bottom: 2px; }

/* Timeline (Jadwal) */
.tl .avatar { font-size: 13px; }
.tl .row.cur { background: var(--primary-soft); }
.tl .row.cur .row-title { color: var(--primary-soft-ink); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 0; border-radius: 12px; padding: 12px 16px; min-height: 46px;
  font-weight: 700; font-size: 15px; background: var(--primary); color: #fff;
  transition: transform .12s var(--ease), background .15s var(--ease), opacity .15s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.block { width: 100%; }
.btn-sm { padding: 8px 12px; min-height: 36px; font-size: 13px; border-radius: 10px; gap: 5px; }
.btn-sm .ico { width: 16px; height: 16px; }
.btn-icon { padding: 0; width: 44px; min-height: 44px; border-radius: 12px; }
.btn-ghost { background: rgba(255,255,255,.16); color: #fff; }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-soft { background: var(--primary-soft); color: var(--primary-soft-ink); }
.btn-danger { background: var(--bad-bg); color: var(--bad); }
.btn-gold { background: var(--gold); color: var(--on-gold); }
.btn-wa { background: #1f9e5a; color: #fff; }
.btn-row { display: flex; gap: 8px; margin: 10px 0; }
.btn-row .btn { flex: 1; }
.link { background: none; border: 0; color: var(--primary); font-weight: 600; padding: 6px 0; }

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }
.field label, .field .lbl { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border-radius: 12px; min-height: 48px;
  border: 1.5px solid var(--line-strong); background: var(--bg); font-size: 16px;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.input-wrap { position: relative; }
.input-wrap input { padding-right: 48px; }
.input-wrap .btn-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; background: none; color: var(--muted); border-radius: 10px; display: grid; place-items: center; }
.hint { font-size: 13px; color: var(--muted); margin: 0 0 12px; line-height: 1.45; }
.hint.inline { display: flex; align-items: flex-start; gap: 6px; }
.hint.inline .ico { width: 16px; height: 16px; margin-top: 2px; color: var(--faint); }
.check { display: flex; align-items: center; gap: 10px; padding: 8px 0 12px; font-size: 15px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--primary); margin: 0; }
select.inline {
  width: 100%; padding: 0 40px 0 14px; border-radius: 12px; font-weight: 700; font-size: 15px; min-height: 46px;
  border: 1.5px solid var(--line-strong); background: var(--card); color: var(--text);
  -webkit-appearance: none; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px; background-repeat: no-repeat;
}

/* Nominal cepat + segmented control */
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.chip-btn {
  flex: 1; min-width: 56px; min-height: 40px; padding: 8px 6px; border-radius: 10px;
  border: 1.5px solid var(--line-strong); background: var(--bg); font-weight: 700; font-size: 14px;
  transition: background .15s, color .15s, border-color .15s;
}
.chip-btn.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.seg { display: flex; border: 1.5px solid var(--line-strong); border-radius: 12px; overflow: hidden; background: var(--bg); }
.seg label { flex: 1; position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.seg span { display: block; text-align: center; padding: 12px 6px; font-weight: 700; font-size: 14px; color: var(--muted); transition: background .15s, color .15s; }
.seg input:checked + span { background: var(--primary); color: #fff; }
.seg input:focus-visible + span { box-shadow: inset var(--focus); }

/* Filter pills (Bayar) */
.filters { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.pill {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; min-height: 36px; border-radius: 99px; font-size: 13px; font-weight: 600;
  background: var(--card); color: var(--muted); border: 1.5px solid var(--line); box-shadow: var(--shadow);
  transition: background .15s, color .15s, border-color .15s;
}
.pill b { font-weight: 700; background: var(--bg-elev); color: var(--muted); border-radius: 99px; padding: 0 7px; font-size: 12px; line-height: 20px; }
.pill.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.pill.on b { background: rgba(255,255,255,.22); color: #fff; }

/* Ringkasan kecil */
.chips { display: flex; gap: 8px; margin-bottom: 12px; }
.chip { background: var(--card); box-shadow: var(--shadow); border-radius: 12px; padding: 9px 11px; font-size: 12px; color: var(--muted); flex: 1; min-width: 0; }
.chip b { display: block; font-size: 14px; margin-top: 2px; color: var(--text); overflow-wrap: anywhere; }

/* Pemilih bulan */
.period-nav { display: flex; gap: 8px; align-items: stretch; margin-bottom: 12px; }
.period-nav select.inline { flex: 1; min-width: 0; }
.period-nav .btn-icon { background: var(--card); color: var(--primary); box-shadow: var(--shadow); width: 46px; }
.period-nav .btn-icon:disabled { color: var(--faint); }

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--card); border-top: 1px solid var(--line);
  display: flex; justify-content: space-around;
  padding-bottom: env(safe-area-inset-bottom);
  height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 20px rgba(0,0,0,.05);
}
.tab {
  flex: 1; border: 0; background: none; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11.5px; font-weight: 600; padding: 6px 0; min-height: 44px; position: relative;
  transition: color .15s var(--ease);
}
.tab .ico { width: 23px; height: 23px; stroke-width: 1.9; transition: transform .2s var(--ease); }
.tab .tab-ico { display: grid; place-items: center; width: 48px; height: 28px; border-radius: 99px; transition: background .2s var(--ease); }
.tab.active { color: var(--primary); }
.tab.active .tab-ico { background: var(--primary-soft); }
.tab.active .ico { stroke-width: 2.3; }
.tab:active .ico { transform: scale(.9); }

/* ---------- Modal / bottom sheet ---------- */
.backdrop {
  position: fixed; inset: 0; background: rgba(8, 20, 14, .5); z-index: 40;
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .18s var(--ease);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.sheet {
  background: var(--card); width: 100%; max-width: 640px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding: 10px 18px calc(18px + env(safe-area-inset-bottom));
  max-height: 92dvh; overflow-y: auto; box-shadow: var(--shadow-sheet);
  animation: up .22s var(--ease);
}
.sheet-handle { width: 40px; height: 4px; border-radius: 99px; background: var(--line-strong); margin: 0 auto 14px; }
.sheet h3 { margin: 0 0 4px; font-size: 19px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.sheet .sheet-sub { color: var(--muted); font-size: 13px; margin-bottom: 16px; line-height: 1.45; }
.sheet-actions { display: flex; gap: 8px; margin-top: 10px; position: sticky; bottom: 0; background: var(--card); padding-top: 8px; }
.sheet-actions .btn { flex: 1; }
.sheet-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.sheet-head .avatar { width: 48px; height: 48px; font-size: 16px; }
.sheet-head h3 { margin: 0; }
.sheet-head .sheet-sub { margin: 0; }
@keyframes up { from { transform: translateY(48px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom));
  transform: translateX(-50%); z-index: 60;
  background: #182238; color: #fff; padding: 11px 16px; border-radius: 12px;
  font-size: 14px; font-weight: 500; max-width: 90vw; box-shadow: 0 8px 24px rgba(0,0,0,.3);
  animation: up .2s var(--ease);
}
.toast.err { background: #b5473e; }

/* ---------- Skeleton loading ---------- */
.skeleton { display: grid; gap: 12px; }
.sk { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.sk::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(127,143,134,.12), transparent); animation: shimmer 1.3s infinite; }
.sk.h46 { height: 46px; } .sk.h150 { height: 150px; } .sk.h80 { height: 80px; } .sk.h200 { height: 200px; }
.sk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ---------- Misc ---------- */
.setup { padding: 20px 0; }
.setup ol { padding-left: 20px; line-height: 1.6; }
.setup code, code { background: var(--primary-soft); color: var(--primary-soft-ink); padding: 2px 6px; border-radius: 6px; font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.small { font-size: 12px; color: var(--muted); }
.mt { margin-top: 12px; }
.text-right { text-align: right; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.kv b { font-weight: 700; }
.kv.total { border-top: 1.5px solid var(--line-strong); margin-top: 4px; padding-top: 12px; font-size: 15px; }
.kv.total b { color: var(--primary-soft-ink); font-size: 16px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (min-width: 640px) {
  .view { padding-top: 20px; }
  .tabbar { max-width: 640px; left: 50%; transform: translateX(-50%); border-radius: 18px 18px 0 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}

/* ---------- Tile berwarna ---------- */
.stat { position: relative; }
.stat .label .ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.stat .label .ic .ico { width: 15px; height: 15px; color: inherit; }
.stat.t-green .ic { background: var(--c-green-bg); color: var(--c-green); }
.stat.t-blue .ic { background: var(--c-blue-bg); color: var(--c-blue); }
.stat.t-amber .ic { background: var(--c-amber-bg); color: #9a6a00; }
.stat.t-red .ic { background: var(--c-red-bg); color: var(--c-red); }
.stat.t-violet .ic { background: var(--c-violet-bg); color: var(--c-violet); }
.stat.t-teal .ic { background: var(--c-teal-bg); color: var(--c-teal); }
.stat::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--line-strong); }
.stat.t-green::before { background: var(--c-green); }
.stat.t-blue::before { background: var(--c-blue); }
.stat.t-amber::before { background: var(--c-amber); }
.stat.t-red::before { background: var(--c-red); }
.stat.t-violet::before { background: var(--c-violet); }
.stat.t-teal::before { background: var(--c-teal); }

/* Avatar berwarna (hash nama) */
.avatar.c0 { background: var(--c-green-bg); color: #0f7a52; }
.avatar.c1 { background: var(--c-blue-bg); color: #1f5fae; }
.avatar.c2 { background: var(--c-amber-bg); color: #8a5e00; }
.avatar.c3 { background: var(--c-violet-bg); color: #4b3bb0; }
.avatar.c4 { background: var(--c-teal-bg); color: #0b7280; }
.avatar.c5 { background: var(--c-pink-bg); color: #a92f6c; }

/* ---------- Chart ---------- */
.chart-card { padding: 14px 16px 12px; }
.chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.chart-title { flex: none; }
.chart-sub { text-align: right; max-width: 50%; line-height: 1.3; padding-top: 2px; }
.chart-title { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.chart-title .ico { width: 16px; height: 16px; color: var(--faint); }
.chart-sub { font-size: 12px; color: var(--muted); }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--font); fill: var(--muted); font-size: 11px; }
.chart .ax { stroke: var(--line); stroke-width: 1; }
.chart .bar { transition: opacity .15s; }
.chart .bar.sel { }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .hit:hover + .bar, .chart .hit:focus-visible + .bar { opacity: .75; }
.chart .lbl-strong { fill: var(--text); font-weight: 700; font-size: 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend b { color: var(--text); }
.donut-wrap { display: flex; align-items: center; gap: 16px; }
.donut-wrap .donut { width: 128px; flex: none; }
.donut-wrap .legend { flex-direction: column; gap: 8px; margin: 0; }
.donut-wrap .legend span { justify-content: space-between; width: 100%; }
.donut-wrap .legend .l { display: inline-flex; align-items: center; gap: 8px; }
.donut-wrap .legend .ico { width: 14px; height: 14px; }
.donut-center { fill: var(--text); font-size: 22px; font-weight: 800; }
.donut-center-sub { fill: var(--muted); font-size: 10px; }
.mbar { height: 6px; border-radius: 99px; background: var(--bg-elev); overflow: hidden; margin-top: 6px; }
.mbar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--c-blue), #7fb0f0); }
.split { display: flex; height: 10px; border-radius: 99px; overflow: hidden; gap: 2px; margin: 10px 0 6px; background: var(--bg-elev); }
.split i { display: block; height: 100%; }
.section-title.accent::before { content: ""; width: 4px; height: 14px; border-radius: 2px; background: var(--c-blue); display: inline-block; margin-right: 8px; }
