:root {
  --bg: #04070a;
  --panel: #0a0f14;
  --panel2: #0d141c;
  --line: #14212b;
  --txt: #cde3d8;
  --dim: #5d7a6c;
  --acc: #00ff9c;
  --acc-dim: #0b6b47;
  --acc-soft: rgba(0, 255, 156, .09);
  --ok: #00ff9c;
  --ok-soft: rgba(0, 255, 156, .08);
  --warn: #ffc857;
  --bad: #ff4d5e;
  --bad-soft: rgba(255, 77, 94, .09);
  --cyan: #52daff;
  --radius: 8px;
  --shadow: 0 0 0 1px var(--line), 0 8px 32px rgba(0, 0, 0, .5);
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sans: 'JetBrains Mono', ui-monospace, monospace;
  --disp: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--txt);
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 70% -10%, rgba(0, 255, 156, .05), transparent 60%),
    radial-gradient(700px 400px at 10% 105%, rgba(82, 218, 255, .04), transparent 60%),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .18) 0px, rgba(0, 0, 0, .18) 1px, transparent 1px, transparent 3px);
  mix-blend-mode: overlay;
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 255, 156, .018) 50%, rgba(0, 255, 156, .028) 100%);
  animation: scan 8s linear infinite;
}
@keyframes scan { 0% { transform: translateY(-100%); } 100% { transform: translateY(100%); } }

.hidden { display: none !important; }
.dim { color: var(--dim); }

/* ---------- brand & topbar ---------- */
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--disp); font-weight: 700; font-size: 15px; letter-spacing: 1px; color: var(--acc); }
.brand span { text-shadow: 0 0 14px rgba(0, 255, 156, .5); }
.brand-lg { font-size: 18px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 22px;
  background: rgba(4, 7, 10, .88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.topbar-right { display: flex; align-items: center; gap: 9px; margin-left: auto; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--acc-dim);
  background: transparent;
  color: var(--acc);
  font: 600 12px var(--mono);
  padding: 8px 15px;
  border-radius: 6px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: .8px;
  transition: background .15s, box-shadow .15s, transform .1s;
}
.btn:hover { background: var(--acc-soft); box-shadow: 0 0 18px rgba(0, 255, 156, .25); }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--acc); border-color: var(--acc); color: #04120a; }
.btn-primary:hover { background: #00ffa8; box-shadow: 0 0 26px rgba(0, 255, 156, .5); }
.btn-ghost { border-color: var(--line); color: var(--dim); }
.btn-ghost:hover { color: var(--acc); border-color: var(--acc-dim); box-shadow: 0 0 14px rgba(0, 255, 156, .18); }
.btn-send {
  border: 0;
  background: var(--acc);
  color: #04120a;
  border-radius: 6px;
  width: 38px; height: 38px; flex: 0 0 38px;
  cursor: pointer;
  display: grid; place-items: center;
  transition: box-shadow .15s;
}
.btn-send:hover { box-shadow: 0 0 22px rgba(0, 255, 156, .55); }
.iconbtn {
  border: 0;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  width: 32px; height: 32px;
  border-radius: 6px;
  display: grid; place-items: center;
  font-size: 17px; line-height: 1;
  transition: color .15s, box-shadow .15s;
}
.iconbtn:hover { color: var(--acc); box-shadow: inset 0 0 12px rgba(0, 255, 156, .12); }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--acc-dim);
  border-radius: var(--radius);
  padding: 44px 36px 34px;
  text-align: center;
  box-shadow: 0 0 60px rgba(0, 255, 156, .08), inset 0 0 40px rgba(0, 255, 156, .02);
  animation: glitchin .5s steps(6) both;
  position: relative;
}
@keyframes glitchin {
  0% { transform: translateX(-14px); opacity: 0; filter: hue-rotate(90deg); }
  40% { transform: translateX(9px); opacity: .6; }
  60% { transform: translateX(-4px); }
  100% { transform: none; opacity: 1; filter: none; }
}
.login-card::before {
  content: '> HEY DETEKSI MASUK — Ketik password admin.';
  display: block;
  text-align: left;
  font: 500 11.5px var(--mono);
  color: var(--dim);
  margin-bottom: 18px;
}
.login-card h1 { font-family: var(--disp); font-size: 20px; color: var(--acc); margin: 4px 0 4px; letter-spacing: 1px; }
.login-card p { font-size: 13px; color: var(--dim); margin-bottom: 24px; }
.login-card input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--acc);
  font: 500 13px var(--mono);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  caret-color: var(--acc);
}
.login-card input:focus { border-color: var(--acc-dim); box-shadow: 0 0 0 3px rgba(0, 255, 156, .1); }
.login-card .btn { width: 100%; justify-content: center; margin-top: 12px; padding: 12px; }
.form-error { margin-top: 14px; color: var(--bad); font-size: 12.5px; text-align: left; }

