:root {
  color-scheme: dark;
  --bg: #0b0b0b;
  --bg-elevated: #0e0e0e;
  --surface: #141414;
  --surface-2: #191919;
  --surface-3: #202020;
  --input: #0f0f0f;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .14);
  --text: #efefef;
  --text-soft: #c9c9c9;
  --muted: #9c9c9c;
  --faint: #666;
  --blue: #338ced;
  --blue-strong: #257de0;
  --blue-soft: rgba(51, 140, 237, .12);
  --orange: #e76624;
  --orange-soft: rgba(231, 102, 36, .12);
  --green: #53c556;
  --green-dot: #0aac23;
  --green-soft: rgba(10, 172, 35, .12);
  --yellow: #fbb315;
  --yellow-soft: rgba(251, 179, 21, .12);
  --red: #eb6263;
  --red-soft: rgba(235, 98, 99, .12);
  --violet: #9887ef;
  --sidebar-w: 252px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 20px 60px rgba(0, 0, 0, .42);
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.modal-open { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
svg { display: block; }
::selection { background: rgba(51, 140, 237, .32); color: #fff; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.is-hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2b2b2b; border: 3px solid var(--bg); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a3a; }

/* ---------- brand, boot ---------- */
.brand-mark {
  width: 38px; height: 38px; flex: 0 0 38px;
  display: grid; place-items: center;
  border: 1px solid rgba(51, 140, 237, .32);
  border-radius: 11px;
  color: #eaf3ff;
  background:
    radial-gradient(120% 120% at 20% 0%, rgba(51, 140, 237, .3), transparent 55%),
    linear-gradient(145deg, #152233, #0d1118);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 8px 24px rgba(0, 0, 0, .25);
}
.brand-mark svg { width: 76%; height: 76%; }
.brand-mark-lg { width: 46px; height: 46px; flex-basis: 46px; border-radius: 13px; }
.brand-name { font-size: 16px; font-weight: 680; letter-spacing: -.01em; color: var(--text); }
.brand-sub { margin-top: 1px; font-size: 8.5px; font-weight: 650; letter-spacing: .18em; color: var(--faint); }

.boot-screen {
  min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px;
  background:
    radial-gradient(600px 360px at 50% 40%, rgba(51, 140, 237, .08), transparent 70%),
    var(--bg);
}
.boot-brand { display: flex; align-items: center; gap: 12px; }
.boot-spinner, .spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .12);
  border-top-color: var(--blue);
  animation: spin .75s linear infinite;
}
.spinner-sm { width: 16px; height: 16px; border-width: 2px; }
.spinner.is-hidden { display: none !important; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- login ---------- */
.login-view {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(420px, .82fr);
  background: var(--bg);
}
.login-art {
  position: relative;
  overflow: hidden;
  min-height: 100dvh;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(900px 560px at 30% 30%, rgba(35, 101, 190, .16), transparent 64%),
    radial-gradient(700px 480px at 76% 88%, rgba(231, 102, 36, .06), transparent 66%),
    #090b0e;
}
.login-art::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(9, 11, 14, .7));
  pointer-events: none;
}
.login-art-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .032) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: radial-gradient(ellipse 72% 64% at 44% 42%, #000 20%, transparent 76%);
  -webkit-mask-image: radial-gradient(ellipse 72% 64% at 44% 42%, #000 20%, transparent 76%);
}
.login-art-inner {
  position: relative; z-index: 1;
  min-height: 100dvh;
  max-width: 760px;
  padding: clamp(30px, 4.2vw, 64px);
  display: flex; flex-direction: column;
}
.login-brand { display: flex; align-items: center; gap: 13px; }
.login-copy { margin-top: clamp(58px, 9vh, 112px); }
.login-eyebrow { display: flex; align-items: center; gap: 10px; color: #8bbdff; }
.eyebrow {
  font-size: 10px; font-weight: 650; letter-spacing: .18em;
  text-transform: uppercase; color: var(--faint);
}
.eyebrow-line { display: inline-block; width: 28px; height: 1px; background: rgba(139, 189, 255, .5); }
.login-copy h1 {
  margin: 16px 0 0;
  font-size: clamp(38px, 4.7vw, 64px);
  line-height: 1.06;
  letter-spacing: -.04em;
  font-weight: 620;
  color: #f2f5f9;
}
.login-copy h1 span {
  color: #a9c9ef;
  background: linear-gradient(92deg, #d9e8fb 0%, #8db9ea 60%, #6599d8 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.login-copy p {
  max-width: 500px;
  margin: 22px 0 0;
  font-size: 15px;
  line-height: 1.8;
  color: #9aa5b2;
}
.protocol-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.proto-chip {
  display: inline-flex; align-items: center; height: 27px; padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 999px;
  background: rgba(255, 255, 255, .025);
  color: #b4bec9;
  font-size: 10.5px; font-weight: 650; letter-spacing: .08em;
}
.network-map {
  flex: 1;
  min-height: 210px;
  display: flex; align-items: center;
  margin-top: 10px;
}
.network-map svg { width: 100%; height: auto; max-height: 310px; }
.map-pulse { transform-origin: 320px 140px; animation: mapPulse 3.4s ease-out infinite; }
@keyframes mapPulse {
  0% { transform: scale(.86); opacity: .7; }
  80%, 100% { transform: scale(1.42); opacity: 0; }
}
.login-art-foot {
  display: flex; flex-wrap: wrap; gap: 22px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, .07);
  color: #7d8793; font-size: 11.5px;
}
.login-art-foot span { display: inline-flex; align-items: center; gap: 8px; }
.login-panel {
  min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 44px 30px 26px;
  background:
    radial-gradient(520px 340px at 50% 18%, rgba(51, 140, 237, .055), transparent 70%),
    #0b0b0b;
}
.login-card { width: min(378px, 100%); }
.login-brand-mobile { display: none; margin-bottom: 42px; }
.login-heading h2 { margin: 0; font-size: 28px; line-height: 1.2; letter-spacing: -.03em; font-weight: 640; }
.login-heading p { margin: 8px 0 30px; color: var(--muted); font-size: 13.5px; }
.login-note {
  margin-top: 22px; display: flex; align-items: center; justify-content: center; gap: 7px;
  color: #707070; font-size: 11px; text-align: center;
}
.login-note svg { width: 14px; height: 14px; flex: 0 0 14px; }
.login-footer {
  margin-top: auto; padding-top: 42px;
  color: #5c5c5c; font-size: 10.5px; letter-spacing: .02em;
}
.login-footer span { margin: 0 5px; color: #3d3d3d; }

/* ---------- app shell ---------- */
.app-view { min-height: 100dvh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0;
  width: var(--sidebar-w);
  z-index: 50;
  display: flex; flex-direction: column;
  padding: 22px 14px 14px;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(340px 240px at -10% 0%, rgba(51, 140, 237, .06), transparent 70%),
    #0c0c0c;
}
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 0 8px; }
.sidebar-brand .brand-mark { width: 34px; height: 34px; flex-basis: 34px; border-radius: 10px; }
.sidebar-brand .brand-name { font-size: 15px; }
.sidebar .sidebar-close { display: none; margin-left: auto; }
.nav { margin-top: 38px; display: flex; flex-direction: column; gap: 4px; }
.nav-label {
  margin: 18px 10px 7px; color: #5d5d5d;
  font-size: 9.5px; font-weight: 650; letter-spacing: .16em; text-transform: uppercase;
}
.nav-label:first-child { margin-top: 0; }
.nav-item {
  position: relative;
  width: 100%; height: 40px;
  display: flex; align-items: center; gap: 11px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #9d9d9d;
  font-size: 13px; text-align: left;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.nav-item svg { width: 17px; height: 17px; flex: 0 0 17px; color: #777; transition: color .16s ease; }
.nav-item:hover { color: var(--text); background: rgba(255, 255, 255, .035); }
.nav-item:hover svg { color: #b8b8b8; }
.nav-item.is-active {
  color: #f2f6fc;
  background: linear-gradient(90deg, rgba(51, 140, 237, .13), rgba(51, 140, 237, .045));
  border-color: rgba(51, 140, 237, .16);
}
.nav-item.is-active::before {
  content: ""; position: absolute; left: -1px; top: 11px; bottom: 11px;
  width: 2px; border-radius: 2px; background: var(--blue);
}
.nav-item.is-active svg { color: #7cb8f8; }
.nav-badge, .nav-count {
  margin-left: auto;
  min-width: 20px; height: 18px; padding: 0 6px;
  display: inline-grid; place-items: center;
  border-radius: 999px; background: rgba(51, 140, 237, .16);
  color: #9cc8fa; font-family: var(--mono); font-size: 9.5px;
}
.nav-count { background: rgba(255, 255, 255, .055); color: #8d8d8d; }
.nav-badge.is-hidden { display: none; }
.sidebar-spacer { flex: 1; min-height: 22px; }
.server-card {
  margin: 0 2px 12px;
  padding: 13px 13px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .022);
}
.server-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.server-title { display: inline-flex; align-items: center; gap: 7px; color: #c9d0d8; font-size: 11.5px; font-weight: 550; }
.server-uptime { color: #5f5f5f; font-family: var(--mono); font-size: 9.5px; }
.server-domain {
  margin-top: 9px;
  color: #b7b7b7; font-family: var(--mono); font-size: 10.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.server-meta { margin-top: 7px; display: flex; align-items: center; gap: 6px; color: #5f5f5f; font-size: 9.5px; }
.dot-sep { width: 2px; height: 2px; border-radius: 50%; background: #444; }
.admin-block {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 7px 4px;
  border-top: 1px solid var(--line);
}
.avatar {
  --av-bg: rgba(51, 140, 237, .16);
  --av-fg: #9cc8fa;
  width: 30px; height: 30px; flex: 0 0 30px;
  display: inline-grid; place-items: center;
  border-radius: 9px;
  background: var(--av-bg); color: var(--av-fg);
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, .055);
}
.avatar-admin { --av-bg: linear-gradient(145deg, rgba(51, 140, 237, .22), rgba(51, 140, 237, .08)); }
.av-0 { --av-bg: rgba(51,140,237,.15); --av-fg: #88c0ff; }
.av-1 { --av-bg: rgba(231,102,36,.15); --av-fg: #f2a47e; }
.av-2 { --av-bg: rgba(0,168,136,.15); --av-fg: #67d7c0; }
.av-3 { --av-bg: rgba(210,142,5,.15); --av-fg: #e8bf62; }
.av-4 { --av-bg: rgba(226,77,139,.15); --av-fg: #ef9bbd; }
.av-5 { --av-bg: rgba(10,172,35,.14); --av-fg: #82d98c; }
.av-6 { --av-bg: rgba(152,135,239,.15); --av-fg: #b7aaf5; }
.av-7 { --av-bg: rgba(235,98,99,.14); --av-fg: #f1a1a2; }
.admin-meta { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.admin-role { color: #686868; font-size: 9.5px; letter-spacing: .05em; }
.admin-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #a7a7a7; font-size: 10.5px; }
.admin-block .icon-btn { width: 30px; height: 30px; flex: 0 0 30px; }

.main-shell {
  min-height: 100dvh;
  margin-left: var(--sidebar-w);
  display: flex; flex-direction: column;
  background:
    radial-gradient(900px 500px at 70% -10%, rgba(51, 140, 237, .035), transparent 70%),
    var(--bg);
}
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: 78px; flex: 0 0 78px;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 0 clamp(20px, 3vw, 36px);
  border-bottom: 1px solid var(--line);
  background: rgba(11, 11, 11, .78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.topbar-left { display: flex; align-items: center; gap: 13px; min-width: 0; }
.page-heading { min-width: 0; }
.page-heading .eyebrow { font-size: 8.5px; letter-spacing: .17em; margin-bottom: 3px; }
.page-heading h1 { margin: 0; font-size: 21px; line-height: 1.2; letter-spacing: -.025em; font-weight: 620; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.live-pill {
  display: inline-flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 999px;
  color: #888; background: rgba(255, 255, 255, .022);
  font-size: 10.5px; white-space: nowrap;
  transition: color .2s, border-color .2s;
}
.live-dot, .status-dot {
  width: 6px; height: 6px; border-radius: 50%; flex: 0 0 6px;
  background: var(--faint);
}
.live-dot {
  background: var(--green-dot);
  box-shadow: 0 0 0 3px rgba(10, 172, 35, .12);
  animation: livePulse 2.4s ease-in-out infinite;
}
.live-pill.is-stale { color: #c79d55; border-color: rgba(251, 179, 21, .18); }
.live-pill.is-stale .live-dot { background: var(--yellow); box-shadow: none; animation: none; }
@keyframes livePulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.icon-btn {
  width: 34px; height: 34px;
  display: inline-grid; place-items: center;
  border: 1px solid transparent; border-radius: 9px;
  background: transparent; color: #888;
  transition: background .16s, color .16s, border-color .16s;
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, .05); border-color: var(--line); }
.mobile-menu { display: none; }
.mobile-scrim { display: none; }

.content {
  flex: 1;
  width: 100%;
  max-width: 1560px;
  margin: 0 auto;
  padding: clamp(22px, 2.6vw, 34px) clamp(20px, 3vw, 36px) 40px;
}
.view { animation: viewIn .28s ease both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.app-footer {
  display: flex; align-items: center; gap: 7px;
  padding: 14px clamp(20px, 3vw, 36px) 20px;
  color: #4f4f4f; font-size: 10px; border-top: 1px solid rgba(255, 255, 255, .045);
}
.footer-dot { color: #333; }
.footer-spacer { flex: 1; }
#foot-domain { font-family: var(--mono); color: #5a5a5a; }

/* ---------- common ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .02) inset;
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px 0; }
.card-title { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.card-sub { margin: 4px 0 0; color: var(--muted); font-size: 11.5px; }
.card-body { padding: 20px 22px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin: 0 0 16px; }
.section-head h2 { margin: 0; font-size: 17px; font-weight: 620; letter-spacing: -.02em; }
.section-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.grid { display: grid; gap: 14px; }
.stretch { min-width: 0; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface-2); color: var(--text-soft);
  font-size: 12.5px; font-weight: 550; white-space: nowrap;
  transition: background .16s, border-color .16s, color .16s, transform .1s;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { background: #222; border-color: var(--line-strong); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary {
  background: var(--blue); border-color: var(--blue); color: #06101d; font-weight: 680;
}
.btn-primary:hover { background: #4a9af3; border-color: #4a9af3; color: #06101d; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: rgba(255, 255, 255, .045); border-color: transparent; color: var(--text); }
.btn-danger { background: var(--red-soft); border-color: rgba(235, 98, 99, .2); color: #ffb5b5; }
.btn-danger:hover { background: rgba(235, 98, 99, .18); border-color: rgba(235, 98, 99, .32); color: #ffd0d0; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 11.5px; border-radius: 8px; }
.btn-lg { height: 47px; border-radius: 10px; font-size: 13.5px; }
.btn-block { width: 100%; }
.btn-arrow { margin-left: auto; transition: transform .16s; }
.btn-block:hover .btn-arrow { transform: translateX(2px); }
.btn .spinner { margin-left: auto; }
.btn-label { flex: 1; text-align: left; }

.field { display: block; }
.field + .field { margin-top: 17px; }
.form-grid + .field, .field + .form-grid, .form-grid + .form-grid { margin-top: 17px; }
.field-label { display: block; margin-bottom: 7px; color: #a3a3a3; font-size: 11.5px; font-weight: 550; }
.field-help { margin-top: 6px; color: #666; font-size: 10.5px; line-height: 1.55; }
.input-shell {
  display: flex; align-items: center; gap: 9px;
  height: 43px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--input);
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.input-shell:focus-within {
  border-color: rgba(51, 140, 237, .65);
  box-shadow: 0 0 0 3px rgba(51, 140, 237, .11);
  background: #101010;
}
.input-icon { width: 16px; height: 16px; flex: 0 0 16px; color: #5f5f5f; }
.input-shell input { width: 100%; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font-size: 13px; }
.input-shell input::placeholder, .input::placeholder { color: #565656; }
.input-action {
  width: 28px; height: 28px; flex: 0 0 28px;
  display: grid; place-items: center;
  border: 0; border-radius: 6px; background: transparent; color: #666;
}
.input-action svg { width: 16px; height: 16px; }
.input-action:hover { color: #b5b5b5; background: rgba(255, 255, 255, .045); }
.form-error {
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(235, 98, 99, .24);
  border-radius: 8px;
  background: rgba(235, 98, 99, .09);
  color: #ffb4b4;
  font-size: 11.5px;
  line-height: 1.5;
}
.login-card .btn-primary { margin-top: 24px; }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--input); outline: 0;
  font-size: 12.5px;
  transition: border-color .16s, box-shadow .16s;
}
.textarea { height: auto; min-height: 76px; padding: 10px 11px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus {
  border-color: rgba(51, 140, 237, .62);
  box-shadow: 0 0 0 3px rgba(51, 140, 237, .1);
}
.select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, #777 50%), linear-gradient(135deg, #777 50%, transparent 50%); background-position: calc(100% - 15px) 17px, calc(100% - 10px) 17px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
option { background: #171717; color: var(--text); }

.status-dot.is-good { background: var(--green-dot); box-shadow: 0 0 0 3px rgba(10, 172, 35, .11); }
.status-dot.is-warn { background: var(--yellow); box-shadow: 0 0 0 3px rgba(251, 179, 21, .1); }
.status-dot.is-danger { background: var(--red); box-shadow: 0 0 0 3px rgba(235, 98, 99, .1); }
.status-dot.is-off { background: #5c5c5c; }
.status-dot.is-on { background: var(--blue); box-shadow: 0 0 0 3px rgba(51, 140, 237, .1); }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 8px;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255, 255, 255, .025);
  color: #b8b8b8; font-size: 10.5px; font-weight: 520; white-space: nowrap;
}
.badge .status-dot { width: 5px; height: 5px; flex-basis: 5px; box-shadow: none; }
.badge.is-good { border-color: rgba(10, 172, 35, .2); background: rgba(10, 172, 35, .07); color: #b8e7bd; }
.badge.is-on { border-color: rgba(51, 140, 237, .2); background: rgba(51, 140, 237, .07); color: #b9d8fa; }
.badge.is-warn { border-color: rgba(251, 179, 21, .2); background: rgba(251, 179, 21, .07); color: #ecd39d; }
.badge.is-danger { border-color: rgba(235, 98, 99, .2); background: rgba(235, 98, 99, .08); color: #f3baba; }
.badge.is-off { color: #8f8f8f; }
.proto-tag {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 7px;
  border: 1px solid var(--line); border-radius: 6px;
  background: rgba(255, 255, 255, .025);
  color: #a6a6a6; font-family: var(--mono); font-size: 9.5px; letter-spacing: .02em;
  white-space: nowrap;
}
.proto-tag .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--blue); }
.proto-tag.is-https .dot { background: var(--orange); }
.proto-tag.is-socks .dot { background: var(--violet); }
.meter { width: 100%; height: 4px; border-radius: 99px; background: rgba(51, 140, 237, .16); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: inherit; background: var(--blue); transition: width .4s ease; }
.meter.is-warn { background: rgba(251, 179, 21, .14); }
.meter.is-warn > span { background: var(--yellow); }
.meter.is-danger { background: rgba(235, 98, 99, .14); }
.meter.is-danger > span { background: var(--red); }
.meter.is-off > span { background: #666; }
.empty {
  padding: 42px 20px; text-align: center; color: var(--muted);
}
.empty-icon {
  width: 44px; height: 44px; margin: 0 auto 13px;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 13px;
  background: rgba(255, 255, 255, .022); color: #666;
}
.empty-icon svg { width: 20px; height: 20px; }
.empty h3 { margin: 0 0 5px; color: #c5c5c5; font-size: 13px; font-weight: 550; }
.empty p { margin: 0; color: #6f6f6f; font-size: 11.5px; line-height: 1.6; }
.empty .btn { margin-top: 16px; }
.link-btn {
  border: 0; background: transparent; color: #7db7f7; font-size: 11.5px; padding: 4px 2px;
}
.link-btn:hover { color: #a8cefa; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- dashboard ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi {
  position: relative; overflow: hidden;
  padding: 19px 20px 17px;
  min-height: 128px;
}
.kpi::after {
  content: ""; position: absolute; right: -30px; top: -50px;
  width: 150px; height: 150px; border-radius: 50%;
  background: radial-gradient(circle, rgba(51, 140, 237, .07), transparent 68%);
  pointer-events: none;
}
.kpi-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.kpi-label { color: #9a9a9a; font-size: 11.5px; font-weight: 500; }
.kpi-icon {
  width: 31px; height: 31px; display: grid; place-items: center;
  border: 1px solid rgba(51, 140, 237, .13); border-radius: 9px;
  background: var(--blue-soft); color: #79b5f3;
}
.kpi-icon svg { width: 15px; height: 15px; }
.kpi-icon.is-orange { color: #eca07c; background: var(--orange-soft); border-color: rgba(231, 102, 36, .13); }
.kpi-icon.is-green { color: #82d98c; background: var(--green-soft); border-color: rgba(10, 172, 35, .13); }
.kpi-icon.is-violet { color: #b7aaf5; background: rgba(152, 135, 239, .1); border-color: rgba(152, 135, 239, .13); }
.kpi-value {
  margin-top: 14px;
  font-size: clamp(25px, 2.1vw, 31px); line-height: 1.1;
  letter-spacing: -.035em; font-weight: 610; color: #f1f1f1;
}
.kpi-value .unit { margin-left: 2px; font-size: .54em; font-weight: 500; letter-spacing: 0; color: #a7a7a7; }
.kpi-meta { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 7px; color: #6f6f6f; font-size: 10.5px; }
.kpi-meta .up { color: #8fbff0; }
.kpi-meta .down { color: #e5a17e; }
.kpi-meta .sep { color: #3d3d3d; }
.dash-main { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(300px, .85fr); gap: 14px; margin-top: 14px; }
.dash-side { display: grid; gap: 14px; }
.dash-lower { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(300px, .85fr); gap: 14px; margin-top: 14px; }
.chart-card { background: #191919; }
.chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 20px 22px 0; }
.chart-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chart-legend { display: flex; align-items: center; gap: 14px; margin-top: 8px; color: #9c9c9c; font-size: 10.5px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 8px; height: 8px; border-radius: 2px; background: var(--blue); }
.legend-swatch.is-orange { background: var(--orange); }
.chart-actions { display: flex; align-items: center; gap: 8px; }
.segmented { display: inline-flex; align-items: center; gap: 1px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: #111; }
.segmented button {
  height: 26px; padding: 0 9px; border: 0; border-radius: 6px;
  background: transparent; color: #777; font-size: 10.5px; font-weight: 550;
}
.segmented button:hover { color: #bbb; }
.segmented button.is-active { background: #2a2a2a; color: #e7e7e7; box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset; }
.chart-toggle { height: 30px; font-size: 10.5px; padding: 0 9px; }
.chart-canvas { position: relative; width: 100%; height: 286px; padding: 6px 12px 0; }
.chart-canvas svg { width: 100%; height: 100%; overflow: visible; }
.chart-canvas text { font-family: var(--font); }
.chart-hit { cursor: crosshair; }
.chart-tooltip {
  position: absolute; z-index: 4; pointer-events: none;
  min-width: 176px; padding: 10px 11px;
  border: 1px solid rgba(255, 255, 255, .11); border-radius: 9px;
  background: rgba(28, 28, 28, .97); box-shadow: 0 10px 30px rgba(0, 0, 0, .38);
  color: #ddd; font-size: 10.5px;
}
.chart-tooltip.is-hidden { display: none; }
.tt-date { color: #8f8f8f; margin-bottom: 7px; font-size: 10px; }
.tt-row { display: flex; align-items: center; gap: 7px; margin-top: 5px; }
.tt-row .legend-swatch { width: 6px; height: 6px; flex: 0 0 6px; }
.tt-label { color: #a0a0a0; }
.tt-value { margin-left: auto; color: #e9e9e9; font-family: var(--mono); font-size: 10px; }
.tt-total { display: flex; gap: 7px; margin-top: 8px; padding-top: 7px; border-top: 1px solid rgba(255, 255, 255, .07); color: #858585; }
.tt-total strong { margin-left: auto; color: #d6d6d6; font-family: var(--mono); font-weight: 500; }
.chart-empty {
  position: absolute; inset: 40px 20px 40px 56px;
  display: flex; align-items: center; justify-content: center;
  color: #656565; font-size: 11.5px; pointer-events: none;
}
.chart-table-wrap { display: none; padding: 0 22px 20px; }
.chart-table-wrap.is-visible { display: block; }
.chart-table-wrap .table-wrap { max-height: 252px; overflow: auto; border: 1px solid var(--line); border-radius: 9px; }
.chart-table-wrap table { min-width: 420px; }
.chart-table-wrap th, .chart-table-wrap td { padding: 9px 12px; font-size: 10.5px; }
.chart-note { padding: 0 22px 18px; display: flex; justify-content: space-between; gap: 14px; color: #666; font-size: 10px; }
.top-list { padding: 4px 22px 16px; }
.top-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 11px 0; border-bottom: 1px solid rgba(255, 255, 255, .05); }
.top-row:last-child { border-bottom: 0; }
.top-rank { color: #555; font-family: var(--mono); font-size: 9px; }
.top-main { min-width: 0; }
.top-name { display: flex; align-items: baseline; gap: 7px; color: #d6d6d6; font-size: 11.5px; }
.top-name em { font-style: normal; color: #5f5f5f; font-size: 9.5px; }
.top-bar { height: 5px; margin-top: 7px; border-radius: 99px; background: #272727; overflow: hidden; }
.top-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2f7ed0, #4b9cf2); }
.top-value { color: #bdbdbd; font-family: var(--mono); font-size: 10px; text-align: right; white-space: nowrap; }
.top-value small { display: block; margin-top: 2px; color: #5f5f5f; font-size: 8.5px; }
.top-empty { padding: 28px 0 20px; color: #666; font-size: 11px; text-align: center; }
.active-list { padding: 5px 22px 13px; }
.active-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 11px 0; border-bottom: 1px solid rgba(255, 255, 255, .05); }
.active-row:last-child { border-bottom: 0; }
.active-main { min-width: 0; }
.active-top { display: flex; align-items: center; gap: 7px; min-width: 0; }
.active-user { color: #d8d8d8; font-size: 11.5px; }
.active-target { margin-top: 3px; color: #666; font-family: var(--mono); font-size: 9.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.active-stats { text-align: right; color: #999; font-family: var(--mono); font-size: 9.5px; white-space: nowrap; }
.active-stats small { display: block; color: #5f5f5f; margin-top: 2px; }
.service-list { padding: 6px 22px 18px; }
.service-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, .05); }
.service-row:last-child { border-bottom: 0; }
.service-key { color: #777; font-size: 10.5px; }
.service-val { color: #bdbdbd; font-family: var(--mono); font-size: 9.5px; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.service-val .status-dot { display: inline-block; margin-right: 6px; vertical-align: 1px; }
.service-foot { padding: 0 22px 18px; }
.service-foot .btn { width: 100%; justify-content: space-between; }
.mobile-more { display: none; }

/* ---------- accounts ---------- */
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.view-head h2 { margin: 0; font-size: 20px; letter-spacing: -.025em; font-weight: 620; }
.view-head p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.view-head-actions { display: flex; align-items: center; gap: 9px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.search-box {
  display: flex; align-items: center; gap: 8px;
  width: 238px; height: 34px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--input);
}
.search-box:focus-within { border-color: rgba(51, 140, 237, .5); box-shadow: 0 0 0 3px rgba(51, 140, 237, .08); }
.search-box svg { width: 14px; height: 14px; color: #5e5e5e; flex: 0 0 14px; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 11.5px; }
.search-box input::placeholder { color: #525252; }
.filter-select { width: auto; height: 34px; padding: 0 30px 0 10px; font-size: 11px; background-position: calc(100% - 13px) 15px, calc(100% - 8px) 15px; }
.toolbar-count { color: #656565; font-size: 10.5px; white-space: nowrap; }
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  padding: 11px 16px; border-bottom: 1px solid var(--line);
  color: #686868; font-size: 9.5px; font-weight: 600; letter-spacing: .09em;
  text-transform: uppercase; text-align: left; white-space: nowrap;
}
.data-table td { padding: 13px 16px; border-bottom: 1px solid rgba(255, 255, 255, .05); vertical-align: middle; font-size: 12px; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .14s; }
.data-table tbody tr:hover { background: rgba(255, 255, 255, .018); }
.account-cell { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.account-ident { min-width: 0; }
.account-name { display: flex; align-items: center; gap: 7px; color: #dedede; font-size: 12px; font-weight: 550; }
.account-note { margin-top: 2px; max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #626262; font-size: 9.5px; }
.usage-cell { min-width: 148px; }
.usage-main { display: flex; align-items: baseline; gap: 6px; color: #d3d3d3; font-family: var(--mono); font-size: 11px; }
.usage-main small { color: #5e5e5e; font-family: var(--font); font-size: 9px; }
.usage-sub { display: flex; gap: 7px; margin-top: 4px; color: #606060; font-size: 9px; white-space: nowrap; }
.usage-sub .up { color: #6f9fca; }
.usage-sub .down { color: #b57f63; }
.quota-line { display: flex; align-items: center; gap: 7px; margin-top: 6px; }
.quota-line .meter { flex: 1; height: 3px; }
.quota-text { color: #5e5e5e; font-size: 8.5px; white-space: nowrap; }
.activity-cell { min-width: 120px; color: #9d9d9d; font-size: 10.5px; }
.activity-ip { margin-top: 3px; color: #555; font-family: var(--mono); font-size: 9px; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 2px; opacity: .56; transition: opacity .14s; }
tr:hover .row-actions { opacity: 1; }
.row-icon {
  width: 28px; height: 28px; display: grid; place-items: center;
  border: 1px solid transparent; border-radius: 7px; background: transparent; color: #777;
}
.row-icon svg { width: 14px; height: 14px; }
.row-icon:hover { color: #ddd; background: rgba(255, 255, 255, .055); border-color: var(--line); }
.row-icon.is-danger:hover { color: #ff9c9c; background: rgba(235, 98, 99, .09); border-color: rgba(235, 98, 99, .16); }
.table-empty { padding: 48px 20px; text-align: center; color: #777; }
.table-empty strong { display: block; margin-bottom: 5px; color: #bdbdbd; font-size: 12px; font-weight: 550; }
.table-empty span { font-size: 11px; }

/* ---------- connections ---------- */
.conn-summary { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.summary-chip { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 255, 255, .02); color: #8e8e8e; font-size: 10.5px; }
.summary-chip strong { color: #d7d7d7; font-family: var(--mono); font-size: 10.5px; font-weight: 500; }
.conn-tabs { display: flex; align-items: center; gap: 4px; padding: 14px 16px 0; border-bottom: 1px solid var(--line); }
.conn-tab { position: relative; height: 36px; padding: 0 11px; border: 0; background: transparent; color: #777; font-size: 11.5px; }
.conn-tab:hover { color: #c9c9c9; }
.conn-tab.is-active { color: #e6e6e6; }
.conn-tab.is-active::after { content: ""; position: absolute; left: 9px; right: 9px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--blue); }
.conn-tab .count { margin-left: 5px; color: #5f5f5f; font-family: var(--mono); font-size: 9px; }
.conn-table td { font-size: 11px; }
.conn-target { display: block; max-width: 330px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #b5b5b5; font-family: var(--mono); font-size: 10px; }
.conn-user { display: flex; align-items: center; gap: 8px; }
.conn-bytes { font-family: var(--mono); font-size: 10px; white-space: nowrap; color: #a4a4a4; }
.conn-bytes .up { color: #7eacd6; }
.conn-bytes .down { color: #c08b70; }
.conn-time { color: #858585; font-size: 10px; white-space: nowrap; }
.conn-status { display: inline-flex; align-items: center; gap: 6px; color: #8d8d8d; font-size: 10px; }
.conn-duration { color: #a5a5a5; font-family: var(--mono); font-size: 10px; }
.live-row-key { display: flex; align-items: center; gap: 7px; color: #6b6b6b; font-size: 10px; }
.live-row-key .live-dot { width: 5px; height: 5px; flex-basis: 5px; animation-duration: 1.8s; }

/* ---------- guide ---------- */
.guide-hero {
  position: relative; overflow: hidden;
  padding: clamp(24px, 3vw, 36px);
  border: 1px solid rgba(51, 140, 237, .17);
  border-radius: 18px;
  background:
    radial-gradient(620px 260px at 85% 20%, rgba(51, 140, 237, .1), transparent 70%),
    linear-gradient(130deg, #0e151e, #0d0d0d 58%);
}
.guide-hero::after {
  content: ""; position: absolute; right: 36px; top: 50%; transform: translateY(-50%);
  width: 190px; height: 190px; border: 1px solid rgba(51, 140, 237, .12);
  border-radius: 50%; box-shadow: 0 0 0 34px rgba(51, 140, 237, .035), 0 0 0 68px rgba(51, 140, 237, .018);
  pointer-events: none;
}
.guide-hero h2 { margin: 12px 0 0; max-width: 640px; font-size: clamp(24px, 2.7vw, 34px); line-height: 1.25; letter-spacing: -.035em; font-weight: 620; }
.guide-hero p { max-width: 620px; margin: 12px 0 0; color: #98a2ad; font-size: 12.5px; line-height: 1.75; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.guide-card { padding: 20px 22px; }
.guide-card .card-title { display: flex; align-items: center; gap: 8px; }
.guide-card .card-title svg { width: 16px; height: 16px; color: #79b5f3; }
.guide-card .card-sub { max-width: 520px; line-height: 1.6; }
.protocol-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.protocol-card { padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255, 255, 255, .018); }
.protocol-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.protocol-name { color: #d5d5d5; font-size: 11.5px; font-weight: 600; }
.protocol-port { color: #5e5e5e; font-family: var(--mono); font-size: 9.5px; }
.protocol-url { margin-top: 8px; color: #858585; font-family: var(--mono); font-size: 9.5px; line-height: 1.55; word-break: break-all; }
.protocol-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.mini-copy { border: 0; background: transparent; color: #647f9d; font-size: 9.5px; padding: 0; }
.mini-copy:hover { color: #9dc7f4; }
.code-block { position: relative; margin-top: 14px; border: 1px solid var(--line); border-radius: 11px; background: #0d0d0d; overflow: hidden; }
.code-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-bottom: 1px solid rgba(255, 255, 255, .055); }
.code-label { color: #606060; font-size: 9.5px; letter-spacing: .05em; }
.code-copy {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 7px; border: 1px solid var(--line); border-radius: 6px;
  background: transparent; color: #777; font-size: 9.5px;
}
.code-copy svg { width: 11px; height: 11px; }
.code-copy:hover { color: #d0d0d0; background: rgba(255, 255, 255, .04); }
.code-block pre { margin: 0; padding: 14px; overflow-x: auto; color: #c8d2df; font-family: var(--mono); font-size: 11px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.code-block pre .c { color: #5f6b78; }
.code-block pre .v { color: #9fc6f1; }
.code-block pre .k { color: #d5b087; }
.callout { display: flex; gap: 10px; margin-top: 13px; padding: 11px 12px; border: 1px solid rgba(51, 140, 237, .15); border-radius: 9px; background: rgba(51, 140, 237, .055); color: #8fa8c1; font-size: 10.5px; line-height: 1.6; }
.callout.is-warn { border-color: rgba(251, 179, 21, .15); background: rgba(251, 179, 21, .045); color: #b6a27b; }
.callout svg { width: 14px; height: 14px; flex: 0 0 14px; margin-top: 1px; }
.guide-wide { grid-column: 1 / -1; }
.step-list { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.step { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 11px; padding: 11px 0; border-bottom: 1px solid rgba(255, 255, 255, .05); }
.step:last-child { border-bottom: 0; }
.step-num { counter-increment: step; width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; color: #777; font-family: var(--mono); font-size: 9px; }
.step-num::before { content: "0" counter(step); }
.step h4 { margin: 2px 0 3px; color: #cfcfcf; font-size: 11.5px; font-weight: 550; }
.step p { margin: 0; color: #777; font-size: 10.5px; line-height: 1.6; }
.inline-code { padding: 1px 5px; border: 1px solid rgba(255, 255, 255, .07); border-radius: 4px; background: rgba(255, 255, 255, .035); color: #b9c7d8; font-family: var(--mono); font-size: .92em; }

/* ---------- settings ---------- */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.settings-grid .card-body { padding-top: 16px; }
.settings-card .card-head { padding-bottom: 16px; }
.settings-desc { margin: 0 0 16px; color: #7b7b7b; font-size: 11px; line-height: 1.65; }
.settings-rows { display: flex; flex-direction: column; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, .05); }
.settings-row:last-child { border-bottom: 0; }
.settings-key { color: #7b7b7b; font-size: 10.5px; }
.settings-value { color: #bdbdbd; font-family: var(--mono); font-size: 10px; text-align: right; word-break: break-all; }
.settings-note { display: flex; align-items: flex-start; gap: 8px; margin-top: 12px; color: #6f6f6f; font-size: 10px; line-height: 1.6; }
.settings-note svg { width: 13px; height: 13px; flex: 0 0 13px; margin-top: 1px; }
.security-list { margin: 0; padding: 0; list-style: none; }
.security-list li { display: flex; align-items: flex-start; gap: 9px; padding: 9px 0; color: #8d8d8d; font-size: 10.5px; line-height: 1.55; border-bottom: 1px solid rgba(255, 255, 255, .045); }
.security-list li:last-child { border-bottom: 0; }
.security-list svg { width: 13px; height: 13px; flex: 0 0 13px; margin-top: 1px; color: #5f8f61; }
.account-card-body { display: flex; align-items: center; gap: 12px; padding: 18px 22px 6px; }
.account-card-body .avatar { width: 40px; height: 40px; flex-basis: 40px; border-radius: 11px; font-size: 13px; }
.account-card-name { color: #dedede; font-size: 13px; font-weight: 550; }
.account-card-role { margin-top: 2px; color: #6b6b6b; font-size: 10px; }
.session-line { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; color: #6f6f6f; font-size: 10.5px; }
.session-line strong { color: #a7a7a7; font-weight: 500; font-family: var(--mono); font-size: 10px; }
.settings-form { margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .field + .field { margin-top: 0; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; }
.password-meter { display: flex; gap: 4px; margin-top: 8px; }
.password-meter span { height: 3px; flex: 1; border-radius: 2px; background: #272727; }
.password-meter span.is-on { background: var(--blue); }
.password-meter span.is-mid { background: var(--yellow); }
.password-meter span.is-strong { background: var(--green); }

/* ---------- modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 22px;
  background: rgba(0, 0, 0, .7);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  animation: fadeIn .16s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(560px, 100%);
  max-height: calc(100dvh - 44px);
  display: flex; flex-direction: column;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 16px;
  background: #161616;
  box-shadow: var(--shadow);
  animation: modalIn .22s ease both;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
.modal-sm { width: min(430px, 100%); }
.modal-wide { width: min(680px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px 16px; border-bottom: 1px solid var(--line); }
.modal-title { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -.015em; }
.modal-sub { margin: 4px 0 0; color: #777; font-size: 10.5px; line-height: 1.55; }
.modal-close { margin: -4px -6px 0 0; width: 30px; height: 30px; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); }
.modal-alert { margin-top: 14px; }
.modal .form-actions { margin-top: 20px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 17px; padding: 11px 0 0; border-top: 1px solid rgba(255, 255, 255, .055); }
.toggle-copy { min-width: 0; }
.toggle-copy strong { display: block; color: #cfcfcf; font-size: 11.5px; font-weight: 550; }
.toggle-copy span { display: block; margin-top: 2px; color: #666; font-size: 9.5px; }
.switch { position: relative; width: 38px; height: 22px; flex: 0 0 38px; }
.switch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #333; transition: background .18s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #a5a5a5; transition: transform .18s, background .18s; }
.switch input:checked + span { background: rgba(51, 140, 237, .65); }
.switch input:checked + span::after { transform: translateX(16px); background: #fff; }
.switch input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.modal-error { margin-top: 14px; }
.credential-wrap { border: 1px solid rgba(51, 140, 237, .2); border-radius: 12px; background: linear-gradient(150deg, rgba(51, 140, 237, .08), rgba(51, 140, 237, .015)); padding: 16px; }
.credential-userline { display: flex; align-items: center; gap: 7px; color: #9abce0; font-size: 10.5px; flex-wrap: wrap; }
.credential-userline > svg { width: 13px; height: 13px; flex: 0 0 13px; }
.credential-name { color: #e1e1e1; font-family: var(--mono); font-size: 13px; }
.secret-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.secret-value { flex: 1; min-width: 0; padding: 9px 11px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 8px; background: #0c0c0c; color: #eaf4ff; font-family: var(--mono); font-size: 15px; letter-spacing: .04em; overflow-wrap: anywhere; }
.secret-actions { display: flex; gap: 4px; }
.secret-note { margin-top: 10px; color: #8a8a8a; font-size: 9.5px; line-height: 1.6; }
.credential-section { margin-top: 18px; }
.credential-section h4 { margin: 0 0 8px; color: #a5a5a5; font-size: 10.5px; font-weight: 550; }
.credential-section .code-block { margin-top: 0; }
.copy-all { margin-top: 16px; }
.modal-desc { margin: 0; color: #a2a2a2; font-size: 12px; line-height: 1.75; }
.modal-desc strong { color: #e2e2e2; font-weight: 600; }
.modal-hint { display: flex; gap: 8px; margin-top: 14px; padding: 10px 11px; border-radius: 8px; background: rgba(255, 255, 255, .03); color: #7f7f7f; font-size: 10px; line-height: 1.6; }
.modal-hint svg { width: 13px; height: 13px; flex: 0 0 13px; margin-top: 1px; }
.danger-text { color: #e3a1a1; }

/* ---------- toast ---------- */
.toast-root { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 9px;
  min-width: 190px; max-width: min(380px, calc(100vw - 40px));
  padding: 11px 13px;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: #1b1b1b; color: #d8d8d8; font-size: 11.5px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .4);
  animation: toastIn .22s ease both;
}
.toast svg { width: 15px; height: 15px; flex: 0 0 15px; color: var(--green); }
.toast.is-error { border-color: rgba(235, 98, 99, .26); }
.toast.is-error svg { color: var(--red); }
.toast.is-leaving { animation: toastOut .2s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(5px); } }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; background: #0b0b0b; color: #ccc; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-main, .dash-lower { grid-template-columns: minmax(0, 1.55fr) minmax(280px, .85fr); }
  .top-value small { display: none; }
}
@media (max-width: 980px) {
  :root { --sidebar-w: 238px; }
  .dash-main, .dash-lower { grid-template-columns: 1fr; }
  .dash-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guide-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .protocol-cards { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .login-view { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-brand-mobile { display: flex; }
  .login-panel { padding: 34px 24px 24px; }
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow); }
  .app-view.is-sidebar-open .sidebar { transform: none; }
  .app-view.is-sidebar-open .mobile-scrim {
    display: block; position: fixed; inset: 0; z-index: 40;
    background: rgba(0, 0, 0, .55); backdrop-filter: blur(2px);
  }
  .main-shell { margin-left: 0; }
  .mobile-menu { display: inline-grid; }
  .sidebar .sidebar-close { display: inline-grid; }
  .topbar { height: 70px; flex-basis: 70px; }
  .content { padding-top: 21px; }
  .guide-hero::after { opacity: .45; }
}
@media (max-width: 700px) {
  .dash-side { grid-template-columns: 1fr; }
  .kpi-grid { gap: 10px; }
  .kpi { padding: 16px; min-height: 116px; }
  .kpi-value { font-size: 25px; }
  .chart-head { flex-direction: column; gap: 12px; }
  .chart-actions { width: 100%; justify-content: space-between; }
  .chart-canvas { height: 228px; padding-left: 0; padding-right: 0; }
  .chart-note { flex-direction: column; gap: 4px; }
  .view-head { align-items: flex-start; flex-direction: column; gap: 13px; }
  .view-head-actions { width: 100%; }
  .view-head-actions .btn-primary { flex: 1; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-left { width: 100%; }
  .search-box { width: 100%; }
  .toolbar-right { justify-content: space-between; }
  .form-grid { grid-template-columns: 1fr; }
  .settings-grid { gap: 10px; }
  .app-footer { flex-wrap: wrap; gap: 5px; }
  .app-footer .footer-spacer { display: none; }
  .modal-overlay { padding: 10px; align-items: flex-end; }
  .modal { max-height: calc(100dvh - 20px); border-radius: 16px 16px 12px 12px; }
  .modal-body { padding: 18px 18px; }
  .modal-head, .modal-foot { padding-left: 18px; padding-right: 18px; }
  .modal-foot .btn { flex: 1; }
  .data-table.responsive-table thead { display: none; }
  .data-table.responsive-table, .data-table.responsive-table tbody, .data-table.responsive-table tr, .data-table.responsive-table td { display: block; width: 100%; }
  .data-table.responsive-table tbody { padding: 8px 12px; }
  .data-table.responsive-table tr { position: relative; padding: 13px 0; border-bottom: 1px solid var(--line); }
  .data-table.responsive-table tr:last-child { border-bottom: 0; }
  .data-table.responsive-table td { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 4px 3px; border: 0; min-height: 25px; }
  .data-table.responsive-table td::before { content: attr(data-label); flex: 0 0 auto; padding-top: 2px; color: #5f5f5f; font-size: 9.5px; letter-spacing: .04em; }
  .data-table.responsive-table td[data-label=""]::before { display: none; }
  .data-table.responsive-table td > * { text-align: right; }
  .data-table.responsive-table .account-cell { text-align: left; justify-content: flex-end; }
  .data-table.responsive-table td[data-label=""] { display: block; padding: 4px 3px 9px; }
  .data-table.responsive-table td[data-label=""] .account-cell { justify-content: flex-start; width: 100%; }
  .data-table.responsive-table td[data-label=""] .account-ident { text-align: left; }
  .data-table.responsive-table td[data-label=""] .account-name { justify-content: flex-start; }
  .data-table.responsive-table td[data-label=""] .account-note { text-align: left; }
  .data-table.responsive-table .account-ident { text-align: right; }
  .data-table.responsive-table .account-name { justify-content: flex-end; }
  .data-table.responsive-table .account-note { text-align: right; }
  .data-table.responsive-table .usage-cell, .data-table.responsive-table .activity-cell { min-width: 0; text-align: right; }
  .data-table.responsive-table .usage-main, .data-table.responsive-table .usage-sub, .data-table.responsive-table .quota-line { justify-content: flex-end; }
  .data-table.responsive-table .usage-sub { flex-wrap: wrap; }
  .data-table.responsive-table .quota-line { max-width: 150px; margin-left: auto; }
  .data-table.responsive-table .row-actions { opacity: 1; justify-content: flex-end; }
  .data-table.responsive-table .conn-target { max-width: 200px; }
  .conn-tabs { overflow-x: auto; }
  .conn-summary { gap: 7px; }
  .summary-chip { height: 29px; padding: 0 9px; }
  .guide-card { padding: 17px 16px; }
  .chart-table-wrap { padding-left: 16px; padding-right: 16px; }
  .top-list, .active-list, .service-list { padding-left: 16px; padding-right: 16px; }
  .chart-head { padding-left: 16px; padding-right: 16px; }
  .chart-note { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 430px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi-value { font-size: 22px; }
  .kpi-meta { font-size: 9.5px; }
  .live-pill { display: none; }
  .topbar { padding-left: 14px; padding-right: 14px; }
  .content { padding-left: 14px; padding-right: 14px; }
  .app-footer { padding-left: 14px; padding-right: 14px; }
  .chart-actions { flex-wrap: wrap; }
  .segmented button { padding: 0 7px; }
  .secret-value { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
