:root {
  --navy: #011e41;
  --red: #ee2435;
  --grey-1: #595959;
  --grey-2: #808080;
  --grey-3: #bfbfbf;
  --grey-4: #f2f2f2;
  --ink: #000000;
  --paper: #ffffff;
  --radius: 6px;
  --font: Calibri, Carlito, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.4;
  color: var(--ink);
  background: var(--grey-4);
}
h2, h3 { margin: 0; font-weight: 700; }
h2 { font-size: 20px; color: var(--navy); margin: 28px 0 12px; }
h3 { font-size: 15px; color: var(--navy); }
a { color: var(--navy); }
[hidden] { display: none !important; }

/* ---------- login ---------- */
.login {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: var(--navy); padding: 16px;
}
.login-card {
  width: 100%; max-width: 360px;
  background: var(--paper); border-radius: var(--radius);
  padding: 28px 24px 20px;
  display: flex; flex-direction: column; gap: 14px;
}
.login-brand { border-bottom: 3px solid var(--red); padding-bottom: 10px; margin-bottom: 4px; }
.login-title { font-size: 20px; font-weight: 700; color: var(--navy); }
.login-sub { color: var(--grey-1); font-size: 13px; }
.login-card label, .filters label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 13px; color: var(--grey-1);
}
input, select {
  font: inherit; font-size: 15px; color: var(--ink);
  border: 1px solid var(--grey-3); border-radius: 4px;
  padding: 8px 10px; background: var(--paper); min-height: 40px;
}
input:focus, select:focus { outline: 2px solid var(--navy); outline-offset: 1px; }
.btn-primary {
  font: inherit; font-weight: 700; font-size: 15px;
  background: var(--navy); color: var(--paper); border: 0;
  border-radius: 4px; padding: 10px 14px; min-height: 42px; cursor: pointer;
}
.btn-primary:hover { background: #042a5a; }
.btn-ghost {
  font: inherit; font-size: 13px; color: var(--navy);
  background: var(--paper); border: 1px solid var(--grey-3);
  border-radius: 4px; padding: 6px 10px; min-height: 36px; cursor: pointer;
}
.btn-ghost:hover { border-color: var(--navy); }
.login-error { color: var(--red); font-size: 13px; }
.login-note { color: var(--grey-2); font-size: 12px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--paper); border-bottom: 1px solid var(--grey-3);
  padding: 10px 16px 0;
}
.topbar-inner { max-width: 1180px; margin: 0 auto; }
.topbar-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.brand-title { font-size: 17px; font-weight: 700; color: var(--navy); line-height: 1.2; }
.brand-sub { font-size: 12px; color: var(--grey-1); margin-top: 2px; }
.filters {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
  padding: 10px 0 8px;
}
.filters label { flex: 0 1 200px; min-width: 140px; }
.filters select { min-height: 38px; padding: 6px 8px; }
.sectnav {
  display: flex; gap: 2px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  border-top: 1px solid var(--grey-4); margin: 0; padding: 0;
}
.sectnav a {
  flex: 0 0 auto; padding: 8px 10px; font-size: 13px; text-decoration: none;
  color: var(--grey-1); border-bottom: 3px solid transparent; white-space: nowrap;
}
.sectnav a.active, .sectnav a:hover { color: var(--navy); border-bottom-color: var(--red); }

/* ---------- content ---------- */
.content { max-width: 1180px; margin: 0 auto; padding: 0 16px 40px; }
.section { scroll-margin-top: 170px; }
.load-error {
  max-width: 1180px; margin: 16px auto 0; padding: 12px 16px;
  background: var(--paper); border-left: 4px solid var(--red); color: var(--ink);
  font-size: 14px; white-space: pre-wrap;
}

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.tile { background: var(--paper); border-radius: var(--radius); padding: 12px 14px; }
.tile-value { font-size: 26px; font-weight: 700; color: var(--navy); line-height: 1.1; }
.tile.alert .tile-value { color: var(--red); }
.tile-label { font-size: 12px; color: var(--grey-1); margin-top: 4px; }
.tile-sub { font-size: 12px; color: var(--grey-2); margin-top: 2px; }