/* ---------- layout ---------- */
.app {
  display: grid;
  grid-template-columns: 218px 1fr;
  animation: fadein .35s ease both;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 18px 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 20;
}

.nav { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.nav-sec {
  margin: 12px 12px 6px;
  font: 600 10px var(--mono);
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--dim);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-left: 2px solid transparent;
  border-radius: 0 5px 5px 0;
  color: var(--txt);
  font: 500 12.5px var(--mono);
  cursor: pointer;
  text-decoration: none;
  border-top: 0; border-right: 0; border-bottom: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: background .12s, border-color .12s, color .12s;
}
.nav-item svg { color: var(--dim); transition: color .12s; flex: 0 0 16px; }
.nav-item:hover { background: var(--acc-soft); color: var(--acc); border-left-color: var(--acc-dim); }
.nav-item.active { background: var(--acc-soft); color: var(--acc); border-left-color: var(--acc); box-shadow: inset 12px 0 30px rgba(0,255,156,.05); font-weight: 600; }
.nav-item.active svg { color: var(--acc); }
.nav-item .chev { margin-left: auto; transition: transform .2s; color: var(--dim); }
.nav-item[aria-expanded="true"] .chev { transform: rotate(180deg); }

.nav-sub { display: none; flex-direction: column; gap: 1px; margin: 2px 0 4px; }
.nav-sub.open { display: flex; }
.nav-sub a {
  padding: 6px 12px 6px 34px;
  font: 400 12px var(--mono);
  color: var(--dim);
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  transition: background .12s, color .12s;
}
.nav-sub a:hover { background: var(--panel2); color: var(--acc); }
.nav-sub a.active { color: var(--acc); }
.nav-sub a.active::before { content: '> '; }

.sidebar-foot { border-top: 1px solid var(--line); padding-top: 10px; }

.main { min-width: 0; padding: 0 22px 44px; }

.topbar h2 { font-size: 16px; font-weight: 600; color: var(--acc); letter-spacing: 1px; }
.topbar h2::before { content: '## '; color: var(--dim); font-size: 13px; }

.sysbadge {
  display: flex; align-items: center; gap: 8px;
  font: 600 11.5px var(--mono);
  padding: 6px 13px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: var(--panel2);
}
.sysbadge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: breathe 2s ease-in-out infinite; }
.sysbadge.ok .dot { box-shadow: 0 0 10px var(--ok); }
.sysbadge.warn .dot { background: var(--warn); box-shadow: 0 0 10px var(--warn); }
.sysbadge.bad .dot { background: var(--bad); box-shadow: 0 0 10px var(--bad); animation: blink .9s ease-in-out infinite; }

/* ---------- stats ---------- */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 10px 0 8px; }
.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.stat-card:hover { border-color: var(--acc-dim); box-shadow: 0 0 24px rgba(0, 255, 156, .1); transform: translateY(-1px); }
.stat-card::before {
  content: '▮';
  position: absolute;
  top: 8px; right: 12px;
  color: var(--acc);
  opacity: .4;
  font-size: 11px;
}
.stat-label { font: 500 11px var(--mono); color: var(--dim); text-transform: uppercase; letter-spacing: 1px; }
.stat-value { font-family: var(--disp); font-size: 24px; font-weight: 700; letter-spacing: -.4px; color: var(--acc); text-shadow: 0 0 12px rgba(0,255,156,.3); }
.stat-value.bad { color: var(--bad); text-shadow: 0 0 12px rgba(255, 77, 94, .3); }
.stat-sub { font-size: 11.5px; color: var(--dim); font-family: var(--mono); }
.stat-card canvas { width: 100%; margin-top: 4px; }

