:root {
  color-scheme: dark;
  --bg: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #232322;
  --border: rgba(255, 255, 255, 0.10);
  --grid: #2c2c2a;
  --axis: #383835;
  --text: #ffffff;
  --text-2: #c3c2b7;
  --muted: #898781;
  --rx: #3987e5;      /* biru  - slot 1 */
  --tx: #d95926;      /* oranye - slot 2 */
  --cpu: #3987e5;
  --mem: #d95926;
  --ping: #199e70;    /* aqua - slot 3 */
  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --critical-text: #ffb3b3;
  --radius: 12px;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* tema terang (pilihan per browser, lihat themeToggle di app.js); warna garis grafik tetap sama */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f4f2;
  --surface: #ffffff;
  --surface-2: #f0efeb;
  --border: rgba(0, 0, 0, 0.12);
  --grid: #e5e4df;
  --axis: #c8c7c1;
  --text: #1a1a19;
  --text-2: #4a4945;
  --muted: #706e67;
  /* versi lebih gelap supaya teks peringatan tetap terbaca di latar putih */
  --warning: #9a6700;
  --serious: #c4511f;
  --critical-text: #a32020;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 12px; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px 16px;
  padding: 12px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-logo { height: 48px; width: auto; max-width: 220px; object-fit: contain; display: block; margin-right: 4px; }
/* emblem MRTG; di dashboard sekaligus tombol Pengaturan */
.logo-img, .logo-btn img { width: 40px; height: 40px; border-radius: 10px; display: block; flex: none; }
.logo-btn {
  flex: none; padding: 0; border: 0; border-radius: 10px; background: none; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.logo-btn:hover { transform: scale(1.06); box-shadow: 0 0 0 3px rgba(57,135,229,.35); }
.logo-btn:active { transform: scale(.97); }
.logo-btn:focus-visible { outline: 2px solid var(--rx); outline-offset: 2px; }
.title { font-weight: 600; font-size: 16px; }
/* nama router + tombol kecil di sampingnya (Flush DNS) */
.title-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.title-row .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn-sm { width: 26px; height: 26px; border-radius: 7px; }
.icon-btn-sm:disabled { opacity: .4; cursor: not-allowed; }
#btnFlushDns:not(:disabled):hover { color: var(--rx); border-color: var(--rx); }
#btnFlushDns.busy svg { animation: spin .8s linear infinite; }
#btnFlushDns.done { color: var(--good); border-color: var(--good); opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }
.subtitle { color: var(--muted); font-size: 12px; }
.topbar-controls { display: flex; align-items: center; gap: 10px; }
/* margin-left auto: tetap di kanan, juga saat turun ke baris kedua di layar sedang */
.topbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-left: auto; }

.conn { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.conn .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--warning); box-shadow: 0 0 0 3px rgba(250,178,25,.2); }
.conn.online .dot { background: var(--good); box-shadow: 0 0 0 3px rgba(12,163,12,.2); }
.conn.offline .dot { background: var(--critical); box-shadow: 0 0 0 3px rgba(208,59,59,.25); }

