/* Bastion PAM — tema gelap "pusat kendali" */
:root {
  color-scheme: dark;
  --void: #070d18;
  --deck: #0e1729;
  --deck-2: #13203a;
  --deck-3: #182a4a;
  --grid: #1e2e4d;
  --grid-hi: #2c4470;
  --text: #dce6f5;
  --text-dim: #8193b0;
  --text-faint: #56688a;
  --ion: #45c2ff;
  --ion-deep: #1a7fc0;
  --flux: #9b87ff;
  --read: #6f84a6;
  --change: #ffb547;
  --danger: #ff5577;
  --ok: #34e0a1;
  --display: "Chakra Petch", "Rajdhani", "Segoe UI", system-ui, sans-serif;
  --sans: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --mono: "JetBrains Mono", "IBM Plex Mono", "Cascadia Mono", Consolas, ui-monospace, monospace;
  --cut: 14px;
  --r: 6px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 14px/1.55 var(--sans); color: var(--text); background: var(--void);
  background-image:
    radial-gradient(1200px 600px at 85% -10%, rgba(69,194,255,.07), transparent 60%),
    linear-gradient(rgba(30,46,77,.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30,46,77,.35) 1px, transparent 1px);
  background-size: auto, 48px 48px, 48px 48px;
  background-attachment: fixed;
}
a { color: var(--ion); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: 13px; }
:focus-visible { outline: 2px solid var(--ion); outline-offset: 2px; }
::selection { background: rgba(69,194,255,.35); }
h1 { font: 600 26px/1.15 var(--display); margin: 0; letter-spacing: .01em; }
h2 { font: 600 16px/1.3 var(--display); margin: 0 0 12px; letter-spacing: .02em; color: var(--text); }
.muted { color: var(--text-dim); }
.hidden { display: none !important; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--grid-hi); border-radius: 5px; border: 2px solid var(--void); }
::-webkit-scrollbar-track { background: transparent; }

/* Panel bersudut terpotong — motif panel perangkat keras */
.chamfer { clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut))); }

/* ================================ Login ================================ */
.login { position: relative; min-height: 100%; display: grid; grid-template-columns: 1fr minmax(340px, 420px); align-items: center; gap: 48px; padding: 48px clamp(24px, 6vw, 96px); overflow: hidden; background: radial-gradient(circle at 30% 40%, #0c1a3b 0%, #060e20 50%, #030611 100%); }
#net { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.login > :not(canvas) { position: relative; z-index: 1; }
.login-hero { max-width: 560px; align-self: end; padding-bottom: 8vh; }
.login-hero .mark { display: flex; align-items: center; gap: 12px; font: 600 15px var(--display); letter-spacing: .08em; color: var(--ion); margin-bottom: 28px; }
.login-hero h1 { font-size: clamp(38px, 5.2vw, 68px); line-height: 1.02; font-weight: 600; letter-spacing: -.01em; }
.login-hero h1 span { display: block; color: var(--text-dim); }
.login-hero p { color: var(--text-dim); font-size: 16px; max-width: 46ch; margin: 22px 0 0; }
.login-hero .legend { display: flex; gap: 20px; margin-top: 28px; font-size: 13px; color: var(--text-dim); flex-wrap: wrap; }
.login-hero .legend i { display: inline-block; width: 10px; height: 10px; margin-right: 7px; vertical-align: -1px; }
.login-panel {
  --cut: 22px;
  background: linear-gradient(180deg, rgba(12,24,45,.95), rgba(7,14,26,.97));
  border: 1px solid var(--grid-hi); padding: 36px 16px 30px; display: flex; flex-direction: column; gap: 16px;
  backdrop-filter: blur(6px); box-shadow: 0 30px 80px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.04);
}
.login-panel .login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--ion);
  font: 600 14px var(--display);
  letter-spacing: .08em;
  margin-bottom: 6px;
  text-align: center;
}
.login-panel .brand-shield {
  display: block;
  width: 84px;
  max-width: 100%;
  height: auto;
  flex: none;
  filter:
    drop-shadow(0 0 1px rgba(0, 210, 255, 0.55))
    drop-shadow(0 0 10px rgba(0, 180, 255, 0.32))
    drop-shadow(0 6px 16px rgba(0, 30, 80, 0.45));
  transition: transform .25s cubic-bezier(0.16, 1, 0.3, 1), filter .25s ease;
}
.login-panel .brand-shield:hover {
  transform: translateY(-2px) scale(1.02);
  filter:
    drop-shadow(0 0 1.5px rgba(0, 230, 255, 0.75))
    drop-shadow(0 0 14px rgba(0, 200, 255, 0.45))
    drop-shadow(0 8px 20px rgba(0, 40, 100, 0.55));
}
.login-panel .brand-text-img {
  display: block;
  width: 200px;
  max-width: 100%;
  height: auto;
  flex: none;
  filter: none !important;
  text-shadow: none !important;
  box-shadow: none !important;
}
.login-panel .login-brand > img:only-child {
  display: block;
  width: 210px;
  max-width: 100%;
  height: auto;
  flex: none;
  filter: none !important;
}
.login-panel .ph { display: flex; justify-content: space-between; align-items: baseline; }
.login-panel .ph.login-heading { justify-content: center; }
.login-panel .ph h2 { font-size: 22px; margin: 0; }
.login-panel .ph span { font: 500 12px var(--mono); color: var(--ok); }
.login-panel .ph span::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-right: 6px; box-shadow: 0 0 10px var(--ok); }
.login-panel .foot { font-size: 12px; color: var(--text-faint); border-top: 1px solid var(--grid); padding-top: 14px; margin-top: 4px; }
.login-panel .btn.primary { padding: 11px; font-size: 15px; }
.login-panel .mfa-help { margin: 0; color: var(--text-dim); font-size: 13px; }
.login-panel .mfa-qr { width: 196px; height: 196px; align-self: center; padding: 8px; background: #fff; border-radius: 4px; image-rendering: pixelated; }
.login-panel .mfa-manual summary { color: var(--ion); cursor: pointer; font-size: 13px; margin-bottom: 8px; }
.login-panel .mfa-secret { display: block; padding: 10px; border: 1px solid var(--grid); color: var(--ion); background: rgba(7,13,24,.7); overflow-wrap: anywhere; user-select: all; }
@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; gap: 24px; padding: 28px 20px; }
  .login-hero { padding-bottom: 0; align-self: start; }
  .login-hero .legend { display: none; }
  #net { opacity: .3; }
}

