/* TR Management Dashboard. Diturunkan dari mockup/styles.css. Navy + oranye mengikuti logo The Rabbaanians; seri grafik memakai palet referensi tervalidasi. */
:root {
  color-scheme: light;
  --paper: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f1f4f9;
  --ink: #1b2533;
  --ink-2: #44526a;
  --muted: #697588;
  --line: #e4e9f1;
  --navy: #22324a;
  --navy-2: #2b3c55;
  --nav-ink: #e9eef6;
  --nav-muted: #b6c2d4;
  --brand: #ee5323;
  --accent: #c2410c;
  --on-accent: #ffffff;
  --accent-text: #c2410c;
  --accent-soft: #fde8dc;
  --accent-soft-ink: #9a3412;
  --focus: #2a78d6;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --grid: #e9edf3;
  --good: #137a3a;
  --good-bg: #e1f4e8;
  --warn: #8a5a00;
  --warn-bg: #fdf1d6;
  --info: #1c5cab;
  --info-bg: #e5edfb;
  --bad: #c0282d;
  --bad-bg: #fde6e4;
  --shadow: 0 1px 2px rgba(20, 32, 54, .04), 0 6px 20px rgba(20, 32, 54, .05);
  --radius: 16px;
}

/* Atribut hidden selalu menang atas display komponen (.btn, .callout, dst.); JS memakai el.hidden. */
[hidden] { display: none !important; }

/* Mode gelap belum dipakai di aplikasi; default selalu terang walau OS gelap. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0e141c;
  --surface: #161e29;
  --surface-2: #1d2733;
  --ink: #e8edf4;
  --ink-2: #b9c3d1;
  --muted: #8d99aa;
  --line: #29343f;
  --navy: #121b27;
  --navy-2: #1a2533;
  --accent-text: #f39466;
  --accent-soft: #3b2418;
  --accent-soft-ink: #f6b08d;
  --series-1: #3987e5;
  --series-2: #d95926;
  --grid: #26303b;
  --good: #5fd38a;
  --good-bg: #173322;
  --warn: #f2c25b;
  --warn-bg: #3a3018;
  --info: #86b6ef;
  --info-bg: #1b2a3d;
  --bad: #f08a8a;
  --bad-bg: #3d1f1f;
  --shadow: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 14px/1.5 "Plus Jakarta Sans", Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 276px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--navy); color: var(--nav-ink);
  display: flex; flex-direction: column;
}
.brand { display: grid; gap: 6px; padding: 22px 22px 18px; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand-logo { display: block; width: 168px; height: auto; }
.brand-sub { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--nav-muted); padding-left: 2px; }
.sidebar nav { padding: 6px 12px 16px; }
.nav-group { margin-top: 16px; }
.nav-label { padding: 0 12px 6px; font-size: 11px; font-weight: 700; letter-spacing: .12em; color: var(--nav-muted); text-transform: uppercase; }
.nav-link {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 9px 12px; border-radius: 10px; border: 0; background: none;
  text-decoration: none; color: var(--nav-ink); font-weight: 500; font-size: 14px; cursor: pointer;
}
.nav-link + .nav-link { margin-top: 2px; }
.nav-link svg { flex: none; width: 18px; height: 18px; color: var(--nav-muted); }
.nav-link:hover { background: rgba(255,255,255,.07); }
.nav-link[aria-current="page"] { background: var(--accent); color: var(--on-accent); font-weight: 700; box-shadow: 0 6px 16px rgba(194, 65, 12, .35); }
.nav-link[aria-current="page"] svg { color: var(--on-accent); }
.nav-tag { margin-left: auto; font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; background: rgba(255,255,255,.1); color: var(--nav-ink); }
.nav-link[aria-current="page"] .nav-tag { background: rgba(255,255,255,.2); }
.sidebar-foot { margin-top: auto; padding: 16px 22px; background: var(--navy-2); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sidebar-foot b { display: block; font-size: 13.5px; }
.sidebar-foot-text > span { display: block; font-size: 11.5px; color: var(--nav-muted); }
.sidebar-foot .ic { width: 22px; height: 22px; color: var(--nav-muted); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-soft-ink); display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 28px; min-height: 72px; background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.menu-btn { display: none; border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 6px 8px; cursor: pointer; }
.topbar-mark { display: none; width: 24px; height: auto; }
.source-chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.search {
  margin-left: auto; display: flex; align-items: center; gap: 8px; width: min(320px, 28vw); height: 40px; padding: 0 12px;
  border-radius: 12px; background: var(--surface-2); border: 1px solid transparent; color: var(--muted);
}
.search:focus-within { border-color: var(--focus); background: var(--surface); }
.search input { border: 0; background: none; outline: none; width: 100%; color: var(--ink); font-size: 13.5px; }
.search input::placeholder { color: var(--muted); }
.icon-btn { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 0; background: none; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn .ic { width: 20px; height: 20px; }
.notif-dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 2px var(--surface); }
.user { display: flex; align-items: center; gap: 10px; }
.user-text { display: grid; justify-items: end; gap: 2px; line-height: 1.2; }
.user-text b { font-size: 14px; white-space: nowrap; }
.user .avatar { width: 40px; height: 40px; font-size: 14px; background: var(--navy); color: #fff; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--line); }
.content { padding: 28px 32px 64px; max-width: 1320px; width: 100%; }

/* Pills: small labels used across the dashboard. */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 600; white-space: nowrap; line-height: 1.6; }
.pill .ic { width: 12px; height: 12px; }
.pill-accent { background: var(--accent-soft); color: var(--accent-soft-ink); }
.pill-good { background: var(--good-bg); color: var(--good); }
.pill-info { background: var(--info-bg); color: var(--info); }
.pill-bad { background: var(--bad-bg); color: var(--bad); }
.pill-neutral { background: var(--surface-2); color: var(--ink-2); }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.eyebrow { font-size: 10px; font-weight: 700; letter-spacing: .17em; color: var(--muted); text-transform: uppercase; }
.page-head h1 { margin: 6px 0 4px; font-size: 28px; font-weight: 700; letter-spacing: -.025em; }
.page-head p { margin: 0; color: var(--muted); max-width: 640px; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* ---------- Controls ---------- */
.select, .input {
  height: 36px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink);
}
.input { width: 100%; }
.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px;
  border-radius: 9px; border: 1px solid var(--line); background: var(--surface);
  font-weight: 600; font-size: 13px; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 7px; font-weight: 600; font-size: 12px; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); flex: none; }
