/* Dashboard Sengketa Informasi — Komisi Informasi Pusat
   Palet seri grafik mengikuti slot kategorikal tervalidasi (biru/oranye/aqua);
   abu-abu netral khusus dipakai untuk kategori "Belum diklasifikasi" (ketiadaan
   data), selalu didampingi legenda + label langsung. */
:root {
  color-scheme: light;

  --surface: #ffffff;
  --bg: #F1F5F9;
  --border: #E2E8F0;
  --grid: #E9EDF2;

  --text-primary: #1E293B;
  --text-secondary: #475569;
  --text-muted: #64748B;

  --brand: #1E40AF;
  --brand-tint: #DBEAFE;

  --series-1: #2a78d6;  /* biru   — Mediasi */
  --series-2: #eb6834;  /* oranye — Ajudikasi */
  --series-3: #1baf7a;  /* aqua   — Pencabutan */
  --series-none: #5b6472; /* netral — Belum diklasifikasi */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 24px 24px 8px;
  background: var(--bg);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

/* ---------- kepala halaman & tab ---------- */
.page-head h1 { font-size: 24px; margin: 0 0 2px; }
.page-sub { color: var(--text-muted); font-size: 14px; margin: 0 0 18px; }

.tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.tab {
  appearance: none;
  border: none;
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--text-muted);
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  border-radius: 6px 6px 0 0;
}
.tab:hover { color: var(--brand); background: var(--brand-tint); }
.tab[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
.tab:focus-visible { outline: 2px solid var(--series-1); outline-offset: 2px; }

.app-status {
  padding: 14px 18px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-muted);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}