/* ---------- list ---------- */
.list-head { display: flex; align-items: center; gap: 14px; margin: 14px 0 4px; flex-wrap: wrap; }
.list-head h2 { font-size: 17px; font-weight: 600; color: var(--acc); letter-spacing: .5px; }
.list-head h2::before { content: '> '; color: var(--dim); }
.list-search {
  flex: 1;
  max-width: 440px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 13px;
  color: var(--dim);
  transition: border-color .15s, box-shadow .15s;
}
.list-search:focus-within { border-color: var(--acc-dim); box-shadow: 0 0 16px rgba(0, 255, 156, .1); }
.list-search input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  color: var(--acc);
  font: 400 12.5px var(--mono);
  padding: 9px 0;
  caret-color: var(--acc);
}
.list-search input::placeholder { color: var(--dim); }

.site-group {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-top: 12px;
  overflow: hidden;
  animation: rise .4s ease both;
}
.sg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(0, 255, 156, .025), transparent);
}
.sg-title { font-family: var(--disp); font-weight: 700; font-size: 14px; color: var(--acc); letter-spacing: .5px; }
.sg-title::before { content: '[ '; color: var(--dim); }
.sg-title::after { content: ' ]'; color: var(--dim); }
.sg-sub { font-size: 11.5px; color: var(--dim); font-family: var(--mono); }
.sg-actions { display: flex; gap: 7px; }
.btn-sm { padding: 6px 12px; font-size: 11px; border-radius: 5px; }
.sg-empty { padding: 22px; text-align: center; font-size: 12.5px; color: var(--dim); }

.site-row {
  display: grid;
  grid-template-columns: 30px minmax(140px, 1.3fr) 96px 90px 64px 70px auto;
  align-items: center;
  gap: 11px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  animation: rise .35s ease both;
  transition: background .12s;
}
.site-row:last-child { border-bottom: 0; }
.site-row:hover { background: var(--panel2); }

.sr-icon {
  width: 30px; height: 30px;
  border-radius: 5px;
  border: 1px solid var(--acc-dim);
  color: var(--acc);
  display: grid; place-items: center;
  box-shadow: inset 0 0 10px rgba(0,255,156,.07);
}
.sr-name { display: flex; align-items: center; gap: 7px; min-width: 0; font-family: var(--mono); font-size: 13px; }
.sr-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--txt); }
.sr-ext { color: var(--dim); text-decoration: none; transition: color .12s; }
.sr-ext:hover { color: var(--acc); }