.chip.is-down .dot { background: var(--bad); }
.chip.is-stale { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.chip.is-stale .dot { background: var(--warn); }

/* ---------- Cards & layout ---------- */
.grid { display: grid; gap: 16px; }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.g-memo { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 20px 0; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; font-size: 15px; font-weight: 650; }
.card-head p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.card-body { padding: 14px 20px 18px; }
.section { margin-top: 16px; }

.tile { padding: 16px 18px; }
.tile-label { font-size: 12px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.tile-value { margin-top: 8px; font-size: 26px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.tile-sub { margin-top: 4px; font-size: 12px; color: var(--muted); }
.tile-src { margin-top: 10px; font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.tile.is-dark { background: var(--navy); border-color: var(--navy); color: #fff; }
.tile.is-dark .tile-label, .tile.is-dark .tile-sub, .tile.is-dark .tile-src { color: rgba(255,255,255,.75); }
.info-tip { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; border: 1px solid currentColor; font-size: 9px; font-weight: 700; cursor: help; opacity: .7; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; }
tbody tr:hover td, tbody tr:hover th { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
td.r, th.r { text-align: right; }
tfoot td, tfoot th { font-weight: 700; border-top: 1px solid var(--line); border-bottom: 0; background: var(--surface-2); }
.matrix th:first-child, .matrix td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; box-shadow: 1px 0 0 var(--line); }
.matrix thead th:first-child { background: var(--surface-2); z-index: 2; }
.row-btn { all: unset; cursor: pointer; font-weight: 600; }
.row-btn:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.strike { text-decoration: line-through; color: var(--muted); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge svg { width: 12px; height: 12px; }
.b-good { background: var(--good-bg); color: var(--good); }
.b-warn { background: var(--warn-bg); color: var(--warn); }
.b-info { background: var(--info-bg); color: var(--info); }
.b-bad { background: var(--bad-bg); color: var(--bad); }
.b-neutral { background: var(--surface-2); color: var(--ink-2); }
.cell-mark { display: inline-grid; place-items: center; width: 24px; height: 22px; border-radius: 6px; font-size: 11px; font-weight: 700; }

/* ---------- Meter ---------- */
.meter { position: relative; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; min-width: 80px; }
.meter > span { position: absolute; inset: 0 auto 0 0; background: var(--series-1); border-radius: 99px; }
.meter-row { display: flex; align-items: center; gap: 10px; }
.meter-row .meter { flex: 1; }

/* ---------- Charts ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis-text { fill: var(--muted); font-size: 11px; }
.chart .value-text { fill: var(--ink-2); font-size: 11px; font-weight: 600; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--line); stroke-width: 1; }
.chart .bar { fill: var(--series-1); }
.chart .bar-2 { fill: var(--series-2); }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover + .hover-band, .chart .is-hover { fill: color-mix(in srgb, var(--ink) 5%, transparent); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.tooltip {
  position: fixed; z-index: 100; pointer-events: none; padding: 8px 10px; border-radius: 9px;
  background: var(--ink); color: var(--paper); font-size: 12px; line-height: 1.45; box-shadow: 0 8px 20px rgba(0,0,0,.18);
  opacity: 0; transform: translateY(4px); transition: opacity .08s, transform .08s; max-width: 260px;
}
.tooltip.is-on { opacity: 1; transform: none; }
.tooltip b { font-variant-numeric: tabular-nums; }

.hbar { display: grid; grid-template-columns: 22px minmax(120px, 1.1fr) minmax(0, 2fr) auto; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.hbar:last-child { border-bottom: 0; }
.hbar .rank { font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.hbar .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .track { display: block; height: 12px; }
.hbar .fill { display: block; height: 12px; border-radius: 0 4px 4px 0; background: var(--series-1); }
.hbar .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.hbar .val small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }

/* ---------- Lists ---------- */
.agenda { list-style: none; margin: 0; padding: 0; }
.agenda li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.agenda li:last-child { border-bottom: 0; }
.date-box { border: 1px solid var(--line); border-radius: 10px; text-align: center; padding: 4px 0; }
.date-box b { display: block; font-size: 17px; line-height: 1.2; }
.date-box span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.agenda-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.agenda-item + .agenda-item { margin-top: 4px; }

.expander { border-top: 1px solid var(--line); }
.expander:first-child { border-top: 0; }
.expander-head { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(140px, 1fr) 90px 24px; align-items: center; gap: 14px; width: 100%; padding: 12px 20px; border: 0; background: none; text-align: left; cursor: pointer; }
.expander-head:hover { background: var(--surface-2); }
.expander-head .chev { transition: transform .15s; color: var(--muted); }
.expander[data-open="true"] .chev { transform: rotate(90deg); }
.expander-body { display: none; padding: 0 20px 16px; }
.expander[data-open="true"] .expander-body { display: block; }
.people { display: flex; flex-wrap: wrap; gap: 6px; }
.person { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 99px; border: 1px solid var(--line); font-size: 12px; }
.person .avatar { width: 22px; height: 22px; font-size: 9px; }

/* ---------- Upload / memo ---------- */
.drop {
  display: grid; place-items: center; text-align: center; gap: 6px; padding: 28px 16px;
  border: 1.5px dashed color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: 12px; background: var(--surface-2);
}
.drop b { font-size: 14px; }
.privacy { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 12.5px; }
.privacy svg { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.privacy.local { background: var(--good-bg); color: var(--good); }
.privacy.server { background: var(--info-bg); color: var(--info); }
.privacy b { display: block; }
.privacy span { color: var(--ink-2); }
.steps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.step { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--muted); }
.step i { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); font-style: normal; font-size: 11px; }
.step.is-done { color: var(--ink-2); }
.step.is-done i { background: var(--accent-soft); color: var(--accent-text); }
.step.is-current { color: var(--ink); border-color: var(--accent); }
.step.is-current i { background: var(--accent); color: var(--on-accent); }
.period-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.check { width: 16px; height: 16px; accent-color: var(--accent); }
.sum-list { display: grid; gap: 10px; margin: 0; }
.sum-list div { display: flex; justify-content: space-between; gap: 10px; }
.sum-list dt { color: var(--muted); }
.sum-list dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.sum-total { padding-top: 10px; border-top: 1px dashed var(--line); }
.sum-total dd { font-size: 20px; font-weight: 700; color: var(--accent-text); }
.field { display: grid; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field small { color: var(--muted); font-size: 11px; }
.sticky { position: sticky; top: 76px; }

/* ---------- Empty / placeholder ---------- */
.empty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 36px 20px; }
.empty-icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.empty h3 { margin: 4px 0 0; font-size: 16px; }
.empty p { margin: 0; max-width: 520px; color: var(--muted); }
.ghost { position: relative; }
.ghost .table-wrap { opacity: .45; filter: saturate(.3); pointer-events: none; user-select: none; }
.ghost-label { position: absolute; top: 12px; right: 14px; z-index: 3; }
.callout { padding: 14px 16px; border-radius: 12px; background: var(--warn-bg); color: var(--ink-2); font-size: 13px; display: flex; gap: 10px; }
.callout svg { flex: none; width: 18px; height: 18px; color: var(--warn); margin-top: 1px; }
.callout.down { background: var(--bad-bg); }
.callout.down svg { color: var(--bad); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs button { border: 0; background: none; padding: 9px 14px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }

.scrim { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main, .g-memo { grid-template-columns: minmax(0, 1fr); }
  .sticky { position: static; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 60; left: 0; top: 0; width: 280px; transform: translateX(-100%); transition: transform .2s; }
  .shell[data-drawer="open"] .sidebar { transform: none; }
  .shell[data-drawer="open"] .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.3); }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 10px 16px; }
  .content { padding: 18px 16px 90px; }
  .g-3, .g-2 { grid-template-columns: minmax(0, 1fr); }
  .expander-head { grid-template-columns: minmax(0, 1fr) 70px 20px; }
  .expander-head .meter-row { display: none; }
  .hbar { grid-template-columns: 20px minmax(0, 1fr) auto; }
  .hbar .track { grid-column: 2 / -1; grid-row: 2; }
}
@media (max-width: 520px) {
  .g-4 { grid-template-columns: minmax(0, 1fr); }
  .page-head h1 { font-size: 22px; }
}
@media print {
  .tx-scroll { max-height: none !important; overflow: visible; border: 0; }
  .sidebar, .topbar { display: none; }
  .shell { display: block; }
}

/* Chart hover: the whole column band is the hit target, larger than the mark. */
.chart .col .band { fill: transparent; }
.chart .col:hover .band { fill: color-mix(in srgb, var(--ink) 6%, transparent); }
.chart .col { cursor: default; }
.chart-note { margin-top: 8px; font-size: 11.5px; color: var(--muted); }

/* Icons default to text size; component rules above override where needed. */
.ic { width: 16px; height: 16px; flex: none; }
.ic.inline { width: 13px; height: 13px; vertical-align: -2px; color: var(--muted); }
.empty-icon .ic { width: 20px; height: 20px; }
.drop .ic { width: 22px; height: 22px; color: var(--accent-text); }
.chip .ic, .tile-src .ic { width: 13px; height: 13px; }
.expander-head .r { text-align: right; }
.g-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.g-5 .tile-value { font-size: 20px; }
.hbar.cat { grid-template-columns: minmax(130px, 1.1fr) minmax(0, 1.4fr) auto; }
@media (max-width: 1100px) { .g-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .g-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .expander-head > :nth-child(2) { display: none; }
  .hbar.cat { grid-template-columns: minmax(0, 1fr) auto; }
  .hbar.cat .track { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 520px) { .g-5 { grid-template-columns: minmax(0, 1fr); } }
.seg { max-width: 100%; overflow-x: auto; }
.seg button { flex: none; }
.matrix th:first-child, .matrix td:first-child { min-width: 190px; white-space: nowrap; }
.matrix td { white-space: nowrap; }
.matrix tbody th { font-weight: 500; }

/* ---------- Topbar source chips ---------- */
.src-chip { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: 99px; background: var(--good-bg); color: var(--good); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.src-chip .dot { background: currentColor; }
.src-chip.is-stale { background: var(--warn-bg); color: var(--warn); }
.src-chip.is-neutral { background: var(--surface-2); color: var(--ink-2); }
.src-chip .ic { width: 14px; height: 14px; }
.src-chip small { font-size: 10.5px; font-weight: 700; padding: 0 6px; border-radius: 6px; background: var(--info-bg); color: var(--info); }

/* ---------- Beranda ---------- */
.hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 26px; }
.hero-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hero h1 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1.2; }
.hero-meta { margin-top: 8px; display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; color: var(--ink-2); font-size: 13.5px; }
.hero-meta span { display: inline-flex; align-items: center; gap: 7px; }
.hero-meta .ic { width: 16px; height: 16px; color: var(--muted); }
.period {
  display: inline-flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px;
  border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); border: 1px solid var(--line);
}
.period .ic { width: 18px; height: 18px; color: var(--ink-2); }
.period select { appearance: none; -webkit-appearance: none; border: 0; background: none; font-weight: 700; font-size: 14px; padding-right: 22px; cursor: pointer; outline: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 6px center, right 1px center; background-size: 5px 5px; background-repeat: no-repeat; }
.period:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }

.kpis { gap: 20px; }
.kpi { display: flex; flex-direction: column; overflow: hidden; }
.kpi-main { flex: 1; padding: 20px 22px 18px; }
.kpi-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.kpi-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; }
.kpi-label .pill { letter-spacing: 0; text-transform: none; }
.kpi-icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; }
.kpi-icon .ic { width: 22px; height: 22px; }
.tone-accent { background: var(--accent-soft); color: var(--accent-text); }
.tone-good { background: var(--good-bg); color: var(--good); }
.tone-bad { background: var(--bad-bg); color: var(--bad); }
.tone-info { background: var(--info-bg); color: var(--info); }
.kpi-value { margin-top: 12px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.kpi-value b { font-size: 36px; font-weight: 800; letter-spacing: -.035em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.kpi-value b.money { font-size: 28px; }
.kpi-value b.is-good { color: var(--good); }
.kpi-value b.is-bad { color: var(--bad); }
.kpi-value span { color: var(--ink-2); font-size: 15px; }
.kpi-foot { padding: 12px 22px; background: var(--surface-2); font-size: 12.5px; color: var(--ink-2); display: flex; justify-content: space-between; align-items: center; gap: 4px 12px; flex-wrap: wrap; }
.kpi-foot b { color: var(--ink); }
.trend { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--good); }
.trend .ic { width: 15px; height: 15px; }
.trend.is-down { color: var(--bad); }
.trend.is-down .ic { transform: scaleY(-1); }
.stackbar { display: flex; gap: 2px; height: 8px; margin-top: 16px; border-radius: 99px; overflow: hidden; background: var(--surface-2); }
.stackbar span { display: block; height: 100%; }
.c-tepat { background: var(--good); }
.c-telat { background: #d9a21b; }
.c-izin { background: var(--series-1); }
.c-alfa { background: var(--bad); }
.legend-inline { display: flex; gap: 4px 12px; flex-wrap: wrap; }
.legend-inline span { display: inline-flex; align-items: center; gap: 5px; }
.legend-inline i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.legend-inline .is-alfa { color: var(--bad); font-weight: 700; }

.home-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 24px; margin-top: 24px; align-items: start; }
.col-stack { display: grid; gap: 24px; min-width: 0; }
.panel-head { display: flex; align-items: flex-start; gap: 14px; padding: 24px 26px 0; flex-wrap: wrap; }
.panel-head > div { flex: 1; min-width: 180px; }
.panel-head h2 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.015em; }
.panel-head p { margin: 3px 0 0; font-size: 13px; color: var(--muted); }
.panel-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; }
.panel-icon .ic { width: 20px; height: 20px; }
.panel-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13.5px; color: var(--accent-text); text-decoration: none; white-space: nowrap; }
.panel-link .ic { width: 16px; height: 16px; }
.panel-link:hover { text-decoration: underline; }
.panel-aside { font-size: 12.5px; color: var(--muted); font-weight: 600; white-space: nowrap; align-self: center; }
.panel-body { padding: 20px 26px 26px; }