.app-status[hidden] { display: none; }
.app-status.is-error { color: #b42318; }

.section-head h2 { font-size: 19px; margin: 0 0 2px; }
.section-sub { color: var(--text-muted); font-size: 13px; margin: 0 0 16px; }

/* ---------- kartu ---------- */
.card {
  background: var(--surface);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  margin-bottom: 18px;
}

/* ---------- filter ---------- */
.filter-bar {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.filter-bar label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 6px;
}
.filter-bar select,
.filter-bar input[type="search"] {
  width: 230px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #CBD5E1;
  font: inherit;
  font-size: 13px;
  background: var(--surface);
  color: var(--text-primary);
}
.filter-bar select:disabled { background: #F8FAFC; color: var(--text-muted); }
.filter-bar select:focus, .filter-bar input[type="search"]:focus {
  outline: none;
  border-color: var(--series-1);
  box-shadow: 0 0 0 3px var(--brand-tint);
}
.filter-search { flex: 1 1 320px; min-width: 260px; }
.filter-search input[type="search"] { width: 100%; }
.filter-hint { font-size: 11px; color: var(--text-muted); margin: 4px 0 0; }

.btn-reset, .btn-more {
  padding: 9px 14px;
  border-radius: 6px;
  border: 1px solid #CBD5E1;
  background: var(--surface);
  color: var(--text-primary);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 26px;
}
.btn-more { margin-top: 0; }
.btn-reset:hover, .btn-more:hover {
  background: var(--brand-tint);
  border-color: var(--series-1);
  color: var(--brand);
}

/* ---------- KPI ---------- */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}
.kpi-row-6 { grid-template-columns: repeat(6, 1fr); }
.kpi {
  background: var(--surface);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  border-top: 3px solid var(--series-1);
}
.kpi .value { font-size: 28px; font-weight: 700; color: var(--brand); line-height: 1.15; }
.kpi .title { font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-top: 6px; }
.kpi .sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ---------- grafik ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.chart-card { margin: 0 0 18px; }
.chart-card figcaption { margin-bottom: 10px; }
.chart-card h3 { font-size: 15px; margin: 0; }
.chart-sub { font-size: 12px; color: var(--text-muted); margin: 2px 0 0; }
/* tinggi plot sudah termasuk pita sumbu-x, jadi tidak ada scroll kecil di kartu */
.plot { width: 100%; }

/* ---------- tabel ---------- */
.table-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.table-head h3 { font-size: 15px; margin: 0; }
.table-count { font-size: 12px; color: var(--text-muted); margin: 0; }
.table-hint { font-size: 12px; color: var(--text-muted); margin: 6px 0 0; }
.table-wrap {
  max-height: 460px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 12px;
}
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th, .data-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.data-table th {
  background: var(--brand);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 1;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  font-weight: 600;
}
.data-table th:hover { background: #1B3A9E; }
.data-table th .sort-mark { opacity: 0.55; margin-left: 4px; font-size: 10px; }
.data-table th[aria-sort="ascending"] .sort-mark,
.data-table th[aria-sort="descending"] .sort-mark { opacity: 1; }
.data-table tbody tr:nth-child(odd of .row-main) { background: #F8FAFC; }
.data-table-expandable .row-main { cursor: pointer; }
.data-table-expandable .row-main:hover { background: var(--brand-tint); }
.data-table .col-num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .empty-cell { text-align: center; color: var(--text-muted); padding: 22px; }
.table-more { margin-top: 12px; }

mark { background: #FDE68A; color: inherit; padding: 0 1px; border-radius: 2px; }

.pill {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.pill-mediasi { color: #1f5fa8; }
.pill-ajudikasi { color: #b4451f; }
.pill-pencabutan { color: #14785a; }
.pill-none { color: var(--text-muted); }

/* ---------- detail kasus ---------- */
.row-detail > td { background: #F8FAFC; padding: 16px 18px; }
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px 22px;
  margin-bottom: 14px;
}
.detail-grid dt { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; }
.detail-grid dd { margin: 2px 0 0; font-size: 12px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--brand-tint); }
.timeline li { position: relative; padding: 0 0 12px 14px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--series-1);
  box-shadow: 0 0 0 2px #F8FAFC;
}
.timeline .tl-date { font-weight: 600; font-size: 12px; }
.timeline .tl-note { font-size: 12px; color: var(--text-muted); }
.detail-subhead { font-size: 12px; font-weight: 600; margin: 0 0 8px; }

.footer-note { color: var(--text-muted); font-size: 11px; margin: 18px 0; text-align: center; }

@media (max-width: 1100px) {
  .kpi-row-6 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  body { padding: 16px 16px 8px; }
  /* Judul tab jangan terpotong/terbelah di layar sempit — geser mendatar saja. */
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { white-space: nowrap; flex: 0 0 auto; }
  .kpi-row, .kpi-row-6 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .filter-bar select, .filter-bar input[type="search"] { width: 100%; }
  .filter-bar > div { flex: 1 1 100%; }
  .btn-reset { margin-top: 4px; }
}

/* =========================================================================
   Tab "Alur & Aturan" — alur proses penyelesaian sengketa informasi.
   Memakai token yang sama dengan tab lain; hanya menambah tiga peran warna:
   biru = tahapan berlanjut, hijau = titik akhir berhasil, merah = titik
   berhenti, plus kuning-cokelat khusus badge tenggat waktu.
   ========================================================================= */
:root {
  --flow-continue: var(--series-1);
  --flow-continue-soft: var(--brand-tint);
  --flow-success: #12805c;
  --flow-success-soft: #E3F3EC;
  --flow-stop: #b42318;
  --flow-stop-soft: #FCE8E6;
  --flow-deadline: #8a5a12;
  --flow-deadline-soft: #FDF0D5;
}

.kpi-row-3 { grid-template-columns: repeat(3, 1fr); }

.panel-title { font-size: 15px; margin: 0 0 12px; }

/* ---------- legenda & glosarium ---------- */
.legend-list { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.legend-item { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--text-secondary); }
.swatch { width: 14px; height: 14px; border-radius: 4px; flex: 0 0 auto; margin-top: 3px; }
.swatch-continue { background: var(--flow-continue); }
.swatch-success { background: var(--flow-success); }
.swatch-stop { background: var(--flow-stop); }
.swatch-deadline { background: var(--flow-deadline); }

.glosarium { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px 20px; margin: 0; }
.glosarium dt { font-size: 12px; font-weight: 700; color: var(--brand); }
.glosarium dd { margin: 3px 0 0; font-size: 12.5px; color: var(--text-secondary); line-height: 1.45; }

/* ---------- navigasi fase ---------- */
.flow-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}
.flow-nav a {
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  white-space: nowrap;
}
.flow-nav a:hover { color: var(--brand); border-color: var(--series-1); background: var(--brand-tint); }
.flow-nav a:focus-visible { outline: 2px solid var(--series-1); outline-offset: 2px; }

/* ---------- fase ---------- */
.phase { border-left: 3px solid var(--series-1); padding: 2px 0 2px 22px; margin: 0 0 30px; scroll-margin-top: 16px; }
.phase-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.phase-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-tint);
  border-radius: 8px;
  padding: 3px 9px;
  margin-left: -36px;
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}
.phase-titles h3 { font-size: 17px; margin: 0; }
.phase-titles .phase-sub { font-size: 12.5px; color: var(--text-muted); margin: 3px 0 0; }
.phase-body { display: flex; flex-direction: column; gap: 12px; }

/* ---------- kartu tahapan ---------- */
.flow-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--flow-continue);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}
.flow-card-success { border-left-color: var(--flow-success); }
.flow-card-stop { border-left-color: var(--flow-stop); }
.flow-card h4 { font-size: 14.5px; margin: 0 0 6px; }
.flow-card p { margin: 0; font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.flow-card p + p { margin-top: 7px; }
.flow-list { margin: 7px 0 0; padding-left: 18px; }
.flow-list li { font-size: 13px; color: var(--text-secondary); line-height: 1.45; margin-bottom: 4px; }
.flow-list li:last-child { margin-bottom: 0; }

.flow-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.badge-flow {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  line-height: 1.35;
}
.badge-pasal { background: var(--brand-tint); color: var(--brand); }
.badge-tenggat { background: var(--flow-deadline-soft); color: var(--flow-deadline); }
.badge-aktor { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); font-weight: 500; }

.flow-more { margin-top: 10px; border-top: 1px dashed var(--border); padding-top: 9px; }
.flow-more > summary {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand);
  list-style: none;
}
.flow-more > summary::-webkit-details-marker { display: none; }
.flow-more > summary::before { content: "+ "; }
.flow-more[open] > summary::before { content: "– "; }
.flow-more .more-body { margin-top: 7px; }