.status-dot { position: relative; flex: 0 0 9px; width: 9px; height: 9px; border-radius: 50%; }
.status-dot.in { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.status-dot.degraded { background: var(--warn); box-shadow: 0 0 8px var(--warn); animation: breathe 1.4s ease-in-out infinite; }
.status-dot.down { background: var(--bad); box-shadow: 0 0 8px var(--bad); animation: blink .8s ease-in-out infinite; }
.status-dot.unknown { background: var(--dim); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: 600 10.5px var(--mono);
  padding: 3px 9px;
  border-radius: 4px;
  white-space: nowrap;
  border: 1px solid transparent;
}
.chip span { width: 6px; height: 6px; border-radius: 50%; }
.chip-ok { background: var(--ok-soft); color: var(--ok); border-color: rgba(0, 255, 156, .25); }
.chip-ok span { background: var(--ok); box-shadow: 0 0 5px var(--ok); }
.chip-warn { background: rgba(255, 200, 87, .08); color: var(--warn); border-color: rgba(255, 200, 87, .25); }
.chip-warn span { background: var(--warn); box-shadow: 0 0 5px var(--warn); }
.chip-bad { background: var(--bad-soft); color: var(--bad); border-color: rgba(255, 77, 94, .25); }
.chip-bad span { background: var(--bad); box-shadow: 0 0 5px var(--bad); animation: blink .9s ease-in-out infinite; }
.chip-idle { background: rgba(93, 122, 108, .08); color: var(--dim); border-color: var(--line); }
.chip-idle span { background: var(--dim); }

.sr-spark { width: 90px; height: 30px; display: block; }
.sr-lat { font: 500 11.5px var(--mono); color: var(--acc); text-align: right; }
.sr-up { font: 600 11.5px var(--mono); text-align: right; color: var(--ok); }
.sr-up.warn { color: var(--warn); }
.sr-up.bad { color: var(--bad); }
.sr-actions { display: flex; gap: 1px; justify-content: flex-end; }
.sr-actions .iconbtn { width: 28px; height: 28px; font-size: 14px; }

/* ---------- stat table ---------- */
.stat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  margin-top: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  font-family: var(--mono);
}
.stat-table th, .stat-table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.stat-table th { font: 600 10px var(--mono); text-transform: uppercase; letter-spacing: 1px; color: var(--dim); background: var(--panel2); }
.stat-table tr:last-child td { border-bottom: 0; }
.stat-table td { font-variant-numeric: tabular-nums; }
.stat-table .sub { color: var(--dim); font-size: 11px; }

/* ---------- panel & statistik views ---------- */
.panel-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-top: 12px;
  animation: rise .35s ease both;
  max-width: 820px;
}
.panel-card h3 { font-size: 13.5px; color: var(--acc); margin-bottom: 8px; letter-spacing: .4px; }
.panel-card h3::before { content: '$ '; color: var(--dim); }
.panel-card p, .panel-card li { font-size: 12.5px; color: var(--txt); }
.panel-card p { margin: 5px 0 12px; }
.panel-card ol { padding-left: 18px; margin: 8px 0; display: grid; gap: 5px; }
.panel-card code, .code-block {
  display: block;
  background: var(--bg);
  border: 1px solid var(--line);
  border-left: 3px solid var(--acc);
  border-radius: 5px;
  padding: 10px 13px;
  font: 500 12px var(--mono);
  color: var(--acc);
  margin: 8px 0;
  overflow-x: auto;
  white-space: pre;
}
.panel-link { color: var(--cyan); text-decoration: none; font-family: var(--mono); }
.panel-link:hover { text-decoration: underline; }

.mini-stat {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--mono);
}

.grade-badge {
  display: inline-grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 6px;
  font: 700 13px var(--disp);
  border: 1px solid;
}
.grade-a { background: var(--ok-soft); color: var(--ok); border-color: var(--acc-dim); box-shadow: 0 0 10px rgba(0,255,156,.2); }
.grade-b { background: rgba(82, 218, 255, .08); color: var(--cyan); border-color: rgba(82, 218, 255, .3); }
.grade-c { background: rgba(255, 200, 87, .08); color: var(--warn); border-color: rgba(255, 200, 87, .3); }
.grade-d { background: rgba(255, 140, 60, .08); color: #ff8c3c; border-color: rgba(255, 140, 60, .3); }
.grade-f { background: var(--bad-soft); color: var(--bad); border-color: rgba(255, 77, 94, .3); }

.hdrchip {
  display: inline-block;
  font: 600 9.5px var(--mono);
  padding: 2px 6px;
  border-radius: 3px;
  margin: 1px 2px 1px 0;
  cursor: default;
}
.hdrchip.on { background: var(--ok-soft); color: var(--ok); }
.hdrchip.off { background: var(--panel2); color: var(--dim); border-left: 2px solid var(--bad); }

/* ---------- empty ---------- */
.empty { text-align: center; padding: 60px 20px; }
.empty-icon { font-size: 32px; opacity: .4; margin-bottom: 10px; }
.empty h2 { font-family: var(--disp); color: var(--acc); margin-bottom: 5px; font-size: 16px; }

/* ---------- chat ---------- */
.chat-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  width: 50px; height: 50px;
  border-radius: 8px;
  border: 1px solid var(--acc-dim);
  background: var(--panel);
  color: var(--acc);
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: 0 0 30px rgba(0, 255, 156, .2);
  transition: box-shadow .2s, transform .18s cubic-bezier(.2, .9, .3, 1.4);
}
.chat-fab:hover { transform: scale(1.08); box-shadow: 0 0 44px rgba(0, 255, 156, .45); }

