/* Palet merujuk identitas korporat Pertamina / Patra Niaga: navy, biru, merah, hijau */
:root {
  color-scheme: light;
  --navy: #0B2A55;
  --blue: #005DAA;
  --red: #E31E24;
  --green: #7AB51D;
  --bg: #F3F6FA;
  --surface: #FFFFFF;
  --surface-2: #F7F9FC;
  --line: #E1E7EF;
  --text: #0E1B2C;
  --text-2: #4A5A6E;
  --muted: #6B7A8D;
  --series-1: #005DAA;     /* SKP */
  --series-2: #E8A33D;     /* STP */
  --track: #DCE6F2;
  --ok: #2E8B3A;  --ok-bg: #E7F4E8;
  --warn: #B26B00; --warn-bg: #FFF3DC;
  --bad: #C4161C;  --bad-bg: #FDE8E8;
  --na: #6B7A8D;  --na-bg: #EEF1F5;
  --shadow: 0 1px 2px rgba(11,42,85,.06), 0 4px 16px rgba(11,42,85,.05);
  --band: #E9EFF7; --band-line: #CFDAE8;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --navy: #071A35; --blue: #3D8BD6; --red: #F0474C; --green: #8FC63A;
    --bg: #0C1420; --surface: #131E2D; --surface-2: #182638; --line: #26364B;
    --text: #E8EEF6; --text-2: #B3C0D0; --muted: #8C9AAD;
    --series-1: #3D8BD6; --series-2: #C98500; --track: #22344A;
    --ok: #6CC77A; --ok-bg: #173323; --warn: #F0B54A; --warn-bg: #3A2D12;
    --bad: #F2787B; --bad-bg: #3D1C1F; --na: #9AA7B8; --na-bg: #1E2A3A;
    --shadow: none;
    --band: #0F1926; --band-line: #2A3B52;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --navy: #071A35; --blue: #3D8BD6; --red: #F0474C; --green: #8FC63A;
  --bg: #0C1420; --surface: #131E2D; --surface-2: #182638; --line: #26364B;
  --text: #E8EEF6; --text-2: #B3C0D0; --muted: #8C9AAD;
  --series-1: #3D8BD6; --series-2: #C98500; --track: #22344A;
  --ok: #6CC77A; --ok-bg: #173323; --warn: #F0B54A; --warn-bg: #3A2D12;
  --bad: #F2787B; --bad-bg: #3D1C1F; --na: #9AA7B8; --na-bg: #1E2A3A;
  --shadow: none;
  --band: #0F1926; --band-line: #2A3B52;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 16px; }
h2 { font-size: 15px; font-weight: 600; margin: 0; }
.muted { color: var(--muted); margin: 2px 0 0; font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

/* Header */
.topbar { background: var(--navy); color: #fff; position: relative; }
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
  background: linear-gradient(90deg, var(--red) 0 33.3%, var(--green) 33.3% 66.6%, #1F8FE5 66.6% 100%); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; padding-top: 16px; padding-bottom: 10px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { display: inline-flex; gap: 3px; transform: skewX(-18deg); flex: none; }
.brand-mark i { width: 7px; height: 28px; border-radius: 2px; display: block; }
.brand-mark i:nth-child(1) { background: var(--red); }
.brand-mark i:nth-child(2) { background: var(--green); }
.brand-mark i:nth-child(3) { background: #1F8FE5; }
.brand-title { font-weight: 600; font-size: 18px; line-height: 1.2; }
.brand-sub { font-size: 12px; opacity: .8; }
.theme-btn { background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.25);
  border-radius: 8px; width: 36px; height: 36px; font-size: 16px; cursor: pointer; flex: none; }
.tabs { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.tab { background: transparent; border: 0; color: rgba(255,255,255,.75); font: inherit; font-size: 13px;
  padding: 10px 12px 12px; cursor: pointer; white-space: nowrap; border-bottom: 3px solid transparent; }
.tab:hover { color: #fff; }
.tab[aria-selected="true"] { color: #fff; font-weight: 600; border-bottom-color: #fff; }
.tab .cnt { font-size: 11px; opacity: .7; margin-left: 4px; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0 14px; align-items: flex-end; }
.f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); min-width: 150px; }
.f.grow { flex: 1 1 220px; }
.f select, .f input { font: inherit; font-size: 13px; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-height: 38px; }
.f select:focus, .f input:focus { outline: 2px solid var(--blue); outline-offset: 1px; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow);
  border: 1px solid var(--line); border-top: 3px solid var(--blue); }
.kpi.accent { border-top-color: var(--green); }
.kpi.alert { border-top-color: var(--red); }
.kpi .lbl { font-size: 12px; color: var(--text-2); }
.kpi .val { font-size: 22px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12px; color: var(--muted); }

.deadlines { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.dl { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 12px; font-size: 12.5px; }
.dl b { font-variant-numeric: tabular-nums; }
.dl.hot { border-color: var(--red); }
.dl .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.dl.hot .dot { background: var(--red); }
.dl.past { opacity: .55; }

/* Cards */
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); gap: 14px; margin-top: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px;
  box-shadow: var(--shadow); margin-top: 14px; min-width: 0; }
.grid2 .card { margin-top: 0; }
.card-h { margin-bottom: 12px; }
.card-h.row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }

/* Bar chart */
.barchart { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: block; cursor: pointer; border-radius: 6px; padding: 4px 6px; }
.bar-row:hover { background: var(--surface-2); }
.bar-head { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; margin-bottom: 3px; }
.bar-lbl { color: var(--text-2); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-val { color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar-trk { position: relative; height: 14px; }
.bar-bg, .bar-fg { position: absolute; left: 0; top: 0; height: 14px; border-radius: 0 4px 4px 0; min-width: 0; }
.bar-bg { background: var(--track); }
.bar-fg { background: var(--series-1); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

.stepchart svg { width: 100%; height: auto; display: block; overflow: visible; }
.stepchart .ax { font-size: 11px; fill: var(--muted); font-family: inherit; }
.stepchart .grid { stroke: var(--line); stroke-width: 1; }
.stepchart .ln { fill: none; stroke: var(--series-1); stroke-width: 2; }
.stepchart .area { fill: var(--series-1); opacity: .1; }
.stepchart .cross { stroke: var(--text-2); stroke-dasharray: 3 3; }
.stepchart .now { stroke: var(--red); stroke-width: 1.5; }
.stepchart .lbl { font-size: 11.5px; fill: var(--text); font-family: inherit; }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th { text-align: left; font-weight: 600; color: var(--text-2); background: var(--surface-2);
  padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; }
.tbl th.sortable { cursor: pointer; user-select: none; }
.tbl th.sortable::after { content: " ↕"; opacity: .35; }
.tbl th.sorted-asc::after { content: " ↑"; opacity: 1; }
.tbl th.sorted-desc::after { content: " ↓"; opacity: 1; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl.clickable tbody tr, #entityTable tbody tr { cursor: pointer; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl tfoot td { font-weight: 600; border-top: 2px solid var(--line); background: var(--surface-2); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.pill.potensial { color: var(--ok); background: var(--ok-bg); }
.pill.verifikasi { color: var(--warn); background: var(--warn-bg); }
.pill.tidak { color: var(--bad); background: var(--bad-bg); }
.pill.na { color: var(--na); background: var(--na-bg); }
.tag { display: inline-block; padding: 1px 7px; border-radius: 4px; font-size: 11.5px; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--line); }
.tag.skp { color: var(--series-1); }
.tag.stp { color: var(--warn); }
.dk { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; font-weight: 600;
  background: var(--navy); color: #fff; font-size: 12px; }
.flagdot { color: var(--warn); margin-left: 4px; }

.btn { font: inherit; font-size: 13px; border-radius: 8px; padding: 8px 14px; cursor: pointer; border: 1px solid var(--blue);
  background: var(--blue); color: #fff; }
.btn.ghost { background: transparent; color: var(--blue); }

.foot { margin: 24px 0 40px; font-size: 12px; color: var(--text-2); }
.foot p { margin: 6px 0; }

/* Drawer */
.drawer-bg { position: fixed; inset: 0; background: rgba(5,15,30,.45); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; height: 100%; width: min(760px, 100%); background: var(--surface);
  z-index: 50; transform: translateX(100%); transition: transform .22s ease; overflow-y: auto;
  box-shadow: -8px 0 32px rgba(0,0,0,.18); }
.drawer.open { transform: translateX(0); }
.drawer-x { position: sticky; top: 12px; float: right; margin: 12px 12px 0 0; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); width: 34px; height: 34px; border-radius: 8px; cursor: pointer; z-index: 2; }
.d-head { background: var(--navy); color: #fff; padding: 20px 20px 18px; }
.d-head .k { font-size: 12px; opacity: .8; }
.d-head h3 { margin: 4px 0 8px; font-size: 19px; font-weight: 600; font-family: ui-monospace, Menlo, monospace; }
.d-head .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; opacity: .95; }
.d-sec { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.d-sec h4 { margin: 0 0 10px; font-size: 14px; font-weight: 600; }
.d-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.d-stat { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.d-stat .lbl { font-size: 11.5px; color: var(--text-2); }
.d-stat .val { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.verdict { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; }
.verdict.potensial { background: var(--ok-bg); }
.verdict.verifikasi { background: var(--warn-bg); }
.verdict.tidak { background: var(--bad-bg); }
.verdict.na { background: var(--na-bg); }
.verdict .big { font-size: 26px; font-weight: 700; line-height: 1; }
.verdict p { margin: 2px 0 0; font-size: 13px; }
.tiers { display: grid; gap: 8px; }
.tier { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; }
.tier.active { border-color: var(--green); box-shadow: inset 4px 0 0 var(--green); }
.tier.passed { opacity: .5; }
.tier .pct { font-size: 20px; font-weight: 700; color: var(--blue); }
.tier .when { font-size: 12.5px; }
.tier .cash { font-size: 12px; color: var(--text-2); text-align: right; }
.tier .cash b { color: var(--text); font-size: 13px; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.checks li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; font-size: 13px; }
.checks .ic { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.ic.ok { background: var(--ok-bg); color: var(--ok); }
.ic.q { background: var(--warn-bg); color: var(--warn); }
.ic.x { background: var(--bad-bg); color: var(--bad); }
.basis { display: block; font-size: 11.5px; color: var(--muted); }
.flags { display: grid; gap: 8px; }
.flag { padding: 10px 12px; border-radius: 8px; font-size: 13px; border-left: 4px solid var(--warn); background: var(--warn-bg); }
.flag.high { border-left-color: var(--bad); background: var(--bad-bg); }
.flag.info { border-left-color: var(--blue); background: var(--surface-2); }
.steps { counter-reset: s; list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 28px 1fr; gap: 10px; font-size: 13px; }
.steps li::before { content: counter(s); width: 26px; height: 26px; border-radius: 50%; background: var(--blue); color: #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 600; }
.steps .ph { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; }

.tip { position: fixed; z-index: 60; pointer-events: none; background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 12px; box-shadow: 0 6px 20px rgba(0,0,0,.15); max-width: 280px; }
.tip b { font-variant-numeric: tabular-nums; }

@media (max-width: 640px) {
  .brand-title { font-size: 15px; }
  .brand-sub { display: none; }
  .f { min-width: calc(50% - 6px); flex: 1 1 calc(50% - 6px); }
  .kv { grid-template-columns: 1fr; }
  .kv dt { margin-top: 6px; }
  .tier { grid-template-columns: 52px 1fr; }
  .tier .cash { grid-column: 1 / -1; text-align: left; }
  .kpi .val { font-size: 18px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 12px; }
}
@media print {
  .topbar .tabs, .filters, .theme-btn, #csvBtn { display: none; }
  .drawer { position: static; transform: none; box-shadow: none; width: 100%; }
}
.table-wrap.tall { max-height: 640px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.tbl tfoot td { position: sticky; bottom: 0; }
.foot { overflow-wrap: anywhere; }
.tbl td.mono { white-space: nowrap; }

/* ===== Putaran 2: kartu entitas, speedometer, donut, jadwal, modal ===== */
:root { --c1: #2a78d6; --c2: #eb6834; --c3: #1baf7a; --c4: #eda100; --c5: #e87ba4; --c-other: #9AA6B4; --road: #3B4656; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500; --c5: #d55181; --c-other: #6B7787; --road: #2A3443; } }
:root[data-theme="dark"] { --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500; --c5: #d55181; --c-other: #6B7787; --road: #2A3443; }

.top-actions { display: flex; gap: 8px; align-items: center; }
.btn.top { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.3); color: #fff; white-space: nowrap; }
.btn.top:hover { background: rgba(255,255,255,.2); }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.srcbar { background: var(--warn-bg); color: var(--text); font-size: 12.5px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.srcbar span { color: var(--text-2); }
.linkbtn { background: none; border: 0; color: var(--blue); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; padding: 0 4px; }
.sec-h { display: flex; align-items: baseline; gap: 12px; margin: 18px 0 10px; flex-wrap: wrap; }
.sec-h .muted { margin: 0; }

/* kartu entitas: 6 kolom */
.ecards { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.ecard { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); position: relative; overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s, background .2s, color .2s; min-height: 148px; }
.ecard::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--blue); }
.ecard:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(11,42,85,.12); }
.ecard:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.ecard.all::before { background: linear-gradient(90deg, var(--red) 0 33.3%, var(--green) 33.3% 66.6%, #1F8FE5 66.6% 100%); }
.ecard.sel, .ecard.nihil.sel { background: linear-gradient(150deg, var(--navy) 0%, #005DAA 100%); color: #fff; border-color: transparent; box-shadow: 0 0 0 3px #1F8FE5, 0 10px 28px rgba(0,93,170,.35); transform: translateY(-2px); }
.ecard.sel::before { background: linear-gradient(90deg, var(--red) 0 33.3%, var(--green) 33.3% 66.6%, #1F8FE5 66.6% 100%); }
.ecard.sel .ec-row span, .ecard.sel .ec-n, .ecard.sel .ec-nil { color: rgba(255,255,255,.78); }
.ecard.sel .ec-code { background: rgba(255,255,255,.18); color: #fff; }
.ecard.sel .ec-row.pot b { color: #9BE07A !important; }
.ecard.sel .ec-logo { border-color: transparent; }
.ecard.sel .ec-logo img { opacity: 1; }
.ecard.nihil { background: var(--surface-2); }
.ec-logo { display: flex; align-items: center; justify-content: flex-start; height: 44px; padding: 6px 8px; margin: 2px 0 2px; background: #fff; border-radius: 8px; border: 1px solid rgba(11,42,85,.08); }
.ec-logo img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.ec-logo.txt .ec-name { color: #0B2A55; font-size: 12px; line-height: 1.25; }
.ecard.nihil .ec-logo img { opacity: .75; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ecard.nihil::before { background: var(--c-other); }
.ec-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.ec-code { font-weight: 700; font-size: 12px; background: var(--surface-2); color: var(--blue); padding: 2px 8px; border-radius: 6px; }
.ec-n { font-size: 11px; color: var(--muted); white-space: nowrap; }
.ec-name { font-size: 12.5px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.ec-row { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; }
.ec-row span { color: var(--text-2); }
.ec-row b { font-variant-numeric: tabular-nums; }
.ec-row.pot b { color: var(--ok); }
.ec-nil { font-size: 12px; color: var(--muted); margin-top: auto; }
.ec-bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; gap: 2px; margin-top: auto; background: transparent; }
.ec-bar i, .sbar i { display: block; height: 100%; min-width: 3px; }
.ec-bar i.potensial, .sbar i.potensial { background: var(--ok); }
.ec-bar i.verifikasi, .sbar i.verifikasi { background: var(--warn); }
.ec-bar i.tidak, .sbar i.tidak { background: var(--bad); }
.ec-bar i.na, .sbar i.na { background: var(--c-other); }
.sbar { display: flex; height: 18px; border-radius: 4px; overflow: hidden; gap: 2px; }

/* speedometer */
.gauges { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.gauge { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 12px 14px 14px; text-align: center; }
.gauge svg { width: 100%; max-width: 220px; display: block; margin: 0 auto; overflow: visible; }
.g-track { fill: none; stroke: var(--track); stroke-width: 14; stroke-linecap: round; }
.g-val { fill: none; stroke: var(--blue); stroke-width: 14; stroke-linecap: round; transition: stroke-dasharray 1.4s cubic-bezier(.3,1.3,.5,1); }
.g-zone { fill: none; stroke-width: 3; stroke-linecap: round; }
.g-zone.ok { stroke: var(--ok); } .g-zone.warn { stroke: var(--warn); } .g-zone.bad { stroke: var(--bad); }
.g-tick { stroke: var(--muted); stroke-width: 1.5; }
.g-needle { transform-origin: 100px 100px; transition: transform 1.4s cubic-bezier(.3,1.5,.5,1); fill: var(--navy); }
:root[data-theme="dark"] .g-needle { fill: #E8EEF6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .g-needle { fill: #E8EEF6; } }
.g-big { font-size: 22px; font-weight: 700; margin-top: -6px; font-variant-numeric: tabular-nums; }
.g-lbl { font-size: 12.5px; font-weight: 600; }
.g-sub { font-size: 11.5px; color: var(--muted); }

/* donut */
.d-wrap { display: grid; grid-template-columns: minmax(160px, 220px) 1fr; gap: 18px; align-items: center; }
.d-svg { width: 100%; height: auto; }
.d-seg { fill: none; stroke-width: 30; cursor: pointer; transition: stroke-width .15s; }
.d-seg:hover { stroke-width: 36; }
.d-c1 { font-size: 11px; fill: var(--muted); font-family: inherit; }
.d-c2 { font-size: 17px; font-weight: 700; fill: var(--text); font-family: inherit; }
.d-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.d-legend li { display: grid; grid-template-columns: 14px 1fr auto 42px; gap: 8px; align-items: center; font-size: 12.5px; }
.d-legend b { font-variant-numeric: tabular-nums; }
.d-legend em { font-style: normal; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

/* jadwal: jalan + truk */
.countdown { background: var(--bad-bg); color: var(--text); border-radius: 999px; padding: 6px 12px; font-size: 12.5px; }
.countdown b { color: var(--bad); }
.today-tag { position: absolute; left: 62%; top: 58px; transform: translateX(-50%); font-size: 10.5px; font-weight: 700; color: #fff; background: var(--red); padding: 1px 7px; border-radius: 999px; white-space: nowrap; }
.ms.dn.near-truck .ms-txt { top: 52px; }
.hourglass { display: inline-block; animation: flip 3s ease-in-out infinite; }
@keyframes flip { 0%, 80% { transform: rotate(0); } 90%, 100% { transform: rotate(180deg); } }
.road-wrap { overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
.road { position: relative; min-width: 1040px; height: 290px; }
.lane { position: absolute; left: 0; right: 0; top: 150px; height: 14px; background: var(--road); border-radius: 7px;
  background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.8) 0 18px, transparent 18px 36px); background-size: 36px 2px; background-repeat: repeat-x; background-position: 0 6px; }
.lane-done { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, var(--green), #1F8FE5); border-radius: 7px; opacity: .85; transition: width 2.4s ease-out; }
.ms { position: absolute; top: 142px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; width: 118px;
  animation: pop .5s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes pop { from { opacity: 0; transform: translateX(-50%) scale(.4); } to { opacity: 1; transform: translateX(-50%) scale(1); } }
.ms-dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--surface);
  border: 3px solid var(--c-other); color: var(--text-2); position: relative; z-index: 2; }
.ms.done .ms-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.ms.next .ms-dot { border-color: var(--red); color: var(--red); animation: ping 1.6s ease-out infinite; }
.ms.hot .ms-dot { border-color: var(--red); }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(227,30,36,.55); } 100% { box-shadow: 0 0 0 14px rgba(227,30,36,0); } }
.ms-txt { position: absolute; display: flex; flex-direction: column; align-items: center; text-align: center; font-size: 11.5px; line-height: 1.3; width: 128px; }
.ms.up .ms-txt { bottom: 82px; }
.ms.dn .ms-txt { top: 40px; }
.ms-txt b { font-size: 12px; }
.ms-txt em { font-style: normal; color: var(--muted); font-size: 11px; }
.ms.hot .ms-txt b { color: var(--red); }
.ms.done .ms-txt { opacity: .7; }
.truck { position: absolute; top: 112px; width: 84px; transform: translateX(-62%); z-index: 3; transition: left 2.5s cubic-bezier(.45,.05,.3,1); }
.truck-svg { width: 84px; height: auto; display: block; filter: drop-shadow(0 3px 2px rgba(0,0,0,.18)); }
.truck .body { animation: bob .5s ease-in-out infinite alternate; }
.truck .tank { fill: #E9EEF5; stroke: #005DAA; stroke-width: 2; }
.truck .cab { fill: #005DAA; } .truck .win { fill: #BFE3FF; }
.truck .chassis { fill: #26303D; }
.truck .eye { fill: #fff; } .truck .smile { fill: none; stroke: #fff; stroke-width: 1.6; stroke-linecap: round; }
.truck .blush { fill: #FF8FA3; opacity: .8; }
.truck .face { animation: blink 4s infinite; transform-origin: 98px 40px; }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.15); } }
.truck .wheel circle { fill: #26303D; stroke: #8796A8; stroke-width: 2; }
.truck .wheel path { stroke: #8796A8; stroke-width: 1.5; }
.truck .puffs circle { fill: var(--c-other); opacity: 0; }
.truck.driving .wheel { animation: spin .35s linear infinite; }
.truck.driving .puffs circle { animation: puff 0.9s ease-out infinite; }
.truck.driving .puffs circle:nth-child(2) { animation-delay: .3s; } .truck.driving .puffs circle:nth-child(3) { animation-delay: .6s; }
.truck:not(.driving) .wheel { animation: spin 3s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bob { from { transform: translateY(0); } to { transform: translateY(-1.5px); } }
@keyframes puff { 0% { opacity: .7; transform: translate(0, 0) scale(.6); } 100% { opacity: 0; transform: translate(-14px, -10px) scale(1.6); } }
.bubble { position: absolute; bottom: 64px; left: 50%; transform: translateX(-30%); background: var(--navy); color: #fff; font-size: 11px; line-height: 1.35;
  padding: 6px 10px; border-radius: 10px; white-space: nowrap; animation: float 2.4s ease-in-out infinite; }
.bubble::after { content: ""; position: absolute; left: 30%; bottom: -6px; border: 6px solid transparent; border-top-color: var(--navy); border-bottom: 0; }
@keyframes float { 0%, 100% { transform: translateX(-30%) translateY(0); } 50% { transform: translateX(-30%) translateY(-4px); } }

/* workflow internal */
.flow { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.fl { position: relative; background: var(--surface-2); padding: 10px 16px 10px 22px; display: flex; flex-direction: column; gap: 2px; min-height: 92px;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%); animation: slidein .5s ease both; }
.fl:first-child { clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%); padding-left: 14px; }
@keyframes slidein { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.fl-ic { font-size: 20px; line-height: 1; }
.fl-t { font-size: 12px; font-weight: 600; line-height: 1.25; }
.fl-w { font-size: 11px; color: var(--muted); }
.fl.done { background: var(--ok-bg); } .fl.done .fl-w { color: var(--ok); font-weight: 600; }
.fl.active { background: var(--blue); color: #fff; } .fl.active .fl-w { color: rgba(255,255,255,.85); }
.fl.active .fl-ic { animation: wiggle 1.2s ease-in-out infinite; display: inline-block; transform-origin: 50% 80%; }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
.fl-note { grid-column: 1 / -1; margin-top: 6px; }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(5,15,30,.5); z-index: 70; display: grid; place-items: center; padding: 16px; }
.modal-bg[hidden] { display: none; }
.modal { background: var(--surface); color: var(--text); border-radius: 14px; width: min(760px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 22px; position: relative; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal h3 { margin: 0 40px 12px 0; font-size: 17px; }
.modal .drawer-x { position: absolute; top: 14px; right: 14px; float: none; margin: 0; }
.mflow { margin: 0 0 14px; padding-left: 20px; font-size: 13px; display: grid; gap: 4px; }
.mrow { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.drop { margin-top: 14px; border: 2px dashed var(--line); border-radius: 12px; padding: 22px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; cursor: pointer; font-size: 13px; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--blue); background: var(--surface-2); }
.drop-ic { font-size: 26px; color: var(--blue); }
.mnote { margin-top: 16px; background: var(--surface-2); border-radius: 10px; padding: 12px 14px; font-size: 12.5px; }
.mnote code { font-size: 12px; }
body.noscroll { overflow: hidden; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 80; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: calc(100% - 32px); }

@media (max-width: 1100px) {
  .ecards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gauges { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .ecards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ecard { min-height: 132px; padding: 10px 12px 12px; }
  .gauges { gap: 10px; }
  .g-big { font-size: 18px; }
  .flow { grid-template-columns: 1fr 1fr; }
  .fl, .fl:first-child { clip-path: none; border-radius: 8px; padding: 10px 12px; }
  .d-wrap { grid-template-columns: 1fr; }
  .d-svg { max-width: 220px; margin: 0 auto; display: block; }
  .btn.top { font-size: 0; padding: 8px 10px; }
  .btn.top::before { content: "⇅ Data"; font-size: 13px; }
  .card-h.row { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.srcbar.shared { background: var(--ok-bg); }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-right: 2px; animation: ping-g 2s ease-out infinite; vertical-align: middle; }
@keyframes ping-g { 0% { box-shadow: 0 0 0 0 rgba(46,139,58,.5); } 100% { box-shadow: 0 0 0 8px rgba(46,139,58,0); } }

/* aksi & form per ketetapan */
.d-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.btn.sm { padding: 6px 12px; font-size: 12.5px; }
.btn.light { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.35); color: #fff; }
.btn.light:hover { background: rgba(255,255,255,.22); }
.btn.light.danger { border-color: rgba(255,140,140,.7); color: #FFD3D3; }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fgrid .f { min-width: 0; }
.fgrid .f.wide { grid-column: 1 / -1; }
.fgrid .f select:disabled { opacity: .7; }
@media (max-width: 560px) { .fgrid { grid-template-columns: 1fr; } }
.linkbtn[data-rv] { white-space: nowrap; }
.ec-no { font-style: normal; font-weight: 600; opacity: .6; margin-right: 6px; font-variant-numeric: tabular-nums; }
.ec-no::after { content: "."; }

/* Bagian (band) dengan batas yang jelas */
.band { background: var(--band); border: 1px solid var(--band-line); border-radius: 16px; padding: 4px 18px 20px; margin: 22px 0 0; position: relative; }
.band:first-of-type { margin-top: 18px; }
.band-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 0 12px; margin: 0 0 16px; border-bottom: 1px solid var(--band-line); }
.band-h > div { flex: 1 1 260px; min-width: 0; }
.band-h h2 { margin: 0; font-size: 17px; font-weight: 700; color: var(--text); }
.band-h .muted { margin: 2px 0 0; }
.band-no { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; background: var(--blue); box-shadow: 0 0 0 4px var(--surface); }
#b-ringkasan .band-no { background: var(--green); }
#b-jadwal .band-no { background: var(--red); }
#b-analisis .band-no { background: var(--navy); }
#b-daftar .band-no { background: #1F8FE5; }
.band .filters { margin-top: 0; }
.band > .card:first-of-type, .band > .grid2:first-of-type { margin-top: 0; }
.band-act { margin-left: auto; }
.bar-more { font-size: 12px; color: var(--muted); padding: 8px 0 2px; border-top: 1px dashed var(--line); margin-top: 6px; }
@media (max-width: 560px) { .band { padding: 2px 12px 14px; border-radius: 12px; } .band-act { margin-left: 0; } }

/* Tata letak: sidebar entitas (kiri) + konten (kanan) */
.wrap { max-width: 1520px; }
.layout { display: grid; grid-template-columns: 284px minmax(0, 1fr); gap: 18px; align-items: start; margin-top: 18px; }
.layout > .side { margin: 0; position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; padding: 0 10px 12px; scrollbar-width: thin; }
.layout > .content { min-width: 0; }
.layout > .content > .band:first-child { margin-top: 0; }
.side .band-h { padding: 10px 2px 8px; margin-bottom: 10px; gap: 8px; position: sticky; top: 0; background: var(--band); z-index: 2; flex-wrap: nowrap; align-items: flex-start; }
.side .band-h > div { flex: 1 1 0; }
.side .band-h h2 { font-size: 15px; }
.side .band-h .muted { font-size: 11px; line-height: 1.35; }
.side .band-no { width: 24px; height: 24px; font-size: 12px; margin-top: 1px; }
.side .ecards { grid-template-columns: 1fr; gap: 6px; }
.side .ecard { min-height: 0; padding: 7px 9px 8px; gap: 5px; border-radius: 10px; }
.side .ecard::before { height: 3px; }
.side .ecard:hover { transform: translateX(2px); }
.side .ecard.sel { transform: translateX(3px); }
.side .ec-top { gap: 6px; align-items: center; justify-content: flex-start; }
.side .ec-top .ec-n { margin-left: auto; font-size: 10.5px; }
.side .ec-no { margin-right: 0; min-width: 16px; font-size: 11px; color: var(--muted); opacity: 1; }
.side .ecard.sel .ec-no { color: rgba(255,255,255,.75); }
.side .ec-logo { height: 30px; width: 150px; flex: none; padding: 3px 6px; border-radius: 6px; margin: 0; }
.side .ec-logo.txt { width: 170px; }
.side .ec-logo.txt .ec-name { font-size: 10.5px; line-height: 1.15; min-height: 0; -webkit-line-clamp: 2; }
.side .ec-top > .ec-name { font-size: 12.5px; min-height: 0; -webkit-line-clamp: 1; }
.side .ec-code { font-size: 11px; padding: 1px 6px; }
.side .ec-vals { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.side .ec-vals > span { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.side .ec-vals small { font-size: 10px; color: var(--muted); }
.side .ec-vals b { font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.side .ec-vals .pot b { color: var(--ok); }
.side .ecard.sel .ec-vals small { color: rgba(255,255,255,.75); }
.side .ecard.sel .ec-vals .pot b { color: #9BE07A; }
.side .ec-bar { height: 4px; margin-top: 0; }
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .layout > .side { position: static; max-height: none; overflow: visible; }
  .side .ecards { grid-template-columns: 1fr; }
  .side .band-h { position: static; }
}
.kpi .val { white-space: nowrap; font-size: clamp(17px, 1.45vw, 22px); }

/* Header korporat */
.topbar { background: var(--navy); color: #fff; }
.corp { background: #fff; border-bottom: 1px solid #E1E7EF; }
.corp-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
.corp-id { display: flex; align-items: center; gap: 16px; min-width: 0; }
.corp-logo { height: 40px; width: auto; display: block; flex: none; }
.corp-div { width: 1px; height: 32px; background: #CFDAE8; flex: none; }
.corp-unit { color: #0B2A55; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.corp-unit b { color: #E31E24; font-weight: 700; }
.corp .btn.top { background: #fff; border-color: #005DAA; color: #005DAA; }
.corp .btn.top:hover { background: #EEF4FB; }
.corp .theme-btn { background: #fff; color: #0B2A55; border: 1px solid #CFDAE8; }
.titlebar { background: linear-gradient(100deg, #0B2A55 0%, #0B2A55 55%, #00468A 100%); position: relative; }
.titlebar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
  background: linear-gradient(90deg, #E31E24 0 33.3%, #7AB51D 33.3% 66.6%, #1F8FE5 66.6% 100%); }
.titlebar-inner { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding-top: 18px; padding-bottom: 22px; }
.tb-eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #9CC3EA; font-weight: 600; }
.tb-title { margin: 2px 0 4px; font-size: 22px; font-weight: 700; line-height: 1.25; color: #fff; }
.tb-title span { font-weight: 500; color: #CFE2F6; }
.tb-sub { font-size: 13px; color: rgba(255,255,255,.78); }
.tb-meta { text-align: right; font-size: 12px; color: rgba(255,255,255,.8); line-height: 1.5; white-space: nowrap; }
.tb-meta b { color: #fff; font-size: 13px; }
@media (max-width: 720px) {
  .corp-logo { height: 30px; }
  .corp-div { height: 24px; }
  .corp-id { gap: 10px; }
  .corp-unit { font-size: 10.5px; letter-spacing: .04em; white-space: normal; line-height: 1.2; }
  .tb-title { font-size: 17px; }
  .tb-meta { display: none; }
  .corp .btn.top { font-size: 0; padding: 8px 10px; }
  .corp .btn.top::before { content: "⇅ Data"; font-size: 13px; }
}
@media print { .corp .theme-btn, .corp .btn.top { display: none; } }
.topbar::after { display: none; }
.tb-right { text-align: right; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.tb-contact { font-size: 12px; color: rgba(255,255,255,.8); }
.tb-contact a { color: #fff; text-decoration: none; border-bottom: 1px dotted rgba(255,255,255,.5); }
.tb-contact a:hover { border-bottom-style: solid; }
.foot-contact a { color: var(--blue); }
@media (max-width: 1100px) { .tb-contact { display: none; } }