.btn {
  border: 1px solid var(--rx); background: var(--rx); color: #fff;
  padding: 7px 14px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 500;
}
.btn:hover { filter: brightness(1.1); }
.btn.ghost { background: transparent; color: var(--text-2); border-color: var(--border); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: transparent; color: var(--critical); border-color: var(--critical); }
.btn.danger:hover { background: rgba(208,59,59,.14); filter: none; }
.btn.success { background: var(--good); border-color: var(--good); color: #fff; }


.banner {
  background: rgba(208,59,59,.15); border-bottom: 1px solid var(--critical);
  color: var(--critical-text); padding: 10px 20px; font-size: 13px;
}

/* ---------- Layout ---------- */
.content { padding: 20px; max-width: 1500px; margin: 0 auto; display: grid; gap: 18px; }

.site-footer {
  text-align: center; color: var(--text-2); font-size: 13px;
  padding: 18px 12px 6px; border-top: 1px solid var(--border); margin-top: 4px;
}
.site-footer strong, .footer-preview strong { color: var(--text); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; min-width: 0;
}
.tile-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.tile-value { font-size: 30px; font-weight: 600; line-height: 1.1; }
.tile-value.small { font-size: 20px; }
.tile-value .unit { font-size: 14px; color: var(--muted); margin-left: 3px; font-weight: 400; }
.tile-foot { color: var(--text-2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { height: 6px; background: var(--grid); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--good); border-radius: 4px; transition: width .4s, background .4s; }

/* kotak sistem [CPU · Memory · Suhu · Core] lalu Uptime, Ping, Download, Upload */
.tiles { grid-template-columns: minmax(0, 3fr) repeat(4, minmax(0, 1fr)); }
.sys-group { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
/* keterangan CPU / Memory: font kecil supaya satu baris tanpa dipotong */
.sys-tile .tile-foot { font-size: 10.5px; letter-spacing: -.1px; overflow: visible; }
/* info ping (loss · min / max) muat satu baris */
#pingInfo { font-size: 10.5px; letter-spacing: -.1px; }
@media (max-width: 1250px) {
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tile.sys-tile { grid-column: 1 / -1; }
}
@media (max-width: 760px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* HP: tetap 2 kolom (Uptime | Ping, Download | Upload), isinya dirapatkan */
@media (max-width: 420px) {
  .tiles { gap: 10px; }
  .tile { padding: 12px; }
  .tile-value { font-size: 24px; }
  .tile-value.small { font-size: 17px; }
  .tile-foot { white-space: normal; }
}

/* CPU Load · Memory · Suhu · Core */
.cpu-row { display: grid; grid-template-columns: 1.2fr 1.2fr .6fr 1fr; gap: 20px; }
@media (max-width: 640px) { .cpu-row { grid-template-columns: 1fr 1fr; } }
.cpu-row > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
/* batang per core: maks 16 per baris, lebih dari itu disusun beberapa baris (app.js set --cols/--rows) */
.cores {
  display: grid; height: 36px; gap: 2px 3px;
  grid-template-columns: repeat(var(--cols, 4), minmax(0, 16px));
  grid-template-rows: repeat(var(--rows, 1), minmax(0, 1fr));
}
.core {
  min-width: 0; background: var(--grid); border-radius: 2px;
  display: flex; align-items: flex-end; overflow: hidden;
}
.cores > .muted { grid-column: 1 / -1; white-space: nowrap; align-self: center; }
.core-fill { width: 100%; background: var(--good); transition: height .4s, background .4s; }

.section-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: -6px 0 -4px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; min-width: 0;
}
.card h2 { margin: 0; font-size: 15px; font-weight: 600; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.card-tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.iface-comment { color: var(--rx); }
.count { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 4px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }
/* salah satu kartu DHCP / PPP disembunyikan: sisanya selebar halaman */
.grid-2.single { grid-template-columns: 1fr; }

.chart-wrap { position: relative; height: 200px; }
.chart-wrap.tall { height: 300px; }
.chart-foot { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 10px; color: var(--text-2); font-size: 12px; }
.chart-foot strong { color: var(--text); font-variant-numeric: tabular-nums; }

.legend { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 12px; }
.swatch { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.swatch.rx, .swatch.cpu { background: var(--rx); }
.swatch.tx, .swatch.mem { background: var(--tx); }

.select, .input {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  padding: 6px 10px; border-radius: 8px; font-size: 13px; min-width: 160px;
}
/* dropdown selebar teks pilihannya (field-sizing), fallback: dibatasi max-width */
.select.compact { min-width: 0; max-width: 220px; field-sizing: content; padding: 4px 8px; font-size: 12px; text-overflow: ellipsis; }

/* header grafik traffic: judul + tools tetap satu baris, judul dipotong bila sempit */
.card-head.traffic-head { flex-wrap: nowrap; }
.traffic-head h2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.traffic-head .card-tools { flex-wrap: nowrap; gap: 10px; flex: none; }
.traffic-head .btn.small { padding: 2px 8px; }

.input:focus, .select:focus { outline: 2px solid var(--rx); outline-offset: 1px; }

/* dropdown interface yang bisa diketik (makeCombo di app.js) */
.combo { position: relative; }
.combo::after {
  content: '▾'; position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 11px; pointer-events: none;
}
.combo-input { width: 210px; max-width: none; field-sizing: fixed; padding-right: 22px; text-overflow: ellipsis; cursor: pointer; }
.combo-input:focus { cursor: text; }
.combo-list {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 15;
  min-width: 100%; width: max-content; max-width: min(360px, 90vw); max-height: 300px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.combo-opt { padding: 5px 8px; border-radius: 6px; font-size: 12px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo-opt:hover, .combo-opt.active { background: var(--surface-2); }
.combo-opt.selected { color: var(--rx); font-weight: 600; }
.combo-empty { padding: 5px 8px; font-size: 12px; color: var(--muted); }
.combo-note { margin-top: 4px; padding: 6px 8px 3px; border-top: 1px solid var(--border); font-size: 11px; color: var(--muted); white-space: normal; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; max-height: 420px; overflow-y: auto; }
.table-wrap.short { max-height: 240px; } /* awal saja; app.js mengukur ulang agar pas 5 baris */
td.usage { line-height: 1.2; }
td.usage .total { color: var(--muted); font-size: 11px; }
td.access { color: var(--text-2); }
td.access .sub { color: var(--muted); }

/* header yang bisa diklik untuk mengurutkan */
th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort]:hover { color: var(--text); }
th[data-sort].asc::after { content: " \25B2"; font-size: 9px; }
th[data-sort].desc::after { content: " \25BC"; font-size: 9px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--grid); }
th { color: var(--muted); font-weight: 500; font-size: 12px; position: sticky; top: 0; background: var(--surface); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:hover td { background: var(--surface-2); }
tr.selected td { background: rgba(57,135,229,.12); }
tbody tr { cursor: default; }
#ifaceTable tr, #pppTable tr[data-iface] { cursor: pointer; }
/* pelanggan PPP yang putus: redup, kecuali kolom status dan keterangan "putus ... lalu" */
#pppTable tr.gone td { opacity: .5; }
#pppTable tr.gone td:first-child, #pppTable tr.gone td.down-ago { opacity: 1; }
td.down-ago { color: var(--critical-text); font-size: 12px; white-space: nowrap; }
.empty td { color: var(--muted); text-align: center; padding: 18px; }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status.up::before { background: var(--good); }
.status.down::before { background: var(--critical); }
.status.disabled::before { background: var(--muted); }
.status.bound::before { background: var(--good); }
.status.waiting::before { background: var(--warning); }
.err { color: var(--serious); }

/* label kecil: interface offline di judul grafik, sumber akun (RADIUS / lokal) di tabel PPP */
.badge {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 4px; vertical-align: middle;
  font-size: 10px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; line-height: 15px;
  border: 1px solid var(--border); color: var(--muted);
}
.badge.off { color: var(--critical-text); border-color: rgba(208,59,59,.45); background: rgba(208,59,59,.12); }
.badge.src-radius { color: var(--rx); border-color: rgba(57,135,229,.45); background: rgba(57,135,229,.10); }

/* ---------- Log ---------- */
.log { max-height: 320px; overflow: auto; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.log-row { display: grid; grid-template-columns: 150px 170px 1fr; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--grid); }
.log-row .t { color: var(--muted); }
.log-row .topic { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; }
.log-row.warn .msg { color: var(--warning); }
.log-row.error .msg { color: var(--critical); }
@media (max-width: 700px) { .log-row { grid-template-columns: 1fr; gap: 2px; } }

/* ---------- Modal ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; z-index: 20; padding: 16px;
}
.modal-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; width: 100%; max-width: 560px;
  max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto;
}
.modal-box h2 { margin: 0 0 4px; font-size: 16px; }
.modal-box form { display: grid; gap: 12px; margin-top: 14px; }
.modal-box .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .modal-box .row { grid-template-columns: 1fr; } }
.modal-box label { display: grid; gap: 4px; font-size: 12px; color: var(--text-2); }
.modal-box input {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  padding: 8px 10px; border-radius: 8px; font-size: 13px;
}
.modal-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.modal-box h3 { margin: 8px 0 0; font-size: 14px; }
.btn.small { padding: 4px 10px; font-size: 12px; }
.modal-box .rr-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* form Tampilan: pratinjau logo & footer seperti tampil di dashboard */
.logo-edit { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.logo-preview {
  display: grid; place-items: center; min-width: 120px; height: 72px; padding: 0 14px;
  border: 1px dashed var(--border); border-radius: 8px;
}
.logo-preview img { height: 48px; max-width: 220px; object-fit: contain; display: block; }
.logo-preview[data-empty]:not([data-empty=""])::after { content: attr(data-empty); color: var(--muted); font-size: 12px; }
.logo-edit > .field { flex: 1 1 220px; } /* logo lebar: keterangan yang turun baris, bukan tombolnya */
.modal-box .field { display: grid; gap: 6px; font-size: 12px; color: var(--text-2); }
.footer-preview {
  text-align: center; color: var(--text-2); font-size: 13px;
  padding: 10px 12px; border: 1px dashed var(--border); border-radius: 8px;
}
.checks { display: flex; gap: 18px; flex-wrap: wrap; }
.modal-box .check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); cursor: pointer; }
.modal-box .check input { width: 16px; height: 16px; margin: 0; padding: 0; accent-color: var(--rx); }
#btnApReset { margin-right: auto; }

/* login admin (di atas modal Pengaturan bila token kedaluwarsa saat menyimpan) */
#loginModal { z-index: 30; }
.login-box { max-width: 360px; display: grid; gap: 12px; }
.login-box p { margin: 0; }
.login-error { color: var(--critical-text); background: rgba(208,59,59,.15); border: 1px solid var(--critical); border-radius: 8px; padding: 6px 10px; font-size: 12px; }

/* pemilih router di topbar */
.router-select { min-width: 150px; font-weight: 500; }
.lang-select { min-width: 0; field-sizing: content; }

/* tombol ikon tema: matahari saat gelap, bulan saat terang */
.icon-btn {
  display: grid; place-items: center; width: 32px; height: 32px; padding: 0; flex: none; cursor: pointer;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); border-radius: 8px;
}
.icon-btn:hover { color: var(--text); }
.icon-btn:focus-visible { outline: 2px solid var(--rx); outline-offset: 1px; }
.theme-toggle .icon-moon, :root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* daftar router di modal */
.router-rows { display: grid; gap: 8px; margin: 14px 0; }
.router-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
}
.router-row .rr-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.router-row .rr-dot.on { background: var(--good); }
.router-row .rr-dot.off { background: var(--critical); }
.router-row .rr-info { flex: 1; min-width: 0; }
.router-row .rr-name { font-weight: 600; font-size: 13px; }
.router-row .rr-sub { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.router-row .rr-actions { display: flex; gap: 6px; flex: none; }

/* ---------- HP / layar sempit ---------- */
@media (max-width: 760px) {
  /* topbar: [MT][judul][logo] / [router][bahasa][tema] / status / tiga tombol sama lebar; tidak menempel saat scroll */
  .topbar { position: static; padding: 12px; gap: 10px; }
  .brand, .topbar-right { display: contents; }
  .brand-text { flex: 1 1 0; min-width: 0; }
  .title, .subtitle { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .brand-logo { order: 1; height: 40px; max-width: 120px; margin-right: 0; }
  .topbar-controls { order: 2; flex: 1 1 100%; }
  .router-select { flex: 1 1 auto; min-width: 0; }
  .conn { order: 3; flex: 1 1 100%; }
  .topbar-right .btn { order: 4; flex: 1 1 0; padding: 7px 8px; }

  .content { padding: 12px; gap: 14px; }
  .card { padding: 14px; }
  .card-tools .input { flex: 1 1 160px; min-width: 0; }
  .chart-foot { gap: 6px 14px; }
  .sys-tile .tile-foot { white-space: normal; }

  /* judul grafik traffic di baris sendiri, legenda + pilihan interface di bawahnya */
  .card-head.traffic-head { flex-wrap: wrap; }
  .traffic-head h2 { flex: 1 1 100%; }
  .traffic-head .card-tools { flex: 1 1 100%; }
  .traffic-head .select.compact { flex: 1 1 auto; max-width: none; }
  .traffic-head .combo { flex: 1 1 auto; min-width: 0; }
  .traffic-head .combo-input { width: 100%; }
  .combo-list { left: 0; right: auto; max-width: calc(100vw - 40px); }

  .modal { padding: 10px; }
  .modal-box { padding: 16px; }
}

/* ---------- Halaman Pelanggan RADIUS (radius.html) ---------- */
.tabs {
  display: flex; gap: 2px; margin-left: auto; padding: 3px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
}
.tab {
  background: transparent; border: 0; border-radius: 7px; padding: 6px 12px; cursor: pointer;
  color: var(--text-2); font-size: 13px; font-weight: 500; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.25); }
a.icon-btn { text-decoration: none; }
.table-wrap.tall { max-height: calc(100vh - 220px); max-height: calc(100dvh - 220px); }
td .sub { color: var(--muted); font-size: 11px; margin-top: 1px; }
.actions-col { width: 1%; }
td.actions { white-space: nowrap; text-align: right; }
td.actions .icon-btn { display: inline-grid; width: 28px; height: 28px; margin-left: 4px; }
td.actions .icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.icon-btn.danger:not(:disabled):hover { color: var(--critical); border-color: var(--critical); }
#custTable tr[data-user], #planTable tr[data-plan] { cursor: pointer; }
.status.isolir::before { background: var(--warning); }
.exp-warn, td .sub.exp-warn { color: var(--warning); }
.exp-over, td .sub.exp-over { color: var(--critical-text); }
.badge.res-ok { color: var(--good); border-color: rgba(12,163,12,.45); background: rgba(12,163,12,.10); }
.badge.res-iso { color: var(--warning); border-color: rgba(250,178,25,.45); background: rgba(250,178,25,.10); }
.badge.res-no { color: var(--critical-text); border-color: rgba(208,59,59,.45); background: rgba(208,59,59,.12); }
td .badge:first-child { margin-left: 0; }
button.secret {
  background: none; border: 0; padding: 0; cursor: pointer; color: var(--text-2);
  font: 12px ui-monospace, Consolas, monospace;
}
.check-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); cursor: pointer; }
.check-inline input { accent-color: var(--rx); }
.input-group { display: flex; align-items: center; gap: 6px; }
.input-group input { flex: 1 1 auto; min-width: 0; }
.modal-box select.select { width: 100%; min-width: 0; padding: 8px 10px; }
.modal-box input[readonly] { opacity: .7; }
.modal-box .status-check { align-self: end; padding-bottom: 9px; }
.modal-box .btn.danger { margin-right: auto; }
.stack { display: grid; gap: 12px; }
.stack label { display: grid; gap: 4px; font-size: 12px; color: var(--text-2); }
.stack p { margin: 0; }
.stack .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
@media (max-width: 560px) { .stack .row { grid-template-columns: 1fr; } }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.saved-note { color: var(--good); font-size: 12px; }
pre.cmd {
  margin: 8px 0; padding: 10px 12px; overflow-x: auto; white-space: pre;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  font: 12px/1.6 ui-monospace, Consolas, monospace; color: var(--text);
}
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 40; max-width: calc(100vw - 32px);
  padding: 9px 16px; border-radius: 8px; font-size: 13px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: 0 6px 20px rgba(0,0,0,.35);
}
.toast.error { color: var(--critical-text); border-color: var(--critical); }
@media (max-width: 760px) {
  .tabs { order: 5; flex: 1 1 100%; margin-left: 0; overflow-x: auto; }
  .tab { flex: 1 1 auto; padding: 6px 8px; }
  .table-wrap.tall { max-height: none; }
}

/* ---------- Menu samping (nav.js): dibuka dari tombol logo, item berupa link ---------- */
.nav-backdrop {
  position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.5);
  opacity: 0; visibility: hidden; transition: opacity .2s, visibility 0s .2s;
}
.nav-backdrop.open { opacity: 1; visibility: visible; transition: opacity .2s; }
.side-nav {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 31; width: min(300px, 86vw);
  display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--border);
  box-shadow: 8px 0 30px rgba(0,0,0,.35); transform: translateX(-100%); visibility: hidden;
  transition: transform .22s ease, visibility 0s .22s;
}
.side-nav.open { transform: none; visibility: visible; transition: transform .22s ease; }
body.nav-open { overflow: hidden; }
.sn-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; border-bottom: 1px solid var(--border); }
.sn-head img { width: 38px; height: 38px; flex: none; border-radius: 10px; }
.sn-account { flex: 1; min-width: 0; }
.sn-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sn-sub { color: var(--muted); font-size: 11px; line-height: 1.45; margin-top: 2px; }
.sn-body { flex: 1; overflow-y: auto; padding: 4px 10px 12px; }
.sn-label { padding: 16px 10px 6px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; }
.sn-link {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text-2); font: inherit; font-size: 14px; text-align: left; text-decoration: none; cursor: pointer;
}
.sn-link svg { flex: none; color: var(--muted); }
.sn-link:hover { background: var(--surface-2); color: var(--text); }
.sn-link:focus-visible { outline: 2px solid var(--rx); outline-offset: -2px; }
.sn-link.active { background: rgba(57,135,229,.14); color: var(--text); font-weight: 600; }
.sn-link.active svg { color: var(--rx); }
.sn-foot { padding: 10px; border-top: 1px solid var(--border); }
.sn-logout:hover, .sn-logout:hover svg { color: var(--critical-text); background: rgba(208,59,59,.1); }
@media (prefers-reduced-motion: reduce) { .side-nav, .side-nav.open, .nav-backdrop, .nav-backdrop.open { transition: none; } }