/* ================================ Shell ================================ */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100%; }
.rail { background: rgba(10,18,33,.92); border-right: 1px solid var(--grid); padding: 20px 12px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto; backdrop-filter: blur(8px); }
.rail .brand { display: flex; align-items: center; gap: 8px; color: var(--text); font: 600 17px var(--display); letter-spacing: .04em; padding: 2px 10px 20px; }
.rail .brand img { width: 22px; height: 25px; object-fit: contain; flex: none; }
.rail .group { font: 500 12px var(--display); letter-spacing: .06em; color: var(--text-faint); padding: 16px 10px 6px; }
.rail button.nav { all: unset; cursor: pointer; padding: 8px 10px; border-radius: var(--r); color: var(--text-dim); display: flex; align-items: center; gap: 10px; position: relative; }
.rail button.nav svg { width: 16px; height: 16px; flex: none; opacity: .8; }
.rail button.nav:hover { color: var(--text); background: rgba(69,194,255,.06); }
.rail button.nav.on { color: #fff; background: linear-gradient(90deg, rgba(69,194,255,.16), rgba(69,194,255,.02)); }
.rail button.nav.on::before { content: ""; position: absolute; left: -12px; top: 6px; bottom: 6px; width: 3px; background: var(--ion); box-shadow: 0 0 12px var(--ion); border-radius: 0 2px 2px 0; }
.rail button.nav.on svg { opacity: 1; color: var(--ion); }
.rail button.nav:focus-visible { outline: 2px solid var(--ion); }
.rail .me { margin-top: auto; border-top: 1px solid var(--grid); padding: 14px 10px 0; font-size: 13px; color: var(--text-dim); }
.rail .me b { color: var(--text); }
.rail .me button { all: unset; cursor: pointer; color: var(--ion); margin-right: 14px; }
.rail .me button:hover { text-decoration: underline; }
.rail .copyright { margin-top: 10px; color: var(--text-faint); font-size: 10px; line-height: 1.4; }
.main { padding: 26px 30px 56px; min-width: 0; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.head p { margin: 6px 0 0; color: var(--text-dim); max-width: 72ch; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--grid); }
  .rail .group, .rail .me, .rail button.nav.on::before { display: none; }
  .rail .brand { width: 100%; padding-bottom: 8px; }
  .main { padding: 18px 14px; }
}

