/* =====================================================================
   Pantau NMS — tema terang "Aurora"
   Modern/futuristik tapi tetap padat informasi: kaca tipis, aksen gradien
   biru→cyan, angka monospace, status jelas.
   ===================================================================== */
:root {
  --bg: #eef2f8;
  --bg-2: #e6ecf5;
  --panel: rgba(255, 255, 255, .82);
  --panel-solid: #ffffff;
  --panel-2: #f3f6fb;
  --border: #dde4ef;
  --border-strong: #c8d3e3;
  --text: #0f1b2d;
  --muted: #5b6b82;
  --dim: #94a3b8;
  --accent: #2f6bff;
  --accent-2: #00b8d9;
  --accent-soft: rgba(47, 107, 255, .10);
  --grad: linear-gradient(135deg, #2f6bff 0%, #00b8d9 100%);
  --ok: #0ea371;
  --warn: #d98a00;
  --crit: #e5484d;
  --unknown: #8a97ab;
  --chart-grid: #e7ecf4;
  --chart-text: #7b8aa1;
  --font: "Inter", "Segoe UI Variable", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", "SFMono-Regular", Menlo, Consolas, monospace;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(15, 27, 45, .04), 0 6px 24px -8px rgba(31, 60, 120, .14);
  --shadow-lg: 0 24px 60px -12px rgba(20, 40, 90, .28);
  --ring: 0 0 0 3px rgba(47, 107, 255, .18);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; min-height: 100%; color: var(--text); font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1100px 600px at 100% -10%, rgba(0, 184, 217, .13), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(47, 107, 255, .12), transparent 60%),
    radial-gradient(rgba(47, 107, 255, .07) 1px, transparent 1px) 0 0 / 22px 22px,
    var(--bg);
  background-attachment: fixed;
}
::selection { background: rgba(47, 107, 255, .2); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
.mono, td.num, .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
h1 { font-size: 22px; margin: 0; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 15px; margin: 0 0 12px; font-weight: 650; letter-spacing: -.01em; }
h3 { font-size: 11.5px; margin: 0 0 8px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 12px;
  background: rgba(255, 255, 255, .7); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 10px 22px; font-weight: 750; font-size: 17px; letter-spacing: -.01em; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 11px; background: var(--grad); display: grid; place-items: center;
  font-size: 16px; color: #fff; box-shadow: 0 6px 18px -4px rgba(47, 107, 255, .55), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.brand small { display: block; font-weight: 500; font-size: 11px; color: var(--muted); letter-spacing: .02em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px;
  color: var(--muted); font-weight: 550; transition: background .15s, color .15s;
}
.nav a svg { flex: none; opacity: .8; transition: opacity .15s, transform .15s; }
.nav a:hover svg, .nav a.active svg { opacity: 1; }
.nav a:hover svg { transform: translateX(1px); }
.nav a:hover { background: var(--accent-soft); color: var(--text); text-decoration: none; }
.nav a.active {
  color: var(--accent); background: linear-gradient(90deg, rgba(47, 107, 255, .13), rgba(0, 184, 217, .06));
  box-shadow: inset 0 0 0 1px rgba(47, 107, 255, .16);
}
.nav a.active::before {
  content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--grad); box-shadow: 0 0 10px rgba(47, 107, 255, .6);
}
.nav .badge { margin-left: auto; }
.side-foot { margin-top: auto; padding: 12px 10px 4px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); }
.side-foot a { color: var(--muted); }
.side-foot a:hover { color: var(--accent); }
.main { padding: 26px 32px 48px; min-width: 0; }
.head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.head .sub { color: var(--muted); font-size: 13px; }
.head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { color: var(--muted); font-size: 12.5px; margin-bottom: 6px; letter-spacing: .01em; }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--accent); }

