/* ================================================================
   BillingNet — stylesheet tunggal
   Tema: control-room ISP. Sidebar navy gelap, konten terang,
   aksen sky/teal, tabel padat, kartu bersih, mendukung dark mode.
   ================================================================ */

:root {
  --bg: #f2f5fa;
  --bg-grad-1: rgba(14, 165, 233, .10);
  --bg-grad-2: rgba(20, 184, 166, .10);
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef2f7;
  --line: #e3e8ef;
  --line-strong: #cfd8e3;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --accent: #0ea5e9;
  --accent-ink: #ffffff;
  --accent-soft: #e0f2fe;
  --teal: #14b8a6;
  --teal-soft: #ccfbf1;
  --danger: #e11d48;
  --danger-soft: #ffe4e6;
  --warn: #d97706;
  --warn-soft: #fef3c7;
  --ok: #15803d;
  --ok-soft: #dcfce7;
  --sidebar: #0b1220;
  --sidebar-2: #111c30;
  --sidebar-ink: #cbd5e1;
  --sidebar-muted: #7d8ca6;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, .14);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

:root[data-theme="dark"] {
  --bg: #070d17;
  --bg-grad-1: rgba(14, 165, 233, .16);
  --bg-grad-2: rgba(20, 184, 166, .13);
  --surface: #0e1729;
  --surface-2: #121d32;
  --surface-3: #182742;
  --line: #1e2b45;
  --line-strong: #2a3a58;
  --ink: #e6edf7;
  --ink-2: #c3cee0;
  --muted: #93a3bd;
  --muted-2: #6b7c97;
  --accent: #38bdf8;
  --accent-ink: #04121f;
  --accent-soft: rgba(56, 189, 248, .16);
  --teal: #2dd4bf;
  --teal-soft: rgba(45, 212, 191, .16);
  --danger: #fb7185;
  --danger-soft: rgba(251, 113, 133, .16);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, .16);
  --ok: #4ade80;
  --ok-soft: rgba(74, 222, 128, .16);
  --sidebar: #060b14;
  --sidebar-2: #0b1526;
  --sidebar-ink: #cbd5e1;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 26px rgba(0, 0, 0, .35);
  --shadow-lg: 0 22px 54px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 480px at 8% -8%, var(--bg-grad-1), transparent 60%),
    radial-gradient(760px 420px at 100% 0%, var(--bg-grad-2), transparent 62%);
  pointer-events: none;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 10px; }
