/* Layout: template shell — white sidebar menu on the left, top bar with search, soft grey canvas holding white cards; blue accent. Below 900px the sidebar turns into a top menu strip. */
:root {
  --page: #e9edf3;
  --bg: #ffffff;
  --canvas: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f1f4f9;
  --line: #e2e7ef;
  --fg: #111a2b;
  --muted: #667085;
  --accent: #1f5fd1;
  --accent-2: #3b82f6;
  --accent-ink: #ffffff;
  --accent-soft: #e6eefc;
  --ink-btn: #111a2b; --ink-btn-fg: #ffffff;
  --ok: #138a4a;   --ok-soft: #e1f5ea;
  --warn: #a35a00; --warn-soft: #fdf0dc;
  --bad: #c62a2a;  --bad-soft: #fde6e6;
  --info: #1f5fd1; --info-soft: #e6eefc;
  --shadow: 0 1px 2px rgba(17,26,43,.04);
  --f-ui: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --r: 16px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --page: #080c14; --bg: #0e1420; --canvas: #0a0f19; --surface: #131b2a; --surface-2: #1a2436; --line: #253147;
  --fg: #e6ecf6; --muted: #93a0b6; --accent: #5b93f5; --accent-2: #7eaaf8; --accent-ink: #061229; --accent-soft: #172a4d;
  --ink-btn: #e6ecf6; --ink-btn-fg: #0e1420;
  --ok: #5cd08e; --ok-soft: #133224; --warn: #f2b45a; --warn-soft: #382a12;
  --bad: #f38a8a; --bad-soft: #3d1a1d; --info: #8fb6fa; --info-soft: #172a4d;
  --shadow: none; color-scheme: dark;
} }
:root[data-theme="dark"] {
  --page: #080c14; --bg: #0e1420; --canvas: #0a0f19; --surface: #131b2a; --surface-2: #1a2436; --line: #253147;
  --fg: #e6ecf6; --muted: #93a0b6; --accent: #5b93f5; --accent-2: #7eaaf8; --accent-ink: #061229; --accent-soft: #172a4d;
  --ink-btn: #e6ecf6; --ink-btn-fg: #0e1420;
  --ok: #5cd08e; --ok-soft: #133224; --warn: #f2b45a; --warn-soft: #382a12;
  --bad: #f38a8a; --bad-soft: #3d1a1d; --info: #8fb6fa; --info-soft: #172a4d;
  --shadow: none; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { background: var(--bg); color: var(--fg); font-family: var(--f-ui); font-size: 14px; line-height: 1.5; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.shell { display: grid; grid-template-columns: 240px minmax(0,1fr); min-height: 100vh; }
aside.side { position: sticky; top: env(safe-area-inset-top, 0px); height: 100vh; display: flex; flex-direction: column; gap: 6px; padding: 22px 14px 18px max(14px, env(safe-area-inset-left, 0px)); background: var(--bg); overflow-y: auto; }
.logo { display: flex; align-items: center; gap: 10px; padding: 0 8px 14px; }
.logo .mk { width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.logo .mk svg.i { width: 20px; height: 20px; stroke-width: 2; }
.logo b { font-size: 17px; font-weight: 800; letter-spacing: -.01em; line-height: 1.15; display: block; }
.logo span { font-size: 11.5px; color: var(--muted); }
.side .grp { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 14px 10px 4px; font-weight: 600; }
nav.tabs { display: grid; gap: 2px; }
nav.tabs a, .side .lnk { appearance: none; background: none; border: 0; border-radius: 10px; padding: 9px 12px; font: 500 14px var(--f-ui); color: var(--fg); opacity: .78; cursor: pointer; display: flex; gap: 11px; align-items: center; text-align: left; width: 100%; position: relative; }
nav.tabs a:hover, .side .lnk:hover { background: var(--surface-2); opacity: 1; }
nav.tabs a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); opacity: 1; font-weight: 600; }
nav.tabs a[aria-current="page"]::before { content: ""; position: absolute; left: -14px; top: 50%; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); transform: translateY(-50%); }
nav.tabs .badge { margin-left: auto; font-size: 11px; background: var(--surface-2); color: var(--muted); padding: 1px 7px; border-radius: 99px; font-weight: 600; font-variant-numeric: tabular-nums; }
nav.tabs .badge.hot { background: var(--bad-soft); color: var(--bad); }
.quick { display: grid; gap: 2px; }
.promo { margin-top: auto; border-radius: 14px; padding: 16px; background: linear-gradient(160deg, var(--accent-2), var(--accent)); color: #fff; display: grid; gap: 8px; text-align: center; }
.promo b { font-size: 15px; }
.promo p { margin: 0; font-size: 12.5px; opacity: .88; }
.promo a { appearance: none; border: 0; background: #fff; color: #163f8f; border-radius: 9px; padding: 8px; font: 700 13px var(--f-ui); cursor: pointer; display: flex; justify-content: center; gap: 6px; align-items: center; }
.col { display: flex; flex-direction: column; min-width: 0; padding: 14px max(16px, env(safe-area-inset-right, 0px)) 18px 0; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 8px 4px 14px; }
.search { flex: 0 1 320px; display: flex; align-items: center; gap: 8px; background: var(--surface-2); border-radius: 10px; padding: 0 12px; color: var(--muted); }
.search input { border: 0; background: transparent; padding: 9px 0; }
.search input:focus { outline: none; }
.search:focus-within { outline: 2px solid var(--accent); }
.topbar .sp { flex: 1; }
.iconbtn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--fg); display: grid; place-items: center; cursor: pointer; position: relative; }
.iconbtn .n { position: absolute; top: -3px; right: -3px; min-width: 17px; height: 17px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
.me { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 800; font-size: 14px; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.me .who b { display: block; font-size: 13px; line-height: 1.2; }
.me .who span { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.live { background: var(--ok); }
main { background: var(--canvas); border-radius: 20px; padding: 24px; display: grid; gap: 18px; align-content: start; flex: 1; min-width: 0; }
main > .sec-head h2, .pagetitle { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
main > .sec-head .small { font-size: 13.5px; }
h2 { font-size: 16px; margin: 0; font-weight: 700; text-wrap: balance; }
.sec-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sec-head .grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--f-mono); font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.datechip { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 8px 14px; font-weight: 500; font-size: 13.5px; }
.btn { appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font: 600 13px var(--f-ui); padding: 9px 15px; border-radius: 99px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ink { background: var(--ink-btn); color: var(--ink-btn-fg); border-color: var(--ink-btn); }
.btn.soft { background: var(--surface-2); border-color: transparent; }
.btn.danger { color: var(--bad); }
.btn.danger.armed { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.sm { padding: 6px 11px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.panel.pad { padding: 18px; }
.cardhead { display: flex; align-items: center; gap: 12px; }
.cardhead h2 { flex: 1; min-width: 0; font-size: 16.5px; font-weight: 600; }
.ibox { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); display: grid; place-items: center; color: var(--fg); flex: none; background: var(--surface); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; }
.kpi { padding: 18px; display: grid; gap: 10px; }
.kpi .val { font-size: 30px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi .note { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.delta { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 6px; }
.delta.up { background: var(--ok-soft); color: var(--ok); }
.delta.down { background: var(--bad-soft); color: var(--bad); }
.delta.flat { background: var(--surface-2); color: var(--muted); }
.grid2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.45fr); gap: 16px; align-items: start; }
.chart { position: relative; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .gl { stroke: var(--line); stroke-dasharray: 3 4; }
.chart .ax { fill: var(--muted); font: 11.5px var(--f-ui); }
.chart .axc { fill: var(--fg); font-weight: 700; }
.chart rect.b { fill: url(#gBar); }
.chart rect.b.cur { fill: url(#gCur); }
.chart rect.hit { fill: transparent; cursor: pointer; }
.tip { position: absolute; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; box-shadow: 0 6px 20px rgba(17,26,43,.12); font-size: 11.5px; color: var(--muted); pointer-events: none; white-space: nowrap; transform: translate(-50%, -100%); }
.tip b { display: block; color: var(--fg); font-size: 15px; }
.legend { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.legend i { width: 4px; height: 13px; border-radius: 2px; background: var(--accent); }
.plans { display: grid; gap: 10px; }
.plan { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; display: grid; gap: 8px; cursor: pointer; border: 0; text-align: left; font: inherit; color: inherit; }
.plan:hover { outline: 1.5px solid var(--accent); }
.plan .top { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; }
.plan .top .ibox { width: 30px; height: 30px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); border: 0; }
.plan .top .ibox svg.i { width: 15px; height: 15px; }
.plan .top span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan .meter { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.plan .meter i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.plan .sub { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.list { display: grid; }
.row { display: flex; gap: 12px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row .main { flex: 1; min-width: 0; }
.row .t { font-weight: 600; overflow-wrap: anywhere; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 99px; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.p-ok { background: var(--ok-soft); color: var(--ok); }
.p-warn { background: var(--warn-soft); color: var(--warn); }
.p-bad { background: var(--bad-soft); color: var(--bad); }
.p-info { background: var(--info-soft); color: var(--info); }
.p-mute { background: var(--surface-2); color: var(--muted); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar input[type=search] { flex: 1 1 220px; min-width: 0; }
input, select, textarea { font: 14px var(--f-ui); color: var(--fg); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; width: 100%; }
textarea { resize: vertical; min-height: 70px; }
.toolbar select { width: auto; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--fg); padding: 6px 12px; border-radius: 99px; font: 600 12.5px var(--f-ui); cursor: pointer; display: inline-flex; gap: 6px; }
.chip span { color: var(--muted); font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip[aria-pressed="true"] span { color: inherit; opacity: .8; }
.tablewrap { overflow-x: auto; padding: 0 8px 8px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 500; padding: 9px 12px; background: var(--surface-2); white-space: nowrap; }
th:first-child { border-radius: 9px 0 0 9px; } th:last-child { border-radius: 0 9px 9px 0; }
td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr { cursor: pointer; }
tbody tr:hover td { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
.thumb { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; background: var(--surface-2); display: block; flex: none; }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); display: grid; gap: 10px; justify-items: center; }
.empty b { color: var(--fg); font-size: 15px; }
.banner { padding: 12px 16px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); font-weight: 600; font-size: 13px; }
.modems { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.mcard { padding: 18px; display: grid; gap: 12px; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.mcard:hover { border-color: var(--accent); }
.mcard .hd { display: flex; gap: 10px; align-items: center; }
.mcard .hd .t { flex: 1; min-width: 0; font-weight: 700; font-size: 15px; overflow-wrap: anywhere; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 13px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.months { display: flex; gap: 4px; }
.months i { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-2); }
.months i.paid { background: var(--accent); }
.months i.miss { background: var(--bad); }
.months i.now { background: var(--warn); }
dialog { border: 1px solid var(--line); border-radius: 18px; padding: 0; width: min(620px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); background: var(--surface); color: var(--fg); box-shadow: 0 20px 50px rgba(17,26,43,.2); }
dialog::backdrop { background: rgba(10,16,30,.45); }
.dlg { display: grid; grid-template-rows: auto minmax(0,1fr) auto; max-height: calc(100dvh - 34px); }
.dlg header { padding: 18px 20px 12px; display: flex; gap: 10px; align-items: start; border-bottom: 1px solid var(--line); }
.dlg header h3 { margin: 0; font-size: 17px; flex: 1; overflow-wrap: anywhere; }
.dlg .body { padding: 18px 20px; overflow-y: auto; display: grid; gap: 14px; }
.dlg footer { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.dlg footer .left { margin-right: auto; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form .full { grid-column: 1 / -1; }
label.f { display: grid; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.timeline { display: grid; gap: 8px; font-size: 13px; }
.timeline div { display: grid; grid-template-columns: 110px 1fr; gap: 10px; }
.photo { max-width: 100%; max-height: 260px; border-radius: 10px; border: 1px solid var(--line); }
.comment { background: var(--surface-2); border-radius: 10px; padding: 9px 11px; font-size: 13px; }
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink-btn); color: var(--ink-btn-fg); padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 13px; z-index: 50; max-width: calc(100vw - 32px); }
.mobile-cards { display: none; }
@media (max-width: 1180px) { .kpis { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 1000px) { .grid2 { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0,1fr); }
  aside.side, .col { min-width: 0; }
  aside.side { position: sticky; height: auto; z-index: 6; flex-direction: row; align-items: center; gap: 8px; padding: 10px max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px)); border-bottom: 1px solid var(--line); overflow: visible; }
  .logo { padding: 0; } .logo span { display: none; }
  .side .grp, .promo, .side .gen { display: none; }
  nav.tabs { display: flex; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
  nav.tabs a { width: auto; white-space: nowrap; padding: 8px 10px; font-size: 13px; }
  nav.tabs a svg.i { display: none; }
  nav.tabs a[aria-current="page"]::before { display: none; }
  .col { padding: 10px max(16px, env(safe-area-inset-right, 0px)) 18px max(16px, env(safe-area-inset-left, 0px)); }
  .me .who { display: none; }
}
@media (max-width: 640px) {
  main { padding: 16px; border-radius: 16px; }
  main > .sec-head h2, .pagetitle { font-size: 21px; }
  .kpi .val { font-size: 24px; }
  .form { grid-template-columns: 1fr; }
  .desk-table { display: none; }
  .mobile-cards { display: grid; }
  .topbar .iconbtn.help { display: none; }
}
@media (max-width: 460px) { .btn { white-space: normal; } .datechip { font-size: 12.5px; } .kpis { grid-template-columns: 1fr 1fr; gap: 10px; } .kpi { padding: 14px; } .logo b { font-size: 15px; } }
@media (prefers-reduced-motion: no-preference) { .btn, .chip, .mcard, nav.tabs a { transition: background .15s, border-color .15s, color .15s; } }

/* ---- tambahan versi PHP ---- */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
a { color: var(--accent); }
nav.tabs a, .side .lnk, .logo, .me, .promo a, .iconbtn { text-decoration: none; }
.logo { color: var(--fg); }
.me { color: var(--fg); }
.btn { text-decoration: none; }
.flash { padding: 12px 16px; border-radius: 12px; font-weight: 600; font-size: 13.5px; }
.flash-ok { background: var(--ok-soft); color: var(--ok); }
.flash-err { background: var(--bad-soft); color: var(--bad); }
.flash-warn { background: var(--warn-soft); color: var(--warn); }
main.bare { min-height: 100vh; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); background: var(--canvas); }
.login { width: min(420px, 100%); display: grid; gap: 18px; padding: 28px; }
.login .logo { padding: 0; }
.formcard { display: grid; gap: 16px; padding: 20px; }
.formcard .actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 14px; }
.formcard .actions .left { margin-right: auto; }
.detail { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(0,1fr); gap: 16px; align-items: start; }
.stack { display: grid; gap: 16px; min-width: 0; }
.qrbox { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; background: var(--surface-2); border-radius: 12px; padding: 12px; }
.qrbox .qr { background: #fff; border-radius: 8px; padding: 6px; line-height: 0; }
.inline-form { display: inline; }
.table-actions { display: flex; gap: 6px; flex-wrap: wrap; }
tr.link td { cursor: pointer; }
tbody tr { cursor: default; }
tbody tr.link:hover td { background: var(--surface-2); }
.checkcol { width: 34px; }
.note { font-size: 12.5px; color: var(--muted); }
.pager { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
@media (max-width: 1000px) { .detail { grid-template-columns: 1fr; } }
@media (max-width: 900px) { aside.side .quick { display: none; } }
@media print {
  aside.side, .topbar, .no-print, .flash { display: none !important; }
  .shell { display: block; }
  .col { padding: 0; }
  main { background: #fff; padding: 0; border-radius: 0; }
  .panel { border-color: #ccc; box-shadow: none; break-inside: avoid; }
  body { background: #fff; color: #000; }
}
a.chip, a.kpi, a.mcard, a.row { text-decoration: none; color: inherit; }
a.chip[aria-pressed="true"] { color: var(--accent-ink); }
.legend span { display: inline-flex; align-items: center; gap: 6px; margin-right: 12px; }
section { display: grid; gap: 8px; }
section h2 { font-size: 15px; }
@media print { .kpis { grid-template-columns: repeat(4, 1fr); } .tablewrap { overflow: visible; } }
main > *, .stack > *, .detail > * { min-width: 0; }
.toolbar select { max-width: 100%; }
@media (max-width: 640px) { .toolbar select, .toolbar .btn { flex: 1 1 auto; } }