.ag-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ag-item { display: grid; grid-template-columns: 66px minmax(0, 1fr) auto; gap: 16px; padding: 18px; border-radius: 14px; background: var(--surface-2); }
.ag-date { display: grid; align-content: center; justify-items: center; height: 70px; border-radius: 12px; line-height: 1; text-transform: uppercase; }
.ag-date span { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; }
.ag-date b { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin: 3px 0 2px; }
.ag-date.is-next { background: var(--accent); color: var(--on-accent); }
.ag-date.is-navy { background: var(--navy); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.ag-date.is-soft { background: var(--info-bg); color: var(--info); }
.ag-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.ag-item h3 { margin: 0 0 8px; font-size: 17px; font-weight: 700; line-height: 1.35; letter-spacing: -.01em; }
.ag-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.ag-meta + .ag-meta { margin-top: 3px; }
.ag-meta .ic { width: 15px; height: 15px; color: var(--muted); }
.ag-meta .ic.is-accent { color: var(--accent-text); }
.ag-time { align-self: start; padding: 6px 12px; border-radius: 10px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); font-weight: 600; font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ag-sub { grid-column: 2 / -1; margin-top: -2px; display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding: 11px 14px; border-radius: 10px; background: var(--surface); font-size: 13px; }
.ag-sub .ic { width: 16px; height: 16px; color: var(--accent-text); }
.ag-sub .right { margin-left: auto; display: inline-flex; align-items: center; gap: 10px; }

.quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.quick a { display: grid; align-content: start; gap: 3px; padding: 18px; border-radius: 14px; background: var(--surface-2); text-decoration: none; transition: box-shadow .12s, transform .12s; }
.quick a:hover { box-shadow: 0 0 0 1.5px var(--accent); transform: translateY(-1px); }
.quick-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; background: var(--surface); color: var(--accent-text); margin-bottom: 18px; box-shadow: var(--shadow); }
.quick-icon .ic { width: 20px; height: 20px; }
.quick b { font-size: 15px; }
.quick span { font-size: 13px; color: var(--muted); }

