:root {
  --brand: #0C7235; --brand-dk: #0A4F27; --brand-tint: #E8F3EC; --gold: #FFCB08;
  --bg: #F2F5F3; --surface: #FFFFFF; --surface-2: #F8FAF9; --line: #D9E2DC; --line-2: #E8EEEA;
  --ink: #15201A; --ink-2: #435248; --ink-3: #647369;
  --grid: #E8EEEA; --axis: #C5D2CA;
  /* Kelompok status: terbit, proses, pending, batal (lolos validate_palette.js --pairs all). */
  --g-terbit: #0C7235; --g-proses: #2A78D6; --g-pending: #EB6834; --g-batal: #4A3AA7; --g-netral: #7D8B82;
  --r: 10px; --r-sm: 7px;
  --shadow: 0 1px 2px rgba(10, 40, 20, .06), 0 8px 24px rgba(10, 40, 20, .05);
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 14px/1.5 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2 { margin: 0; line-height: 1.25; }
h1 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 15px; font-weight: 650; margin-bottom: 14px; }
p { margin: 0; }
a { color: var(--brand); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding: 14px 24px; background: var(--surface); border-bottom: 3px solid var(--brand); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand p { font-size: 13px; color: var(--ink-3); }
.sync { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.btn { display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 13px; color: var(--ink); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--surface-2); border-color: var(--axis); }
.btn:disabled { opacity: .5; cursor: progress; }

main { max-width: 1320px; margin: 0 auto; padding: 20px 24px 40px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: end; }
.filters label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ink-2); min-width: 130px; }
.filters .grow { flex: 1 1 220px; }
select, input { font: inherit; font-size: 14px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); min-height: 36px; padding: 0 10px; width: 100%; }
select { max-width: 260px; }
select:focus, input:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: var(--brand); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chips:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--brand); background: var(--brand-tint); color: var(--brand-dk); font-size: 13px; font-weight: 600; cursor: pointer; }
.chip span { font-size: 16px; line-height: 1; }
.chip.reset { border-color: var(--line); background: var(--surface); color: var(--ink-2); }
.error { margin-top: 12px; padding: 10px 14px; border-radius: var(--r-sm); background: #FBE5E3; color: #9E2722; font-weight: 600; }

.tiles { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.tile { display: grid; align-content: start; gap: 2px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--shadow); }
.tile-label { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.tile[class*=" g-"] .tile-label::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; }
.tile-value { font-size: 24px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.tile-sub { font-size: 12px; color: var(--ink-3); }
.tile.hero { background: var(--brand); border-color: var(--brand); }
.tile.hero .tile-label { color: #D2E8D9; }
.tile.hero .tile-value { color: #fff; font-size: 32px; }
.g-terbit { --c: var(--g-terbit); } .g-proses { --c: var(--g-proses); } .g-pending { --c: var(--g-pending); }
.g-batal { --c: var(--g-batal); } .g-netral { --c: var(--g-netral); }

.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 18px 0 10px; font-size: 13px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend span::before { content: ""; width: 12px; height: 12px; border-radius: 3px; background: var(--c); }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px 18px 18px; min-width: 0; }
.card.wide { grid-column: 1 / -1; }
.card.tall { grid-row: span 2; }
.empty { color: var(--ink-3); padding: 12px 0; }
.foot { font-size: 12px; margin-top: 8px; }

/* Batang mendatar */
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.bar { display: grid; grid-template-columns: minmax(0, 44%) minmax(0, 1fr) 40px; align-items: center; gap: 10px; width: 100%; min-height: 32px; padding: 4px 6px; border: 0; border-radius: 6px; background: transparent; text-align: left; cursor: pointer; }
.bar:hover { background: var(--surface-2); }
.bar.on { background: var(--brand-tint); box-shadow: inset 3px 0 0 var(--brand); }
.bar-label { font-size: 13px; line-height: 1.3; color: var(--ink); overflow-wrap: anywhere; }
.bar-label small { display: block; font-size: 11.5px; color: var(--ink-3); }
.bar-track { height: 14px; display: flex; }
.bar-fill { display: flex; gap: 2px; height: 100%; min-width: 3px; border-radius: 0 4px 4px 0; overflow: hidden; }
.seg { flex-basis: 0; min-width: 2px; background: var(--c); }
.bar-value { text-align: right; font-size: 13px; font-weight: 600; }

/* Kolom per bulan */
.colchart { display: grid; grid-template-columns: 34px minmax(0, 1fr); grid-template-rows: 200px auto; }
.plot { grid-column: 2; position: relative; border-bottom: 1px solid var(--axis); }
.area { position: absolute; inset: 18px 0 0; }
.tick { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--grid); }
.tick:first-child { border-top: 0; }
.tick span { position: absolute; right: calc(100% + 8px); top: -8px; font-size: 11px; color: var(--ink-3); }
.cols { position: absolute; inset: 0; display: flex; gap: 2px; }
.col { flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; border-radius: 4px 4px 0 0; }
.col:hover { background: var(--surface-2); }
.col-total { font-size: 11px; font-weight: 600; color: var(--ink-2); line-height: 16px; }
.col-stack { width: min(24px, 70%); display: flex; flex-direction: column-reverse; gap: 2px; border-radius: 4px 4px 0 0; overflow: hidden; }
.xs { grid-column: 2; display: flex; gap: 2px; padding-top: 6px; }
.col-x { flex: 1 1 0; min-width: 0; text-align: center; font-size: 11px; color: var(--ink-3); line-height: 1.3; }
.col-x small { display: block; font-size: 10.5px; font-weight: 600; color: var(--ink-2); }

/* Tabel */
.list { margin-top: 16px; }
.table-wrap { overflow-x: auto; margin: 0 -18px -18px; border-top: 1px solid var(--line-2); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-2); }
th { position: sticky; top: 0; background: var(--surface-2); font-size: 12px; font-weight: 650; color: var(--ink-2); white-space: nowrap; }
th button { border: 0; background: none; padding: 0; font-weight: 650; color: var(--brand-dk); cursor: pointer; }
th.r, td.r { text-align: right; }
td { min-width: 90px; }
td.strong { font-weight: 600; min-width: 180px; }
td.note { min-width: 240px; color: var(--ink-2); }
td.wide { min-width: 220px; }
td.mid { min-width: 150px; }
td .code { display: block; font-size: 11.5px; color: var(--ink-3); }
.nowrap { white-space: nowrap; }
tbody tr:hover { background: var(--surface-2); }
.status { display: inline-flex; gap: 8px; align-items: baseline; min-width: 150px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; transform: translateY(-1px); }
.links { white-space: nowrap; }
.links a { margin-right: 10px; font-weight: 600; }

.tip { position: fixed; z-index: 20; max-width: 280px; padding: 8px 10px; border-radius: 8px; background: #15201A; color: #fff; font-size: 12.5px; line-height: 1.45; white-space: pre-line; pointer-events: none; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); }

@media (max-width: 1100px) {
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .card.tall { grid-row: auto; }
}
@media (max-width: 640px) {
  .top { padding: 12px 16px; }
  #stamp { flex-basis: 100%; }
  main { padding: 16px 16px 32px; }
  .filters label { min-width: calc(50% - 6px); flex: 1 1 calc(50% - 6px); }
  select { max-width: none; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { padding: 14px 14px 16px; }
  .table-wrap { margin: 0 -14px -16px; }
  .bar { grid-template-columns: minmax(0, 42%) minmax(0, 1fr) 34px; gap: 8px; }
  .dense .col-total { display: none; }
  .dense .col-x:not(.year):nth-child(even) { visibility: hidden; }
}