/* pita masa trial / langganan hampir habis (nav.js), di bawah header */
.plan-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 20px; font-size: 13px;
  color: var(--text); background: rgba(57,135,229,.12); border-bottom: 1px solid rgba(57,135,229,.35);
}
.plan-bar > span { flex: 1; min-width: 200px; }
.plan-bar.warn { background: rgba(250,178,25,.12); border-bottom-color: rgba(250,178,25,.45); }
.plan-bar .btn { text-decoration: none; }

/* dialog konfirmasi dengan isian (Flush DNS + password router) */
.confirm-box { max-width: 440px; display: grid; gap: 14px; }
.confirm-head { display: flex; align-items: flex-start; gap: 14px; }
.confirm-head h2 { margin: 2px 0 4px; }
.confirm-head p { margin: 0; font-size: 13px; line-height: 1.5; }
.confirm-icon {
  display: grid; place-items: center; width: 46px; height: 46px; flex: none; border-radius: 50%;
  color: var(--warning); background: rgba(250,178,25,.14); border: 1px solid rgba(250,178,25,.4);
}
.confirm-hint { margin: -8px 0 0; font-size: 12px; }
.confirm-box .modal-actions { margin-top: 0; }

/* ---------- Konfirmasi keluar + ucapan terima kasih (session.js) ---------- */
.logout-modal { z-index: 40; }
.logout-box { max-width: 380px; text-align: center; display: grid; justify-items: center; gap: 6px; }
.logout-box h2 { margin: 6px 0 0; font-size: 17px; }
.logout-box p { margin: 0; }
.logout-box .modal-actions { justify-content: center; margin-top: 14px; width: 100%; }
.logout-box .modal-actions .btn { flex: 1; padding: 9px 14px; }
.lo-icon {
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
  color: var(--critical-text); background: rgba(208,59,59,.12); border: 1px solid rgba(208,59,59,.35);
}
.logout-box.thanks .lo-icon { color: var(--good); background: rgba(12,163,12,.12); border-color: rgba(12,163,12,.35); animation: loPop .35s ease-out; }
.logout-box.thanks .lo-redirect { margin-top: 8px; font-size: 12px; }
.btn.danger-solid { background: var(--critical); border-color: var(--critical); color: #fff; }
@keyframes loPop { from { transform: scale(.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .logout-box.thanks .lo-icon { animation: none; } }

/* akun belum punya router: hanya ajakan menambah router */
#emptyState { display: none; }
body.no-routers #emptyState {
  display: grid; justify-items: center; gap: 10px; text-align: center; padding: 48px 20px; max-width: 560px; margin: 40px auto 0;
}
body.no-routers #emptyState p { margin: 0 0 6px; max-width: 420px; }
.empty-emblem { width: 72px; height: 72px; border-radius: 16px; }
body.no-routers main.content > :not(#emptyState),
body.no-routers #routerSelect, body.no-routers #btnReconnect, body.no-routers #btnDisconnect { display: none !important; }

/* ---------- Halaman masuk / daftar (login.html) ---------- */
.auth-page { min-height: 100vh; }
.auth-shell { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }

/* panel kiri selalu gelap (warna merek), di tema terang juga */
.auth-hero {
  position: relative; overflow: hidden; display: flex; align-items: center; padding: clamp(24px, 4vh, 48px) 56px;
  background: radial-gradient(120% 90% at 0% 0%, #12304a 0%, #0b1220 55%, #060a12 100%); color: #e6edf6;
}
.hero-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%); mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%);
  animation: gridDrift 14s linear infinite;
}
@keyframes gridDrift { to { background-position: 44px 44px, 44px 44px; } }
.hero-glow {
  position: absolute; width: 560px; height: 560px; right: -160px; top: -160px; border-radius: 50%;
  background: radial-gradient(circle, rgba(45,212,191,.26), transparent 65%); animation: glowShift 9s ease-in-out infinite alternate;
}
@keyframes glowShift { to { transform: translate(-80px, 120px) scale(1.15); opacity: .7; } }
.hero-content { position: relative; max-width: 600px; display: grid; gap: clamp(18px, 3.6vh, 40px); }
.hero-brand { display: flex; align-items: center; gap: 14px; }
.hero-emblem { width: 56px; height: 56px; border-radius: 14px; box-shadow: 0 12px 30px rgba(0,0,0,.45); }
.hero-name { font-weight: 700; font-size: 20px; letter-spacing: .2px; }
.hero-tag { color: #8aa0b8; font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase; margin-top: 2px; }
.hero-title { margin: 0; font-size: clamp(28px, 2.9vw, 42px); line-height: 1.12; font-weight: 750; letter-spacing: -.5px; }
.hero-title span { display: block; background: linear-gradient(90deg, #2dd4bf, #f5a524); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { margin: 0; max-width: 470px; color: #a9b8c9; font-size: 15px; line-height: 1.6; }
.hero-chart { padding: 18px 18px 12px; border-radius: 18px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); }
.hero-chart svg { display: block; width: 100%; height: auto; max-height: 30vh; overflow: visible; }
.hero-chart .bars rect {
  fill: url(#barGrad); opacity: .9; transform-box: fill-box; transform-origin: bottom;
  transform: scaleY(var(--h)); animation: barPulse 3.4s ease-in-out infinite; animation-delay: var(--d);
}
@keyframes barPulse { 0%, 100% { transform: scaleY(var(--h)); } 50% { transform: scaleY(calc(var(--h) * .7)); } }
.hero-chart .area { fill: url(#areaGrad); opacity: 0; animation: fadeIn 1s ease-out 1.6s forwards; }
.hero-chart .line { fill: none; stroke: #f5a524; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 520; stroke-dashoffset: 520; animation: drawLine 2.2s ease-out .3s forwards; }
.hero-chart .dot { fill: #f5a524; opacity: 0; filter: drop-shadow(0 0 8px rgba(245,165,36,.9)); transform-box: fill-box; transform-origin: center; animation: fadeIn .3s 2.4s forwards, dotPulse 1.8s ease-in-out 2.7s infinite; }
@keyframes drawLine { to { stroke-dashoffset: 0; } }
@keyframes fadeIn { to { opacity: 1; } }
@keyframes dotPulse { 50% { transform: scale(1.5); } }
.hero-chips { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-chips .chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px; border-radius: 999px; font-size: 13px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); animation: floatY 6s ease-in-out infinite;
}
.hero-chips .c2 { animation-delay: -2s; }
.hero-chips .c3 { animation-delay: -4s; }
@keyframes floatY { 50% { transform: translateY(-6px); } }
.chip-dot { width: 8px; height: 8px; border-radius: 50%; }
.chip-dot.good { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.2); }
.chip-dot.rx { background: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.2); }
.chip-dot.warn { background: #f5a524; box-shadow: 0 0 0 3px rgba(245,165,36,.2); }
.hero-points { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(10px, 1.6vh, 16px); color: #c4d1df; font-size: 14px; }
.hero-points li { display: flex; align-items: center; gap: 10px; }
.hero-points li::before {
  content: ""; width: 20px; height: 20px; flex: none; border-radius: 50%;
  background: rgba(45,212,191,.16) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232dd4bf' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 12px no-repeat;
}

/* kartu kanan */
.auth-main { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 72px 24px 32px; background: var(--bg); }
.auth-tools { position: absolute; top: 18px; right: 20px; display: flex; gap: 8px; }
.auth-card {
  width: 100%; max-width: 420px; display: grid; gap: 18px; padding: 28px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 24px 60px rgba(0,0,0,.28);
  animation: rise .45s ease-out;
}
.auth-card.wide { max-width: 640px; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.auth-card-head { display: flex; align-items: center; gap: 14px; }
.auth-emblem { width: 46px; height: 46px; border-radius: 12px; flex: none; }
.auth-card-head h1 { margin: 0; font-size: 21px; letter-spacing: -.2px; }
.auth-card-head p { margin: 3px 0 0; font-size: 13px; }
.auth-foot { margin: 0; font-size: 12px; }

.seg { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; }
.seg-btn { border: 0; background: transparent; color: var(--text-2); padding: 9px; border-radius: 9px; font-size: 14px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s; }
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.3); }

.auth-view { display: grid; gap: 14px; }
.auth-view .field { display: grid; gap: 6px; font-size: 12px; font-weight: 500; color: var(--text-2); }
.auth-view .field small { font-weight: 400; }
.auth-view input:not([type=file]):not([type=checkbox]) {
  width: 100%; padding: 11px 12px; border-radius: 10px; font-size: 14px;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border); transition: border-color .15s, box-shadow .15s;
}
.auth-view input:focus { outline: none; border-color: var(--rx); box-shadow: 0 0 0 3px rgba(57,135,229,.25); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row2 > .field { align-content: start; } /* kolom dengan teks bantuan tidak menggeser input kolom sebelahnya */
.pw-wrap { position: relative; display: block; }
.auth-view .pw-wrap input { padding-right: 42px; }
.pw-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; display: grid; place-items: center;
  border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer;
}
.pw-eye:hover, .pw-eye.on { color: var(--text); }
.btn-lg { padding: 11px 16px; font-size: 14px; font-weight: 600; border-radius: 10px; }
.btn:disabled { opacity: .6; cursor: default; }
.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; animation: spin .7s linear infinite;
}
.btn.ghost.loading::after { border-color: var(--border); border-top-color: var(--text); }
@keyframes spin { to { transform: rotate(360deg); } }
.auth-error { padding: 9px 12px; border-radius: 10px; font-size: 13px; color: var(--critical-text); background: rgba(208,59,59,.12); border: 1px solid rgba(208,59,59,.45); }
.auth-switch { margin: 2px 0 0; text-align: center; font-size: 13px; color: var(--text-2); }
.auth-switch a { color: var(--rx); font-weight: 600; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }

/* langkah daftar */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.steps li { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.steps li span {
  width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 50%;
  font-size: 12px; font-weight: 700; background: var(--surface-2); border: 1px solid var(--border); transition: all .2s;
}
.steps li em { font-style: normal; font-weight: 600; white-space: nowrap; }
.steps li:not(:last-child)::after { content: ""; flex: 1; height: 2px; min-width: 8px; border-radius: 2px; background: var(--border); }
.steps li.active { color: var(--text); }
.steps li.active span { background: var(--rx); border-color: var(--rx); color: #fff; box-shadow: 0 0 0 4px rgba(57,135,229,.2); }
.steps li.done span { background: rgba(12,163,12,.15); border-color: var(--good); color: var(--good); }
.steps li.done::after { background: var(--good); }
.step { display: grid; gap: 14px; animation: rise .3s ease-out; }
.step-actions { display: flex; gap: 10px; }
.step-actions .btn { flex: 1; }
.invisible { visibility: hidden; }

/* paket langganan */
.pkg-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 10px; }
.pkg {
  position: relative; display: grid; gap: 4px; align-content: start; padding: 14px; text-align: left; cursor: pointer;
  color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.pkg:hover { transform: translateY(-2px); border-color: rgba(57,135,229,.5); }
.pkg.on { border-color: var(--rx); box-shadow: 0 0 0 3px rgba(57,135,229,.22); background: linear-gradient(180deg, rgba(57,135,229,.12), transparent 70%), var(--surface-2); }
.pkg-name { font-size: 15px; font-weight: 700; }
.pkg-price { margin-bottom: 4px; font-size: 18px; font-weight: 750; }
.pkg-price small { font-size: 12px; font-weight: 500; color: var(--muted); }
.pkg-feat { font-size: 12px; color: var(--text-2); }
.pkg-feat::before { content: "\2713  "; color: var(--good); font-weight: 700; }
.pkg-desc { margin-top: 4px; font-size: 11px; color: var(--muted); }
.pkg-flag {
  position: absolute; top: -9px; right: 10px; padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 800;
  letter-spacing: .5px; text-transform: uppercase; color: #0b1220; background: linear-gradient(90deg, #2dd4bf, #f5a524);
}
.pkg-list.compact .pkg { padding: 10px 12px; }
.pkg-list.compact .pkg-desc, .pkg-list.compact .pkg-flag { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn {
  padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 500; cursor: pointer;
  color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border);
}
.chip-btn:hover { color: var(--text); }
.chip-btn.on { color: var(--text); border-color: var(--rx); background: rgba(57,135,229,.15); }
.total-row {
  display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-radius: 12px;
  font-size: 13px; color: var(--text-2); background: var(--surface-2); border: 1px dashed var(--border);
}
.total-row strong { font-size: 20px; color: var(--text); }

/* info pembayaran & unggah bukti */
.pay-box { display: grid; gap: 10px; padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.pay-amount { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); }
.pay-amount strong { margin-right: auto; font-size: 20px; color: var(--text); }
pre.pay-info { margin: 0; white-space: pre-wrap; font: 13px/1.6 ui-monospace, Consolas, monospace; color: var(--text); }
.qris { justify-self: start; display: flex; align-items: center; gap: 10px; padding: 6px; border: 1px solid var(--border); border-radius: 10px; background: #fff; cursor: zoom-in; }
.qris img { width: 96px; height: 96px; object-fit: contain; }
.qris span { padding-right: 8px; color: #111; font-weight: 700; }
#imgModal { cursor: zoom-out; }
#imgModal img { max-width: min(90vw, 520px); max-height: 85vh; border-radius: 12px; background: #fff; }
.dropzone {
  display: flex; align-items: center; gap: 14px; padding: 16px; cursor: pointer; color: var(--text-2);
  border: 2px dashed var(--border); border-radius: 12px; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.drag, .dropzone:focus-visible { outline: none; border-color: var(--rx); background: rgba(57,135,229,.06); }
.dropzone > svg { flex: none; color: var(--rx); }
.dropzone.has-file { border-style: solid; border-color: rgba(12,163,12,.55); }
.dropzone img { width: 56px; height: 56px; flex: none; object-fit: cover; border-radius: 8px; }
.dz-pdf { width: 56px; height: 56px; flex: none; display: grid; place-items: center; border-radius: 8px; font-size: 12px; font-weight: 700; color: var(--critical-text); background: rgba(208,59,59,.15); }
.dz-text { display: grid; gap: 2px; min-width: 0; font-size: 13px; }
.dz-text strong { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dz-text span { font-size: 12px; color: var(--muted); }

/* status akun */
.status-hero { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.status-icon { width: 50px; height: 50px; flex: none; display: grid; place-items: center; border-radius: 14px; }
.st-pending .status-icon { color: var(--warning); background: rgba(250,178,25,.15); animation: ringPulse 2s ease-out infinite; }
.st-expired .status-icon, .st-rejected .status-icon { color: var(--critical-text); background: rgba(208,59,59,.14); }
.st-suspended .status-icon { color: var(--muted); background: var(--grid); }
.st-active .status-icon { color: var(--good); background: rgba(12,163,12,.14); }
.st-trial .status-icon, .st-unverified .status-icon { color: var(--rx); background: rgba(57,135,229,.14); }
/* daftar trial, kirim ulang aktivasi, pesan berhasil */
.trial-note { display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; font-size: 13px; color: var(--text-2); background: rgba(57,135,229,.1); border: 1px solid rgba(57,135,229,.35); }
.trial-note strong { color: var(--text); font-size: 14px; }
.auth-ok { padding: 9px 12px; border-radius: 10px; font-size: 13px; color: var(--good); background: rgba(12,163,12,.1); border: 1px solid rgba(12,163,12,.4); }
.resend { display: grid; gap: 10px; }
/* form daftar: bagian paket & harga, centang langsung berlangganan */
.reg-section { display: grid; gap: 12px; padding: 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); }
.reg-head { display: grid; gap: 2px; }
.reg-head h3, .reg-title { margin: 0; font-size: 14px; }
.reg-head .muted { font-size: 12px; }
.reg-title { margin-top: 4px; }
.total-row > span { display: grid; gap: 2px; }
.total-row small { font-size: 11px; font-weight: 400; }
.check-row { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 13px; }
.check-row input { width: 16px; height: 16px; margin: 2px 0 0; flex: none; accent-color: var(--rx); }
.check-row > span { display: grid; gap: 2px; }
.check-row small { font-size: 12px; line-height: 1.45; }
.reg-pay { display: grid; gap: 12px; }
/* isian yang salah (mis. username berisi @): bingkai merah + penjelasan di bawahnya */
.field input.invalid { border-color: var(--critical); box-shadow: 0 0 0 3px rgba(208,59,59,.15); }
.field small.err { color: var(--critical-text); }
.link-btn { padding: 0; border: 0; background: none; color: var(--rx); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
/* aturan password baru: centang hijau per syarat yang sudah terpenuhi */
.pw-rules { display: flex; flex-wrap: wrap; gap: 4px 14px; list-style: none; margin: -2px 0 0; padding: 0; font-size: 12px; color: var(--muted); }
.pw-rules li::before { content: "○"; display: inline-block; width: 14px; }
.pw-rules li.ok { color: var(--good); }
.pw-rules li.ok::before { content: "✓"; font-weight: 700; }
/* halaman owner: email & invoice, status trial / belum aktivasi */
.mail-test { display: flex; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.mail-test .input { flex: 1; min-width: 0; }
.sub-title { margin: 18px 0 8px; font-size: 13px; color: var(--text-2); }
.compact-table { max-height: 320px; }
.status.trial::before { background: var(--rx); }
.badge.pay-trial { color: var(--rx); border-color: rgba(57,135,229,.45); background: rgba(57,135,229,.10); }
@keyframes ringPulse { 0% { box-shadow: 0 0 0 0 rgba(250,178,25,.35); } 100% { box-shadow: 0 0 0 12px rgba(250,178,25,0); } }
.status-title { font-size: 16px; font-weight: 700; }
.status-hero .muted { font-size: 13px; line-height: 1.5; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; margin: 0; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }
.renew { display: grid; gap: 12px; padding-top: 14px; border-top: 1px solid var(--border); }
.renew h3, .history h3 { margin: 0; font-size: 15px; }
.history { display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid var(--border); }
.pay-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 10px 12px; font-size: 13px; border: 1px solid var(--border); border-radius: 10px; }
.pay-right { display: flex; align-items: center; gap: 8px; }
.pay-reason { grid-column: 1 / -1; font-size: 12px; color: var(--critical-text); }
.badge.pay-pending { color: var(--warning); border-color: rgba(250,178,25,.45); background: rgba(250,178,25,.10); }
.badge.pay-approved { color: var(--good); border-color: rgba(12,163,12,.45); background: rgba(12,163,12,.10); }
.badge.pay-rejected { color: var(--critical-text); border-color: rgba(208,59,59,.45); background: rgba(208,59,59,.12); }

/* layar laptop pendek (mis. 1366x768): hero dirapatkan supaya tidak perlu scroll */
@media (min-width: 981px) and (max-height: 860px) {
  .auth-hero { padding-top: 28px; padding-bottom: 28px; }
  .hero-content { gap: clamp(14px, 2.4vh, 20px); }
  .hero-chart { padding: 12px 14px 8px; }
  .hero-chart svg { max-height: 26vh; }
  .hero-points { gap: clamp(7px, 1.2vh, 10px); }
}
@media (max-width: 980px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-hero { padding: 26px 20px 22px; }
  .hero-content { gap: 14px; }
  .hero-chart, .hero-points, .hero-sub { display: none; }
  .hero-title { font-size: 26px; }
  .auth-main { justify-content: flex-start; padding: 16px 16px 28px; }
  .auth-tools { position: static; align-self: flex-end; }
}
@media (max-width: 520px) {
  .auth-card { padding: 20px 16px; border-radius: 16px; }
  .row2 { grid-template-columns: 1fr; }
  .steps li em { display: none; }
  .hero-chips { display: none; }
  .hero-title span { display: inline; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-page *, .auth-page *::before, .auth-page *::after { animation: none !important; transition: none !important; }
  .hero-chart .line { stroke-dashoffset: 0; }
  .hero-chart .area, .hero-chart .dot { opacity: 1; }
}

/* ---------- Halaman super admin / owner (admin.html) ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.stat { display: grid; gap: 4px; align-content: start; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.stat-value { font-size: 24px; font-weight: 650; letter-spacing: -.3px; }
.stat.good .stat-value { color: var(--good); }
.stat.warn .stat-value { color: var(--warning); }
.stat.bad .stat-value { color: var(--critical-text); }
.stat-delta { font-size: 12px; }
.stat-delta.up { color: var(--good); }
.stat-delta.down { color: var(--critical-text); }
.section-title { margin: 0; font-size: 16px; font-weight: 600; }
.tab-badge {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px; border-radius: 999px;
  font-size: 11px; font-weight: 700; color: #1a1a19; background: var(--warning); vertical-align: 1px;
}
tr.clickable, #userTable tr[data-user], #payTable tr[data-pay] { cursor: pointer; }
.proof-thumb {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0; overflow: hidden; cursor: zoom-in;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
}
.proof-thumb img { width: 100%; height: 100%; object-fit: cover; }
.proof-thumb.pdf { font-size: 11px; font-weight: 700; color: var(--critical-text); }
.proof-box { max-width: 720px; }
.proof-full { display: block; max-width: 100%; max-height: 65vh; margin: 12px auto; border-radius: 10px; }
.modal-box select.select, .stack select.select { width: 100%; min-width: 0; padding: 8px 10px; }
textarea.input { width: 100%; min-width: 0; resize: vertical; font: 13px/1.6 ui-monospace, Consolas, monospace; }
.stack .input { width: 100%; min-width: 0; padding: 8px 10px; }
.qris-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.qris-preview {
  display: grid; place-items: center; width: 120px; height: 120px; padding: 6px;
  border: 1px dashed var(--border); border-radius: 10px; background: #fff;
}
.qris-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.qris-edit { display: grid; gap: 6px; font-size: 12px; color: var(--text-2); }
.fin-chart { height: 300px; }
.fin-grid .card { min-width: 0; }
.empty-chart canvas { display: none; }
.empty-chart { display: grid; place-items: center; }
.empty-chart::after { content: attr(data-empty); color: var(--muted); font-size: 13px; }
#finMonthlyTable { max-height: 300px; }

/* catat pembayaran pelanggan (radius.html) */
.icon-btn.pay:hover { color: var(--good); border-color: var(--good); }
.pay-preview { padding: 10px 12px; border-radius: 8px; font-size: 13px; color: var(--text-2); background: rgba(12,163,12,.08); border: 1px solid rgba(12,163,12,.35); }
.pay-preview strong { color: var(--text); }
.pay-hist { display: grid; gap: 6px; }
.pay-hist:empty { display: none; }
.pay-hist-row { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px; padding: 4px 4px 4px 10px; font-size: 12px; border-radius: 8px; background: var(--surface-2); }
.pay-hist-row span:first-child { color: var(--muted); }
.pay-hist-row .icon-btn { width: 26px; height: 26px; background: transparent; }
/* bukti bayar & status lunas setelah tersimpan */
.dz-remove { margin-left: auto; }
.btn svg { vertical-align: -3px; margin-right: 4px; }
.pay-done { display: none; }
#payForm.is-done > :not(h2):not(.pay-done) { display: none; }
#payForm.is-done .pay-done { display: grid; gap: 8px; justify-items: center; text-align: center; padding-top: 10px; }
.pay-done p { margin: 0; }
.pay-done-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; color: var(--good); background: rgba(12,163,12,.12); border: 1px solid rgba(12,163,12,.35); }
.pay-done-title .badge { margin: 0; padding: 3px 12px; font-size: 13px; line-height: 18px; letter-spacing: 1px; }
.pay-done .modal-actions { justify-content: center; margin-top: 8px; }
.modal-box textarea, .modal-box select { font: inherit; }

/* status pembayaran (tabel pelanggan ISP & pengguna owner) */
.badge.pay-paid { color: var(--good); border-color: rgba(12,163,12,.45); background: rgba(12,163,12,.10); }
.badge.pay-grace { color: var(--warning); border-color: rgba(250,178,25,.45); background: rgba(250,178,25,.10); }
.badge.pay-unpaid { color: var(--critical-text); border-color: rgba(208,59,59,.45); background: rgba(208,59,59,.12); }
.badge.pay-waiting { color: var(--rx); border-color: rgba(57,135,229,.45); background: rgba(57,135,229,.10); }
td .badge[class*="pay-"] { margin-left: 0; }
.icon-btn.wa:hover { color: #25d366; border-color: #25d366; }

/* panel WhatsApp (wa.js) */
.wa-panel { display: grid; gap: 18px; }
.wa-panel .stack select.select, .wa-panel .stack .input { width: 100%; min-width: 0; padding: 8px 10px; }
.wa-qr { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.wa-qr img { width: 220px; height: 220px; padding: 8px; background: #fff; border-radius: 12px; }
.wa-qr ol { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13px; color: var(--text-2); }
.wa-buttons { justify-content: flex-start; margin: 10px 0 4px; }
.wa-test { display: flex; gap: 8px; margin-top: 12px; }
.wa-test .input { flex: 1 1 auto; min-width: 0; }
.wa-note { margin: 10px 0 0; line-height: 1.5; }
.stack label.check-inline.wa-enable { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); }
.wa-templates { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-bottom: 12px; }
.wa-tpl { display: grid; gap: 6px; font-size: 12px; color: var(--text-2); }
.wa-tpl > span { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.wa-tpl textarea { width: 100%; resize: vertical; font: 13px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
.link-btn { background: none; border: 0; padding: 0; color: var(--rx); font-size: 12px; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* tab Perangkat (ACS / modem ONT) */
.dev-note { margin: -4px 0 10px; }
.rx-pill, .pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; font-variant-numeric: tabular-nums; }
.rx-pill.rx-good { color: var(--good); background: rgba(12,163,12,.12); border-color: rgba(12,163,12,.4); }
.rx-pill.rx-warn { color: #e8890c; background: rgba(245,165,36,.12); border-color: rgba(245,165,36,.45); }
.rx-pill.rx-bad { color: var(--critical-text); background: rgba(208,59,59,.12); border-color: rgba(208,59,59,.45); }
.pill-on { color: var(--good); background: rgba(12,163,12,.12); }
.pill-off { color: var(--critical-text); background: rgba(208,59,59,.14); }
td.mono { font: 600 12px ui-monospace, Consolas, monospace; letter-spacing: .3px; }
#devTable tr[data-dev] td { vertical-align: middle; }
ol.guide { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: 13px; color: var(--text-2); line-height: 1.5; }
ol.guide code { word-break: break-all; }
#acsUrl { white-space: pre-wrap; word-break: break-all; }
#wifiForm { display: grid; gap: 12px; }
#wifiForm h2 + p { margin: -8px 0 0; }
#wifiForm p { margin: 0; }

/* filter router di halaman Pelanggan: kolom Router hanya tampil bila router lebih dari satu */
body.single-router .col-router { display: none; }
.router-select { max-width: 200px; field-sizing: content; }
td.col-router { white-space: nowrap; }

/* ---------- Keuangan, akuntansi & laporan (finance.html; sidebar Keuangan di semua halaman) ---------- */
.sn-link .sn-badge {
  margin-left: auto; display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 6px;
  border-radius: 999px; font-size: 11px; font-weight: 700; color: #1a1a19; background: var(--warning);
}
.period-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px; min-height: 32px; cursor: pointer; text-align: left;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: 8px; font: inherit;
}
.period-btn:hover { border-color: var(--rx); }
.period-btn .period-text { display: grid; line-height: 1.15; }
.period-btn .period-text > span:first-child { font-size: 12px; font-weight: 600; }
.period-btn .range { font-size: 11px; color: var(--muted); white-space: nowrap; }
.preset-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.preset-list button {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; cursor: pointer; text-align: left;
  background: transparent; color: var(--text); border: 1px solid transparent; border-radius: 8px; font: inherit; font-size: 13px;
}
.preset-list button:hover { background: var(--surface-2); }
.preset-list button.selected { border-color: var(--rx); background: rgba(57,135,229,.12); }
.preset-list .range { display: block; color: var(--muted); font-size: 11px; }
.range-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: end; }
.range-row .sep { padding-bottom: 9px; color: var(--muted); font-size: 12px; }
@media (max-width: 480px) { .range-row { grid-template-columns: 1fr; } .range-row .sep { display: none; } }

.content.fin-view { max-width: none; } /* keuangan memakai lebar layar penuh: kolom tabel lebih lega */
.fin-view.is-loading { opacity: .55; pointer-events: none; transition: opacity .15s; }
.fin-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin: -4px 0 -6px; }
.fin-head h2 { margin: 0; font-size: 18px; }
.fin-head .sub { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.fin-head .card-tools .btn { white-space: nowrap; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar .input { min-width: 200px; }
.toolbar .check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.toolbar .check input { accent-color: var(--rx); width: 15px; height: 15px; margin: 0; }
.fin-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.fin-main > .stack { gap: 18px; }
@media (max-width: 1000px) { .fin-main { grid-template-columns: 1fr; } }
.stat .meter { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin: 4px 0 2px; }
.stat .meter span { display: block; height: 100%; background: var(--rx); border-radius: 999px; }
.stat-meta { color: var(--text-2); font-size: 12px; }
.stat .tile-label svg { vertical-align: -3px; margin-right: 4px; color: var(--muted); }
.fin-alert {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: 10px; font-size: 13px;
  border: 1px solid rgba(208,59,59,.45); background: rgba(208,59,59,.12); color: var(--critical-text);
}
.fin-alert.warn { border-color: rgba(250,178,25,.5); background: rgba(250,178,25,.12); color: var(--warning); }
.fin-alert a { color: inherit; font-weight: 600; margin-left: auto; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.checklist a { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 13px; }
.checklist a:hover { text-decoration: underline; }
.checklist .tick { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--muted); flex: none; }
.summary-list { list-style: none; margin: 0; padding: 0; }
.summary-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-2); }
.summary-list li:first-child { border-top: 0; padding-top: 0; }
.summary-list .v { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.quick-actions { display: grid; gap: 8px; }
.quick-actions .btn { display: flex; align-items: center; justify-content: flex-start; gap: 8px; text-decoration: none; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.chart-box { position: relative; height: 280px; }
.chart-box.short { height: 220px; }
.table-wrap.auto { max-height: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cell-sub { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; font-weight: 400; }
.danger-text { color: var(--critical-text); }
.ok-text { color: var(--good); }
tr.muted-row td { opacity: .55; }
tr.jr-first td { border-top: 2px solid var(--border); }
.jr-table td { vertical-align: top; }
.jr-table .acct-credit { padding-left: 32px; }
.jr-table td.jr-desc { white-space: normal; min-width: 300px; line-height: 1.4; }
.jr-table td.jr-acct { white-space: nowrap; }
.jr-table td.jr-acct .cell-sub { white-space: normal; }
.jr-table td.jr-desc .cell-sub { margin-top: 4px; }
.src-tag { display: inline-block; margin-top: 3px; padding: 1px 6px; border-radius: 4px; font-size: 10px; font-weight: 600; letter-spacing: .3px; text-transform: uppercase; border: 1px solid var(--border); color: var(--muted); }
.report-sheet { padding: 22px 24px; }
.report-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 14px; }
.report-head .biz { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.report-head h2 { font-size: 18px; margin: 2px 0; }
.report-head p { margin: 0; }
.report-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 6px; }
.report-summary > div { padding: 10px 12px; background: var(--surface-2); border-radius: 8px; display: grid; gap: 2px; }
.report-summary span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.report-summary b { font-size: 15px; font-variant-numeric: tabular-nums; }
.report-section { margin-top: 18px; }
.report-section h3 { margin: 0 0 8px; font-size: 12px; color: var(--text-2); text-transform: uppercase; letter-spacing: .5px; }
.report-note { color: var(--muted); font-size: 12px; margin: 14px 0 0; line-height: 1.5; }
tr.r-total td { font-weight: 700; border-top: 2px solid var(--border); }
tr.r-subheading td { font-weight: 600; color: var(--text-2); background: var(--surface-2); }
tr.r-muted td { opacity: .6; }
tr.r-bold td { font-weight: 600; }
.lines-editor { display: grid; gap: 6px; }
.lines-editor .line { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr) auto; gap: 6px; align-items: center; }
.lines-editor .line select, .lines-editor .line input { width: 100%; min-width: 0; }
.lines-editor .line .icon-btn { width: 30px; height: 30px; }
@media (max-width: 640px) { .lines-editor .line { grid-template-columns: 1fr 1fr; } }
.lines-total { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.lines-total b { color: var(--text); font-variant-numeric: tabular-nums; }
.modal-box.wide { max-width: min(820px, 96vw); }
.pay-radio { display: flex; gap: 14px; font-size: 13px; min-height: 36px; align-items: center; }
.pay-radio label { display: inline-flex !important; align-items: center; gap: 6px; color: var(--text); font-size: 13px; }
.pay-radio input { accent-color: var(--rx); width: 15px; height: 15px; margin: 0; }
.coa-type { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .3px; }
.inline-list { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-2); }
.inline-list b { color: var(--text); }
.view-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.view-switch button { padding: 4px 10px; font: inherit; font-size: 12px; cursor: pointer; background: transparent; color: var(--text-2); border: 0; }
.view-switch button.active { background: var(--surface-2); color: var(--text); font-weight: 600; }
.empty-box { display: grid; place-items: center; gap: 4px; padding: 26px 12px; color: var(--muted); font-size: 13px; text-align: center; }
.empty-box b { color: var(--text-2); }
@media (max-width: 760px) { .period-btn .range { display: none; } .period-btn .period-text > span:first-child { font-size: 11px; } }
@media print {
  .topbar, .side-nav, .nav-backdrop, .plan-bar, .toolbar, .no-print, .toast, .fin-head .card-tools, td.actions, th.actions-col { display: none !important; }
  body { background: #fff; color: #000; }
  .content { padding: 0; max-width: none; display: block; }
  .card, .report-sheet { border: 0; box-shadow: none; padding: 0; background: #fff; color: #000; }
  .table-wrap { max-height: none; overflow: visible; }
  th { position: static; background: #fff; color: #000; }
  tr.r-subheading td, .report-summary > div { background: #f2f2f2; }
}

/* ---------- Tabel: teks membungkus (tidak dipotong) & pengurutan lewat judul kolom (table.js) ---------- */
/* Di layar lebar sel membungkus supaya seluruh tulisan terbaca tanpa scroll mendatar; angka, tanggal pendek, status, dan
   tombol aksi tetap satu baris. Di HP tabel kembali satu baris per sel dengan scroll mendatar (kolom terlalu sempit). */
td { white-space: normal; overflow-wrap: break-word; }
th { white-space: nowrap; }
td.num, td.actions, td.nowrap, td.date, td.col-router, td.down-ago, td .status, td .badge, td time, td .nowrap { white-space: nowrap; }
td.access { max-width: none; overflow: visible; text-overflow: clip; }
td .sub, td .cell-sub { white-space: normal; }
@media (max-width: 760px) {
  td, td .sub, td .cell-sub { white-space: nowrap; overflow-wrap: normal; }
  td.jr-desc, td.wrap { white-space: normal; overflow-wrap: break-word; }
}
thead th:not(:empty):not(.actions-col) { cursor: pointer; user-select: none; }
thead th:not(:empty):not(.actions-col):hover { color: var(--text); }
th.asc::after { content: " \25B2"; font-size: 9px; }
th.desc::after { content: " \25BC"; font-size: 9px; }
/* ubah jurnal langsung di tabel (finance.html) */
tr.editing td { background: rgba(57,135,229,.06); vertical-align: top; }
tr.editing .input, tr.editing .select { width: 100%; min-width: 0; padding: 6px 8px; font-size: 13px; }
tr.editing td.num .input { text-align: right; min-width: 110px; }
tr.editing textarea.input { resize: vertical; min-height: 54px; font: inherit; line-height: 1.4; }
tr.editing .jr-memo { margin-top: 6px; font-size: 12px; }
tr.editing .input-group .select { flex: 1 1 160px; }
tr.editing .input-group .icon-btn { width: 30px; height: 30px; }
tr.editing td.actions .icon-btn.primary { color: #fff; background: var(--rx); border-color: var(--rx); }

/* master paket (admin.html): pratinjau kartu seperti halaman daftar + tombol bintang tanda POPULER */
.pkg-preview { margin-bottom: 14px; }
.pkg-preview .pkg { text-align: left; cursor: pointer; }
.pkg-preview-note { margin: -4px 0 10px; }
.icon-btn.star.on { color: var(--warning); border-color: var(--warning); }
.icon-btn.star:not(.on) svg { fill: none; }
.modal-box textarea.input { resize: vertical; }

/* lebar kolom bisa ditarik di tepi kanan judul kolom (table.js); klik dua kali di tepi = lebar otomatis */
thead th.col-edge { cursor: col-resize; box-shadow: inset -2px 0 0 var(--rx); }
body.col-resizing, body.col-resizing * { cursor: col-resize !important; user-select: none !important; }

/* paket tanpa menu Keuangan: ajakan upgrade (finance.js) */
.upgrade-card { max-width: 640px; margin: 24px auto; text-align: center; display: grid; gap: 10px; justify-items: center; padding: 28px 24px; }
.upgrade-card h2 { font-size: 18px; }
.upgrade-icon { color: var(--rx); }
.upgrade-list { list-style: none; margin: 4px 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; font-size: 13px; color: var(--text-2); }
.upgrade-list li::before { content: "\2713  "; color: var(--good); font-weight: 700; }
.upgrade-actions { grid-auto-flow: column; justify-content: center; }
@media (max-width: 480px) { .upgrade-actions { grid-auto-flow: row; } }

/* PPN di kartu paket & form PPN (menu Paket owner) */
.pkg-tax { margin-top: -2px; font-size: 11px; font-weight: 600; color: var(--warning); }
.stack label.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); cursor: pointer; }
.stack label.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--rx); }
.ppn-form .row .select, .ppn-form .row .input { width: 100%; min-width: 0; padding: 8px 10px; }

/* halaman isolir (tab Router & Pengaturan) */
.iso-form textarea.input { font: inherit; font-size: 13px; }
.iso-form .input, .iso-mode .select { width: 100%; min-width: 0; padding: 8px 10px; }
.iso-mode { display: grid; gap: 4px; font-size: 12px; color: var(--text-2); margin-bottom: 10px; }
.iso-sub { margin: -4px 0 12px; }
#isoWarn { margin-bottom: 12px; }
/* tombol berupa tautan (<a class="btn">) tanpa garis bawah, sama seperti <button> */
a.btn { text-decoration: none; }

/* batas grafik per paket: "2/3 grafik" di samping tombol Tambah Grafik (klik -> halaman Langganan) */
.graph-quota { display: inline-flex; align-items: center; padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: 12px; color: var(--text-2); text-decoration: none; white-space: nowrap; }
.graph-quota:hover { color: var(--text); border-color: var(--text-2); }
.graph-quota.full { color: var(--warning); border-color: var(--warning); }
#btnAddChart.is-full { opacity: 0.55; }
/* batas router per paket di Daftar Router: "3/3 router" + keterangan upgrade bila penuh */
.router-add { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#btnAddRouter.is-full { opacity: 0.55; }
.limit-note { margin: 10px 0 0; font-size: 13px; }
.limit-note a { color: var(--rx); font-weight: 600; text-decoration: none; }
.limit-note a:hover { text-decoration: underline; }
/* halaman login (layar lebar): panel kiri setinggi layar dan menempel di atas, jadi posisinya sama di tab Masuk dan Daftar
   walau form kanan memanjang (paket, durasi, bukti bayar), dan tetap terlihat saat form di-scroll */
@media (min-width: 981px) {
  .auth-hero { position: sticky; top: 0; align-self: start; height: 100vh; height: 100dvh; }
}
/* notifikasi pembayaran di header (public/notify.js): lonceng di samping tombol tema, daftar melayang di bawahnya */
.notice-bell { position: relative; }
.notice-bell[hidden] { display: none; }
.notice-bell.has-items { color: var(--warning); border-color: rgba(250,178,25,.5); }
.notice-bell.has-items svg { transform-origin: 50% 12%; animation: bell-ring 7s ease-in-out infinite; }
.notice-bell.on { background: var(--surface-2); }
.notice-count { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--critical); color: #fff; font-size: 10.5px; font-weight: 800; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--bg); pointer-events: none; }
.notice-count[hidden] { display: none; }
@keyframes bell-ring { 0%, 84%, 100% { transform: rotate(0); } 86% { transform: rotate(-14deg); } 88% { transform: rotate(11deg); } 90% { transform: rotate(-9deg); } 92% { transform: rotate(6deg); } 94% { transform: rotate(-3deg); } }
@media (prefers-reduced-motion: reduce) { .notice-bell.has-items svg { animation: none; } }
.notice-panel { position: fixed; z-index: 60; width: min(480px, calc(100vw - 24px)); max-height: min(72vh, 640px); overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 18px 40px rgba(0,0,0,.45); }
.notice-panel[hidden] { display: none; }
.notice-head { padding: 14px 16px 10px; border-bottom: 1px solid var(--border); }
.notice-head b { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.notice-head > span { display: block; margin-top: 3px; color: var(--text-2); font-size: 12.5px; }
.notice-chip { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--critical); color: #fff; font-size: 11px; font-weight: 800; }
.notice-list { list-style: none; margin: 0; padding: 6px; }
.notice-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 8px 12px; padding: 10px; border-radius: 10px; }
.notice-list li:hover { background: var(--surface-2); }
.notice-main { min-width: 0; }
.notice-main b { font-size: 13.5px; }
.notice-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 3px; color: var(--muted); font-size: 12px; }
.notice-wa { display: flex; align-items: center; gap: 5px; margin-top: 4px; color: var(--muted); font-size: 12px; }
.notice-wa.ok { color: var(--good); }
.notice-wa.bad { color: var(--critical-text); }
.notice-amount { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.notice-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.notice-actions .btn { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; text-decoration: none; }
.badge.notice-over { color: var(--critical-text); border-color: rgba(208,59,59,.45); background: rgba(208,59,59,.12); }
.badge.notice-today, .badge.notice-grace { color: var(--warning); border-color: rgba(250,178,25,.45); background: rgba(250,178,25,.10); }
.notice-more { margin: 0; padding: 2px 16px 14px; color: var(--muted); font-size: 12.5px; }
.notice-more a { color: var(--rx); font-weight: 600; text-decoration: none; }
.notice-toast { bottom: 72px; }
@media print { .notice-bell, .notice-panel, .notice-toast { display: none !important; } }
/* lonceng: judul bagian (Pesan support / pembayaran) */
.notice-section + .notice-section { border-top: 1px solid var(--border); }
.notice-section h3 { display: flex; align-items: center; gap: 8px; margin: 0; padding: 12px 16px 2px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.notice-hint { margin: 2px 16px 0; color: var(--text-2); font-size: 12.5px; }
.notice-snip { display: block; color: var(--text-2); }
.notice-new { color: var(--rx); font-size: 12.5px; }

/* ---------------- Support Center (support.html) ---------------- */
.sup-crumbs { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.sup-page-title { margin: 0; font-size: 19px; font-weight: 700; }
.sup-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--text-2); font-size: 13.5px; }
.sup-breadcrumb a { color: var(--text-2); text-decoration: none; }
.sup-breadcrumb a:hover { color: var(--text); }
.sup-breadcrumb .current { color: var(--rx); }
.sup-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: start; padding: 26px 28px; }
.sup-eyebrow { font-size: 11.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.sup-hero h2 { margin: 12px 0 10px; font-size: clamp(20px, 2.1vw, 28px); line-height: 1.25; }
.sup-hero p { margin: 0; max-width: 780px; line-height: 1.65; }
.sup-facts { display: grid; grid-template-columns: repeat(2, minmax(170px, 230px)); gap: 12px; }
.sup-fact { padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.sup-fact-value { margin-top: 8px; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
.sup-fact-value.unset { color: var(--muted); font-weight: 500; }
.sup-channels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.sup-channel { display: flex; flex-direction: column; gap: 14px; }
.sup-ch-head { display: flex; align-items: flex-start; gap: 12px; }
.sup-ch-icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.sup-ch-title { flex: 1; min-width: 0; display: grid; gap: 3px; }
.sup-ch-title b { font-size: 15px; }
.sup-ch-title span { color: var(--text-2); font-size: 14px; overflow-wrap: anywhere; }
.badge.sup-ok { color: var(--good); border-color: rgba(12,163,12,.45); background: rgba(12,163,12,.12); }
.badge.sup-unset { color: var(--warning); border-color: rgba(250,178,25,.45); background: rgba(250,178,25,.10); }
.sup-channel > p { margin: 0; flex: 1; line-height: 1.55; }
.sup-ch-btn { display: flex; justify-content: center; align-items: center; text-decoration: none; padding: 11px 14px; }
.sup-ch-btn.disabled { opacity: .5; pointer-events: none; }
.sup-chat-card .card-head p { margin: 4px 0 0; font-size: 13px; }
.sup-info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sup-info-form label { display: grid; gap: 4px; font-size: 12px; color: var(--text-2); }
.sup-info-form .input { width: 100%; min-width: 0; padding: 8px 10px; font: inherit; font-size: 13px; }
@media (max-width: 980px) {
  .sup-hero { grid-template-columns: 1fr; }
  .sup-channels { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .sup-facts, .sup-info-grid { grid-template-columns: 1fr; }
  .sup-hero { padding: 18px; }
}
/* chat Support Center (support-chat.js) */
.chat { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.chat-list { display: flex; flex-direction: column; gap: 8px; height: min(52vh, 520px); overflow-y: auto; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); }
.chat-empty { margin: auto; max-width: 440px; text-align: center; color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.chat-day { display: flex; justify-content: center; margin: 6px 0; }
.chat-day span { padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 11.5px; }
.chat-msg { display: flex; }
.chat-msg.mine { justify-content: flex-end; }
.chat-bubble { max-width: min(78%, 640px); padding: 9px 12px 6px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.chat-msg.mine .chat-bubble { background: rgba(57,135,229,.16); border-color: rgba(57,135,229,.38); border-bottom-right-radius: 4px; }
.chat-msg.theirs .chat-bubble { border-bottom-left-radius: 4px; }
.chat-who { margin-bottom: 2px; color: var(--rx); font-size: 12px; font-weight: 700; }
.chat-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.5; }
.chat-text a { color: var(--rx); }
.chat-meta { margin-top: 3px; text-align: right; color: var(--muted); font-size: 11px; }
.chat-form { display: flex; gap: 10px; align-items: flex-end; }
.chat-form textarea { flex: 1; min-width: 0; min-height: 46px; max-height: 200px; resize: vertical; padding: 10px 12px; font: inherit; font-size: 14px; }
.chat-send { flex: none; padding: 12px 20px; }
.chat-error { color: var(--critical-text); font-size: 13px; }
/* kotak masuk Chat Support owner (support-owner.js) */
.card.sup-panel { padding: 0; overflow: hidden; }
.sup-inbox { display: grid; grid-template-columns: 320px minmax(0, 1fr); min-height: 600px; }
.sup-convos-wrap { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--border); }
.sup-convos-wrap > .input { margin: 12px; padding: 8px 10px; font: inherit; font-size: 13px; }
.sup-convos { flex: 1; max-height: 680px; overflow-y: auto; }
.sup-convo { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px; border: 0; border-top: 1px solid var(--border); background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.sup-convo:hover { background: var(--surface-2); }
.sup-convo.on { background: rgba(57,135,229,.13); box-shadow: inset 3px 0 0 var(--rx); }
.sup-avatar { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #2dd4bf, #3987e5); color: #fff; font-weight: 700; }
.sup-convo-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.sup-convo-main b, .sup-convo-snip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sup-convo-main b { font-size: 13.5px; }
.sup-convo-snip { color: var(--muted); font-size: 12.5px; }
.sup-convo.unread .sup-convo-snip { color: var(--text); font-weight: 600; }
.sup-convo-side { flex: none; display: grid; justify-items: end; gap: 4px; }
.sup-convo-time { color: var(--muted); font-size: 11.5px; }
.sup-unread { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--critical); color: #fff; font-size: 11px; font-weight: 800; line-height: 20px; text-align: center; }
.sup-none { padding: 18px; color: var(--muted); font-size: 13px; }
.sup-thread { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 14px 16px; }
.sup-thread-head { display: flex; align-items: center; gap: 10px; min-height: 42px; }
.sup-thread-info b { font-size: 15px; }
.sup-thread-info .muted { margin-top: 2px; font-size: 12.5px; }
.sup-thread-info a { color: var(--rx); text-decoration: none; }
.sup-back { display: none; }
.sup-pick { margin: auto; padding: 40px 12px; color: var(--muted); text-align: center; }
.sup-thread:not(.active) .chat, .sup-thread:not(.active) .sup-thread-head { display: none; }
.sup-thread.active .sup-pick { display: none; }
.sup-thread .chat-list { height: min(60vh, 600px); }
@media (max-width: 760px) {
  .sup-inbox { grid-template-columns: 1fr; min-height: 0; }
  .sup-convos-wrap { border-right: 0; }
  .sup-inbox.has-thread .sup-convos-wrap { display: none; }
  .sup-inbox:not(.has-thread) .sup-thread { display: none; }
  .sup-back { display: inline-flex; }
  .chat-list, .sup-thread .chat-list { height: 56vh; }
  .chat-bubble { max-width: 88%; }
}
/* Import dari MikroTik (radius.html) */
.modal-box.imp-box { max-width: min(940px, 96vw); }
.imp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.imp-head h2 { margin: 0; }
.imp-step { display: grid; gap: 12px; }
.imp-step h3 { margin: 6px 0 0; color: var(--text-2); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.imp-step > p { margin: 0; line-height: 1.55; }
.imp-cmds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.imp-cmds b { display: block; margin-bottom: 4px; color: var(--text-2); font-size: 12px; }
.imp-cmds pre.cmd { margin: 0; }
.imp-note { font-size: 12.5px; }
.imp-drop { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; padding: 18px; border: 1.5px dashed var(--border); border-radius: 12px; color: var(--text-2); text-align: center; cursor: pointer; }
.imp-drop:hover, .imp-drop.over { border-color: var(--rx); background: rgba(57,135,229,.06); color: var(--text); }
.imp-drop b { color: var(--rx); font-weight: 600; }
.imp-text { width: 100%; min-width: 0; resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.imp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.imp-chip { padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); font-size: 13px; }
.imp-chip.ok { border-color: rgba(12,163,12,.45); color: var(--good); }
.imp-chip.bad { border-color: rgba(208,59,59,.45); color: var(--critical-text); }
.imp-warn { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid rgba(250,178,25,.45); border-radius: 10px; background: rgba(250,178,25,.08); color: var(--warning); font-size: 13px; line-height: 1.5; }
.imp-rate { width: 86px; padding: 6px 8px; font: inherit; font-size: 13px; }
.imp-price { width: 120px; padding: 6px 8px; font: inherit; font-size: 13px; }
.imp-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.imp-options label { display: grid; gap: 4px; color: var(--text-2); font-size: 12px; }
.imp-options .select, .imp-options .input { width: 100%; min-width: 0; padding: 8px 10px; }
.imp-sample { max-height: 260px; overflow: auto; }
.imp-done { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid rgba(12,163,12,.4); border-radius: 12px; background: rgba(12,163,12,.10); color: var(--good); }
.imp-done b { color: var(--text); font-size: 15px; }
.imp-sum { display: grid; gap: 4px; margin: 0; padding-left: 20px; }
.imp-errors { padding: 10px 12px; border: 1px solid rgba(208,59,59,.45); border-radius: 10px; background: rgba(208,59,59,.08); font-size: 13px; }
.imp-errors ul { max-height: 180px; margin: 6px 0 0; padding-left: 18px; overflow: auto; }
.imp-next { padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.imp-next ol { display: grid; gap: 4px; margin: 6px 0; padding-left: 20px; }
.imp-next pre.cmd { margin: 8px 0; }
.imp-next p { margin: 0; }
@media (max-width: 760px) { .imp-cmds, .imp-options { grid-template-columns: 1fr; } }
/* lampiran chat (gambar / PDF) */
.chat-form .chat-attach { flex: none; align-self: flex-end; width: 44px; height: 46px; }
.chat.drag .chat-list { border-color: var(--rx); background: rgba(57,135,229,.06); }
.chat-attach-preview { display: flex; }
.chat-chip { display: flex; align-items: center; gap: 10px; max-width: 100%; padding: 6px 8px 6px 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.chat-chip img { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; }
.chat-chip-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 6px; background: rgba(208,59,59,.12); color: var(--critical-text); }
.chat-chip-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.chat-chip small { flex: none; color: var(--muted); font-size: 12px; }
.chat-img-link { display: block; margin: 2px 0 4px; }
.chat-img { display: block; max-width: min(320px, 100%); max-height: 260px; border-radius: 10px; object-fit: contain; background: var(--bg); }
.chat-file { display: flex; align-items: center; gap: 10px; min-width: 200px; margin: 2px 0 4px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); text-decoration: none; }
.chat-file svg { flex: none; color: var(--critical-text); }
.chat-file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 600; }
.chat-file small { flex: none; color: var(--muted); font-size: 11.5px; }
.chat-file:hover { border-color: var(--rx); }