.chat-panel {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  width: min(400px, calc(100vw - 32px));
  height: min(520px, calc(100vh - 90px));
  background: #080d12;
  border: 1px solid var(--acc-dim);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: glitchin .3s steps(4) both;
  box-shadow: 0 0 60px rgba(0, 255, 156, .2);
  font-family: var(--mono);
}
.chat-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 13px;
  border-bottom: 1px solid var(--line);
  font: 600 12.5px var(--mono);
  color: var(--acc);
  letter-spacing: 1px;
}
.chat-head::before { content: '$ '; color: var(--dim); }
.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  scrollbar-width: thin;
}
.chat-hint { color: var(--dim); font-size: 12px; text-align: center; padding: 26px 10px; }
.msg { max-width: 92%; padding: 8px 12px; border-radius: 6px; font-size: 12.5px; white-space: pre-wrap; word-break: break-word; animation: rise .25s ease both; }
.msg.user { align-self: flex-end; background: var(--acc-dim); color: #eafff4; }
.msg.ai { align-self: flex-start; background: var(--panel2); border-left: 2px solid var(--acc); color: var(--txt); }
.msg.err { align-self: center; color: var(--warn); font-size: 11.5px; background: transparent; }
.typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 9px 13px; background: var(--panel2); border-radius: 6px; }
.typing i { width: 5px; height: 5px; background: var(--acc); border-radius: 50%; animation: bob 1s ease-in-out infinite; }
.typing i:nth-child(2) { animation-delay: .12s; }
.typing i:nth-child(3) { animation-delay: .24s; }
.chat-input { display: flex; gap: 7px; padding: 10px; border-top: 1px solid var(--line); background: var(--panel); }
.chat-input input {
  flex: 1; padding: 9px 12px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--bg); color: var(--acc);
  font: 400 12.5px var(--mono); outline: none; caret-color: var(--acc);
  transition: border-color .15s;
}
.chat-input input:focus { border-color: var(--acc-dim); }

/* ---------- modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(2, 4, 6, .78);
  backdrop-filter: blur(5px);
  display: grid; place-items: center;
  padding: 18px;
  animation: fadein .15s ease both;
}
.modal-card {
  width: min(430px, 100%);
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--acc-dim);
  border-radius: var(--radius);
  padding: 20px;
  animation: glitchin .3s steps(4) both;
  box-shadow: 0 0 60px rgba(0, 255, 156, .12);
}
.modal-wide { width: min(640px, 100%); }
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  font: 600 13px var(--mono); color: var(--acc);
  margin-bottom: 14px;
  letter-spacing: .5px;
}
.modal-head::before { content: '$ '; color: var(--dim); }
.modal-card label { display: block; font: 500 11px var(--mono); color: var(--dim); margin-bottom: 11px; text-transform: uppercase; letter-spacing: .6px; }
.modal-card input, .modal-card select {
  display: block; width: 100%; margin-top: 5px;
  padding: 9px 12px; border-radius: 5px;
  border: 1px solid var(--line); background: var(--bg); color: var(--acc);
  font: 400 12.5px var(--mono); outline: none; caret-color: var(--acc);
  transition: border-color .15s;
}
.modal-card input:focus, .modal-card select:focus { border-color: var(--acc-dim); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 6px; }

.insight-body { font-size: 13px; line-height: 1.65; font-family: var(--mono); }
.insight-body ul { padding-left: 18px; margin: 5px 0; }
.insight-body p { margin: 7px 0; }
.skeleton { color: var(--dim); }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%; bottom: 26px;
  transform: translateX(-50%);
  z-index: 70;
  background: var(--panel2);
  border: 1px solid var(--acc-dim);
  color: var(--acc);
  border-radius: 6px;
  padding: 10px 16px;
  font: 500 12px var(--mono);
  box-shadow: 0 0 36px rgba(0, 255, 156, .2);
  animation: rise .25s ease both;
}
.toast.bad { border-color: var(--bad); color: var(--bad); box-shadow: 0 0 36px rgba(255, 77, 94, .25); }

/* ---------- terminal ---------- */
.term {
  background: var(--bg);
  border: 1px solid var(--acc-dim);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 46px rgba(0, 255, 156, .12);
  margin-top: 12px;
  font-family: var(--mono);
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: var(--panel2);
  border-bottom: 1px solid var(--line);
}
.term-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.term-bar i:nth-child(1) { background: var(--bad); }
.term-bar i:nth-child(2) { background: var(--warn); }
.term-bar i:nth-child(3) { background: var(--ok); }
.term-bar span { margin-left: 7px; font: 500 11px var(--mono); color: var(--dim); }