.card { background: var(--paper); border-radius: var(--radius); padding: 14px 16px 12px; margin-bottom: 12px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.card-note { font-size: 12px; color: var(--grey-1); margin-top: 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 860px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-2 .card { margin-bottom: 0; } .grid-2 { margin-bottom: 12px; } }

.chart { width: 100%; position: relative; }
.chart svg { display: block; width: 100%; height: auto; font-family: var(--font); }
.chart .axis text { font-size: 12px; fill: var(--grey-1); }
.chart .axis line, .chart .axis path { stroke: var(--grey-3); }
.chart .grid line { stroke: var(--grey-4); }
.chart .grid path { stroke: none; }
.chart .label { font-size: 12px; fill: var(--ink); }
.chart .label.muted { fill: var(--grey-1); }
.chart .label.white { fill: var(--paper); }
.chart .empty { font-size: 13px; fill: var(--grey-2); }
.chart .hit { fill: transparent; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--grey-1); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar select, .toolbar input { min-height: 36px; padding: 6px 8px; font-size: 14px; }
.toolbar input { flex: 1 1 160px; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap.tall { max-height: 440px; overflow-y: auto; border: 1px solid var(--grey-3); }
.table { border-collapse: collapse; width: 100%; font-size: 13px; }
.table th, .table td { border: 1px solid var(--grey-3); padding: 6px 8px; text-align: left; vertical-align: top; }
.table th { background: var(--navy); color: var(--paper); font-weight: 700; white-space: nowrap; position: sticky; top: 0; }
.table tbody tr:nth-child(even) td { background: var(--grey-4); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table td.neg { color: var(--red); font-weight: 700; }
.table td.tingkat-Tinggi { color: var(--red); font-weight: 700; }
.table tfoot td { font-weight: 700; background: var(--grey-4); }

.map { width: 100%; height: 420px; border-radius: 4px; background: var(--grey-4); z-index: 1; }
.map .leaflet-tooltip { font-family: var(--font); font-size: 12px; line-height: 1.35; background: var(--navy); color: var(--paper); border: 0; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.map .leaflet-tooltip-top:before { border-top-color: var(--navy); }
.map .leaflet-control-attribution { font-size: 10px; }
.map-legend { background: rgba(255,255,255,.92); padding: 6px 8px; border-radius: 4px; font-size: 11px; color: var(--grey-1); line-height: 1.2; }
.map-legend svg { display: block; }
@media (max-width: 600px) { .map { height: 320px; } .filters label { flex: 1 1 45%; } }

.tooltip {
  position: fixed; z-index: 60; pointer-events: none;
  background: var(--navy); color: var(--paper);
  font-size: 12px; line-height: 1.35; padding: 6px 9px; border-radius: 4px;
  max-width: 240px; box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.tooltip b { color: var(--paper); }

.footer { color: var(--grey-1); font-size: 12px; margin-top: 24px; border-top: 1px solid var(--grey-3); padding-top: 12px; }
.footer p { margin: 0 0 6px; }

.topbar-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.only-mobile { display: none; }
@media (max-width: 600px) {
  body { font-size: 14px; }
  .tile-value { font-size: 22px; }
  .topbar { padding-top: 8px; }
  .brand-title { font-size: 15px; }
  .brand-sub { display: none; }
  .only-mobile { display: inline-block; }
  .filters { display: none; padding-top: 8px; }
  .filters.open { display: flex; }
  .topbar.has-filter #toggle-filters { border-color: var(--red); color: var(--red); }
  .section { scroll-margin-top: 120px; }
}

#table-isu td:nth-child(1), #table-isu td:nth-child(4) { white-space: nowrap; }