.flow-callout {
  background: var(--flow-deadline-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px 16px;
}
.flow-callout h4 { font-size: 12.5px; margin: 0 0 5px; color: var(--flow-deadline); text-transform: uppercase; letter-spacing: 0.02em; }
.flow-callout p { margin: 0; font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

/* ---------- percabangan ---------- */
.fork-q {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 2px 0 9px;
}
.fork-paths { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: stretch; }
.fork-divider { display: flex; align-items: center; justify-content: center; }
.fork-divider span {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 9px;
}
.path {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--flow-continue);
  border-radius: 10px;
  padding: 13px 15px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}
.path-success { border-top-color: var(--flow-success); }
.path-stop { border-top-color: var(--flow-stop); }
.path-cond { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; display: block; margin-bottom: 5px; }
.path .path-cond { color: var(--flow-continue); }
.path-success .path-cond { color: var(--flow-success); }
.path-stop .path-cond { color: var(--flow-stop); }
.path h4 { font-size: 14px; margin: 0 0 5px; }
.path p { margin: 0; font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; }
.path p + p { margin-top: 6px; }

.flow-disclaimer p { margin: 0; font-size: 12px; color: var(--text-muted); line-height: 1.6; }
.flow-disclaimer p + p { margin-top: 6px; }

@media (max-width: 900px) {
  .kpi-row-3 { grid-template-columns: 1fr; }
  .fork-paths { grid-template-columns: 1fr; }
  .fork-divider { padding: 1px 0; }
  .phase { padding-left: 14px; }
  .phase-num { margin-left: -28px; }
}

.flow-card code, .flow-callout code, .path code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
}
