/* Token dan komponen dasar. Acuan: docs/design/README.md */
:root {
  /* Palet mengikuti wondr by BNI (wondr.bni.co.id). Warna asli wondr dipakai untuk
     latar, tombol, dan grafik; versi lebih gelap untuk teks supaya kontras ≥ 4.5:1. */
  --bg: #F7F9F9;
  --surface: #FFFFFF;
  --surface-2: #F0F4F4;
  --surface-3: #FAFBFB;
  --border: #E3E8E8;
  --border-strong: #CFD8D8;
  --line: #EEF2F2;
  --ink: #141414;
  --ink-2: #3D3D3D;
  --muted: #6B6B6B;
  --muted-2: #707070;

  --brand: #71DBD3;          /* tosca wondr: tombol utama, penanda brand */
  --brand-hover: #5CCFC5;
  --brand-disabled: #A7ECE8;
  --brand-soft: #D9F4F1;
  --brand-tint: #EDF9F7;
  --accent: #ECF789;         /* lime wondr: sorotan */
  --accent-border: #D3E25C;

  --up: #177069;             /* teks naik, link */
  --up-ink: #0F524D;
  --up-line: #2A9D95;        /* garis dan bar grafik */
  --up-soft: #D9F4F1;
  --down: #A84A00;           /* teks turun */
  --down-line: #D96C00;      /* oranye BNI untuk grafik */
  --down-soft: #FFEFD9;

  --danger-ink: #A93232;
  --danger-soft: #FBEAEA;
  --danger-border: #F2C4C4;

  --shadow-sm: 0 1px 2px rgba(20, 20, 20, 0.10);

  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --r-card: 14px;
  --r-ctl: 10px;
  --r-pill: 999px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
}

a { color: var(--up); }
a:hover { color: var(--up-ink); }

h1, h2 { margin: 0; letter-spacing: -0.02em; }
h1 { font-size: 26px; }
h2 { font-size: 16px; letter-spacing: -0.01em; }

.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.up { color: var(--up); }
.down { color: var(--down); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 2px solid var(--up); outline-offset: 2px; }

/* ---------- Kontrol ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border: 1px solid #9FDCD6; border-radius: var(--r-ctl);
  background: var(--brand-tint); color: var(--up-ink);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
/* Semua tombol berwarna supaya jelas bisa diklik (masukan user): bawaan tosca muda. */
.btn:hover { background: var(--brand-soft); border-color: var(--up-line); color: var(--up-ink); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--ink); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--ink); }
.btn-primary:disabled { background: var(--brand-disabled); border-color: var(--brand-disabled); cursor: not-allowed; }
.btn:disabled { color: var(--muted-2); cursor: not-allowed; }
.btn-lg { height: 48px; font-size: 15px; }
.btn-sm { height: 36px; padding: 0 12px; font-size: 13px; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.input {
  width: 100%; height: 46px; padding: 0 14px;
  border: 1px solid var(--border-strong); border-radius: var(--r-ctl);
  background: var(--surface-3); color: var(--ink);
  font: inherit; font-size: 15px; font-weight: 400;
}
.input:focus { outline: 2px solid var(--up); outline-offset: 1px; background: var(--surface); }
.input[aria-invalid="true"] { border-color: var(--down); }

.alert {
  padding: 12px 14px; border-radius: var(--r-ctl);
  border: 1px solid var(--danger-border); background: var(--danger-soft); color: var(--danger-ink);
  font-size: 14px;
}

.badge {
  display: inline-flex; align-items: center; height: 24px; padding: 0 8px;
  border-radius: 6px; font-family: var(--font-mono); font-size: 12px; font-weight: 600;
}
.badge.up { background: var(--up-soft); }
.badge.down { background: var(--down-soft); }
.chip {
  display: inline-flex; align-items: center; height: 24px; padding: 0 8px;
  border-radius: 6px; background: var(--surface-2); color: var(--ink-2);
  font-size: 12px; font-weight: 600;
}
.tag-sample {
  display: inline-flex; align-items: center; height: 26px; padding: 0 10px;
  border-radius: var(--r-pill); border: 1px solid var(--accent-border);
  background: var(--accent); color: var(--ink); font-size: 12px; font-weight: 600;
}

/* ---------- Login ---------- */
.login { min-height: 100vh; display: flex; flex-wrap: wrap; }
.login-main {
  flex: 1 1 480px; display: flex; align-items: center; justify-content: center;
  padding: 48px 24px; background: var(--surface);
}
.login-form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 18px; }
.login-form h1 { margin-top: 12px; font-size: 28px; }
.login-form p { margin: 6px 0 0; }
.pw-wrap { position: relative; display: flex; }
.pw-wrap .input { padding-right: 84px; }
.pw-toggle {
  position: absolute; right: 6px; top: 6px; height: 34px; padding: 0 10px;
  border: 0; border-radius: 7px; background: var(--surface-2); color: var(--ink-2);
  font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
}
.captcha-row { display: flex; gap: 10px; align-items: stretch; }
.captcha-img {
  flex: none; width: 150px; height: 46px; border-radius: var(--r-ctl);
  border: 1px solid var(--border); background: var(--surface); object-fit: cover;
}
.captcha-row .input { flex: 1; min-width: 0; letter-spacing: 0.2em; font-family: var(--font-mono); }
.captcha-reload { flex: none; width: 46px; padding: 0; }
.captcha-reload svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.login-foot { font-size: 13px; color: var(--muted); }
.logo-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.logo-strip img { display: block; height: 40px; width: auto; }