/* =============================== Controls ============================== */
label.f { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--text-dim); }
input, select, textarea { font: inherit; color: var(--text); background: rgba(7,13,24,.7); border: 1px solid var(--grid-hi); border-radius: var(--r); padding: 8px 10px; min-width: 0; }
input::placeholder, textarea::placeholder { color: var(--text-faint); }
input:focus, select:focus, textarea:focus { border-color: var(--ion); outline: none; box-shadow: 0 0 0 3px rgba(69,194,255,.18); }
input[type=checkbox] { accent-color: var(--ion); width: 16px; height: 16px; }
input[type=date]::-webkit-calendar-picker-indicator { filter: invert(.8); }
select option { background: var(--deck); }
.btn { font: 500 14px var(--sans); border: 1px solid var(--grid-hi); background: var(--deck-2); color: var(--text); border-radius: var(--r); padding: 7px 13px; cursor: pointer; white-space: nowrap; display: inline-block; text-decoration: none !important; transition: border-color .15s, background .15s, box-shadow .15s; }
.btn:hover { border-color: var(--ion-deep); background: var(--deck-3); }
.btn.primary { background: linear-gradient(180deg, #4cc8ff, #2a9ae0); border-color: #5fd0ff; color: #04111f; font-weight: 600; }
.btn.primary:hover { box-shadow: 0 0 0 1px #8fdfff, 0 0 22px rgba(69,194,255,.35); background: linear-gradient(180deg, #6ad3ff, #35a7ec); }
.btn.danger { color: var(--danger); border-color: rgba(255,85,119,.35); }
.btn.danger:hover { background: rgba(255,85,119,.1); border-color: var(--danger); }
.btn.small { padding: 4px 9px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: default; box-shadow: none; }
.btns { display: flex; gap: 6px; flex-wrap: wrap; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; background: rgba(14,23,41,.85); border: 1px solid var(--grid); border-radius: var(--r); padding: 14px; margin-bottom: 14px; }
.filters label.f { min-width: 130px; }

/* ================================ Tables =============================== */
.tablewrap { background: rgba(14,23,41,.88); border: 1px solid var(--grid); border-radius: var(--r); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font: 500 12px var(--display); letter-spacing: .05em; color: var(--text-dim); background: rgba(19,32,58,.9); padding: 10px 12px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
td { padding: 9px 12px; border-bottom: 1px solid rgba(30,46,77,.6); vertical-align: top; }
tbody tr:hover td { background: rgba(69,194,255,.035); }
tr:last-child td { border-bottom: 0; }
td.cmd { font-family: var(--mono); font-size: 13px; white-space: pre-wrap; word-break: break-all; max-width: 640px; color: #c8d6ee; }
tr.cat-change td:first-child { box-shadow: inset 3px 0 0 var(--change); }
tr.cat-danger td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
tr.cat-danger td { background: rgba(255,85,119,.05); }
.empty { padding: 36px; text-align: center; color: var(--text-dim); }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 12px 0; color: var(--text-dim); font-size: 13px; }

.tag { display: inline-block; font: 500 12px/1.6 var(--sans); padding: 0 8px; border-radius: 3px; background: rgba(111,132,166,.14); color: var(--text-dim); white-space: nowrap; border: 1px solid rgba(111,132,166,.22); }
.tag.read { color: #a6b5cf; }
.tag.change { background: rgba(255,181,71,.1); border-color: rgba(255,181,71,.35); color: var(--change); }
.tag.danger { background: rgba(255,85,119,.12); border-color: rgba(255,85,119,.4); color: #ff8aa2; }
.tag.ok { background: rgba(52,224,161,.1); border-color: rgba(52,224,161,.35); color: var(--ok); }
.tag.fail { background: rgba(255,85,119,.12); border-color: rgba(255,85,119,.4); color: #ff8aa2; }
.tag.proto { background: rgba(69,194,255,.08); border-color: rgba(69,194,255,.3); color: var(--ion); font-family: var(--mono); font-size: 11.5px; }
.live { display: inline-flex; align-items: center; gap: 7px; color: var(--ok); font-weight: 500; }
.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); animation: pulse 1.8s infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }

/* =============================== Dashboard ============================= */
.cc-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.cc-head .clock { text-align: right; }
.cc-head .clock b { display: block; font: 500 30px/1 var(--display); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.cc-head .clock span { font-size: 13px; color: var(--text-dim); }
.posture { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 5px 12px; border: 1px solid; border-radius: 3px; font-size: 13px; }
.posture.ok { color: var(--ok); border-color: rgba(52,224,161,.4); background: rgba(52,224,161,.07); }
.posture.warn { color: var(--change); border-color: rgba(255,181,71,.45); background: rgba(255,181,71,.07); }
.posture.alert { color: #ff8aa2; border-color: rgba(255,85,119,.5); background: rgba(255,85,119,.08); }

.hud { display: grid; grid-template-columns: 1.3fr repeat(4, 1fr); gap: 1px; background: var(--grid); border: 1px solid var(--grid); margin-bottom: 18px; }
.hud > div { background: rgba(14,23,41,.94); padding: 16px 18px; position: relative; min-width: 0; }
.hud b { display: block; font: 600 34px/1.05 var(--display); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.hud span { font-size: 13px; color: var(--text-dim); }
.hud small { display: block; font-size: 12px; color: var(--text-faint); margin-top: 6px; }
.hud .lead { background: linear-gradient(135deg, rgba(69,194,255,.16), rgba(155,135,255,.08) 70%), rgba(14,23,41,.94); }
.hud .lead b { font-size: 48px; color: #fff; text-shadow: 0 0 24px rgba(69,194,255,.45); }
.hud .warn b { color: var(--change); }
.hud .alert b { color: var(--danger); text-shadow: 0 0 18px rgba(255,85,119,.35); }
@media (max-width: 1100px) { .hud { grid-template-columns: repeat(2, 1fr); } .hud .lead { grid-column: 1 / -1; } }

.grid2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 18px; margin-bottom: 18px; align-items: start; }
@media (max-width: 1100px) { .grid2 { grid-template-columns: 1fr; } }
.panel { background: rgba(14,23,41,.9); border: 1px solid var(--grid); padding: 18px; position: relative; }
.panel.chamfer { border: 0; background: linear-gradient(var(--grid-hi), var(--grid)) ; padding: 1px; }
.panel.chamfer > .in { background: rgba(14,23,41,.97); padding: 18px; height: 100%; clip-path: inherit; }
.panel-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.panel-h h2 { margin: 0; }
.panel-h span { font-size: 12px; color: var(--text-dim); }

.chart { width: 100%; height: 220px; display: block; }
.chart .axis { stroke: var(--grid); }
.chart text { fill: var(--text-faint); font: 11px var(--mono); }
.chart-legend { display: flex; gap: 16px; font-size: 12px; color: var(--text-dim); }
.chart-legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; }

.ledger { display: flex; flex-direction: column; }
.ledger .row { display: grid; grid-template-columns: 3px 1fr; border-bottom: 1px solid rgba(30,46,77,.7); }
.ledger .row:last-child { border-bottom: 0; }
.ledger .stripe { background: var(--grid-hi); }
.ledger .stripe.change { background: var(--change); box-shadow: 0 0 8px rgba(255,181,71,.5); }
.ledger .stripe.danger { background: var(--danger); box-shadow: 0 0 8px rgba(255,85,119,.6); }
.ledger .stripe.live { background: var(--ok); box-shadow: 0 0 8px rgba(52,224,161,.5); }
.ledger .body { padding: 10px 14px; min-width: 0; }
.ledger .body code { display: block; white-space: pre-wrap; word-break: break-all; margin-bottom: 4px; color: #d3e0f5; }
.ledger .meta { font-size: 12px; color: var(--text-dim); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.bars { display: flex; flex-direction: column; gap: 10px; }
.bars .b { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 13px; }
.bars .b .track { grid-column: 1 / -1; height: 6px; background: var(--deck-3); border-radius: 3px; overflow: hidden; }

/* =============================== Network map ========================== */
.network-controls { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.network-controls label.f { flex: 1 1 210px; }
.network-hint { color: var(--text-dim); font-size: 12px; padding: 8px 0; }
.network-map { position: relative; overflow: hidden; min-height: 290px; padding: 22px clamp(14px, 4vw, 48px) 28px; border: 1px solid var(--grid); background: radial-gradient(ellipse at 50% 0, rgba(69,194,255,.09), transparent 55%), repeating-linear-gradient(0deg, transparent 0 27px, rgba(44,68,112,.12) 28px), repeating-linear-gradient(90deg, transparent 0 27px, rgba(44,68,112,.12) 28px), rgba(8,15,28,.9); }
.network-origin { position: relative; z-index: 1; display: flex; justify-content: center; align-items: center; gap: 10px; font: 600 13px var(--display); letter-spacing: .08em; color: var(--ion); }
.network-origin > span:last-child { color: var(--text-dim); font: 12px var(--sans); letter-spacing: 0; }
.network-origin-dot, .host-indicator { width: 8px; height: 8px; border-radius: 50%; background: var(--ion); box-shadow: 0 0 12px rgba(69,194,255,.8); }
.network-backbone { position: relative; height: 38px; width: 2px; margin: 0 auto; background: linear-gradient(180deg, rgba(69,194,255,.8), rgba(69,194,255,.18)); }
.network-backbone::after { content: ""; position: absolute; top: 0; left: -2px; width: 6px; height: 15px; background: var(--ion); filter: drop-shadow(0 0 5px var(--ion)); animation: network-flow 2.6s linear infinite; }
@keyframes network-flow { from { transform: translateY(-12px); opacity: 0 } 15% { opacity: 1 } to { transform: translateY(40px); opacity: 0 } }
.network-segment { position: relative; z-index: 1; border: 1px solid rgba(69,194,255,.28); background: rgba(14,23,41,.94); box-shadow: 0 0 30px rgba(0,0,0,.2), inset 0 1px rgba(255,255,255,.025); }
.network-segment::before { content: ""; position: absolute; width: 2px; height: 19px; left: 50%; top: -20px; background: rgba(69,194,255,.35); }
.network-segment > header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--grid); }
.network-segment > header h2 { margin: 4px 0 0; font: 500 15px var(--mono); }
.network-kicker { color: var(--text-faint); font: 11px var(--mono); letter-spacing: .08em; }
.network-hosts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr)); gap: 10px; padding: 14px; }
.network-host { position: relative; display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 11px 12px; border: 1px solid var(--grid); background: rgba(7,13,24,.7); animation: host-arrive .35s both; }
@keyframes host-arrive { from { opacity: 0; transform: translateY(5px) } to { opacity: 1; transform: translateY(0) } }
.network-host .host-indicator { position: absolute; top: 14px; right: 12px; width: 6px; height: 6px; background: var(--ok); box-shadow: 0 0 8px rgba(52,224,161,.7); }
.network-host.is-target { border-color: var(--ion); box-shadow: 0 0 16px rgba(69,194,255,.2); }
.network-host b { padding-right: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.network-host code, .host-detail { color: var(--text-dim); font-size: 11px; overflow-wrap: anywhere; }
.host-detail { color: var(--text-faint); }
.network-segment > footer { padding: 9px 14px; color: var(--text-faint); font-size: 11px; border-top: 1px solid var(--grid); }
.network-empty { grid-column: 1 / -1; padding: 20px; text-align: center; color: var(--text-dim); }
.network-sweep { position: absolute; inset: 0; pointer-events: none; opacity: .13; background: linear-gradient(transparent 0 48%, rgba(69,194,255,.2) 50%, transparent 52%); background-size: 100% 120px; animation: network-sweep 8s linear infinite; }
@keyframes network-sweep { to { background-position-y: 120px } }
.route-panel { margin-top: 16px; }
.route-panel .panel-h { align-items: center; }
.route-panel .panel-h h2 { margin: 0 0 4px; }
.route-panel .panel-h h2 code { color: var(--ion); font-size: inherit; }
.route-track { display: flex; flex-direction: column; }
.route-hop { display: grid; grid-template-columns: 36px 2px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 54px; opacity: 0; animation: hop-arrive .35s ease-out forwards; animation-delay: calc(var(--hop-index) * 140ms); }
@keyframes hop-arrive { from { opacity: 0; transform: translateX(-8px) } to { opacity: 1; transform: translateX(0) } }
.hop-number { color: var(--ion); font: 12px var(--mono); }
.hop-line { height: 100%; min-height: 54px; position: relative; background: rgba(69,194,255,.25); }
.hop-line::after { content: ""; position: absolute; left: -2px; top: 0; width: 6px; height: 10px; background: var(--ion); box-shadow: 0 0 8px var(--ion); animation: network-flow 1.4s linear infinite; }
.route-hop b, .route-hop div span { display: block; }
.route-hop b { font: 500 13px var(--mono); }
.route-hop div span { color: var(--text-dim); font-size: 12px; }
.route-hop > code { color: var(--text-dim); font-size: 12px; }
.route-note { color: var(--text-dim); font-size: 12px; border-top: 1px solid var(--grid); padding-top: 12px; margin: 12px 0 0; }
.route-loading { display: flex; align-items: center; gap: 12px; padding: 26px 10px; }
.route-loading b, .route-loading span { display: block; }
.route-loading > div span { color: var(--text-dim); font-size: 12px; margin-top: 3px; }
.route-spinner { width: 22px; height: 22px; border: 2px solid var(--grid-hi); border-top-color: var(--ion); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }
@media (max-width: 600px) { .network-controls { align-items: stretch; } .network-controls .btn { flex: 1; } .network-segment > header { align-items: flex-start; } .route-hop { grid-template-columns: 30px 2px minmax(0, 1fr) auto; gap: 8px; } }
@media (prefers-reduced-motion: reduce) { .network-backbone::after, .network-sweep, .hop-line::after, .route-spinner { animation: none; } .network-host, .route-hop { animation: none; opacity: 1; } }
.bars .b .fill { height: 100%; background: linear-gradient(90deg, var(--ion-deep), var(--ion)); box-shadow: 0 0 10px rgba(69,194,255,.5); }
.connection-notices { margin: 16px 0; }
.resources { margin: 16px 0; }
.res-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; padding-top: 6px; }
.res-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; color: var(--text-dim); }
.res-h b { color: var(--text); font-size: 18px; }
.res .track { height: 8px; background: var(--grid); border-radius: 4px; overflow: hidden; }
.res .fill { height: 100%; background: linear-gradient(90deg, var(--ion-deep), var(--ion)); transition: width .4s; }
.res.warn .fill { background: #ffb547; }
.res.alert .fill { background: #ff5577; }
.res.warn .res-h b { color: #ffb547; }
.res.alert .res-h b { color: #ff5577; }
.rt-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #3ddc97; box-shadow: 0 0 6px #3ddc97; animation: rt-pulse 2s ease-in-out infinite; }
@keyframes rt-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .rt-dot { animation: none; } }
.res-d { margin-top: 6px; font-size: 12px; color: var(--text-faint); overflow-wrap: anywhere; }

/* ================================ Dialog =============================== */
dialog { --cut: 18px; border: 0; padding: 1px; width: min(640px, 94vw); color: var(--text); background: linear-gradient(160deg, var(--ion-deep), var(--grid) 40%); box-shadow: 0 30px 90px rgba(0,0,0,.6); }
dialog > * { background: var(--deck); }
dialog::backdrop { background: rgba(3,7,14,.72); backdrop-filter: blur(3px); }
dialog form, dialog .dbody { padding: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
dialog .full { grid-column: 1 / -1; }
dialog .dhead { padding: 16px 20px; border-bottom: 1px solid var(--grid); font: 600 17px var(--display); letter-spacing: .02em; }
dialog .dfoot { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; padding-top: 6px; }
dialog .hint { font-size: 12px; color: var(--text-faint); }
dialog .set-row { display: flex; gap: 8px; align-items: stretch; }
dialog .set-row input { flex: 1; min-width: 0; }
dialog .set-status { font-size: 12px; color: var(--text-dim); }
dialog .set-status[data-kind="ok"] { color: var(--ok, #3ddc97); }
dialog .set-status[data-kind="warn"] { color: #ffb547; }
dialog .set-status[data-kind="err"] { color: #ff8aa2; }
.checklist { max-height: 340px; overflow-y: auto; border: 1px solid var(--grid); border-radius: var(--r); padding: 6px 12px; }
.checklist label { display: flex; gap: 10px; align-items: center; padding: 5px 0; }

.toast { position: fixed; bottom: 22px; right: 22px; background: var(--deck-2); color: var(--text); border: 1px solid var(--ion-deep); border-left: 3px solid var(--ion); padding: 11px 16px; max-width: 440px; z-index: 50; box-shadow: 0 12px 40px rgba(0,0,0,.5); }
.toast.err { border-color: rgba(255,85,119,.5); border-left-color: var(--danger); }
.error-text { color: #ff8aa2; font-size: 13px; min-height: 1em; }
.password-strength { display: grid; gap: 6px; font-size: 12px; }
.password-strength-heading { color: var(--text-dim); }
.password-strength[data-level="red"] .password-strength-state,
.password-strength[data-level="red"] .password-strength-rules li:not(.passed) { color: var(--danger); }
.password-strength[data-level="yellow"] .password-strength-state,
.password-strength[data-level="yellow"] .password-strength-rules li:not(.passed) { color: var(--change); }
.password-strength[data-level="green"] .password-strength-state,
.password-strength-rules li.passed { color: var(--ok); }
.password-strength-track { height: 5px; overflow: hidden; background: var(--grid); border-radius: 4px; }
.password-strength-bar { display: block; width: 0; height: 100%; background: var(--danger); transition: width .18s, background-color .18s; }
.password-strength[data-level="yellow"] .password-strength-bar { background: var(--change); }
.password-strength[data-level="green"] .password-strength-bar { background: var(--ok); }
.password-strength-rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 12px; margin: 0; padding-left: 18px; color: var(--text-faint); }
@media (max-width: 500px) { .password-strength-rules { grid-template-columns: 1fr; } }

/* ============================ Halaman sesi ============================= */
.sessionbar { display: flex; align-items: center; gap: 14px; padding: 9px 16px; background: rgba(10,18,33,.96); border-bottom: 1px solid var(--grid); color: var(--text-dim); font-size: 13px; flex-wrap: wrap; }
.sessionbar b { color: var(--text); font: 600 15px var(--display); letter-spacing: .03em; }
.sessionbar .rec { color: #ff8aa2; display: inline-flex; gap: 7px; align-items: center; }
.sessionbar .rec::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 10px var(--danger); animation: pulse 1.8s infinite; }
.sessionbar .grow { flex: 1; }
body.term { background: #050a13; display: flex; flex-direction: column; height: 100vh; }
#term { flex: 1; padding: 8px; min-height: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; }
}

/* ============================ Tema terang (opsional, setelah login) ============================ */
:root[data-theme="light"] {
  color-scheme: light;
  --void: #f3f6fb; --deck: #ffffff; --deck-2: #eef3fa; --deck-3: #e4ecf7;
  --grid: #d3dcea; --grid-hi: #b4c3d9;
  --text: #17233a; --text-dim: #4a5b78; --text-faint: #6f7f9a;
  --ion: #0a6fb5; --ion-deep: #0a5a93; --flux: #6a54d8; --read: #5b6f90;
  --change: #a85f00; --danger: #c4234a; --ok: #0b8a5f;
}
[data-theme="light"] body {
  background-image: radial-gradient(1200px 600px at 85% -10%, rgba(10,111,181,.06), transparent 60%),
    linear-gradient(rgba(180,195,217,.35) 1px, transparent 1px), linear-gradient(90deg, rgba(180,195,217,.35) 1px, transparent 1px);
}
[data-theme="light"] ::selection { background: rgba(10,111,181,.25); }
[data-theme="light"] .rail { background: rgba(255,255,255,.96); }
[data-theme="light"] .rail button.nav:hover { background: rgba(10,111,181,.07); }
[data-theme="light"] .rail button.nav.on { color: var(--ion-deep); background: linear-gradient(90deg, rgba(10,111,181,.14), rgba(10,111,181,.02)); }
[data-theme="light"] input, [data-theme="light"] select, [data-theme="light"] textarea { background: #fff; }
[data-theme="light"] input:focus, [data-theme="light"] select:focus, [data-theme="light"] textarea:focus { box-shadow: 0 0 0 3px rgba(10,111,181,.18); }
[data-theme="light"] .btn.primary { background: linear-gradient(180deg, #1c86cf, #0a6fb5); border-color: #0a5a93; color: #fff; }
[data-theme="light"] .btn.primary:hover { background: linear-gradient(180deg, #2a94dc, #137bc4); box-shadow: 0 0 0 1px #0a6fb5, 0 4px 14px rgba(10,111,181,.3); }
[data-theme="light"] .btn.danger:hover { background: rgba(196,35,74,.08); }
[data-theme="light"] .filters, [data-theme="light"] .tablewrap, [data-theme="light"] .panel,
[data-theme="light"] .panel.chamfer > .in, [data-theme="light"] .network-segment, [data-theme="light"] .hud > div { background: #fff; }
[data-theme="light"] th { background: #eef3fa; }
[data-theme="light"] td { border-bottom-color: #e1e8f2; }
[data-theme="light"] tbody tr:hover td { background: rgba(10,111,181,.05); }
[data-theme="light"] td.cmd, [data-theme="light"] .ledger .body code { color: #1f2f4d; }
[data-theme="light"] .ledger .row { border-bottom-color: #e1e8f2; }
[data-theme="light"] .tag { background: #eef3fa; border-color: #c9d5e6; color: var(--text-dim); }
[data-theme="light"] .tag.read { color: #46587a; }
[data-theme="light"] .tag.change { background: #fff4e0; border-color: #e6b566; color: var(--change); }
[data-theme="light"] .tag.danger, [data-theme="light"] .tag.fail { background: #fde8ed; border-color: #e8a0b2; color: #b01c3f; }
[data-theme="light"] .tag.ok { background: #e3f6ee; border-color: #8ed0b5; color: var(--ok); }
[data-theme="light"] .tag.proto { background: #e6f2fb; border-color: #9fcbe9; color: var(--ion-deep); }
[data-theme="light"] .posture.alert, [data-theme="light"] .error-text, [data-theme="light"] dialog .set-status[data-kind="err"] { color: #b01c3f; }
[data-theme="light"] .hud .lead { background: linear-gradient(135deg, rgba(10,111,181,.12), rgba(106,84,216,.06) 70%), #fff; }
[data-theme="light"] .hud .lead b { color: var(--ion-deep); text-shadow: none; }
[data-theme="light"] .hud .alert b { text-shadow: none; }
[data-theme="light"] .network-map { background: radial-gradient(ellipse at 50% 0, rgba(10,111,181,.08), transparent 55%), #f7f9fd; }
[data-theme="light"] .network-host { background: #f7f9fd; }
[data-theme="light"] dialog { background: linear-gradient(160deg, var(--ion-deep), var(--grid) 40%); box-shadow: 0 20px 60px rgba(23,35,58,.3); }
[data-theme="light"] dialog::backdrop { background: rgba(23,35,58,.45); }
[data-theme="light"] .toast { box-shadow: 0 12px 30px rgba(23,35,58,.2); }
[data-theme="light"] dialog .set-status[data-kind="warn"], [data-theme="light"] .res.warn .res-h b { color: var(--change); }
[data-theme="light"] .res.alert .res-h b { color: var(--danger); }

/* Pemilih tema di sidebar */
.theme-pick { display: flex; gap: 6px; margin-top: 8px; }
.theme-pick button { flex: 1; }
.theme-pick button[aria-pressed="true"] { border-color: var(--ion); color: var(--ion); font-weight: 600; }

.sortsel { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.sortsel select { padding: 6px 8px; }

/* Listbox tema futuristik */
.rail .tsel { position: relative; margin: 10px 0 12px; }
.rail .tsel-cap { display: block; margin-bottom: 5px; font: 500 9.5px var(--display); letter-spacing: .18em; color: var(--text-faint); }
.rail .tsel .tsel-btn { all: unset; box-sizing: border-box; cursor: pointer; width: 100%; display: flex; align-items: center; gap: 9px; padding: 8px 11px;
  color: var(--text); font: 500 13px var(--display); letter-spacing: .04em;
  background: linear-gradient(135deg, rgba(69,194,255,.14), rgba(155,135,255,.10)); border: 1px solid var(--grid-hi);
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 9px 100%, 0 calc(100% - 9px));
  transition: border-color .15s, box-shadow .15s, background .15s; }
.rail .tsel .tsel-btn:hover, .rail .tsel.open .tsel-btn { border-color: var(--ion); box-shadow: inset 0 0 0 1px var(--ion), 0 0 16px rgba(69,194,255,.28); text-decoration: none; }
.rail .tsel .tsel-btn:focus-visible { outline: 2px solid var(--ion); outline-offset: 2px; }
.tsel-ico { display: inline-flex; color: var(--ion); }
.tsel-label { flex: 1; }
.tsel-caret { width: 7px; height: 7px; border-right: 1.6px solid var(--ion); border-bottom: 1.6px solid var(--ion); transform: rotate(45deg) translateY(-2px); transition: transform .18s; }
.tsel.open .tsel-caret { transform: rotate(-135deg) translateY(-2px); }
.rail .tsel-list { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); margin: 0; padding: 4px; list-style: none; z-index: 20;
  background: rgba(10,18,33,.97); border: 1px solid var(--ion-deep); backdrop-filter: blur(10px);
  box-shadow: 0 12px 34px rgba(0,0,0,.55), 0 0 22px rgba(69,194,255,.2);
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 9px 100%, 0 calc(100% - 9px)); animation: tsel-in .14s ease-out; }
.rail .tsel-list[hidden] { display: none; }
@keyframes tsel-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.rail .tsel-list li { display: flex; align-items: center; gap: 9px; padding: 8px 9px; cursor: pointer; color: var(--text-dim); font: 500 13px var(--display); letter-spacing: .04em; border-radius: 3px; outline: none; }
.rail .tsel-list li:hover, .rail .tsel-list li:focus { color: var(--text); background: rgba(69,194,255,.12); box-shadow: inset 2px 0 var(--ion); }
.rail .tsel-list li[aria-selected="true"] { color: var(--ion); }
.rail .tsel-list li .tsel-tick { margin-left: auto; opacity: 0; font-size: 12px; }
.rail .tsel-list li[aria-selected="true"] .tsel-tick { opacity: 1; }
.rail .appver { margin-top: 4px; display: inline-block; padding: 1px 7px; font: 500 10px var(--mono); letter-spacing: .08em; color: var(--ion); border: 1px solid var(--grid-hi); border-radius: 2px; }
[data-theme="light"] .rail .tsel .tsel-btn { background: linear-gradient(135deg, rgba(10,111,181,.10), rgba(106,84,216,.08)); }
[data-theme="light"] .rail .tsel-list { background: rgba(255,255,255,.98); box-shadow: 0 12px 30px rgba(23,35,58,.2), 0 0 16px rgba(10,111,181,.12); }
[data-theme="light"] .rail .tsel-list li:hover, [data-theme="light"] .rail .tsel-list li:focus { background: rgba(10,111,181,.09); }

.desc-cell { max-width: 320px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; word-break: break-word; font-size: 13px; color: var(--text-dim); }

/* Video robot saat login gagal / berhasil */
.robot-overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(3,7,14,.72); backdrop-filter: blur(4px); animation: robot-in .2s ease-out; cursor: pointer; }
.robot-box { position: relative; max-height: 92vh; display: flex; flex-direction: column; align-items: center; gap: 10px; cursor: default; }
.robot-video { display: block; height: auto; width: min(92vw, 640px); max-height: 80vh; aspect-ratio: 16 / 9; object-fit: contain; background: #000; border-radius: 14px; border: 1px solid var(--ion-deep); box-shadow: 0 24px 80px rgba(0,0,0,.6), 0 0 40px rgba(69,194,255,.25); }
.robot-video.robot-fail { border-color: rgba(255,85,119,.6); box-shadow: 0 24px 80px rgba(0,0,0,.7), 0 0 40px rgba(255,85,119,.35); }
.robot-video.robot-ok { border-color: var(--ion-deep); box-shadow: 0 24px 80px rgba(0,0,0,.6), 0 0 40px rgba(69,194,255,.25); }
.robot-cap { max-width: min(92vw, 540px); text-align: center; color: #fff; font: 500 14px var(--sans); text-shadow: 0 1px 6px rgba(0,0,0,.8); padding: 4px 12px; }
.robot-close { position: absolute; top: 8px; right: 8px; z-index: 2; width: 32px; height: 32px; border: 1px solid rgba(255,255,255,.4); border-radius: 50%; color: #fff; background: rgba(0,0,0,.5); font: 16px/1 var(--sans); cursor: pointer; }
.robot-close:hover { background: rgba(255,85,119,.8); }
@keyframes robot-in { from { opacity: 0; } to { opacity: 1; } }
.robot-video.robot-ok { height: auto; width: min(92vw, 640px); max-height: 80vh; aspect-ratio: 16 / 9; object-fit: contain; background: #000; border-radius: 14px; }

/* GIF login gagal: latar transparan, jadi diberi kartu terang agar teks biru tua terbaca */
.robot-gif { display: block; height: auto; width: min(64vw, 300px); max-height: 52vh; object-fit: contain; padding: 14px 14px 10px; border-radius: 16px; background: #f4f7fc; border: 1px solid var(--ion-deep); box-shadow: 0 24px 80px rgba(0,0,0,.6), 0 0 40px rgba(255,85,119,.22); }

/* Hilangkan copyright dan versi di sidebar */
.rail .copyright, .rail .appver { display: none !important; }

/* Styling modal Leaflet Map & Google Map */
dialog.map-dialog, dialog:has(.map-modal-wrap) {
  width: min(960px, 95vw) !important;
  max-width: 95vw !important;
}
dialog.map-dialog .dbody, dialog:has(.map-modal-wrap) .dbody, .map-modal-wrap {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  box-sizing: border-box !important;
  gap: 12px !important;
  padding: 18px 22px !important;
}
#sessionLeafletMap {
  height: 480px !important;
  width: 100% !important;
  min-height: 480px !important;
  border-radius: 8px;
  border: 1px solid var(--grid-hi, #1e3a5f);
  overflow: hidden;
  background: #06111f;
  margin: 4px 0;
}
.leaflet-popup-content-wrapper { background: #0a192f !important; color: #e2e8f0 !important; border: 1px solid #00d2ff !important; border-radius: 6px !important; box-shadow: 0 4px 20px rgba(0,0,0,0.5) !important; }
.leaflet-popup-tip { background: #0a192f !important; }
.leaflet-container { font-family: var(--sans, inherit) !important; }

.map-snapshot-container:hover .map-snapshot-thumb {
  border-color: #00d2ff !important;
  box-shadow: 0 0 16px rgba(0, 210, 255, 0.45) !important;
  transform: scale(1.02);
}