p:last-child { margin-bottom: 0; }
.ico { flex: 0 0 auto; vertical-align: middle; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.bold { font-weight: 700; }
.truncate { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.newline { white-space: pre-line; }

/* ------------------------------------------------------------- layout */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 252px;
  flex: 0 0 252px;
  background-color: var(--sidebar);
  background-image:
    radial-gradient(420px 220px at 10% 0%, rgba(14, 165, 233, .20), transparent 70%),
    linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
  color: var(--sidebar-ink);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 50;
  border-right: 1px solid rgba(148, 163, 184, .12);
}

.brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px; border-bottom: 1px solid rgba(148, 163, 184, .12); }
.brand-logo {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  color: #04121f; font-weight: 800; font-size: 15px;
  display: grid; place-items: center; letter-spacing: -.5px;
  box-shadow: 0 6px 18px rgba(14, 165, 233, .35);
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { color: #f8fafc; font-size: 15px; line-height: 1.2; }
.brand-text small { color: var(--sidebar-muted); font-size: 11px; letter-spacing: .02em; }
.side-close { display: none; margin-left: auto; background: transparent; border: 0; color: var(--sidebar-ink); cursor: pointer; }

.nav { flex: 1; overflow-y: auto; padding: 10px 10px 16px; scrollbar-width: thin; }
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, .25); border-radius: 8px; }
.nav-group { margin-bottom: 2px; }
.nav-head {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  background: transparent; border: 0; color: var(--sidebar-muted);
  font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  padding: 10px 10px 6px; cursor: pointer; font-family: inherit;
}
.nav-head svg { transition: transform .18s ease; opacity: .6; }
.nav-group:not(.open) .nav-head svg { transform: rotate(-90deg); }
.nav-items { display: none; }
.nav-group.open .nav-items { display: block; }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 9px; margin-bottom: 1px;
  color: var(--sidebar-ink); font-size: 13px; font-weight: 500;
  text-decoration: none; position: relative; transition: background .15s ease, color .15s ease;
}
.nav-link:hover { background: rgba(148, 163, 184, .12); color: #f1f5f9; text-decoration: none; }
.nav-link .ico { opacity: .72; }
.nav-link.active { background: linear-gradient(90deg, rgba(14, 165, 233, .24), rgba(20, 184, 166, .12)); color: #f8fafc; }
.nav-link.active::before { content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav-link.active .ico { opacity: 1; color: #7dd3fc; }

.sidebar-foot { border-top: 1px solid rgba(148, 163, 184, .12); padding: 12px; }
.side-user { display: flex; gap: 10px; align-items: center; text-decoration: none; padding: 6px; border-radius: 10px; }
.side-user:hover { background: rgba(148, 163, 184, .1); text-decoration: none; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 34px;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
  background: linear-gradient(135deg, rgba(14, 165, 233, .3), rgba(20, 184, 166, .3));
  color: #e0f2fe; border: 1px solid rgba(148, 163, 184, .25);
}
.su-text { display: flex; flex-direction: column; min-width: 0; }
.su-text strong { color: #f1f5f9; font-size: 13px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.su-text small { color: var(--sidebar-muted); font-size: 11px; }
.side-logout {
  margin-top: 8px; width: 100%; display: flex; align-items: center; gap: 8px; justify-content: center;
  background: rgba(148, 163, 184, .1); border: 1px solid rgba(148, 163, 184, .18);
  color: var(--sidebar-ink); border-radius: 9px; padding: 8px; cursor: pointer; font-size: 12.5px;
  font-family: inherit;
}
.side-logout:hover { background: rgba(225, 29, 72, .2); color: #fecdd3; border-color: rgba(225, 29, 72, .3); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 24px; min-height: 66px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px) saturate(150%);
  border-bottom: 1px solid var(--line);
}
.tb-title { min-width: 0; }
.tb-title h1 { font-size: 18px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-title p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.hamburger { display: none; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); border-radius: 9px; padding: 7px; cursor: pointer; }

.global-search { position: relative; display: flex; align-items: center; }
.global-search .gs-ico { position: absolute; left: 10px; color: var(--muted-2); display: flex; }
.global-search input {
  width: 230px; padding: 8px 12px 8px 32px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink);
  font-size: 12.5px; font-family: inherit; outline: none; transition: border-color .15s, width .2s;
}
.global-search input:focus { border-color: var(--accent); background: var(--surface); width: 280px; }

.icon-btn {
  position: relative; width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2);
}
.icon-btn:hover { background: var(--surface-3); text-decoration: none; }
.dot-badge {
  position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px;
  background: var(--danger); color: #fff; font-size: 10px; font-weight: 700;
  border-radius: 9px; display: grid; place-items: center; border: 2px solid var(--surface);
}

.theme-toggle {
  position: relative; width: 52px; height: 28px; border-radius: 99px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface-3); padding: 0; flex: 0 0 auto;
}
.theme-toggle .tt-sun, .theme-toggle .tt-moon {
  position: absolute; top: 50%; transform: translateY(-50%); display: flex;
  color: var(--muted); transition: opacity .2s;
}
.theme-toggle .tt-sun { left: 6px; }
.theme-toggle .tt-moon { right: 6px; }
.theme-toggle::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px;
  border-radius: 50%; background: var(--surface); box-shadow: 0 1px 4px rgba(15, 23, 42, .3);
  transition: transform .22s cubic-bezier(.4, 0, .2, 1);
}
:root[data-theme="dark"] .theme-toggle::after { transform: translateX(24px); }
:root[data-theme="dark"] .theme-toggle .tt-sun { opacity: .35; }
.theme-toggle .tt-moon { opacity: .35; }
:root[data-theme="dark"] .theme-toggle .tt-moon { opacity: 1; }
.theme-toggle .tt-sun { opacity: 1; }
.theme-toggle.sm { width: 44px; height: 24px; }
.theme-toggle.sm::after { width: 18px; height: 18px; }
:root[data-theme="dark"] .theme-toggle.sm::after { transform: translateX(20px); }

.content { padding: 22px 24px 40px; max-width: 1440px; width: 100%; margin: 0 auto; flex: 1; }
.content.wide { max-width: none; }
.footer {
  display: flex; justify-content: space-between; padding: 14px 24px;
  color: var(--muted-2); font-size: 11.5px; border-top: 1px solid var(--line);
}

.scrim {
  display: none; position: fixed; inset: 0; background: rgba(3, 8, 18, .55);
  z-index: 45; backdrop-filter: blur(2px);
}

/* ------------------------------------------------------------- kartu */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px; border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.card-head h2 { font-size: 14.5px; }
.card-head p { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.card-body { padding: 18px; }
.card-body.flush { padding: 0; }
.card.flat { box-shadow: none; }

.grid { display: grid; gap: 20px; }
.grid-2 { display: grid; gap: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: 20px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { display: grid; gap: 20px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { display: grid; gap: 16px; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-2 > *, .grid-3 > *, .grid-4 > *, .grid-5 > * { min-width: 0; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }

.stat-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px;
  min-width: 0; position: relative; overflow: hidden;
}
.stat-card::after {
  content: ""; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px;
  border-radius: 50%; background: var(--accent-soft); opacity: .55;
}
.sc-top { display: flex; align-items: center; justify-content: space-between; }
.sc-ico {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c);
}
.sc-trend { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 99px; position: relative; z-index: 1; }
.sc-trend.up { background: var(--ok-soft); color: var(--ok); }
.sc-trend.down { background: var(--danger-soft); color: var(--danger); }
.sc-label { color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }
.sc-value { font-size: 21px; font-weight: 750; letter-spacing: -.02em; line-height: 1.15; position: relative; z-index: 1; }
.sc-foot { font-size: 11.5px; color: var(--muted); }

/* ------------------------------------------------------------- tombol */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 14px; border-radius: 10px; font-size: 13px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; font-family: inherit;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease;
  white-space: nowrap; text-decoration: none; line-height: 1.2;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, #0ea5e9, #0284c7); color: #fff; box-shadow: 0 6px 16px rgba(14, 165, 233, .28); }
.btn-primary:hover { box-shadow: 0 8px 22px rgba(14, 165, 233, .38); color: #fff; }
.btn-teal { background: linear-gradient(135deg, #14b8a6, #0d9488); color: #fff; box-shadow: 0 6px 16px rgba(20, 184, 166, .26); }
.btn-teal:hover { color: #fff; }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-soft { background: var(--accent-soft); color: #0369a1; border-color: transparent; }
.btn-soft:hover { color: #075985; }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.btn-danger:hover { color: var(--danger); }
.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.btn-xs { padding: 4px 8px; font-size: 11.5px; border-radius: 7px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.acts { display: flex; align-items: center; gap: 4px; }
.act {
  width: 28px; height: 28px; display: inline-grid; place-items: center; border-radius: 7px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; padding: 0;
}
.act:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.act.danger:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }
form.inline { display: inline; margin: 0; }

/* ------------------------------------------------------------- form */

.input {
  width: 100%; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font-size: 13px; font-family: inherit;
  outline: none; transition: border-color .15s, box-shadow .15s; min-height: 38px;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.input:disabled { background: var(--surface-3); color: var(--muted); }
textarea.input { min-height: 74px; resize: vertical; line-height: 1.5; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 16px, calc(100% - 11px) 16px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
select[multiple].input { background-image: none; padding-right: 11px; min-height: 110px; }

.fld { display: flex; flex-direction: column; gap: 5px; }
.fld-label { font-size: 12px; font-weight: 650; color: var(--ink-2); }
.fld-hint { font-size: 11px; color: var(--muted); }
.form-grid { display: grid; gap: 14px 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 8px; align-items: center; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.chk { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.chk input { width: 16px; height: 16px; accent-color: var(--accent); }

/* ------------------------------------------------------------- tabel */

.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 12.8px; }
.table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); font-weight: 700; padding: 10px 12px;
  background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table.compact td, .table.compact th { padding: 7px 10px; }
.table .empty { padding: 20px 10px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .act-cell { text-align: right; width: 1%; white-space: nowrap; }
.table td .sub { display: block; font-size: 11px; color: var(--muted); }
.table-foot td { background: var(--surface-2); font-weight: 700; border-top: 1px solid var(--line-strong); }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px;
  border-radius: 99px; font-size: 11px; font-weight: 650; line-height: 1.4;
  background: var(--b-bg); color: var(--b-ink); white-space: nowrap;
}
.badge .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
:root[data-theme="dark"] .badge { background: color-mix(in srgb, var(--b-ink) 22%, transparent); color: color-mix(in srgb, var(--b-ink) 55%, #fff); }

/* ------------------------------------------------------------- toolbar */

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .input { width: auto; min-width: 150px; }
.toolbar .search-inp { min-width: 230px; }
.toolbar .spacer { flex: 1; }

.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tab {
  padding: 9px 13px; font-size: 12.5px; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none;
}
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-count { margin-left: 6px; background: var(--surface-3); border-radius: 99px; padding: 1px 6px; font-size: 10.5px; }

.pager { display: flex; align-items: center; gap: 4px; justify-content: center; padding: 14px 0 2px; flex-wrap: wrap; }
.pg {
  min-width: 30px; height: 30px; display: inline-grid; place-items: center; padding: 0 8px;
  border-radius: 8px; border: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); text-decoration: none;
}
.pg:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.pg.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.pg-gap { color: var(--muted); padding: 0 2px; }

/* ------------------------------------------------------------- flash */

.flash {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 11px;
  margin-bottom: 16px; font-size: 13px; border: 1px solid transparent;
}
.flash.ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.flash.err { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.flash span { flex: 1; }
.flash-x { background: transparent; border: 0; color: inherit; font-size: 18px; cursor: pointer; line-height: 1; padding: 0 2px; }

.empty { text-align: center; color: var(--muted); padding: 26px 16px; font-size: 13px; }
.empty-ico {
  width: 52px; height: 52px; border-radius: 14px; background: var(--surface-3); color: var(--muted-2);
  display: grid; place-items: center; margin: 0 auto 10px;
}
.empty-card { text-align: center; padding: 40px 24px; }
.empty-card h3 { margin-bottom: 6px; }
.empty-card p { color: var(--muted); margin-bottom: 16px; }

/* ------------------------------------------------------------- misc */

.kv { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; text-align: right; }

.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.li-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); flex: 0 0 32px; }
.li-body { min-width: 0; flex: 1; }
.li-body strong { display: block; font-size: 13px; }
.li-body small { color: var(--muted); font-size: 11.5px; }
.li-right { text-align: right; font-size: 11.5px; color: var(--muted); white-space: nowrap; }

.progress { height: 7px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--teal)); border-radius: 99px; }
.progress.warn > i { background: linear-gradient(90deg, #f59e0b, #ef4444); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 99px;
  background: var(--surface-3); color: var(--ink-2); font-size: 11.5px; font-weight: 600; text-decoration: none;
}
.chip:hover { background: var(--accent-soft); color: #0369a1; text-decoration: none; }
.chip.active { background: var(--accent); color: #fff; }

.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: 11px; font-size: 12.5px; margin-bottom: 16px; background: var(--warn-soft); color: #92400e; }
:root[data-theme="dark"] .alert { color: #fde68a; }
.alert.info { background: var(--accent-soft); color: #075985; }
:root[data-theme="dark"] .alert.info { color: #7dd3fc; }
.alert .ico { margin-top: 1px; }

.hero {
  background: linear-gradient(120deg, #0b1220 0%, #10233d 55%, #0b3a44 100%);
  color: #e2e8f0; border-radius: 16px; padding: 24px; position: relative; overflow: hidden;
  margin-bottom: 20px;
}
.hero::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px;
  border-radius: 50%; background: radial-gradient(circle, rgba(14, 165, 233, .45), transparent 65%);
}
.hero h2 { font-size: 19px; color: #f8fafc; margin-bottom: 6px; }
.hero p { color: #9fb0c7; font-size: 13px; max-width: 620px; }
.hero .row { position: relative; z-index: 1; }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; padding: 28px; box-shadow: var(--shadow-lg);
}
.login-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }
.login-brand strong { font-size: 18px; display: block; }
.login-brand small { color: var(--muted); font-size: 12px; }
.login-foot { margin-top: 18px; text-align: center; font-size: 12px; color: var(--muted); }
.login-theme { position: fixed; top: 18px; right: 18px; }
.demo-creds { margin-top: 14px; padding: 10px 12px; border-radius: 9px; background: var(--surface-2); color: var(--muted); font-size: 11.5px; line-height: 1.5; }

/* ------------------------------------------------------------- peta */

.map-shell { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); }
#map, .map-canvas { height: 540px; width: 100%; background: var(--surface-3); }
.map-panel {
  position: absolute; top: 12px; right: 12px; z-index: 500; width: 240px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; box-shadow: var(--shadow); font-size: 12.5px;
}
.map-panel h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 8px; }
.map-legend { display: flex; flex-direction: column; gap: 6px; }
.map-legend label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12.5px; }
.map-legend input { accent-color: var(--accent); }
.leaflet-container { font-family: inherit; }
.map-pop { font-size: 12.5px; line-height: 1.45; }
.map-pop strong { display: block; font-size: 13px; margin-bottom: 2px; }
.map-pin {
  width: 26px; height: 26px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35);
}
.map-pin span { transform: rotate(45deg); font-size: 10px; font-weight: 800; color: #fff; }
.leaflet-control-attribution { font-size: 9px !important; }

/* kalender */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-dow { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); padding: 4px 0; text-transform: uppercase; }
.cal-cell {
  min-height: 88px; border: 1px solid var(--line); border-radius: 9px; padding: 6px;
  background: var(--surface); font-size: 11.5px; display: flex; flex-direction: column; gap: 3px;
}
.cal-cell.out { background: var(--surface-2); color: var(--muted-2); }
.cal-cell.today { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.cal-date { font-weight: 700; font-size: 11.5px; }
.cal-item {
  display: block; padding: 2px 5px; border-radius: 4px; font-size: 10.5px;
  background: var(--accent-soft); color: #0369a1; text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-item.late { background: var(--danger-soft); color: var(--danger); }
.cal-item.done { background: var(--ok-soft); color: var(--ok); }

/* kartu tagihan / scan */
.scan-box {
  border: 2px dashed var(--line-strong); border-radius: var(--radius); padding: 24px;
  text-align: center; background: var(--surface-2);
}
.scan-box video { width: 100%; max-width: 380px; border-radius: 12px; background: #000; }
.invoice-card {
  width: 100%; max-width: 340px; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; background: var(--surface); font-size: 12px;
}
.invoice-card h4 { font-size: 13px; margin-bottom: 2px; }
.invoice-card .ic-row { display: flex; justify-content: space-between; padding: 3px 0; }
.invoice-card .ic-total { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 14px; font-weight: 800; display: flex; justify-content: space-between; }

/* invoice cetak */
.invoice-sheet { background: #fff; color: #0f172a; padding: 32px; border-radius: 12px; border: 1px solid #e2e8f0; max-width: 820px; margin: 0 auto; }
.invoice-sheet h2 { font-size: 22px; }
.inv-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 2px solid #0f172a; padding-bottom: 14px; margin-bottom: 18px; }
.inv-title { text-align: right; }
.inv-title .big { font-size: 24px; font-weight: 800; letter-spacing: .06em; color: #0ea5e9; }
.inv-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; font-size: 13px; }
.inv-meta h5 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #64748b; margin: 0 0 4px; }
.invoice-sheet table { width: 100%; border-collapse: collapse; font-size: 13px; }
.invoice-sheet th { background: #f1f5f9; text-align: left; padding: 8px 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #475569; }
.invoice-sheet td { padding: 8px 10px; border-bottom: 1px solid #e2e8f0; }
.invoice-sheet .totals { margin-left: auto; width: 280px; margin-top: 14px; font-size: 13px; }
.invoice-sheet .totals div { display: flex; justify-content: space-between; padding: 5px 0; }
.invoice-sheet .totals .grand { border-top: 2px solid #0f172a; margin-top: 6px; padding-top: 8px; font-size: 16px; font-weight: 800; }
.inv-sign { display: flex; justify-content: space-between; margin-top: 40px; font-size: 12px; }
.inv-sign div { width: 180px; text-align: center; }
.inv-sign .line { margin-top: 52px; border-top: 1px solid #94a3b8; padding-top: 5px; }

/* QRIS */
.qris-box { text-align: center; }
.qris-box img { width: 240px; height: 240px; background: #fff; padding: 8px; border-radius: 10px; border: 1px solid var(--line); }

/* charts sederhana (bar) */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 8px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; }
.bars .bar i { width: 100%; border-radius: 5px 5px 0 0; background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 45%, transparent)); min-height: 2px; display: block; }
.bars .bar span { font-size: 9.5px; color: var(--muted); white-space: nowrap; }
.bars .bar b { font-size: 10px; color: var(--ink-2); }
.bars.teal .bar i { background: linear-gradient(180deg, var(--teal), color-mix(in srgb, var(--teal) 45%, transparent)); }

.donut-legend { display: flex; flex-direction: column; gap: 7px; font-size: 12px; }
.donut-legend .dl-item { display: flex; align-items: center; gap: 8px; }
.donut-legend .sw { width: 9px; height: 9px; border-radius: 3px; }

/* timeline */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding-bottom: 14px; font-size: 12.5px; }
.tl-item::before {
  content: ""; position: absolute; left: -21px; top: 4px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--surface); border: 2px solid var(--accent);
}
.tl-item small { color: var(--muted); display: block; font-size: 11px; }

/* toast */
.toast-wrap { position: fixed; right: 18px; bottom: 18px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 12.5px;
  min-width: 220px; animation: slideIn .2s ease;
}
.toast.err { border-left-color: var(--danger); }
@keyframes slideIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* portal publik */
.public-body { background: var(--bg); }
.pub-header {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.pub-inner { max-width: 1120px; margin: 0 auto; padding: 12px 22px; display: flex; align-items: center; gap: 18px; }
.pub-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.pub-brand strong { display: block; font-size: 15px; line-height: 1.2; }
.pub-brand small { color: var(--muted); font-size: 11px; }
.pub-nav { margin-left: auto; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pub-nav a { color: var(--ink-2); font-size: 13px; font-weight: 600; text-decoration: none; }
.pub-nav a:hover { color: var(--accent); }
.pub-main { max-width: 1120px; margin: 0 auto; padding: 26px 22px 50px; }
.pub-footer { border-top: 1px solid var(--line); background: var(--surface); }
.pub-footer p { color: var(--muted); font-size: 12px; }
.pub-foot-links { margin-left: auto; display: flex; gap: 16px; font-size: 12.5px; }
.pub-hero {
  background: linear-gradient(120deg, #0b1220, #10233d 60%, #0b3a44);
  color: #e2e8f0; border-radius: 18px; padding: 38px 30px; margin-bottom: 24px; position: relative; overflow: hidden;
}
.pub-hero h1 { font-size: 28px; color: #fff; margin-bottom: 8px; letter-spacing: -.02em; }
.pub-hero p { color: #a6b6cc; max-width: 560px; }
.pub-hero .row { position: relative; z-index: 1; margin-top: 18px; }
.pub-hero::after { content: ""; position: absolute; right: -80px; bottom: -80px; width: 300px; height: 300px; border-radius: 50%; background: radial-gradient(circle, rgba(20, 184, 166, .4), transparent 65%); }
.paket-card { position: relative; display: flex; flex-direction: column; gap: 6px; }
.paket-card .pk-price { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.paket-card .pk-price small { font-size: 12px; color: var(--muted); font-weight: 600; }
.paket-card ul { margin: 10px 0 14px; padding-left: 18px; color: var(--ink-2); font-size: 12.5px; }

/* ------------------------------------------------------------- responsif */

@media (max-width: 1180px) {
  .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .22s ease; box-shadow: none; }
  .sidebar.open { transform: none; box-shadow: 0 0 0 100vmax rgba(3, 8, 18, .45); }
  .side-close { display: block; }
  .scrim.show { display: block; }
  .hamburger { display: inline-grid; }
  .global-search { display: none; }
  .content { padding: 18px 16px 32px; }
  .topbar { padding: 10px 16px; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: auto; }
  .map-panel { position: static; width: auto; margin-bottom: 12px; }
  #map, .map-canvas { height: 420px; }
}

@media (max-width: 720px) {
  .grid-3, .grid-4, .grid-5, .form-grid, .form-grid.cols-3 { grid-template-columns: 1fr; }
  .tb-title h1 { font-size: 15.5px; }
  .tb-title p { display: none; }
  .filter-toolbar { width: 100%; }
  .cal-cell { min-height: 62px; padding: 4px; }
  .cal-item { font-size: 9px; }
  .invoice-sheet { padding: 18px; }
  .inv-head { flex-direction: column; }
  .inv-title { text-align: left; }
  .inv-meta { grid-template-columns: 1fr; }
  .table th, .table td { padding: 8px 10px; }
  .hide-sm { display: none; }
  .toast-wrap { left: 12px; right: 12px; bottom: 12px; }
}

/* ------------------------------------------------------------- cetak */

@media print {
  :root, :root[data-theme="dark"] {
    --bg: #fff; --surface: #fff; --surface-2: #fff; --surface-3: #f1f5f9;
    --ink: #000; --ink-2: #111; --muted: #444; --line: #ccc; --line-strong: #999;
    --accent: #0369a1; --shadow: none;
  }
  body { background: #fff !important; color: #000; }
  body::before { display: none; }
  .sidebar, .topbar, .footer, .toast-wrap, .theme-toggle, .no-print, .pub-header, .pub-footer { display: none !important; }
  .main { display: block; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .invoice-sheet { border: 0; padding: 0; max-width: none; }
  .table th { background: #f1f5f9 !important; color: #000; }
  a { color: #000; text-decoration: none; }
  .print-only { display: block !important; }
}
.print-only { display: none; }

/* ============================ form router / integrasi ============================ */

.req { color: var(--danger); font-weight: 700; }
.card-foot {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 14px 18px; border-top: 1px solid var(--line); background: var(--surface-2);
}
.fld-plain .fld-label { font-weight: 650; }

/* kotak "Fitur Router" */
.sub-box {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
  margin-top: 18px; background: var(--surface);
}
.sub-box h4 { font-size: 13px; margin-bottom: 10px; }
.toggle-grid { display: grid; gap: 12px 18px; grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* sakelar */
.toggle-row { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; min-width: 0; }
.toggle { position: relative; flex: 0 0 auto; display: inline-flex; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
  width: 40px; height: 22px; border-radius: 99px; background: var(--line-strong);
  display: inline-block; position: relative; transition: background .18s ease;
}
.toggle-knob {
  position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .35);
  transition: transform .18s cubic-bezier(.4, 0, .2, 1);
}
.toggle input:checked + .toggle-track { background: var(--accent); }
.toggle input:checked + .toggle-track .toggle-knob { transform: translateX(18px); }
.toggle input:focus-visible + .toggle-track { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.toggle-text { font-size: 12.5px; font-weight: 600; color: var(--ink-2); line-height: 1.35; padding-top: 1px; }
.toggle-text small { display: block; font-weight: 400; font-size: 11px; color: var(--muted); }

/* panel cache */
.cache-panel {
  margin-top: 18px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface-2); padding: 16px;
}
:root[data-theme="dark"] .cache-panel { background: color-mix(in srgb, var(--surface-2) 80%, #000 20%); }
.cache-head h4 { font-size: 13.5px; margin-bottom: 3px; }
.cache-head p { margin: 0 0 10px; }
.cache-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.cache-tab {
  display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--line); font-size: 11.5px; font-weight: 700; color: var(--muted);
}
.cache-tab.active { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); color: #0369a1; }
:root[data-theme="dark"] .cache-tab.active { color: #7dd3fc; }
.cache-note {
  display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 9px;
  background: var(--accent-soft); color: #075985; font-size: 12px; margin-bottom: 16px;
}
:root[data-theme="dark"] .cache-note { color: #bae6fd; }
.cache-note .ico { margin-top: 1px; }

/* bagian lanjutan */
.adv { margin-top: 18px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; background: var(--surface); }
.adv summary {
  cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--ink-2);
  display: flex; align-items: center; gap: 7px; list-style: none;
}
.adv summary::-webkit-details-marker { display: none; }
.adv summary::after { content: "▾"; margin-left: auto; color: var(--muted); }
.adv[open] summary::after { content: "▴"; }

@media (max-width: 900px) {
  .toggle-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .toggle-grid { grid-template-columns: 1fr; }
  .card-foot { position: sticky; bottom: 0; z-index: 5; }
}
@media print {
  .cache-panel, .adv, .card-foot { display: none !important; }
}

/* ====================== halaman Daftar Layanan (gaya aplikasi billing) ====================== */

.page-tabs {
  display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px;
  border-bottom: 1px solid var(--line); padding-bottom: 2px;
}
.page-tab {
  padding: 8px 14px; font-size: 13px; font-weight: 600; color: var(--muted);
  border: 1px solid transparent; border-bottom: 2px solid transparent;
  border-radius: 8px 8px 0 0; text-decoration: none;
}
.page-tab:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.page-tab.active {
  color: var(--accent); border-bottom-color: var(--accent);
  background: var(--surface); border-color: var(--line); border-bottom-color: var(--accent);
}

.svc-toolbar { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.svc-toolbar .btn { font-weight: 600; }

/* menu dropdown (Export / Kolom) */
.menu { position: relative; }
.menu > summary {
  list-style: none; cursor: pointer; user-select: none;
}
.menu > summary::-webkit-details-marker { display: none; }
.menu .caret { font-size: 10px; opacity: .7; }
.menu-body {
  position: absolute; z-index: 60; top: calc(100% + 4px); left: 0; min-width: 220px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-lg); padding: 6px; display: flex; flex-direction: column; gap: 2px;
}
.menu-body a {
  padding: 8px 10px; border-radius: 7px; font-size: 12.5px; color: var(--ink-2); text-decoration: none;
}
.menu-body a:hover { background: var(--surface-2); color: var(--accent); text-decoration: none; }
.menu-kolom { padding: 8px 10px; gap: 8px; }
.menu-kolom .chk { font-size: 12.5px; }

/* baris filter */
.filter-bar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.filter-bar .fb { display: flex; flex-direction: column; gap: 4px; min-width: 130px; flex: 1 1 130px; }
.filter-bar .fb > span { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.filter-bar .fb .input { min-height: 34px; font-size: 12.5px; }
.filter-bar .fb-aksi { flex: 0 0 auto; }

/* tabel layanan */
.svc-table { font-size: 12.3px; }
.svc-table th { font-size: 10.5px; }
.svc-table td { padding: 9px 10px; vertical-align: top; }
.svc-table .sub { display: block; font-size: 10.8px; color: var(--muted); line-height: 1.35; }
.svc-table td[data-col="router"] { min-width: 190px; }
.svc-table td[data-col="koordinat"] { min-width: 130px; }
.svc-table td[data-col="register"] { min-width: 110px; white-space: nowrap; }
.rute-badge { text-decoration: none; font-size: 10px; gap: 3px; }
.rute-badge:hover { text-decoration: none; filter: brightness(.96); }

.svc-foot { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.svc-foot .pager { padding: 0; }

@media (max-width: 900px) {
  .filter-bar .fb { flex: 1 1 46%; }
  .svc-toolbar { gap: 6px; }
  .svc-toolbar .btn, .svc-toolbar .menu > summary { font-size: 11.5px; padding: 6px 9px; }
}

/* jam topbar */
.tb-clock { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; margin-right: 4px; }
.tb-clock small { font-size: 9.5px; color: var(--muted-2); letter-spacing: .02em; }
.tb-clock strong { font-size: 12px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
@media (max-width: 1180px) { .tb-clock small { display: none; } }
@media (max-width: 720px) { .tb-clock { display: none; } }

/* ===================== form pelanggan baru: konfigurasi mikrotik ===================== */

.mt-box { display: flex; flex-direction: column; gap: 12px; }
.mt-status-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 10px; border: 1px dashed var(--line-strong); border-radius: 10px; background: var(--surface-2);
}
.mt-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.mt-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-2); display: inline-block; }
.mt-status .dot.ok { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); }
.mt-status .dot.err { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.mt-status[data-state="ok"] { color: var(--ok); }
.mt-status[data-state="err"] { color: var(--danger); }
.mt-cache { font-size: 11.5px; color: var(--muted); }
.spin {
  width: 12px; height: 12px; border-radius: 50%; display: inline-block;
  border: 2px solid var(--line-strong); border-top-color: var(--accent);
  animation: mtSpin .7s linear infinite;
}
@keyframes mtSpin { to { transform: rotate(360deg); } }

.radio-pills { display: flex; gap: 8px; flex-wrap: wrap; margin: 2px 0 4px; }
.radio-pill { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.radio-pill input { accent-color: var(--accent); width: 15px; height: 15px; }
.radio-pill span { padding: 4px 2px; }

.mt-panel { display: none; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.mt-panel.active { display: block; }

#peta-picker { box-shadow: var(--shadow); }
#map-input { border-radius: var(--radius); }

/* peta port ODP */
.port-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.port-cell {
  border: 1px solid var(--line); border-radius: 9px; padding: 7px 8px; background: var(--surface-2);
  display: flex; flex-direction: column; gap: 1px; min-height: 62px;
}
.port-cell.isi { border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: var(--accent-soft); }
.port-no { font-size: 10.5px; font-weight: 800; color: var(--accent); }
.port-nama { font-size: 11.5px; font-weight: 600; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.port-nama:hover { color: var(--accent); text-decoration: none; }
.port-kode { font-size: 10px; color: var(--muted); }
.port-kosong { font-size: 11px; color: var(--muted-2); }
@media print { .port-cell { break-inside: avoid; } }

/* ===================== detail pelanggan: data pelanggan & live traffic ===================== */

.dp-top { align-items: start; }
.dp-card .card-body { padding-top: 12px; }
.dp-row {
  display: flex; gap: 12px; align-items: baseline;
  padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px;
}
.dp-row:last-of-type { border-bottom: 0; }
.dp-k { flex: 0 0 116px; color: var(--muted); font-weight: 600; }
.dp-v { flex: 1; min-width: 0; text-align: right; font-weight: 600; color: var(--ink); word-break: break-word; }
.dp-v .sub { display: block; font-weight: 400; font-size: 10.8px; color: var(--muted); }
.dp-note {
  display: flex; gap: 8px; align-items: flex-start; margin-top: 10px;
  padding: 9px 11px; border-radius: 9px; background: var(--surface-2);
  font-size: 12px; line-height: 1.45; color: var(--ink-2);
}
.dp-note.ok { background: var(--ok-soft); color: var(--ok); }
.dp-note.warn { background: var(--warn-soft); color: #92400e; }
:root[data-theme="dark"] .dp-note.warn { color: #fde68a; }
.dp-note .ico { margin-top: 2px; flex: 0 0 auto; }
.dp-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.dp-grid { gap: 18px 24px; }
.dp-grid .dp-row { font-size: 12px; }
.dp-grid .dp-k { flex-basis: 104px; }

.isolir-logika {
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2);
  padding: 10px 12px; margin-bottom: 12px;
}
.isolir-logika p { margin: 4px 0 0; }

/* live traffic */
.traffic-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 12px 0 6px; }
.ts-box {
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px;
  background: var(--surface-2); display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.ts-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.ts-val { font-size: 14px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.ts-update { font-size: 11px; font-weight: 600; }

.traffic-chart { position: relative; margin-top: 8px; }
.traffic-chart svg {
  width: 100%; height: 220px; display: block; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
}
.tc-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.tc-line.rx { stroke: #2563eb; }
.tc-line.tx { stroke: #16a34a; }
.tc-legend { display: flex; gap: 16px; justify-content: center; font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.tc-legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; vertical-align: middle; margin-right: 5px; }
.tc-legend i.rx { background: #2563eb; }
.tc-legend i.tx { background: #16a34a; }
.tc-status { text-align: center; margin-top: 4px; }

@media (max-width: 980px) {
  .dp-k { flex-basis: 100px; }
  .traffic-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .dp-row { flex-direction: column; gap: 2px; }
  .dp-v { text-align: left; }
  .traffic-chart svg { height: 170px; }
}
@media print {
  .traffic-chart svg, .dp-actions, #btn-toggle-traffic { display: none !important; }
}

/* ============ kartu Konfigurasi Mikrotik (form layanan) ============ */

.mt-sync-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.mt-sync-row.mt-sync-between { justify-content: space-between; margin-top: 14px; }
.mt-status {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 650;
  padding: 3px 9px; border-radius: 8px; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--line);
}
.mt-status[data-state="ok"] { color: #0d9488; border-color: color-mix(in srgb, var(--teal) 40%, transparent); background: color-mix(in srgb, var(--teal) 10%, var(--surface)); }
.mt-status[data-state="err"] { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: var(--danger-soft); }

.btn-sync {
  background: var(--surface); border: 1px solid color-mix(in srgb, var(--teal) 55%, transparent);
  color: #0f766e; font-weight: 650;
}
.btn-sync:hover { background: var(--teal-soft); color: #0f766e; }
:root[data-theme="dark"] .btn-sync { color: #5eead4; border-color: color-mix(in srgb, var(--teal) 45%, transparent); }
:root[data-theme="dark"] .btn-sync:hover { background: color-mix(in srgb, var(--teal) 18%, transparent); }

.mt-user-result { min-height: 16px; margin-top: 8px; line-height: 1.45; }

.mt-info-box {
  margin-top: 12px; border: 1px solid color-mix(in srgb, var(--teal) 30%, transparent);
  border-radius: 12px; background: color-mix(in srgb, var(--teal) 9%, var(--surface));
  padding: 12px 14px;
}
:root[data-theme="dark"] .mt-info-box { background: color-mix(in srgb, var(--teal) 12%, var(--surface)); }
.mt-info-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.mt-info-head strong { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: #0f766e; }
:root[data-theme="dark"] .mt-info-head strong { color: #5eead4; }
.mt-info-box p { margin: 3px 0; font-size: 12.6px; color: var(--ink-2); line-height: 1.5; }

.mt-panduan {
  margin-top: 12px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface-2); padding: 14px 16px;
}
.mt-panduan h4 { font-size: 13px; margin-bottom: 8px; }
.mt-panduan ol { margin: 0 0 10px; padding-left: 20px; font-size: 12.5px; line-height: 1.6; color: var(--ink-2); }
.mt-panduan li { margin-bottom: 6px; }

.info-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; border-radius: 50%; margin-left: 4px;
  border: 1px solid var(--line-strong); color: var(--muted); font-size: 10px; font-weight: 700;
  font-style: normal; cursor: help; vertical-align: middle;
}

/* baris pilihan user */
.mt-pilih-user { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 14px 0 10px; }
.mt-pilih-label { font-size: 12.5px; font-weight: 650; color: var(--ink-2); }
.mt-pilih-user .radio-pill { margin: 0; }
.mt-user-row { margin-bottom: 10px; }

/* baris info cache + Ambil Realtime (kotak penuh seperti gambar) */
.mt-cache-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--teal) 28%, transparent);
  background: color-mix(in srgb, var(--teal) 8%, var(--surface));
}
.mt-cache-text { flex: 1; min-width: 180px; font-size: 12.3px; color: var(--ink-2); }
.mt-cache-row .btn-sync { margin-left: auto; }

.mt-sync-hint { margin-top: 12px; }
.mt-sinkron-on .mt-info-box { border-color: color-mix(in srgb, var(--teal) 55%, transparent); }

@media (max-width: 860px) {
  .mt-sync-row.mt-sync-between { flex-direction: column; align-items: flex-start; }
  .mt-info-head { flex-direction: column; align-items: flex-start; }
  .mt-cache-row { flex-direction: column; align-items: flex-start; }
  .mt-cache-row .btn-sync { margin-left: 0; }
}
@media print { .mt-panduan, .btn-sync { display: none !important; } }
