:root {
  --bg: #f7f7f8;
  --panel: #ffffff;
  --panel-2: #fafafa;
  --ink: #111214;
  --ink-2: #3a3d44;
  --muted: #6b6f78;
  --line: #e7e7ea;
  --line-2: #f0f0f2;
  --side: #ffffff;
  --side-ink: #3a3d44;
  --side-active: #fdecea;
  --red: #c1140b;
  --red-2: #a5110a;
  --red-bg: #fdecea;
  --accent: var(--red);
  --accent-ink: #fff;
  --ok: #15803d; --ok-bg: #e8f7ee;
  --warn: #b45309; --warn-bg: #fff4e0;
  --bad: #c1140b; --bad-bg: #fdecea;
  --info: #1d4ed8; --info-bg: #eaf1ff;
  --grey-bg: #f1f2f4;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04);
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 Inter, system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ── layout ── */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); border-right: 1px solid var(--line); padding: 18px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 6px 10px 18px; }
.brand img { height: 30px; width: auto; display: block; }
.brand .tag { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--red); }
.nav-sec { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #9a9ea6; padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--side-ink); font-weight: 500; }
.nav a:hover { background: var(--panel-2); color: var(--ink); }
.nav a.active { background: var(--side-active); color: var(--red); font-weight: 600; box-shadow: inset 3px 0 0 var(--red); }
.nav a .ic { width: 18px; text-align: center; opacity: .85; }
.nav a .pill-n { margin-left: auto; background: var(--bad); color: #fff; font-size: 10.5px; font-weight: 700; border-radius: 99px; padding: 1px 7px; }
.side-foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.side-foot b { color: var(--ink); font-weight: 600; display: block; }
.side-foot button { margin-top: 8px; background: none; border: 1px solid var(--line); color: var(--ink-2); border-radius: 7px; padding: 4px 10px; cursor: pointer; font-size: 12px; }

.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: 18px; margin: 0; font-weight: 700; letter-spacing: -.01em; }
.topbar .sp { flex: 1; }
.menu-btn { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; cursor: pointer; }
.content { padding: 24px 28px 60px; max-width: 1320px; }

/* ── status ── */
.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 99px; font-weight: 600; font-size: 12.5px; }
.status-pill .dot { width: 8px; height: 8px; border-radius: 99px; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 25%, transparent); }
.status-pill.on { background: var(--ok-bg); color: var(--ok); }
.status-pill.off { background: var(--bad-bg); color: var(--bad); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .65; } }
.env { font-size: 11.5px; font-weight: 700; padding: 4px 9px; border-radius: 6px; background: var(--grey-bg); color: var(--ink-2); letter-spacing: .03em; }
.env.prod { background: var(--bad-bg); color: var(--bad); }

/* ── buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 7px 13px; border-radius: 9px; font-weight: 600; font-size: 13px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--panel-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--red); color: #fff; border-color: var(--red); }
.btn.primary:hover { background: var(--red-2); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger:hover { filter: brightness(.95); }
.btn.ghost-danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.sm { padding: 4px 9px; font-size: 12px; border-radius: 7px; }
.btn.panic { background: var(--red); color: #fff; border: none; padding: 8px 14px; letter-spacing: .02em; }
.btn.panic.restore { background: var(--ok); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ── cards & grids ── */
.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g21 { grid-template-columns: 2fr 1fr; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.card-h h3 { margin: 0; font-size: 14px; font-weight: 700; }
.card-h .sp { flex: 1; }
.card-b { padding: 16px 18px; }
.card-b.tight { padding: 0; }
.kpi .label { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.kpi .val { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.section-title { font-size: 13px; font-weight: 700; margin: 26px 0 10px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em; }

/* ── banner ── */
.banner { display: flex; gap: 14px; align-items: center; padding: 14px 18px; border-radius: var(--radius); margin-bottom: 18px; border: 1px solid; }
.banner.bad { background: var(--bad-bg); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.banner.warn { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.banner.info { background: #fff; color: var(--ink-2); border-color: var(--line); border-left: 4px solid var(--red); }
.banner.info b { color: var(--ink); }
.banner b { display: block; font-size: 14px; }
.banner .sp { flex: 1; }

/* ── tables ── */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--panel-2); white-space: nowrap; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--panel-2); }
.empty { padding: 36px; text-align: center; color: var(--muted); }

/* ── badges ── */
.b { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.b.paid, .b.delivered, .b.ok, .b.active, .b.on { background: var(--ok-bg); color: var(--ok); }
.b.pending, .b.failed-retry, .b.warn, .b.retrying { background: var(--warn-bg); color: var(--warn); }
.b.awaiting_method, .b.info, .b.sandbox { background: var(--info-bg); color: var(--info); }
.b.expired, .b.canceled, .b.grey, .b.off, .b.revoked { background: var(--grey-bg); color: var(--muted); }
.b.failed, .b.dead, .b.review, .b.bad, .b.killed, .b.critical { background: var(--bad-bg); color: var(--bad); }
.b.live { background: var(--ink); color: #fff; }

/* ── forms ── */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 11.5px; color: var(--muted); }
.inp { width: 100%; padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); outline: none; }
.inp:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(193, 20, 11, .12); }
textarea.inp { min-height: 70px; resize: vertical; font-family: var(--mono); font-size: 12.5px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; font-size: 13px; cursor: pointer; font-weight: 500; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters .inp { width: auto; min-width: 140px; }
.filters .inp.grow { flex: 1; min-width: 220px; }

/* ── switch (toggle) ── */
.toggle { position: relative; width: 44px; height: 24px; border-radius: 99px; background: var(--ok); border: none; cursor: pointer; flex: none; transition: background .15s; }
.toggle::after { content: ''; position: absolute; top: 3px; left: 23px; width: 18px; height: 18px; border-radius: 99px; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.toggle.killed { background: var(--bad); }
.toggle.killed::after { left: 3px; }
.sw-row { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--line-2); }
.sw-row:last-child { border-bottom: none; }
.sw-row .name { font-weight: 600; }
.sw-row .meta { font-size: 12px; color: var(--muted); }
.sw-row .sp { flex: 1; }

/* ── big kill panel ── */
.kill-hero { display: flex; align-items: center; gap: 22px; padding: 22px; }
.kill-hero .big { width: 92px; height: 92px; border-radius: 50%; border: 6px solid #fff; outline: 4px solid #111; background: var(--red); color: #fff; font-weight: 900; font-size: 14px; letter-spacing: .04em; cursor: pointer; flex: none; box-shadow: 0 8px 24px color-mix(in srgb, var(--bad) 35%, transparent); }
.kill-hero .big.restore { background: var(--ok); outline-color: var(--ok); box-shadow: 0 8px 24px color-mix(in srgb, var(--ok) 35%, transparent); }
.kill-hero h2 { margin: 0 0 4px; font-size: 18px; }

/* ── timeline ── */
.tl { list-style: none; margin: 0; padding: 4px 18px 14px; }
.tl li { position: relative; padding: 10px 0 10px 22px; border-left: 2px solid var(--line); margin-left: 6px; }
.tl li::before { content: ''; position: absolute; left: -7px; top: 14px; width: 12px; height: 12px; border-radius: 99px; background: var(--panel); border: 2px solid var(--muted); }
.tl li.paid::before { border-color: var(--ok); background: var(--ok); }
.tl li.bad::before { border-color: var(--bad); background: var(--bad); }
.tl li.warn::before { border-color: var(--warn); }
.tl .t { font-weight: 600; }
.tl .d { font-size: 12px; color: var(--muted); }
.tl pre { margin: 6px 0 0; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; font: 11.5px/1.45 var(--mono); white-space: pre-wrap; word-break: break-all; max-height: 160px; overflow: auto; }
dl.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; margin: 0; }
dl.kv dt { color: var(--muted); font-size: 12.5px; }
dl.kv dd { margin: 0; word-break: break-word; }

/* ── chart ── */
.chart { width: 100%; height: 180px; display: block; }
.chart .bar { fill: var(--ink); opacity: .85; }
.chart .bar.made { fill: #d4d6db; opacity: 1; }
.chart .bar.paid { fill: var(--red); }
.chart text { fill: var(--muted); font-size: 10px; font-family: Inter, sans-serif; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.hbar { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; margin: 0 0 12px; font-size: 13px; }
.hbar .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hbar .v { font-weight: 600; text-align: right; }
.hbar .track { grid-column: 1 / -1; height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.hbar .fill { height: 100%; background: var(--red); border-radius: 99px; }

/* ── provider cards ── */
.prov { padding: 16px 18px; }
.prov .top { display: flex; align-items: center; gap: 10px; }
.prov .nm { font-weight: 800; font-size: 16px; }
.prov .sp { flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 11.5px; padding: 3px 8px; border-radius: 6px; background: var(--grey-bg); color: var(--ink-2); font-weight: 600; }
.chip.on { background: var(--ok-bg); color: var(--ok); }
.chip.off { background: var(--bad-bg); color: var(--bad); text-decoration: line-through; }

/* ── modal ── */
.modal-bg { position: fixed; inset: 0; background: rgba(17, 18, 20, .35); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .12s; }
.modal { background: var(--panel); border-radius: 14px; width: min(560px, 100%); max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal.wide { width: min(760px, 100%); }
.modal-h { padding: 16px 20px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; }
.modal-h h3 { margin: 0; font-size: 16px; }
.modal-h .x { margin-left: auto; background: none; border: none; font-size: 20px; cursor: pointer; color: var(--muted); }
.modal-b { padding: 18px 20px; }
.modal-f { padding: 14px 20px; border-top: 1px solid var(--line-2); display: flex; gap: 8px; justify-content: flex-end; }
@keyframes fade { from { opacity: 0; } }
.secret-box { background: var(--panel-2); border: 1px dashed var(--line); border-radius: 10px; padding: 12px; font-family: var(--mono); font-size: 12.5px; word-break: break-all; display: flex; gap: 10px; align-items: center; justify-content: space-between; margin: 6px 0 12px; }
pre.code { background: #f6f6f8; color: #1f2227; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; overflow-x: auto; font: 12.5px/1.55 var(--mono); margin: 8px 0 16px; }

/* ── toasts ── */
#toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px; font-weight: 500; box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: 380px; animation: fade .15s; }
.toast.err { background: var(--bad); color: #fff; }

/* ── login ── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--bg); border-top: 4px solid var(--red); }
.login .box { width: min(400px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: 0 20px 50px rgba(0,0,0,.08); }
.login .brand { color: var(--ink); padding: 0 0 18px; }
.login .login .err { color: var(--bad); font-size: 13px; min-height: 18px; margin-bottom: 8px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 8px 12px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--red); border-bottom-color: var(--red); }

/* ── responsive ── */
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g21 { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; left: 0; top: 0; width: 250px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.25); }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 10px 16px; }
  .topbar .hide-sm { display: none; }
  .content { padding: 16px 16px 60px; }
  .g3, .g2 { grid-template-columns: 1fr; }
  dl.kv { grid-template-columns: 1fr; gap: 2px; }
  dl.kv dd { margin-bottom: 8px; }
  .kill-hero { flex-direction: column; text-align: center; }
}
@media (max-width: 480px) { .g4 { grid-template-columns: 1fr 1fr; } .kpi .val { font-size: 19px; } }

/* ── minimal pass (v2) ── */
:root { --shadow: none; }
.content { padding: 28px 32px 64px; max-width: 1200px; }
.topbar { padding: 14px 32px; border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: 17px; }
.brand { padding: 8px 12px 26px; }
.brand img { height: 26px; }
.brand .tag { letter-spacing: .12em; font-size: 10.5px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { padding: 9px 12px; font-weight: 500; color: var(--ink-2); }
.nav a.active { box-shadow: none; }
.side-foot { display: flex; align-items: center; gap: 10px; }
.side-foot .who { flex: 1; text-decoration: none; min-width: 0; }
.side-foot .who b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot .who span { font-size: 11.5px; color: var(--muted); }
.side-foot button { margin-top: 0; }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--ok); }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status.off { color: var(--red); animation: pulse 1.4s infinite; }
.btn.panic { padding: 7px 14px; border-radius: 9px; font-size: 13px; letter-spacing: 0; }
.env { background: var(--grey-bg); color: var(--muted); font-weight: 600; font-size: 11.5px; }
.env.prod { background: var(--red-bg); color: var(--red); }
.card { box-shadow: none; }
.card-h { padding: 16px 20px; border-bottom: none; }
.card-b { padding: 4px 20px 20px; }
.card-b.tight { padding: 0 0 6px; }
.link { background: none; border: none; color: var(--red); font-weight: 600; font-size: 13px; cursor: pointer; text-decoration: none; padding: 0; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); }
.kpis .kpi { padding: 20px 22px; border-left: 1px solid var(--line-2); }
.kpis .kpi:first-child { border-left: none; }
.kpi .val { font-size: 26px; }
.kpi .val.red { color: var(--red); }
.banner { display: block; padding: 12px 16px; font-size: 13.5px; text-decoration: none; margin-bottom: 12px; }
.banner b { display: inline; font-size: 13.5px; }
.tbl th { background: none; font-size: 11px; color: var(--muted); border-bottom: 1px solid var(--line); padding: 10px 20px; }
.tbl td { padding: 12px 20px; }
.pm { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.pm img { height: 16px; width: auto; max-width: 64px; }
.sw-row { padding: 12px 20px; }
.chart .bar.made { fill: #e6e7ea; }
.legend i { border-radius: 50%; width: 8px; height: 8px; }
.tabs { margin-bottom: 18px; }
.tabs a { padding: 9px 14px; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, 1fr); } .kpis .kpi:nth-child(3) { border-left: none; } .kpis .kpi:nth-child(n+3) { border-top: 1px solid var(--line-2); } }
@media (max-width: 820px) { .content { padding: 16px 16px 60px; } .topbar { padding: 10px 16px; } .tbl th, .tbl td { padding: 10px 12px; } }
.tbl td .mono { white-space: nowrap; }
.filters .inp { min-width: 0; flex: 1 1 150px; }
.filters .inp.grow { flex: 2 1 240px; }
.pm img[alt="QRIS"], .pm img[alt="qris"] { height: 24px; }
details.emergency { margin-top: 16px; }
details.emergency summary { padding: 14px 20px; cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--ink-2); }
.sm-sel { width: auto; padding: 5px 8px; font-size: 13px; }
