:root {
  --ink: #1B2A33;          /* jaket kabel / sidebar */
  --ink-2: #2A3D48;
  --ink-text: #C9D4D9;
  --strand: #F2C230;       /* patchcord single-mode */
  --apc: #1F8A70;          /* konektor APC — aksi utama, sinyal baik */
  --apc-dark: #176B57;
  --warn: #D9901A;
  --crit: #C8452E;
  --bg: #F1F4F2;
  --panel: #FFFFFF;
  --line: #DCE3E0;
  --text: #1C2529;
  --muted: #5E6E74;
  --soft: #E8EEEB;
  --r-sm: 4px; --r: 8px;
  --font: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.5 var(--font); color: var(--text); background: var(--bg); font-variant-numeric: tabular-nums; }
a { color: var(--apc-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; line-height: 1.25; margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; font-weight: 600; }
h3 { font-size: .95rem; margin: 0 0 .5rem; font-weight: 600; }
:focus-visible { outline: 2px solid var(--strand); outline-offset: 2px; }

/* ===== Shell ===== */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--ink); color: var(--ink-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { padding: 20px 20px 16px; display: flex; gap: 10px; align-items: center; color: #fff; font-weight: 600; }
.brand svg { flex: none; }
.brand small { display: block; font-weight: 400; color: var(--ink-text); font-size: 12px; }
.nav { padding: 4px 10px; overflow-y: auto; flex: 1; }
.nav .grp { color: #7E929B; font-size: 12px; padding: 14px 10px 4px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); color: var(--ink-text); position: relative; }
.nav a:hover { background: var(--ink-2); color: #fff; text-decoration: none; }
.nav a.on { background: var(--ink-2); color: #fff; }
.nav a.on::before { content: ''; position: absolute; left: -10px; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--strand); }
.nav svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.side-foot { padding: 14px 20px; border-top: 1px solid var(--ink-2); font-size: 13px; }
.side-foot button { background: none; border: 0; color: var(--ink-text); padding: 0; cursor: pointer; font: inherit; }
.side-foot button:hover { color: #fff; text-decoration: underline; }
.main { min-width: 0; }
.topbar { display: none; }
.page { padding: 28px 32px 48px; max-width: 1400px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ===== Elemen ===== */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--text);
  padding: 7px 14px; border-radius: var(--r-sm); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #B9C6C1; background: #FAFBFA; }
.btn.primary { background: var(--apc); border-color: var(--apc); color: #fff; }
.btn.primary:hover { background: var(--apc-dark); }
.btn.danger { color: var(--crit); }
.btn.danger.solid { background: var(--crit); border-color: var(--crit); color: #fff; }
.btn.sm { padding: 3px 9px; font-size: 13px; }
.btn.ghost { border-color: transparent; background: none; }
.btn[disabled] { opacity: .55; cursor: wait; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; }
.panel + .panel, .grid + .panel, .panel + .grid { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.muted { color: var(--muted); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 16px; }
.hidden { display: none !important; }

/* Ringkasan angka: baris ber-garis, bukan kartu seragam */
.figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.figure { padding: 16px 20px; border-left: 1px solid var(--line); }
.figure:first-child { border-left: 0; }
.figure .v { font-size: 1.55rem; font-weight: 600; line-height: 1.2; }
.figure .l { color: var(--muted); font-size: 13px; }
.figure .s { font-size: 12.5px; margin-top: 4px; }
.figure a.s { display: inline-block; }

/* Tabel */
.tbl-wrap { overflow-x: auto; margin: 0 -20px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--soft); vertical-align: middle; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
th { font-weight: 500; color: var(--muted); font-size: 13px; background: #FAFBFA; border-bottom-color: var(--line); white-space: nowrap; }
tbody tr:hover { background: #F8FAF9; }
td.num, th.num { text-align: right; }
tr.click { cursor: pointer; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.empty .btn { margin-top: 10px; }

/* Badge status */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 500; padding: 1px 8px; border-radius: 20px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-ok { background: #E3F2EC; color: #136650; }
.b-warn { background: #FBF0DC; color: #95600B; }
.b-crit { background: #F8E2DD; color: #A3331F; }
.b-info { background: #E4ECF1; color: #2D5466; }
.b-plain::before { display: none; }

/* Redaman — elemen khas aplikasi */
.sig { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; white-space: nowrap; }
.sig .bars { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; }
.sig .bars i { width: 3px; background: var(--line); border-radius: 1px; }
.sig .bars i:nth-child(1) { height: 5px; } .sig .bars i:nth-child(2) { height: 8px; } .sig .bars i:nth-child(3) { height: 11px; } .sig .bars i:nth-child(4) { height: 14px; }
.sig.ok { color: var(--apc-dark); } .sig.ok .bars i { background: var(--apc); }
.sig.warn { color: #95600B; } .sig.warn .bars i:nth-child(-n+2) { background: var(--warn); }
.sig.crit { color: var(--crit); } .sig.crit .bars i:nth-child(1) { background: var(--crit); }
.sig.na { color: var(--muted); }

/* Strip distribusi redaman di dashboard */
.strip { display: flex; height: 34px; border-radius: var(--r-sm); overflow: hidden; background: var(--soft); }
.strip span { display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; font-size: 13px; min-width: 0; overflow: hidden; }
.strip .ok { background: var(--apc); } .strip .warn { background: var(--warn); } .strip .crit { background: var(--crit); } .strip .off { background: #8A989D; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

/* Form */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
input, select, textarea { font: inherit; color: var(--text); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 7px 10px; background: #fff; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(31,138,112,.35); border-color: var(--apc); }
textarea { width: 100%; min-height: 80px; resize: vertical; }
.toolbar input[type=search] { width: 260px; }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.form .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.field input, .field select, .field textarea { width: 100%; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 3px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 400 !important; }
.check input { width: auto; }
code, .mono { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 12.5px; }
pre.console { background: var(--ink); color: #D8E3E7; padding: 14px; border-radius: var(--r-sm); max-height: 460px; overflow: auto; font: 12.5px/1.45 ui-monospace, Consolas, monospace; white-space: pre-wrap; margin: 0; }

/* Dialog */
dialog { border: 0; border-radius: var(--r); padding: 0; width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 48px); box-shadow: 0 20px 60px rgba(20,35,42,.28); color: var(--text); }
dialog.wide { width: min(980px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(20,35,42,.45); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.dlg-head h2 { margin: 0; }
.dlg-body { padding: 18px 20px; overflow-y: auto; max-height: calc(100vh - 190px); }
.dlg-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: #FAFBFA; }
.x { background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); padding: 2px 6px; }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 9px 14px; font: inherit; font-weight: 500; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs button.on { color: var(--text); border-bottom-color: var(--apc); }

/* Info list */
dl.info { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; margin: 0; }
dl.info dt { color: var(--muted); }
dl.info dd { margin: 0; word-break: break-word; }

/* Chart */
.chart { width: 100%; height: auto; display: block; }
.chart text { font: 11px var(--font); fill: var(--muted); }
.chart .grid-line { stroke: var(--soft); }

/* Toast */
#toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 1000; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r-sm); box-shadow: 0 6px 20px rgba(0,0,0,.2); max-width: 380px; border-left: 4px solid var(--apc); animation: tin .18s ease-out; }
.toast.err { border-left-color: var(--crit); }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }

/* Login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-art { background: var(--ink); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; position: relative; }
.login-art h1 { font-size: 2.2rem; max-width: 12ch; line-height: 1.15; }
.login-art p { color: var(--ink-text); max-width: 40ch; }
.login-art svg.fibers { position: absolute; right: -40px; bottom: 60px; width: 110%; opacity: .9; pointer-events: none; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 32px; }
.login-form form { width: 100%; max-width: 340px; display: grid; gap: 14px; }
.login-form .btn { justify-content: center; padding: 10px; }
.err-text { color: var(--crit); font-size: 13px; min-height: 1.2em; }

/* Invoice cetak */
.invoice-doc { background: #fff; max-width: 760px; margin: 0 auto; padding: 40px 44px; border: 1px solid var(--line); }
.invoice-doc .ih { display: flex; justify-content: space-between; gap: 24px; border-bottom: 3px solid var(--ink); padding-bottom: 16px; margin-bottom: 20px; }
.invoice-doc .total { font-size: 1.4rem; font-weight: 700; }
.stamp { display: inline-block; border: 3px solid var(--apc); color: var(--apc); padding: 4px 14px; font-weight: 700; font-size: 1.2rem; transform: rotate(-6deg); border-radius: 4px; }
.stamp.unpaid { border-color: var(--crit); color: var(--crit); }

@media print {
  .side, .no-print, #toasts { display: none !important; }
  .shell { display: block; } .page { padding: 0; }
  body { background: #fff; } .invoice-doc { border: 0; padding: 0; }
}
@media (max-width: 1100px) { .g3, .g-main { grid-template-columns: minmax(0, 1fr); } .figures { grid-template-columns: repeat(2, 1fr); } .figure:nth-child(3) { border-left: 0; } .figure:nth-child(n+3) { border-top: 1px solid var(--line); } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 250px; transform: translateX(-100%); transition: transform .2s; z-index: 50; }
  .side.open { transform: none; }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 40; }
  .topbar button { background: none; border: 0; color: #fff; font-size: 22px; cursor: pointer; }
  .page { padding: 18px 16px 40px; }
  .g2, .form { grid-template-columns: minmax(0, 1fr); }
  .login { grid-template-columns: 1fr; } .login-art { display: none; }
  .toolbar input[type=search] { width: 100%; }
  dl.info { grid-template-columns: 110px 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.grid > .panel { margin-top: 0; }
.grid { align-items: start; }
.main, .page { min-width: 0; overflow-x: hidden; }
@media (max-width: 860px) {
  .figure { padding: 12px 14px; }
  .figure .v { font-size: 1.2rem; word-break: break-word; }
  .page-head .actions { width: 100%; }
}

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { border: 1px solid var(--line); background: var(--panel); border-radius: 20px; padding: 4px 12px; font: inherit; font-size: 13px; cursor: pointer; color: var(--text); }
.chip b { margin-left: 4px; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.months { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.mcell { display: grid; gap: 2px; border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; cursor: pointer; font-size: 13px; position: relative; }
.mcell input { position: absolute; right: 10px; top: 10px; }
.mcell.due { border-color: var(--warn); }
.mcell.paid { background: var(--soft); cursor: default; opacity: .8; }
.mcell:has(input:checked) { border-color: var(--apc); background: #E3F2EC; }

/* =====================================================================
   Tema macOS (Tahap 4) — sidebar ala Finder, warna PRIMANET, terang/gelap
   Mode: <html data-theme="light|dark">; tanpa atribut = ikut sistem.
   ===================================================================== */
:root {
  --accent: #004890; --accent-2: #0A5FB4; --accent-soft: rgba(0,72,144,.10); --accent-ring: rgba(48,180,252,.45);
  --apc: var(--accent); --apc-dark: var(--accent-2); --strand: #30B4FC;
  --bg: #F5F5F7; --panel: #FFFFFF; --panel-2: #FAFAFB; --line: rgba(0,0,0,.10); --soft: #F0F0F3; --hover: rgba(0,0,0,.035);
  --text: #1D1D1F; --muted: #6E6E73; --input: #FFFFFF;
  --side-bg: rgba(232,232,237,.82); --side-text: #2C2C2E; --side-muted: #8A8A8E; --side-on: rgba(0,0,0,.07);
  --ok: #1E8E5A; --warn: #C27A0E; --crit: #D23F31;
  --ok-bg: #E2F4EA; --ok-fg: #17663F; --warn-bg: #FCF1DC; --warn-fg: #8E5A06; --crit-bg: #FBE3E0; --crit-fg: #A92E22; --info-bg: #E3EEF9; --info-fg: #174E86;
  --console-bg: #1D1D1F; --console-fg: #E5E5EA; --shadow: 0 1px 2px rgba(0,0,0,.04), 0 1px 1px rgba(0,0,0,.03);
  --r-sm: 7px; --r: 11px;
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', 'Segoe UI Variable', 'Segoe UI', 'IBM Plex Sans', Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --accent: #30B4FC; --accent-2: #5CC4FD; --accent-soft: rgba(48,180,252,.16);
  --bg: #1C1C1E; --panel: #2A2A2D; --panel-2: #303033; --line: rgba(255,255,255,.10); --soft: #343437; --hover: rgba(255,255,255,.04);
  --text: #F2F2F7; --muted: #A1A1A8; --input: #1F1F22;
  --side-bg: rgba(38,38,41,.86); --side-text: #E5E5EA; --side-muted: #8E8E93; --side-on: rgba(255,255,255,.09);
  --ok-bg: rgba(48,209,120,.15); --ok-fg: #5FDB98; --warn-bg: rgba(255,179,64,.15); --warn-fg: #FFC266; --crit-bg: rgba(255,90,80,.16); --crit-fg: #FF8A80; --info-bg: rgba(48,180,252,.15); --info-fg: #7CCBFD;
  --console-bg: #111113; --shadow: none; color-scheme: dark;
} }
:root[data-theme="dark"] {
  --accent: #30B4FC; --accent-2: #5CC4FD; --accent-soft: rgba(48,180,252,.16);
  --bg: #1C1C1E; --panel: #2A2A2D; --panel-2: #303033; --line: rgba(255,255,255,.10); --soft: #343437; --hover: rgba(255,255,255,.04);
  --text: #F2F2F7; --muted: #A1A1A8; --input: #1F1F22;
  --side-bg: rgba(38,38,41,.86); --side-text: #E5E5EA; --side-muted: #8E8E93; --side-on: rgba(255,255,255,.09);
  --ok-bg: rgba(48,209,120,.15); --ok-fg: #5FDB98; --warn-bg: rgba(255,179,64,.15); --warn-fg: #FFC266; --crit-bg: rgba(255,90,80,.16); --crit-fg: #FF8A80; --info-bg: rgba(48,180,252,.15); --info-fg: #7CCBFD;
  --console-bg: #111113; --shadow: none; color-scheme: dark;
}
body { font-size: 13.5px; -webkit-font-smoothing: antialiased; }
a { color: var(--accent-2); }
:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 1px; }
.side { background: var(--side-bg); color: var(--side-text); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-right: 1px solid var(--line); }
.dots { display: flex; gap: 8px; padding: 16px 18px 0; } .dots i { width: 12px; height: 12px; border-radius: 50%; background: #FF5F57; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.15); } .dots i:nth-child(2) { background: #FEBC2E; } .dots i:nth-child(3) { background: #28C840; }
.brand { color: var(--side-text); padding: 14px 18px 8px; flex-direction: column; align-items: flex-start; gap: 2px; }
.brand img { height: 34px; width: auto; display: block; }
.brand small { color: var(--side-muted); font-size: 11.5px; padding-left: 2px; }
.logo-dark { display: none !important; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-light { display: none !important; } :root:not([data-theme="light"]) .logo-dark { display: block !important; } }
:root[data-theme="dark"] .logo-light { display: none !important; } :root[data-theme="dark"] .logo-dark { display: block !important; }
.nav .grp { color: var(--side-muted); font-size: 11px; font-weight: 600; padding: 14px 10px 3px; }
.nav a { color: var(--side-text); padding: 6px 10px; border-radius: 6px; }
.nav a:hover { background: var(--side-on); color: var(--side-text); }
.nav a.on { background: var(--side-on); color: var(--side-text); font-weight: 500; }
.nav a.on::before { display: none; }
.nav a.on svg { color: var(--accent); opacity: 1; }
.nav svg { color: var(--accent); opacity: .8; }
.side-foot { border-top: 1px solid var(--line); color: var(--side-text); display: grid; gap: 6px; }
.side-foot button { color: var(--side-muted); } .side-foot button:hover { color: var(--side-text); }
.side-foot select { padding: 3px 6px; font-size: 12px; background: transparent; }
.powered { font-size: 11px; color: var(--side-muted); line-height: 1.35; }
.panel, .figures { border-color: var(--line); box-shadow: var(--shadow); }
.btn { border-color: var(--line); background: var(--panel); box-shadow: var(--shadow); border-radius: 7px; padding: 6px 13px; }
.btn:hover { border-color: var(--line); background: var(--panel-2); }
.btn.primary { background: var(--accent); border-color: transparent; color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
:root[data-theme="dark"] .btn.primary, :root[data-theme="dark"] .chip.on { color: #04213A; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary, :root:not([data-theme="light"]) .chip.on { color: #04213A; } }
.btn.ghost { box-shadow: none; }
th { background: var(--panel-2); } tbody tr:hover { background: var(--hover); }
input, select, textarea { background: var(--input); border-color: var(--line); border-radius: 7px; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--accent-ring); border-color: var(--accent); }
.b-ok { background: var(--ok-bg); color: var(--ok-fg); } .b-warn { background: var(--warn-bg); color: var(--warn-fg); }
.b-crit { background: var(--crit-bg); color: var(--crit-fg); } .b-info { background: var(--info-bg); color: var(--info-fg); }
.sig.ok { color: var(--ok); } .sig.ok .bars i { background: var(--ok); } .sig.warn { color: var(--warn-fg); }
.strip .ok { background: var(--ok); }
pre.console { background: var(--console-bg); color: var(--console-fg); }
dialog { background: var(--panel); border-radius: 13px; box-shadow: 0 24px 70px rgba(0,0,0,.30), 0 0 0 .5px var(--line); }
dialog::backdrop { background: rgba(0,0,0,.32); backdrop-filter: blur(2px); }
.dlg-foot { background: var(--panel-2); }
.tabs button.on { border-bottom-color: var(--accent); }
.toast { background: var(--console-bg); border-left-color: var(--accent); border-radius: 9px; }
.chip { background: var(--panel); } .chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.mcell:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.login { background: var(--bg); }
.login-art { background: linear-gradient(150deg, #004890 0%, #0A5FB4 55%, #30B4FC 130%); }
.login-art .brandimg { height: 46px; }
.login-art p { color: rgba(255,255,255,.82); }
.login-form form { background: var(--panel); padding: 28px; border-radius: 14px; border: 1px solid var(--line); box-shadow: 0 10px 40px rgba(0,0,0,.08); }
.invoice-doc { color: #1D1D1F; } .invoice-doc .ih { border-bottom-color: #004890; } .invoice-doc .ih img { height: 44px; margin-bottom: 6px; }
.invoice-doc .stamp { border-color: #1E8E5A; color: #1E8E5A; } .invoice-doc .stamp.unpaid { border-color: #D23F31; color: #D23F31; }
@media (max-width: 860px) {
  .topbar { background: var(--side-bg); color: var(--text); backdrop-filter: blur(20px); border-bottom: 1px solid var(--line); }
  .topbar button { color: var(--text); } .topbar img { height: 24px; }
  .side { background: var(--panel); }
}
@media print { .invoice-doc { color: #000; } }
.login-art svg.fibers { bottom: auto; top: 120px; opacity: .5; }
.login-art > div { position: relative; z-index: 1; }

/* ===== Voucher A4: 5 kolom × 10 baris = 50 per lembar ===== */
@page a4v { size: A4; margin: 0; }
.vsheets { page: a4v; }
.vsheets { display: grid; gap: 16px; }
.vsheet { background: #fff; color: #000; width: 210mm; height: 297mm; padding: 6mm; display: grid; grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(10, 1fr); gap: 0; border: 1px solid var(--line); margin: 0 auto; }
.vc { border: .2mm dashed #9AA3A8; padding: 1.4mm 1.8mm; overflow: hidden; display: flex; flex-direction: column; gap: 1mm; font-family: -apple-system, 'Segoe UI', Roboto, Arial, sans-serif; }
.vc-h { display: flex; align-items: center; justify-content: space-between; } .vc-h img { height: 3.6mm; } .vc-h b { font-size: 9pt; color: #004890; }
.vc-b { display: flex; gap: 1.6mm; align-items: center; min-height: 0; }
.vc-qr { flex: none; width: 14mm; } .vc-qr svg { width: 14mm; height: 14mm; display: block; }
.vc-t { min-width: 0; line-height: 1.2; }
.vc-code { font: 700 11pt/1.15 ui-monospace, Consolas, 'Courier New', monospace; letter-spacing: .03em; margin-bottom: .6mm; }
.vc-s { font-size: 5.2pt; color: #222; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media print {
  .vsheets { gap: 0; } .vsheet { border: 0; margin: 0; page-break-after: always; break-after: page; }
  .page:has(.vsheets) { max-width: none; padding: 0 !important; } .topbar, .page-head { display: none !important; } body { background: #fff !important; }
}
@media screen and (max-width: 860px) { .vsheet { transform: scale(.45); transform-origin: top left; margin-bottom: -160mm; } }

/* ===== Monitoring trafik ===== */
.devgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.devgrid > .panel { margin: 0; }
a.dev { color: var(--text); display: grid; gap: 12px; } a.dev:hover { text-decoration: none; border-color: var(--accent); }
.dev-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.dev-rate { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .dev-rate div { display: grid; } .dev-rate b { font-size: 1.25rem; font-weight: 600; }
.dev-m { display: grid; grid-template-columns: 64px 1fr; gap: 6px 10px; align-items: center; font-size: 12.5px; }
.meter { height: 6px; background: var(--soft); border-radius: 3px; overflow: hidden; } .meter i { display: block; height: 100%; border-radius: 3px; }
.alarm-box { margin-bottom: 16px; border-color: var(--crit); } .alarm { padding: 6px 0; border-top: 1px solid var(--soft); } .alarm.crit b { color: var(--crit-fg); }

/* ===== Struk thermal 58 mm ===== */
.receipt { width: 58mm; background: #fff; color: #000; margin: 0 auto; padding: 3mm; font: 9pt/1.35 ui-monospace, Consolas, 'Courier New', monospace; border: 1px solid var(--line); }
.receipt img { display: block; height: 9mm; margin: 0 auto 1mm; } .receipt .c { text-align: center; font-size: 7.5pt; }
.receipt hr { border: 0; border-top: 1px dashed #000; margin: 2mm 0; } .receipt .r { display: flex; justify-content: space-between; gap: 2mm; } .receipt .r span:last-child { text-align: right; }
.receipt .big { font-size: 11pt; }
@media print { .page:has(.receipt) { padding: 0 !important; } .page:has(.receipt) ~ *, .topbar { display: none !important; } .receipt { border: 0; margin: 0; } @page { margin: 0; } }
.devgrid.live { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }
.livebox { border-top: 1px solid var(--soft); padding-top: 10px; display: grid; gap: 4px; }
.live-h { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.live-h .lbl { border: 0; background: transparent; font-weight: 600; padding: 2px 0; min-width: 0; flex: 1; }
.live-h .lbl:focus { outline: 2px solid var(--accent-ring); }
.live-h .ifsel { max-width: 55%; font-size: 12.5px; padding: 3px 6px; }
.live-now { display: flex; gap: 16px; font-size: 13px; } .live-now b { font-size: 1.05rem; }
@media (max-width: 520px) { .devgrid.live { grid-template-columns: 1fr; } }
.btn.wa { color: #128C4A; } .btn.wa svg { flex: none; }
:root[data-theme="dark"] .btn.wa { color: #4CD787; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.wa { color: #4CD787; } }

/* ===== Tombol mata: angka keuangan disembunyikan ===== */
.hide-money .money:not(.reveal) { font-size: 0 !important; cursor: pointer; }
.hide-money .money.cnt:not(.reveal)::after { content: '•••'; }
.hide-money .money:not(.reveal)::after { content: 'Rp•••••'; font-size: 1rem; letter-spacing: .04em; color: var(--muted); }
.figure .v .money:not(.reveal)::after { font-size: 1.55rem; }
.figure .s .money:not(.reveal)::after, td .money:not(.reveal)::after, .muted .money:not(.reveal)::after { font-size: 12.5px; }
.hide-money .money.reveal { cursor: pointer; }
.hide-money svg .money-ax { visibility: hidden; }
.btn.eye { padding: 6px 10px; }
/* ===== Tooltip grafik ===== */
.chart-tip { position: fixed; z-index: 2000; pointer-events: none; display: none; background: var(--console-bg); color: var(--console-fg); padding: 8px 10px; border-radius: 8px; font-size: 12.5px; line-height: 1.5; box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: 300px; }
.chart-tip i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; }
.hide-money .chart-tip .money { font-size: 0; } .hide-money .chart-tip .money::after { content: 'Rp•••••'; font-size: 12.5px; }
svg .hov:hover { fill: rgba(127,127,127,.08); }
.docgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.docbox { display: grid; gap: 6px; border: 1px dashed var(--line); border-radius: var(--r); padding: 10px; font-size: 13px; font-weight: 500; }
.docbox img { max-width: 100%; max-height: 160px; border-radius: 6px; object-fit: cover; } .docbox img:not([src]) { display: none; }
@media (max-width: 860px) { .docgrid { grid-template-columns: 1fr; } }
.stale { margin: 16px 32px 0; padding: 12px 16px; border-radius: 10px; background: var(--warn-bg); color: var(--warn-fg); border: 1px solid var(--warn); }

/* ===== Batch 1: tombol jendela ala macOS di semua pop-up ===== */
.dlg-head { justify-content: flex-start; gap: 14px; }
.mac { display: inline-flex; gap: 8px; align-items: center; flex: none; }
.mc { width: 13px; height: 13px; border-radius: 50%; border: 0; padding: 0; display: inline-grid; place-items: center; cursor: pointer; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.18); }
.mc.r { background: #FF5F57; } .mc.y { background: #FEBC2E; cursor: default; } .mc.g { background: #28C840; }
.mc b { font: 700 10px/1 system-ui, sans-serif; color: rgba(0,0,0,.55); opacity: 0; }
.mac:hover .mc b, .mc:focus-visible b { opacity: 1; }
dialog.full { width: calc(100vw - 16px); max-height: calc(100vh - 16px); height: calc(100vh - 16px); }
@media (hover: none), (max-width: 700px) { .mc { width: 22px; height: 22px; } .mc b { opacity: 1; font-size: 15px; } .mac { gap: 10px; } }
/* filter redaman, dashboard, kartu router */
.fbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 12px; }
.fbar input[type=number] { width: 90px; }
.figures.f8 { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
a.figure { color: inherit; text-decoration: none; } a.figure:hover { box-shadow: 0 0 0 2px var(--accent) inset; }
.rcard .kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.rcard .kv div { background: var(--bg); border-radius: 8px; padding: 8px; } .rcard .kv b { display: block; font-size: 1.05rem; }
.rcard.down { border-left: 4px solid var(--crit); }
.stock-grid td input { width: 90px; }
.figures.f8 { gap: 1px; background: var(--line); overflow: hidden; } .figures.f8 .figure { background: var(--panel); border-left: 0; }
@media (max-width: 700px) { .figures.f8 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Batch 3: peta jaringan */
.leaflet-interactive.flow { stroke-dasharray: 10 12; animation: flow 1.4s linear infinite; }
.leaflet-interactive.cut { stroke-dasharray: 6 6; animation: blinkcut 1s steps(2, start) infinite; }
@keyframes flow { to { stroke-dashoffset: -22; } }
@keyframes blinkcut { 50% { opacity: .15; } }
.mk { display: block; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
ol.trace li { margin: 4px 0; }
@media (prefers-reduced-motion: reduce) { .leaflet-interactive.flow, .leaflet-interactive.cut { animation: none; } }

/* ===== Batch 5 ===== */
.undo-bar { position: fixed; right: 16px; bottom: 16px; z-index: 50; display: flex; gap: 6px; padding: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.12); }
.undo-bar .btn:disabled { opacity: .45; cursor: default; }
@media print { .undo-bar, .va-ribbon { display: none !important; } }
.va-ribbon { position: sticky; top: 0; z-index: 60; background: #E3A008; color: #1b1400; text-align: center; font-size: 13px; padding: 6px 12px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--panel); color: var(--text); padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; border-left: 1px solid var(--line); }
.seg button:first-child { border-left: 0; }
.seg button.on { background: var(--accent); color: #fff; }
.figure.alert .v { color: var(--crit); }
#b5dash { display: grid; gap: 16px; margin-top: 16px; }
.wa-bubble { margin-top: 8px; padding: 10px 12px; background: #DCF8C6; color: #111; border-radius: 10px 10px 10px 2px; max-width: 420px; font-size: 13.5px; }
.sim { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
.sim-l { max-height: 78vh; overflow: auto; }
.sim-r { padding: 0; overflow: hidden; }
.sim-bar { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.sim-bar #sl { flex: 1; font-size: 13px; }
.sim iframe { width: 100%; height: 74vh; border: 0; background: var(--bg); }
table.perm td { padding: 4px 6px; font-size: 13px; } table.perm tr.open td:first-child { font-weight: 600; } table.perm select { padding: 3px 6px; }
@media (max-width: 900px) { .sim { grid-template-columns: 1fr; } }
/* garis pelanggan ke ODP: hidup = hijau berkedip, putus = merah putus-putus */
.leaflet-interactive.drop-on { animation: dropblink 1.6s ease-in-out infinite; }
.leaflet-interactive.drop-off { stroke-dasharray: 4 5; animation: flow 1.2s linear infinite reverse; }
@keyframes dropblink { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .leaflet-interactive.drop-on, .leaflet-interactive.drop-off { animation: none; } }
.subtabs { margin-bottom: 14px; }
.ind { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.ind.up { background: #2FA36B; box-shadow: 0 0 0 3px rgba(47,163,107,.18); }
.ind.down { background: #D23F31; box-shadow: 0 0 0 3px rgba(210,63,49,.2); animation: dropblink 1.2s ease-in-out infinite; }
.chk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 12px; }
.kecgrp { margin: 6px 0 8px; } .kecgrp .chk-grid { margin-left: 22px; }
details.pk summary { cursor: pointer; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
details.pk .chk-grid { margin-top: 8px; max-height: 180px; overflow: auto; }
.pkbox { max-height: 170px; overflow: auto; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