.term-out {
  height: 420px;
  overflow-y: auto;
  padding: 13px 15px;
  font: 400 12.5px/1.6 var(--mono);
  color: var(--txt);
  background: var(--bg);
  scrollbar-width: thin;
}
.tl { white-space: pre-wrap; word-break: break-word; }
.tdim { color: var(--dim); }

.term-line {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px 10px;
  background: var(--bg);
  border-top: 1px solid var(--line);
}
.term-ps { font: 600 12.5px var(--mono); color: var(--acc); white-space: nowrap; }
.term-ps .tp { color: var(--cyan); }
.term-in {
  flex: 1;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--acc);
  font: 400 12.5px var(--mono);
  caret-color: var(--acc);
}

.gate-item { padding: 4px 0; font-size: 12.5px; font-family: var(--mono); }
.gate-item .sub { margin-left: 7px; color: var(--dim); }
.sha { font: 500 11px var(--mono); color: var(--cyan); }

/* ---------- animations ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes breathe { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 0 14px 40px; }
}
@media (max-width: 620px) {
  .stats-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .site-row { grid-template-columns: 30px minmax(110px, 1fr) 80px auto; }
  .sr-lat, .sr-up, .chip { display: none; }
  .stat-value { font-size: 20px; }
  .list-search { max-width: 100%; }
}

/* ---------- db tabs ---------- */
.db-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 4px; }
.db-tab {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--txt);
  font: 600 11.5px var(--mono);
  padding: 6px 13px;
  border-radius: 5px;
  cursor: pointer;
  transition: all .15s;
}
.db-tab:hover { border-color: var(--acc-dim); color: var(--acc); }
.db-tab.active { background: var(--acc-soft); color: var(--acc); border-color: var(--acc-dim); }
.db-tab .sub { color: var(--dim); font-weight: 400; }
.mono-cell { font-family: var(--mono); font-size: 11.8px; }
.sql-box {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-left: 3px solid var(--acc);
  border-radius: 5px;
  color: var(--acc);
  font: 500 12px var(--mono);
  padding: 10px 12px;
  outline: none;
  resize: vertical;
}

/* ---------- blacklist reputation chips ---------- */
.blchip {
  display: inline-block;
  font: 600 9.5px var(--mono);
  padding: 2px 6px;
  border-radius: 3px;
  margin: 1px 2px 1px 0;
  cursor: default;
  border: 1px solid transparent;
}
.blchip.bl-ok { background: var(--ok-soft); color: var(--ok); border-color: rgba(0,255,156,.25); }
.blchip.bl-bad { background: var(--bad-soft); color: var(--bad); border-color: rgba(255,77,94,.35); animation: blink 1.1s ease-in-out infinite; }
.blchip.bl-unk { background: var(--panel2); color: var(--dim); border-color: var(--line); }