.top-list { display: grid; gap: 20px; }
.top-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 8px 12px; }
.top-rank { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--info-bg); color: var(--info); font-weight: 700; font-size: 13px; }
.top-row:first-child .top-rank { background: var(--accent); color: var(--on-accent); }
.top-name { min-width: 0; }
.top-name b { font-size: 15px; font-weight: 600; }
.top-name small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.top-val { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.top-bar { grid-column: 1 / -1; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.top-bar span { display: block; height: 100%; border-radius: 99px; background: var(--accent); }

.section-label { margin: 0 0 10px; font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.acct-box { background: var(--surface-2); border-radius: 14px; padding: 4px 16px; }
.acct { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 13px 0; }
.acct + .acct { border-top: 1px solid var(--line); }
.bank-badge { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--surface); color: #00857f; font-size: 11.5px; font-weight: 800; letter-spacing: .02em; box-shadow: 0 0 0 1px var(--line); }
.acct b { display: block; font-size: 13.5px; font-weight: 600; }
.acct small { color: var(--muted); font-size: 12px; }
.acct-val { font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.memo-box { margin-top: 16px; padding: 16px 18px; border-radius: 14px; border: 1px solid var(--line); }
.memo-box .memo-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.memo-box .memo-no { margin: 6px 0 12px; font-weight: 700; font-size: 15px; }
.memo-box .memo-bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.memo-box .memo-sum { font-size: 12.5px; color: var(--muted); }
.memo-box .memo-sum b { display: block; font-size: 17px; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.memo-box .section-label { margin: 0; }

/* ---------- Responsive (shell + Beranda) ---------- */
@media (max-width: 1280px) {
  .search { display: none; }
  .source-chips { margin-right: auto; }
}
@media (max-width: 1100px) {
  .home-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .sidebar { width: 280px; }
  .topbar { min-height: 60px; padding: 10px 16px; gap: 10px; }
  .topbar-mark { display: block; margin-right: auto; }
  .source-chips, .user-text { display: none; }
  .user .avatar { width: 34px; height: 34px; font-size: 12px; }
  .content { padding: 20px 16px 96px; }
  .hero h1 { font-size: 24px; }
  .quick { grid-template-columns: minmax(0, 1fr); }
  .quick a { grid-template-columns: 42px minmax(0, 1fr); column-gap: 14px; align-items: center; }
  .quick-icon { grid-row: span 2; margin: 0; }
  .ag-item { grid-template-columns: 56px minmax(0, 1fr); gap: 12px; padding: 14px; }
  .ag-date { height: 62px; }
  .ag-date b { font-size: 24px; }
  .ag-time { grid-column: 2; grid-row: 1; justify-self: start; margin-bottom: -4px; }
  .ag-item > .ag-body { grid-column: 2; }
  .ag-sub { grid-column: 1 / -1; }
  .ag-date { grid-row: 1 / span 2; }
  .panel-head { padding: 20px 18px 0; }
  .panel-body { padding: 16px 18px 20px; }
}
@media (max-width: 520px) {
  .kpi-value b { font-size: 30px; }
  .kpi-value b.money { font-size: 26px; }
}

/* =====================================================================
   Tambahan aplikasi (bukan dari mockup): login, form, notifikasi, status.
   ===================================================================== */

.btn-block { width: 100%; justify-content: center; height: 44px; font-size: 14px; }
.btn-ghost { border-color: transparent; background: none; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; }
.btn-danger { color: var(--bad); }

/* Login */
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--paper); }
.login-side { background: var(--navy); color: var(--nav-ink); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.login-side img { width: 200px; height: auto; }
.login-side h1 { font-size: 34px; line-height: 1.15; letter-spacing: -.03em; margin: 0 0 12px; color: #fff; }
.login-side p { margin: 0; color: var(--nav-muted); max-width: 440px; }
.login-side ul { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; color: var(--nav-ink); }
.login-side li { display: flex; gap: 10px; align-items: center; }
.login-side li .ic { color: var(--brand); width: 18px; height: 18px; }
.login-side small { color: var(--nav-muted); }
.login-main { display: grid; place-items: center; padding: 32px 16px; }
.login-card { width: min(400px, 100%); padding: 32px 28px; }
.login-card h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -.02em; }
.login-card > p { margin: 0 0 22px; color: var(--muted); }
.login-card .callout { margin-bottom: 16px; }
.login-mark { width: 40px; height: auto; margin-bottom: 18px; }
.google-g { width: 18px; height: 18px; }
.login-foot { margin-top: 18px; font-size: 12px; color: var(--muted); }
.dev-login { margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--line); display: grid; gap: 8px; }
@media (max-width: 860px) {
  .login-page { grid-template-columns: minmax(0, 1fr); }
  .login-side { padding: 28px 20px; }
  .login-side ul, .login-side small { display: none; }
  .login-side h1 { font-size: 24px; }
}

/* Notifikasi di atas konten */
.flash { margin-bottom: 16px; }
.callout.ok { background: var(--good-bg); }
.callout.ok svg { color: var(--good); }
.callout.info { background: var(--info-bg); }
.callout.info svg { color: var(--info); }

/* Form */
.form-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 160px auto; gap: 10px; align-items: end; }
.form-row .field { margin: 0; }
@media (max-width: 860px) { .form-row { grid-template-columns: minmax(0, 1fr); } }
.edit-row summary { list-style: none; cursor: pointer; }
.edit-row summary::-webkit-details-marker { display: none; }
.edit-row[open] summary { margin-bottom: 10px; }
.edit-form { display: grid; gap: 8px; min-width: 240px; }
.delete-form { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.edit-form .check { display: flex; align-items: center; gap: 8px; font-size: 13px; }

/* Topbar: user + logout */
.user form { margin: 0; }
.user .avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.topbar .icon-btn.logout .ic { width: 18px; height: 18px; }

/* Status sistem di Beranda */
.status-list { list-style: none; margin: 0; padding: 0; }
.status-list li { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line); }
.status-list li:first-child { border-top: 0; }
.status-list .si { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); }
.status-list .si .ic { width: 18px; height: 18px; }
.status-list b { display: block; font-size: 13.5px; }
.status-list span.small { color: var(--muted); }
.phase-list { list-style: none; margin: 0; padding: 0; }
.phase-list li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 20px; border-top: 1px solid var(--line); }
.phase-list li:first-child { border-top: 0; }
.phase-list i { font-style: normal; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.phase-list li.is-done i { background: var(--accent); color: var(--on-accent); }
.phase-list li.is-current i { background: var(--accent-soft); color: var(--accent-soft-ink); box-shadow: inset 0 0 0 2px var(--accent); }
.phase-list b { display: block; font-size: 13.5px; }
.phase-list p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.need-list { margin: 0; padding-left: 18px; line-height: 1.9; }
code { font-size: 12px; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.topbar .user { margin-left: auto; }
.user-link { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; border-radius: 12px; padding: 2px 4px; }
.user-link:hover .avatar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--accent); }
.login-card form .field { margin-bottom: 14px; }
.login-card .input { height: 42px; }
.pw-form { display: grid; gap: 0; max-width: 420px; }
.form-row.users { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) 150px auto; }
@media (max-width: 1100px) { .form-row.users { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (max-width: 860px) { .form-row.users { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Laporan Kas ---------- */
.nowrap { white-space: nowrap; }
.upload-card { display: grid; gap: 10px; align-content: start; }
.upload-card .drop { cursor: pointer; }
.file-input { font-size: 13px; max-width: 100%; }
.file-input::file-selector-button { font: inherit; font-weight: 600; margin-right: 10px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; }
.upload-card .btn-primary { justify-self: start; }
.kas-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.kas-actions { display: flex; gap: 8px; }
.seg-links a { display: inline-block; padding: 6px 12px; border-radius: 7px; font-weight: 600; font-size: 12.5px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.seg-links a:hover { color: var(--ink); }
.seg-links a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow), 0 0 0 1px var(--line); }
.acct-grid:empty { display: none; }
.acct-card { border-left: 4px solid var(--good); }
.acct-card.is-down { border-left-color: var(--bad); }
.acct-card.is-up .acct-head > b { color: var(--good); }
.acct-card.is-down .acct-head > b { color: var(--bad); }
.acct-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.acct-head b { display: block; }
.acct-bal { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.acct-bal div { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.acct-bal span { display: block; font-size: 11.5px; color: var(--muted); }
.acct-bal b { font-size: 13px; font-variant-numeric: tabular-nums; }
.cat-link { text-decoration: none; color: inherit; border-radius: 8px; padding-left: 6px; padding-right: 6px; margin: 0 -6px; }
.cat-link:hover, .cat-link.is-active { background: var(--surface-2); }
.fill.fill-in { background: var(--good); }
.fill.fill-out { background: var(--bad); opacity: .85; }
.tx-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding-bottom: 6px; }
.tx-search { display: flex; gap: 8px; flex: 1 1 360px; }
.search-box { flex: 1; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); }
.search-box:focus-within { border-color: var(--focus); }
.search-box input { border: 0; outline: none; background: none; width: 100%; color: var(--ink); }
.tx-table td { vertical-align: top; }
.tx-table tr.tx-in td { background: color-mix(in srgb, var(--good-bg) 55%, transparent); }
.tx-table tr.tx-out td { background: color-mix(in srgb, var(--bad-bg) 55%, transparent); }
.tx-table tr.is-review td { background: color-mix(in srgb, var(--warn-bg) 70%, transparent); }
.tx-table tr.tx-in:hover td { background: var(--good-bg); }
.tx-table tr.tx-out:hover td { background: var(--bad-bg); }
.tx-table tr.is-review:hover td { background: var(--warn-bg); }
.th-sort { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.th-sort:hover { color: var(--ink); }
.th-sort:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sort-ic { font-size: 9px; opacity: .45; }
th[aria-sort] .th-sort { color: var(--ink); }
th[aria-sort] .sort-ic { opacity: 1; }
.tx-desc { display: block; font-size: 13px; line-height: 1.4; max-width: 520px; overflow-wrap: anywhere; }
.tx-meta { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); }
.cat-form { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.cat-new { display: flex; gap: 6px; width: 100%; max-width: 280px; }
.cat-new[hidden] { display: none; }
.cat-new .input { height: 32px; font-size: 12px; flex: 1; min-width: 0; }
.cat-form .select { height: 32px; font-size: 12px; max-width: 220px; }
.amt { font-weight: 650; }
.is-in { color: var(--good); }
.is-out { color: var(--bad); }
.tx-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
/* Tabel transaksi digulir sendiri; tinggi pastinya (±20 baris) diatur app.js, ini cadangan tanpa JS. */
.tx-scroll { max-height: 70vh; overflow: auto; overscroll-behavior: contain; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tx-scroll thead th { z-index: 1; }
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.pager .is-current { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.pager [aria-disabled="true"] { opacity: .45; pointer-events: none; }
.pager-gap { padding: 0 4px; color: var(--muted); }
.inline-form { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.inline-form .input { height: 32px; }
.acct-no { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 44px; }
.donor-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.donor-list form { margin: 0; }
.chip-x { border: 0; background: none; cursor: pointer; font-size: 15px; line-height: 1; padding: 0 0 0 4px; color: var(--muted); }
.chip-x:hover { color: var(--bad); }
a.chip { text-decoration: none; }
.matrix-wrap { max-height: 72vh; }
.matrix .indent { padding-left: 28px; font-weight: 500; }
.matrix .row-main th, .matrix .row-main td { font-weight: 700; background: var(--surface-2); }
.matrix .row-main th { background: var(--surface-2); }
.matrix .row-in td { color: var(--good); }
.matrix .row-out td { color: var(--bad); }
.matrix .row-section th { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--surface); padding-top: 14px; }
.matrix .row-closing th, .matrix .row-closing td { background: var(--accent-soft); color: var(--accent-soft-ink); }
.acct-cell span { display: block; font-size: 11px; color: var(--muted); }
.print-title { display: none; }
@media print {
  .no-print, .flash { display: none !important; }
  .print-title { display: block; margin-bottom: 12px; }
  .print-title h2 { margin: 0; font-size: 18px; }
  .print-title p { margin: 2px 0 0; color: var(--muted); }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; break-inside: avoid; }
  .cat-form .select { border: 0; appearance: none; padding: 0; height: auto; }
  .matrix-wrap, .table-wrap { max-height: none; overflow: visible; }
  .page-head p { display: none; }
}
.matrix tfoot th:first-child { background: var(--surface-2); }
.matrix .row-closing th:first-child { background: var(--accent-soft); }
.grid > .privacy { align-self: start; }

/* ---------- Memo Donasi Listrik ---------- */
.step-head { display: flex; gap: 12px; align-items: flex-start; }
.step-no { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--accent); color: var(--on-accent); }
.memo-step .card-head p { max-width: 760px; }
.upload-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.period-list { margin: 0 0 14px; padding-left: 20px; display: grid; gap: 4px; }
.period-list li { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.period-list li span { color: var(--muted); }
.memo-summary { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.memo-summary .stat { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.memo-summary .stat span { display: block; font-size: 11.5px; color: var(--muted); }
.memo-summary .stat b { font-size: 15px; font-variant-numeric: tabular-nums; }
.memo-summary .stat.is-primary { background: var(--accent-soft); }
.memo-summary .stat.is-primary b { color: var(--accent-soft-ink); }
@media (max-width: 1100px) { .memo-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 520px) { .memo-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.summary-warning { margin: 10px 0 0; }
.reconcile { margin: 12px 0 8px; color: var(--ink-2); }
.audit { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-top: 10px; }
.audit summary { cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.audit[open] summary { margin-bottom: 8px; }
.period-card.is-off { opacity: .72; }
.period-total { display: grid; gap: 2px; padding: 10px 14px; border-radius: 12px; background: var(--good-bg); margin-bottom: 12px; }
.period-total span { font-size: 12px; color: var(--ink-2); }
.period-total.is-off { background: var(--surface-2); }
.warn { color: var(--bad); }
.donations td, .debits td { vertical-align: middle; }
th.pick, td.pick { width: 36px; text-align: center; }
.donations input[type=checkbox], .debits input[type=checkbox], .toggle-all { width: 16px; height: 16px; accent-color: var(--accent); }
.memo-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.memo-fields .wide { grid-column: 1 / -1; }
@media (max-width: 860px) { .memo-fields { grid-template-columns: minmax(0, 1fr); } }
.with-button { display: flex; gap: 8px; }
.action-total { display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); margin: 4px 0 12px; }
.action-total span { font-size: 12px; color: var(--muted); }
.actions { display: flex; gap: 12px; align-items: center; }
.settings-form .field { margin-bottom: 10px; }
tr.is-new td { background: var(--good-bg); }

/* ---------- Panitia & Bazaar ---------- */
details.expander > summary { list-style: none; }
details.expander > summary::-webkit-details-marker { display: none; }
details.expander[open] .expander-body { display: block; }
details.expander[open] .chev { transform: rotate(90deg); }
.tabs a { padding: 9px 14px; font-weight: 600; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.section-gap { margin-bottom: 16px; }
.chart .col title { pointer-events: none; }

/* ---------- Laporan Kas Tahunan: rata-rata, ringkasan HP, rincian kategori, tabel lengkap (5 Okt 2026) ---------- */
.year-summary, .rotate-hint, .year-back, .v-short { display: none; }
.back-link { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 12px; font-weight: 600; color: var(--accent-text); text-decoration: none; }
.back-link svg { width: 16px; height: 16px; }
.col-avg { background: color-mix(in srgb, var(--info-bg) 45%, transparent); }
.netchart { width: 100%; height: auto; display: block; }
.net-zero { stroke: var(--grid); stroke-width: 1; }
.net-up { fill: var(--series-1); }
.net-down { fill: var(--bad); }
.net-hit { fill: transparent; }
.net-col:hover .net-up, .net-col:hover .net-down { opacity: .72; }
.net-lbl { font-size: 8.5px; fill: var(--muted); text-anchor: middle; }
.ys-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.ys-head h2 { font-size: 15px; margin: 0; }
.ys-legend { display: flex; align-items: center; gap: 6px; margin: 6px 0 0; }
.key-up, .key-down { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.key-up { background: var(--series-1); }
.key-down { background: var(--bad); margin-left: 8px; }
.ys-month { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.ys-month:first-of-type { border-top: 0; }
.ym-label { width: 112px; flex: none; font-weight: 600; font-size: 13px; }
.ym-val { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ym-val small { font-size: 11.5px; color: var(--muted); }
.ys-month .ic { width: 16px; height: 16px; color: var(--muted); }
.ys-more summary { list-style: none; cursor: pointer; text-align: center; padding: 10px 0 2px; border-top: 1px solid var(--line); color: var(--accent-text); font-weight: 600; font-size: 13px; }
.ys-more summary::-webkit-details-marker { display: none; }
.ys-more[open] summary { display: none; }
.ys-more[open] > a:first-of-type { border-top: 1px solid var(--line); }
.ys-cat { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; padding: 9px 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; font-size: 13px; }
.ys-cat:first-of-type { border-top: 0; }
.ys-cat small { grid-column: 1 / -1; font-size: 11.5px; color: var(--muted); }
.yc-bar, .cm-track { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.yc-bar span, .cm-fill { display: block; height: 100%; border-radius: 3px; }
.yc-bar .fill-in, .cm-fill.fill-in { background: var(--good); }
.yc-bar .fill-out, .cm-fill.fill-out { background: var(--bad); opacity: .85; }
.ys-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ys-actions .btn { justify-content: center; }
.cat-detail h2 { margin: 4px 0 14px; }
.cat-detail-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding-bottom: 14px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.cat-detail-kpis span { display: block; font-size: 12px; color: var(--muted); }
.cat-detail-kpis b { font-size: 20px; font-variant-numeric: tabular-nums; }
.cat-month { display: grid; grid-template-columns: 140px minmax(0, 1fr) 150px; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; font-size: 13px; }
.cat-month:first-child { border-top: 0; }
.cm-track { grid-column: auto; height: 8px; border-radius: 4px; }
.year-full .back-link { margin-top: 4px; }
.back-link.year-back { display: none; }
.cm-val { text-align: right; font-variant-numeric: tabular-nums; }

@media (max-width: 860px) {
  .year-summary { display: block; }
  .back-link.year-back { display: inline-flex; }
  .year-full { display: none; }
  .year-full.is-forced { display: block; }
  .year-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .year-tiles .tile.is-dark { grid-column: 1 / -1; order: -1; }
  .year-tiles .v-full { display: none; }
  .year-tiles .v-short { display: inline; }
  .year-ringkas.on-summary { display: none; }
  .year-full.is-forced .matrix th:first-child, .year-full.is-forced .matrix td:first-child { min-width: 104px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
  .cat-detail-kpis { grid-template-columns: minmax(0, 1fr); }
  .cat-month { grid-template-columns: 92px minmax(0, 1fr) 112px; gap: 8px; }
}
@media (max-width: 860px) and (orientation: portrait) {
  .year-full.is-forced .rotate-hint { display: flex; }
}
@media print {
  .year-summary, .back-link, .rotate-hint { display: none !important; }
  .year-full { display: block !important; }
}

/* ---------- PWA: mode aplikasi dan ajakan pasang (5 Okt 2026) ---------- */
.pwa-only { display: none; }
.is-standalone .pwa-only { display: grid; }
@media (display-mode: standalone) {
  .pwa-only { display: grid; }
  /* Cetak dari mode aplikasi di HP sulit; cetak tetap tersedia dari browser/desktop. */
  [data-action="print"] { display: none !important; }
}
body { padding-bottom: env(safe-area-inset-bottom); }
.install-banner { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px 12px; align-items: center; margin-bottom: 16px; padding: 14px 16px;
  border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); border: 1px solid var(--line); }
.install-banner[hidden] { display: none; }
.install-banner img { border-radius: 10px; }
.install-text { display: flex; flex-direction: column; font-size: 13px; }
.install-text span { color: var(--ink-2); }
.install-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; }
.install-guide ol { margin: 8px 0 10px; padding-left: 18px; }
.install-guide li { margin: 5px 0; }
.key { display: inline-flex; align-items: center; gap: 4px; padding: 1px 6px; border-radius: 6px; background: var(--info-bg); color: var(--info); font-weight: 600; white-space: nowrap; }
.key svg { width: 14px; height: 14px; }