/* ---------- panels ---------- */
.panel, .stat {
  background: var(--panel); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.panel { padding: 16px 18px; margin-bottom: 18px; min-width: 0; }
.panel.flush { padding: 0; overflow: hidden; }
.panel.flush > h2 { padding: 16px 18px 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1200px) { .g6 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(2, 1fr); } }
/* sidebar parts: desktop shows brand + body stacked; mobile gets a top bar + drawer */
.side-body { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow-y: auto; }
.menu-btn, .m-title, .drawer-head, .nav-scrim { display: none; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side {
    position: sticky; top: 0; z-index: 40; height: auto; padding: 8px 12px 8px 14px; border-right: 0; border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, .94); backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .side-top { display: flex; align-items: center; gap: 10px; }
  .side-top .brand { padding: 0; font-size: 15px; gap: 9px; }
  .side-top .brand small { display: none; }
  .side-top .brand .logo, .drawer-head .logo { width: 30px; height: 30px; border-radius: 9px; }
  .m-title { display: block; color: var(--muted); font-weight: 600; font-size: 13.5px; padding-left: 10px; border-left: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .menu-btn {
    display: grid; place-items: center; position: relative; margin-left: auto; width: 40px; height: 40px; padding: 0; flex: none;
    border-radius: 11px; background: var(--panel-2); border: 1px solid var(--border); color: var(--text); box-shadow: none;
  }
  .menu-dot { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--crit); box-shadow: 0 0 0 2px #fff; }
  .side-body {
    position: fixed; top: 0; left: 0; bottom: 0; width: min(290px, 84vw); z-index: 61; padding: 12px 12px 16px;
    background: var(--panel-solid); box-shadow: var(--shadow-lg); transform: translateX(-105%); transition: transform .22s ease;
  }
  .drawer-head { display: flex; align-items: center; margin-bottom: 10px; }
  .drawer-head .brand { padding: 4px 6px; font-size: 16px; }
  .nav a { padding: 11px 12px; font-size: 15px; }
  .nav-scrim { display: block; position: fixed; inset: 0; z-index: 60; background: rgba(15, 27, 45, .32); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .app.nav-open .side-body { transform: none; }
  .app.nav-open .nav-scrim { opacity: 1; pointer-events: auto; }
  .main { padding: 16px 12px 40px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .head { margin-bottom: 14px; gap: 10px; }
  .head .actions { margin-left: 0; width: 100%; }
  h1 { font-size: 20px; }
  .panel { padding: 14px; margin-bottom: 14px; border-radius: 12px; }
  .panel.flush > h2 { padding: 14px 14px 0; }
  .tbl th { padding: 9px 10px; font-size: 10.5px; }
  .tbl td { padding: 8px 10px; font-size: 13px; }
  .modal-bg { padding: 12px 10px; }
  .modal { padding: 18px 16px; border-radius: 16px; }
}
@media (max-width: 520px) {
  .g6, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 12px 14px 10px; }
  .stat .value { font-size: 22px; }
}

.stat { position: relative; padding: 16px 18px 14px; overflow: hidden; }
.stat::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--grad); opacity: .85; }
.stat::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(47, 107, 255, .10), transparent 70%); pointer-events: none;
}
.stat .label { color: var(--muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.stat .value { font: 650 28px/1.2 var(--font-mono); margin-top: 8px; letter-spacing: -.02em; }
.stat .foot { color: var(--muted); font-size: 12px; margin-top: 4px; }
.stat.ok::before { background: linear-gradient(90deg, var(--ok), #34d6a0); }
.stat.crit::before { background: linear-gradient(90deg, var(--crit), #ff8a7a); }
.stat.warn::before { background: linear-gradient(90deg, var(--warn), #ffc44d); }
.stat.ok .value { color: var(--ok); } .stat.crit .value { color: var(--crit); } .stat.warn .value { color: var(--warn); }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-weight: 650; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em;
  padding: 11px 12px; background: rgba(243, 246, 251, .8); border-bottom: 1px solid var(--border); white-space: nowrap; cursor: default; user-select: none;
}
.tbl th.sort { cursor: pointer; }
.tbl th.sort:hover { color: var(--accent); }
.tbl td { padding: 9px 12px; border-bottom: 1px solid #edf1f7; vertical-align: middle; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: rgba(47, 107, 255, .045); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.num, .tbl th.num { text-align: right; white-space: nowrap; }
.tbl .muted { color: var(--muted); }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

/* ---------- status ---------- */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--unknown); vertical-align: middle; margin-right: 7px; flex: none; }
.dot.up, .dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(14, 163, 113, .16), 0 0 8px rgba(14, 163, 113, .5); }
.dot.down, .dot.crit { background: var(--crit); box-shadow: 0 0 0 3px rgba(229, 72, 77, .18), 0 0 8px rgba(229, 72, 77, .55); animation: pulse 1.6s infinite; }
.dot.snmp_down, .dot.warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(217, 138, 0, .16); }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(229, 72, 77, .05), 0 0 12px rgba(229, 72, 77, .35); } }
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 650;
  background: var(--panel-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap;
}
.badge.crit, .badge.critical { background: rgba(229, 72, 77, .09); color: var(--crit); border-color: rgba(229, 72, 77, .28); }
.badge.warn, .badge.warning { background: rgba(217, 138, 0, .10); color: #b06f00; border-color: rgba(217, 138, 0, .3); }
.badge.ok, .badge.up { background: rgba(14, 163, 113, .09); color: var(--ok); border-color: rgba(14, 163, 113, .28); }
.badge.live { background: rgba(229, 72, 77, .09); color: var(--crit); border-color: rgba(229, 72, 77, .32); }
.badge.live::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--crit); margin-right: 5px; vertical-align: 1px; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.val-warn { color: var(--warn); } .val-crit { color: var(--crit); } .val-ok { color: var(--text); }

.bar { position: relative; height: 6px; background: #e6ebf3; border-radius: 99px; overflow: hidden; min-width: 70px; }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--grad); border-radius: 99px; }
.bar.warn > i { background: linear-gradient(90deg, #f0a400, #ffc44d); } .bar.crit > i { background: linear-gradient(90deg, var(--crit), #ff8a7a); }

/* ---------- device tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.tile {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--panel-solid); border: 1px solid var(--border); color: var(--text); min-width: 0;
  transition: transform .12s, border-color .12s, box-shadow .12s;
}
.tile:hover { border-color: rgba(47, 107, 255, .45); box-shadow: 0 6px 18px -8px rgba(47, 107, 255, .45); transform: translateY(-1px); text-decoration: none; }
.tile .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.tile.down { border-color: rgba(229, 72, 77, .45); background: rgba(229, 72, 77, .05); }
.tile.snmp_down { border-color: rgba(217, 138, 0, .45); background: rgba(217, 138, 0, .04); }

/* ---------- forms ---------- */
button, .btn {
  font: inherit; font-size: 13px; font-weight: 550; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--panel-solid); color: var(--text); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  box-shadow: 0 1px 2px rgba(15, 27, 45, .05); transition: border-color .15s, box-shadow .15s, transform .08s, filter .15s;
}
button:hover { border-color: var(--border-strong); box-shadow: 0 3px 10px -4px rgba(15, 27, 45, .18); }
button:active { transform: translateY(1px); }
button:focus-visible { outline: none; box-shadow: var(--ring); }
button.primary {
  background: var(--grad); color: #fff; border-color: transparent; font-weight: 650;
  box-shadow: 0 6px 16px -6px rgba(47, 107, 255, .6), inset 0 1px 0 rgba(255, 255, 255, .25);
}
button.primary:hover { filter: brightness(1.06) saturate(1.1); box-shadow: 0 8px 22px -6px rgba(47, 107, 255, .7), inset 0 1px 0 rgba(255, 255, 255, .25); }
button.danger { color: var(--crit); }
button.danger:hover { border-color: rgba(229, 72, 77, .45); background: rgba(229, 72, 77, .05); }
button.small { padding: 4px 10px; font-size: 12px; border-radius: 8px; }
button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
input, select, textarea {
  font: inherit; font-size: 13px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--panel-solid); color: var(--text); width: 100%; transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--dim); }
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input:disabled { background: var(--panel-2); color: var(--muted); }
input[type=checkbox] { width: auto; accent-color: var(--accent); box-shadow: none; }
label.f { display: block; margin-bottom: 14px; }
label.f > span { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
label.f small { display: block; margin-top: 4px; color: var(--dim); font-size: 11.5px; }
label.chk { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; cursor: pointer; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0 12px; }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar input[type=search] { max-width: 300px; padding-left: 34px; background: var(--panel-solid) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 11px 50%; }
.toolbar select { width: auto; }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; }
.seg button { border: 0; border-radius: 7px; background: transparent; color: var(--muted); padding: 5px 11px; font-size: 12px; box-shadow: none; }
.seg button:hover { color: var(--text); box-shadow: none; }
.seg button + button { border-left: 0; }
.seg button.on { background: var(--panel-solid); color: var(--accent); box-shadow: 0 1px 3px rgba(15, 27, 45, .12); }
.seg button.on.live-on { color: var(--crit); }

.tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 18px; overflow-x: auto; background: rgba(255, 255, 255, .6); border: 1px solid var(--border); border-radius: 12px; width: fit-content; max-width: 100%; }
.tabs a { padding: 7px 14px; color: var(--muted); border-radius: 9px; font-weight: 600; font-size: 13px; white-space: nowrap; transition: background .15s, color .15s; }
.tabs a:hover { color: var(--text); background: var(--accent-soft); text-decoration: none; }
.tabs a.on { color: #fff; background: var(--grad); box-shadow: 0 4px 12px -4px rgba(47, 107, 255, .55); }

/* ---------- modal ---------- */
.modal-bg {
  position: fixed; inset: 0; background: rgba(15, 27, 45, .28); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: flex-start; justify-content: center; padding: 7vh 16px; z-index: 50; overflow-y: auto; animation: fade .15s;
}
.modal {
  background: var(--panel-solid); border: 1px solid var(--border); border-radius: 18px; width: 100%; max-width: 560px;
  padding: 24px 26px; box-shadow: var(--shadow-lg); animation: pop .18s cubic-bezier(.2, .9, .3, 1.2);
}
.modal h2 { font-size: 18px; margin-bottom: 18px; }
.modal .foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; padding-top: 14px; border-top: 1px solid #edf1f7; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.note { font-size: 12.5px; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--border); color: var(--muted); margin-bottom: 14px; white-space: pre-wrap; }
.note.err { color: var(--crit); background: rgba(229, 72, 77, .06); border-color: rgba(229, 72, 77, .3); }
.note.ok { color: var(--ok); background: rgba(14, 163, 113, .06); border-color: rgba(14, 163, 113, .3); }

/* ---------- toast ---------- */
#toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast {
  background: var(--panel-solid); border: 1px solid var(--border); border-left: 4px solid var(--accent); padding: 11px 16px;
  border-radius: 12px; min-width: 240px; max-width: 420px; box-shadow: var(--shadow-lg); animation: tin .2s;
}
.toast.err { border-left-color: var(--crit); } .toast.ok { border-left-color: var(--ok); }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }

/* ---------- charts ---------- */
.tc-wrap { position: relative; width: 100%; }
.tc-wrap canvas { display: block; }
.tc-tip {
  position: absolute; display: none; pointer-events: none; background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px);
  border: 1px solid var(--border); border-radius: 10px; padding: 8px 11px; font-size: 12px; white-space: nowrap; z-index: 5; box-shadow: var(--shadow-lg);
}
.tc-tip-t { color: var(--muted); margin-bottom: 3px; font-family: var(--font-mono); }
.tc-msg { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; color: var(--dim); font-size: 13px; pointer-events: none; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.tc-legend table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 8px; }
.tc-legend th { color: var(--dim); font-weight: 600; text-align: right; padding: 4px 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.tc-legend td { padding: 4px 8px; text-align: right; font-family: var(--font-mono); white-space: nowrap; }
.tc-legend td:first-child { text-align: left; font-family: var(--font); max-width: 380px; overflow: hidden; text-overflow: ellipsis; }
.tc-legend tbody tr { cursor: pointer; }
.tc-legend tbody tr:hover { background: var(--accent-soft); }
.tc-legend tr.off { opacity: .35; }
.gp-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.gp-head h2 { margin: 0; }
.gp-head .ctl { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.gp-head select { width: auto; padding: 5px 9px; font-size: 12px; border-radius: 8px; }
.gp-head .ctl span { white-space: nowrap; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; position: relative; overflow: hidden; }
.login::before, .login::after { content: ""; position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; pointer-events: none; }
.login::before { width: 420px; height: 420px; background: #8fb3ff; top: -120px; left: -80px; }
.login::after { width: 380px; height: 380px; background: #7fe3f2; bottom: -120px; right: -60px; }
.login .box {
  position: relative; z-index: 1; width: 100%; max-width: 380px; padding: 32px;
  background: rgba(255, 255, 255, .78); backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, .9); border-radius: 22px; box-shadow: var(--shadow-lg);
}
.login .brand { padding: 0 0 24px; justify-content: center; }
.login button.primary { width: 100%; justify-content: center; padding: 11px; font-size: 14px; }

.empty { color: var(--dim); text-align: center; padding: 34px 10px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 7px 12px; font-size: 13px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 10px 12px; color: var(--muted); font-size: 12px; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: sp .7s linear infinite; vertical-align: -2px; }
@keyframes sp { to { transform: rotate(360deg); } }

/* ---------- IP allocation grid ---------- */
.ipgrid { display: grid; gap: 3px; }
.ipc {
  position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 1.6; min-height: 22px;
  border-radius: 5px; font: 10.5px/1 var(--font-mono); color: rgba(255, 255, 255, .95); text-decoration: none;
  border: 1px solid rgba(15, 27, 45, .05); transition: transform .1s;
}
.ipc:hover { outline: 2px solid var(--accent); outline-offset: 1px; transform: scale(1.08); text-decoration: none; z-index: 1; }
.ipc.free { color: #8a97ab; }
.ipc.special { color: #b6c0cf; cursor: default; }
.ipc.special:hover { transform: none; outline: 0; }
.ipc i { position: absolute; top: 2px; right: 2px; width: 5px; height: 5px; border-radius: 50%; background: #fff; box-shadow: 0 0 5px #fff, 0 0 2px rgba(15, 27, 45, .4); }

/* ---------- motion preference ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- upstream ---------- */
.up-card { border-top: 0; }
.up-card::before { background: var(--uc, var(--accent)) !important; }
.up-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--uc, var(--accent)); margin-right: 6px; vertical-align: 1px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--uc, var(--accent)) 18%, transparent); }
.up-h3 { font-size: 13px; font-weight: 650; margin: 16px 0 8px; color: var(--text); }
.up-h3:first-child { margin-top: 0; }
.chip { display: inline-block; padding: 1px 7px; border-radius: 999px; background: var(--chip-bg, rgba(47,107,255,.08)); border: 1px solid rgba(47,107,255,.18); font-size: 11.5px; margin: 1px 0; }
[hidden] { display: none !important; }

/* ---------- NOC maps ---------- */
.gp-t { min-width: 0; }
.gp-t h2 a { color: inherit; }
.gp-t h2 a:hover { color: var(--accent); }
.gp-sub { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gp-head.compact { margin-bottom: 6px; flex-wrap: nowrap; }
.gp-head.compact h2 { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-grid { display: grid; gap: 14px; grid-template-columns: repeat(var(--map-cols, 3), minmax(0, 1fr)); }
.map-grid .panel { margin-bottom: 0; }
.map-cell { position: relative; padding: 12px 14px 10px; }
.map-tools { position: absolute; top: 8px; right: 10px; z-index: 3; display: flex; gap: 4px; }
.map-tools button { background: var(--panel-solid); }
.map-edit-bar { margin-bottom: 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.map-head .actions { flex-wrap: wrap; }
.map-card { display: flex; gap: 12px; align-items: flex-start; color: inherit; text-decoration: none; transition: transform .12s, box-shadow .12s; }
.map-card:hover { transform: translateY(-2px); }
.map-card-ic { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.map-src { max-height: 300px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 10px; }
.map-src tr.sel td { background: var(--accent-soft); }
.brand-mini { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--grad); flex: 0 0 auto; }
@media (max-width: 760px) { .map-grid { grid-template-columns: 1fr; } }
/* NOC / kiosk: no sidebar, tighter spacing */
body.kiosk .app { grid-template-columns: 1fr; }
body.kiosk .side { display: none; }
body.kiosk .main { padding: 14px 16px 20px; }
body.kiosk .map-head { margin-bottom: 12px; }
body.kiosk .map-head h1 { font-size: 19px; }
body.kiosk #mp-clock { font-family: var(--font-mono); font-size: 13px; }
.gp-util { margin-left: auto; flex: 0 0 auto; }
.gp-util .badge { font-size: 12px; font-weight: 700; }
/* map cells adapt their legend to the cell width (4-6 columns on a 1080p screen) */
.map-cell { container-type: inline-size; overflow: hidden; }
.map-cell .tc-legend table { margin-top: 4px; }
.map-cell .tc-legend th, .map-cell .tc-legend td { padding: 3px 5px; }
.map-cell .tc-legend td:first-child { max-width: none; }
@container (max-width: 430px) {
  .tc-legend th:nth-child(3), .tc-legend td:nth-child(3), .tc-legend th:nth-child(5), .tc-legend td:nth-child(5) { display: none; }
  .tc-legend th, .tc-legend td { font-size: 11px; padding: 2px 4px; }
}
@container (max-width: 250px) {
  .tc-legend th:nth-child(4), .tc-legend td:nth-child(4) { display: none; }
}

/* ---------- dashboard ---------- */
.d-h { display: flex; align-items: center; gap: 10px; }
.d-more { margin-left: auto; font-size: 12px; font-weight: 500; }
.d-note { font-size: 12px; font-weight: 400; }
.d-of { font-size: 15px; color: var(--muted); font-weight: 500; margin-left: 2px; }
.d-upg { padding: 6px 18px 12px; }
.d-upg + .d-upg { border-top: 1px solid var(--border); padding-top: 12px; }
.d-upg-h { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; margin-bottom: 6px; }
.d-upr { display: grid; grid-template-columns: minmax(120px, 1.3fr) 2fr minmax(90px, auto); gap: 10px; align-items: center; font-size: 12.5px; padding: 3px 0; }
.d-upn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-upb { height: 7px; border-radius: 4px; background: var(--panel-2); overflow: hidden; }
.d-upb i { display: block; height: 100%; border-radius: 4px; }
.d-upv { text-align: right; white-space: nowrap; }
.d-peers-h { padding: 14px 18px 10px; flex-wrap: wrap; }
.d-peers-h .seg button { display: inline-flex; align-items: center; gap: 6px; }
.d-peers-h .seg .dot { width: 8px; height: 8px; }
.d-peers-h input[type=search] { width: 220px; padding: 6px 10px; font-size: 12.5px; }
.d-peers { max-height: 520px; overflow: auto; }
.d-peers thead th { position: sticky; top: 0; background: var(--panel-solid); z-index: 1; }
tr.d-row-down td { background: rgba(229, 72, 77, .06); }

/* upstream asymmetry */
.asy-bar{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:10px;font-size:13px}
.asy-bar select{width:auto}
.asy-bar input[type=search]{margin-left:auto;min-width:180px;max-width:280px}
.asy-sum{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px;margin-bottom:10px}
.asy-sum>div{border:1px solid var(--border);border-radius:8px;padding:10px 12px;font-size:12px}
.asy-sum b{font-size:18px}
.asy-car{display:inline-block;transition:transform .15s;color:var(--muted)}
tr.asy-as.open .asy-car{transform:rotate(90deg)}
tr.asy-sub>td{background:var(--bg);padding-top:4px;padding-bottom:12px}
.asy-sub-h{display:flex;align-items:center;justify-content:space-between;margin:2px 0 6px}

/* blacklist */
.bl-ck{display:flex;gap:6px}
.bl-ck input{width:220px}
.bl-h-note{font-size:12px;font-weight:400;margin-left:6px}
tr.bl-row.open .asy-car{transform:rotate(90deg)}
.bl-how{border:1px solid var(--border);border-radius:8px;padding:10px 12px;margin:4px 0 8px;font-size:12.5px;background:var(--panel-solid)}
.bl-how-h{display:flex;align-items:center;gap:8px;margin-bottom:6px;flex-wrap:wrap}
.bl-guide summary{cursor:pointer}
.bl-guide ol{margin:10px 0 0;padding-left:20px;font-size:13px;line-height:1.6}
a.btn{display:inline-block;text-decoration:none}
a.btn.small{padding:4px 10px;font-size:12px;border-radius:8px}
a.btn.primary{background:var(--grad);color:#fff;border-color:transparent;font-weight:650}
/* RBAC */
.rbac-tbl td, .rbac-tbl th { white-space: nowrap; }
.rbac-form td { vertical-align: top; }
.rbac-quick { font-size: 12px; margin: 0 0 8px; }