.login-aside {
  flex: 1 1 480px; padding: 48px; display: flex; flex-direction: column; justify-content: center;
  background: var(--brand-tint);
}
.login-aside-inner { width: 100%; max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.login-aside h2 { font-size: 24px; letter-spacing: -0.02em; }
.login-aside p { margin: 0; color: var(--muted); font-size: 15px; }
.aside-chart { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 22px; }
.aside-chart svg { display: block; width: 100%; height: 160px; }
.aside-chart .area { fill: var(--up-line); fill-opacity: 0.08; }
.aside-chart .line { fill: none; stroke: var(--up-line); stroke-width: 2.5; stroke-linejoin: round; }
.aside-chart .target { fill: none; stroke: var(--down-line); stroke-width: 2; stroke-dasharray: 6 5; }
.aside-chart .grid { stroke: var(--line); stroke-width: 1; }

/* ---------- Shell aplikasi ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-inner {
  max-width: 1440px; margin: 0 auto; padding: 12px 24px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand-sub { color: var(--muted); font-weight: 500; }
.brand-logo { display: block; height: 32px; width: auto; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 auto; }
.nav a { padding: 8px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--brand-soft); color: var(--ink); font-weight: 600; }
.nav .nav-soon { padding: 8px 12px; color: var(--muted-2); cursor: not-allowed; }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--brand-soft); color: var(--up-ink);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-meta strong { font-size: 13px; }
.user-meta span { font-size: 12px; color: var(--muted); text-transform: capitalize; }
.logout-form { margin: 0; }

.ticker { background: var(--surface); border-bottom: 1px solid var(--border); overflow: hidden; }
.ticker-track { display: flex; width: max-content; animation: tick 40s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 22px;
  border-right: 1px solid var(--line); white-space: nowrap;
}
.ticker-item strong { font-weight: 600; }
.ticker-item .num:last-child { font-weight: 600; }
@keyframes tick { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker-track { animation: none; } }

.page { max-width: 1440px; margin: 0 auto; padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.page-head h1 { margin-top: 4px; }
.page-sub { color: var(--muted); font-size: 13px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 20px; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }

/* KPI */
.kpis { display: flex; flex-wrap: wrap; gap: 16px; }
.kpi { flex: 1 1 230px; display: flex; flex-direction: column; gap: 10px; padding: 18px; }
.kpi-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kpi-label { color: var(--muted); font-size: 13px; font-weight: 500; }
.kpi-bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.kpi-value { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.spark { flex: none; fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark.up { stroke: var(--up-line); }
.spark.down { stroke: var(--down-line); }

/* Chart + unit */
.row { display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; }
.chart-card { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.chart-value { display: flex; align-items: baseline; gap: 10px; margin-top: 4px; }
.chart-value .num:first-child { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; }
.chart-value .num:last-child { font-weight: 600; }
.segmented { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: var(--r-ctl); }
.segmented a {
  min-width: 52px; height: 36px; padding: 0 10px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-weight: 600; text-decoration: none;
}
.segmented a:hover { color: var(--ink); }
.segmented a[aria-current="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.legend { display: flex; gap: 18px; font-size: 13px; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { display: block; width: 12px; height: 0; border-top: 3px solid var(--up-line); border-radius: 2px; }
.legend i.target { border-top: 2px dashed var(--down-line); }
.chart { display: block; width: 100%; height: 300px; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .area { fill: var(--up-line); fill-opacity: 0.08; }
.chart .target { fill: none; stroke: var(--down-line); stroke-width: 2; stroke-dasharray: 6 5; vector-effect: non-scaling-stroke; }
.chart .line { fill: none; stroke: var(--up-line); stroke-width: 2.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }

.unit-card { flex: 1 1 320px; display: flex; flex-direction: column; gap: 14px; }
.unit-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.unit-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.unit-item {
  position: relative; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 9px 10px; border-radius: 8px; overflow: hidden;
}
.unit-item .bar { position: absolute; inset: 0; width: 100%; height: 100%; }
.unit-item .bar rect { fill: var(--brand-soft); }
.unit-item > span { position: relative; }
.unit-item .num { font-size: 13px; }
.unit-totals { margin-top: auto; display: flex; gap: 10px; }
.unit-totals div { flex: 1; background: var(--brand-tint); border-radius: var(--r-ctl); padding: 12px; }
.unit-totals span { display: block; font-size: 12px; color: var(--muted); }
.unit-totals strong { display: block; margin-top: 2px; font-family: var(--font-mono); font-weight: 600; }

/* Tabel */
.table-card { display: flex; flex-direction: column; gap: 14px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filters a {
  height: 36px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--border);
  display: flex; align-items: center; background: var(--surface); color: var(--ink-2);
  font-weight: 600; text-decoration: none;
}
.filters a:hover { border-color: var(--border-strong); color: var(--ink); }
.filters a[aria-current="true"] { background: var(--brand); border-color: var(--brand); color: var(--ink); }
.table-scroll { position: relative; overflow-x: auto; } /* kurung .sr-only (absolute) agar tidak melebarkan halaman */
.table { width: 100%; min-width: 900px; border-collapse: collapse; }
.table th {
  padding: 10px 12px; border-bottom: 1px solid var(--line);
  font-size: 12px; font-weight: 500; color: var(--muted); text-align: left; white-space: nowrap;
}
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover { background: var(--surface-3); }
.table .right { text-align: right; }
.table .name { font-weight: 600; }
.table .name small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.table .delta { font-weight: 600; }
.meter { display: flex; align-items: center; gap: 8px; min-width: 140px; }
.meter svg { flex: 1; height: 6px; border-radius: 3px; }
.meter .track { fill: var(--line); }
.meter .fill { fill: var(--up-line); }
.meter .num { width: 38px; text-align: right; font-size: 12px; }
.table-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.empty { padding: 32px 12px; text-align: center; color: var(--muted); }

@media (max-width: 640px) {
  .topbar-inner, .page { padding-left: 16px; padding-right: 16px; }
  .login-aside { padding: 32px 16px; }
  .user-meta { display: none; }
}

/* ---------- Admin ---------- */
.page.narrow { max-width: 720px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.block { display: block; }
.search { display: flex; gap: 8px; flex-wrap: wrap; }
.search .input { width: 280px; height: 40px; }
.chip.ok { background: var(--up-soft); color: var(--up-ink); }
.chip.warn { background: var(--down-soft); color: var(--down); }
fieldset { margin: 0; padding: 0; border: 0; }
legend { padding: 0; margin-bottom: 4px; font-size: 16px; font-weight: 600; }
fieldset p, .stack > p { margin: 0; }
.target { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; }
.target dt { font-size: 12px; color: var(--muted); }
.target dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.secret {
  display: block; padding: 14px 16px; border-radius: var(--r-ctl);
  border: 1px dashed var(--border-strong); background: var(--surface-3);
  font-size: 22px; font-weight: 600; letter-spacing: 0.06em; user-select: all;
}
@media (max-width: 640px) { .target { grid-template-columns: minmax(0, 1fr); } .search .input { width: 100%; } }

/* ---------- Modul ---------- */
.modul { max-width: 1440px; margin: 0 auto; display: flex; gap: 8px; align-items: flex-start; }
.subnav { flex: none; width: 200px; position: sticky; top: 0; padding: 24px 0 24px 24px; display: flex; flex-direction: column; gap: 2px; }
.subnav a { padding: 7px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 14px; }
.subnav a:hover { background: var(--surface-2); color: var(--ink); }
.subnav a[aria-current="page"] { background: var(--brand-soft); color: var(--ink); font-weight: 600; }
.subnav .subnav-title { font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.modul-main { flex: 1 1 auto; min-width: 0; margin: 0; }
.modul-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.modul-card { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); }
.modul-card:hover { border-color: var(--up-line); color: var(--ink); }
.flash { background: var(--brand-soft); border-radius: var(--r-ctl); padding: 10px 14px; font-weight: 500; }
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.toolbar .search { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pager { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; }
.pager-links { display: flex; gap: 8px; align-items: center; }
.nowrap { white-space: nowrap; }
.table td.wide { min-width: 280px; }
.btn-danger { color: var(--danger-ink); background: var(--danger-soft); border-color: var(--danger-border); }
.btn-danger:hover { color: #fff; background: var(--danger-ink); border-color: var(--danger-ink); }
.btn-edit { color: var(--ink); background: var(--accent); border-color: var(--accent-border); }
.btn-edit:hover { color: var(--ink); background: #E2F06A; border-color: #C3D24A; }
.btn-excel { color: #14532D; background: #DCF5E3; border-color: #86CFA0; }
.btn-excel:hover { color: #fff; background: #1E7A45; border-color: #1E7A45; }
.btn-pdf { color: var(--down); background: var(--down-soft); border-color: #F5BE85; }
.btn-pdf:hover { color: #fff; background: var(--down-line); border-color: var(--down-line); }
.narrow-card { max-width: 560px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.field-error { color: var(--danger-ink); font-size: 12px; font-weight: 500; }
.field-hint { color: var(--muted); font-size: 12px; font-weight: 400; }
.input[readonly] { background: var(--surface-2); color: var(--muted); }
textarea.input { min-height: 96px; padding-top: 10px; resize: vertical; }
@media (max-width: 860px) {
  .modul { flex-direction: column; }
  .subnav { position: static; width: auto; flex-direction: row; flex-wrap: wrap; padding: 16px 16px 0; }
  .subnav .subnav-title { width: 100%; margin-bottom: 0; }
}
.alert.warn { background: var(--down-soft); color: var(--down); border-color: transparent; }
.check { display: flex; align-items: center; gap: 8px; height: 44px; font-weight: 500; }
select.input { appearance: auto; }
.swatch { display: inline-flex; align-items: center; gap: 6px; }
.thumb { width: 56px; height: 40px; object-fit: cover; border-radius: 6px; display: block; }
#f-content { min-height: 260px; }
.input-date { width: auto; }
.detail { display: grid; gap: 10px; margin: 0; }
.detail > div { display: grid; grid-template-columns: 160px 1fr; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.detail dt { color: var(--muted); font-size: 13px; }
.detail dd { margin: 0; word-break: break-word; }
.detail pre { margin: 0; white-space: pre-wrap; font-family: var(--font-mono); font-size: 12px; background: var(--surface-2); padding: 12px; border-radius: 8px; max-height: 480px; overflow: auto; }
@media (max-width: 640px) { .detail > div { grid-template-columns: 1fr; } }

/* Tab halaman (RKA TJSL | PMS, Register Permohonan | Lainnya) */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.tabs a { padding: 8px 14px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--brand); }
.filter-range { display: inline-flex; align-items: center; gap: 6px; }
.filter-range label { color: var(--muted); font-size: 13px; }

/* Timeline tahapan kegiatan (Update Status register) */
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.timeline .step { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 0 0 16px 24px; border-left: 2px solid var(--border); margin-left: 6px; }
.timeline .step::before { content: ""; position: absolute; left: -7px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border); }
.timeline .step.done { border-left-color: var(--brand); }
.timeline .step.done::before { background: var(--brand); border-color: var(--brand); }
.timeline .step:last-child { padding-bottom: 0; }

/* Dashboard v2 (layout dashboard lama, nuansa trading) */
.ticker-item .up { color: var(--up); }
.kpi-note { font-size: 12px; }
.pilar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.pilar-card { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; color: inherit; text-decoration: none; }
.pilar-card:hover { border-color: var(--brand); }
.pilar-pct { font-size: 22px; font-weight: 600; }
.pilar-rp { font-size: 12px; }
.pilar-card .meter, .top-list .meter { min-width: 0; width: 100%; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); align-items: center; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.legend .lg-a { background: var(--up-line); }
.legend .lg-b { background: var(--accent-border); }
.bars { width: 100%; height: auto; display: block; }
.bars .grid { stroke: var(--line); stroke-width: 1; }
.bars .bar-a { fill: var(--up-line); }
.bars .bar-b { fill: var(--accent-border); }
.bars a:hover rect { opacity: .8; }
.bars .bar-label { font-size: 10px; fill: var(--muted); font-family: var(--font-sans); }
.dash-split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.dash-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.top-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.top-list li { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; font-size: 13px; }
.top-list .meter { grid-column: 1 / -1; }
.peta { width: 100%; height: auto; display: block; background: var(--surface-3); border-radius: var(--r-ctl); }
.peta path { stroke: var(--surface); stroke-width: .6; }
.peta a:hover path { stroke: var(--ink); stroke-width: 1; }
.peta .m0, .peta-legend .m0 { fill: var(--line); background: var(--line); }
.peta .m1, .peta-legend .m1 { fill: #CDEFEC; background: #CDEFEC; }
.peta .m2, .peta-legend .m2 { fill: #9FDCD6; background: #9FDCD6; }
.peta .m3, .peta-legend .m3 { fill: #5FC2BA; background: #5FC2BA; }
.peta .m4, .peta-legend .m4 { fill: #2A9D95; background: #2A9D95; }
.peta .m5, .peta-legend .m5 { fill: #177069; background: #177069; }
.attrib { font-size: 11px; }
.sdg { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.donut { width: 180px; height: 180px; flex: none; }
.sdg-list { list-style: none; margin: 0; padding: 0; flex: 1 1 220px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.sdg-list li { display: grid; grid-template-columns: 10px 1fr auto; gap: 8px; align-items: center; }
.sdg-list .dot { width: 10px; height: 10px; }
@media (max-width: 760px) { .dash-split { grid-template-columns: 1fr; } }
.sub-head { margin: 4px 0 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.top-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 20px; }
.peta-legend i { width: 18px; height: 10px; margin: 0; }
.bars { overflow: visible; }

/* Dashboard v3 (3 layer) */
.kat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.kat-card { display: flex; flex-direction: column; gap: 4px; padding: 14px; color: inherit; text-decoration: none; background: var(--brand-tint); }
.kat-card:hover { border-color: var(--brand); }
.kat-qty { font-size: 20px; font-weight: 600; }
.kat-rp { font-size: 12px; }
.serap { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.serap-info { flex: 1 1 220px; gap: 6px; }
.donut-pct { font-family: var(--font-mono); font-size: 18px; font-weight: 600; fill: var(--ink); }
.wilayah { display: grid; grid-template-columns: minmax(0, 3fr) minmax(240px, 1fr); gap: 16px; align-items: start; }
.region-card h2 { text-transform: uppercase; }
@media (max-width: 860px) { .wilayah { grid-template-columns: 1fr; } }
/* Tabel sebaran dashboard: ringkas, scroll di dalam kartu. */
.table-scroll.capped { max-height: 360px; overflow-y: auto; }
.table-scroll.capped thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.laporan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; align-items: start; }
.laporan-wide { grid-column: 1 / -1; }

/* Form satu kolom dan saklar (form realisasi seperti app lama). */
.form-stack { display: flex; flex-direction: column; gap: 16px; max-width: 760px; }
.toggle { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; }
.toggle input[type="checkbox"] {
  appearance: none; width: 44px; height: 24px; border-radius: 12px; margin: 0; cursor: pointer;
  background: var(--border-strong); position: relative; transition: background .15s;
}
.toggle input[type="checkbox"]::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--surface); box-shadow: var(--shadow-sm); transition: transform .15s;
}
.toggle input[type="checkbox"]:checked { background: var(--up-line); }
.toggle input[type="checkbox"]:checked::after { transform: translateX(20px); }
.toggle input[type="checkbox"]:focus-visible { outline: 2px solid var(--up); outline-offset: 2px; }
.stage-split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .stage-split { grid-template-columns: minmax(0, 1fr); } }
.info-box { display: flex; flex-direction: column; gap: 4px; }

/* Template WA dan Blast WA. */
.table-compact { min-width: 0; }
.wa-msg { white-space: pre-wrap; word-break: break-word; font: inherit; font-size: 13px; max-width: 500px; margin: 0; }
.unit-list { max-height: 400px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 6px 10px; }
.unit-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-bottom: 1px solid var(--line); cursor: pointer; }
.unit-item:last-child { border-bottom: 0; }
.unit-item:has(input:checked) { background: var(--brand-tint); font-weight: 600; }
