/* Nest Host dashboard */

:root {
  color-scheme: dark;
  --bg: #070a0f;
  --bg-soft: #0b0f16;
  --panel: #0f1520;
  --panel-2: #131b28;
  --panel-3: #17202e;
  --line: #1c2635;
  --line-soft: #172030;
  --text: #e8eef7;
  --text-soft: #aab6c6;
  --muted: #77869a;
  --accent: #6ee7ff;
  --accent-2: #8b5cf6;
  --accent-ink: #041218;
  --success: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 12% -10%, rgba(110, 231, 255, 0.09), transparent 60%),
    radial-gradient(800px 500px at 92% 0%, rgba(139, 92, 246, 0.1), transparent 55%),
    radial-gradient(700px 500px at 70% 110%, rgba(52, 211, 153, 0.05), transparent 60%);
  z-index: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

code,
.mono {
  font-family: var(--mono);
  font-size: 0.88em;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}
.soft {
  color: var(--text-soft);
}
.danger-text {
  color: var(--danger);
}
.success-text {
  color: var(--success);
}
.warn-text {
  color: var(--warn);
}
.nowrap {
  white-space: nowrap;
}
.break {
  word-break: break-all;
}

/* scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: #263243 transparent;
}
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-thumb {
  background: #243042;
  border-radius: 99px;
  border: 3px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: #314157;
  background-clip: padding-box;
  border: 3px solid transparent;
}

/* boot */
.app-boot {
  min-height: 100vh;
  display: grid;
  place-items: center;
}
.boot-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 24px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius);
  color: var(--text-soft);
}
.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(110, 231, 255, 0.25);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
  flex: none;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* auth gate */
.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
  position: relative;
  z-index: 1;
}
.gate-card {
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(19, 27, 40, 0.95), rgba(10, 14, 21, 0.98));
  box-shadow: var(--shadow);
  overflow: hidden;
}
.gate-aside {
  padding: 42px 38px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 28px;
  background:
    radial-gradient(500px 300px at 0% 0%, rgba(110, 231, 255, 0.1), transparent 65%),
    radial-gradient(420px 280px at 100% 100%, rgba(139, 92, 246, 0.12), transparent 60%);
}
.gate-form {
  padding: 42px 38px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}
.gate-badge {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(110, 231, 255, 0.3);
  background: rgba(110, 231, 255, 0.08);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.gate-title {
  font-size: clamp(1.7rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.gate-title span {
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.gate-lead {
  color: var(--text-soft);
  max-width: 34ch;
}
.gate-list {
  display: grid;
  gap: 10px;
  margin-top: auto;
  font-size: 13.5px;
  color: var(--text-soft);
}
.gate-list div {
  display: flex;
  gap: 10px;
  align-items: center;
}
.gate-list svg {
  flex: none;
  color: var(--accent);
}
.gate h2 {
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}
.gate-sub {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: -8px;
}

/* shell */
.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 16px 18px;
  background: rgba(9, 13, 20, 0.86);
  border-right: 1px solid var(--line-soft);
  backdrop-filter: blur(14px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 6px;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, rgba(110, 231, 255, 0.18), rgba(139, 92, 246, 0.22));
  border: 1px solid rgba(110, 231, 255, 0.28);
  color: var(--accent);
  flex: none;
}
.brand-text strong {
  display: block;
  font-size: 15px;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.brand-text span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nav-section {
  display: grid;
  gap: 4px;
}
.nav-label {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #56657a;
  padding: 0 10px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  text-align: left;
  font-size: 13.5px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  width: 100%;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}
.nav-item.active {
  background: linear-gradient(100deg, rgba(110, 231, 255, 0.1), rgba(139, 92, 246, 0.09));
  border-color: rgba(110, 231, 255, 0.22);
  color: var(--text);
}
.nav-item.active svg {
  color: var(--accent);
}
.nav-icon {
  display: grid;
  place-items: center;
  width: 18px;
  color: #7f8ea3;
  flex: none;
}
.nav-badge {
  margin-left: auto;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(110, 231, 255, 0.1);
  color: var(--accent);
  border: 1px solid rgba(110, 231, 255, 0.18);
  font-variant-numeric: tabular-nums;
}
.sidebar-foot {
  margin-top: auto;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(19, 27, 40, 0.4);
  font-size: 11.5px;
  color: var(--muted);
}
.sys-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sys-row b {
  font-weight: 500;
  color: var(--text-soft);
}
.sys-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 5px;
}
.sys-dot.on {
  background: var(--success);
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.7);
}
.sys-dot.off {
  background: #526174;
}

.workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
}
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 26px clamp(18px, 3.4vw, 42px) 18px;
  border-bottom: 1px solid var(--line-soft);
  flex: none;
}
.eyebrow {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 6px;
}
.page-title {
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  letter-spacing: -0.025em;
  font-weight: 650;
  line-height: 1.2;
}
.page-sub {
  color: var(--muted);
  font-size: 13px;
  margin-top: 5px;
  max-width: 60ch;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
main#main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px clamp(18px, 3.4vw, 42px) 56px;
}

.app-foot {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px clamp(18px, 3.4vw, 42px);
  border-top: 1px solid var(--line-soft);
  background: rgba(8, 11, 16, 0.62);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.4;
}
.app-foot .build {
  color: var(--text-soft);
}
@media (max-width: 720px) {
  .app-foot {
    flex-wrap: wrap;
    font-size: 10px;
  }
}

/* page pieces */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.section-title {
  font-size: 14px;
  font-weight: 620;
  letter-spacing: 0.01em;
}
.section-sub {
  font-size: 12.5px;
  color: var(--muted);
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}
.stat {
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(19, 27, 40, 0.6), rgba(15, 21, 32, 0.4));
  display: grid;
  gap: 2px;
}
.stat-value {
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
}
.stat.accent .stat-value {
  color: var(--accent);
}

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 13px;
  cursor: pointer;
  transition: transform 0.12s, background 0.15s, border-color 0.15s, color 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover {
  background: var(--panel-3);
  border-color: #2a3a50;
  color: var(--text);
  text-decoration: none;
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn svg {
  flex: none;
}
.btn-primary {
  background: linear-gradient(100deg, var(--accent), #7dd3fc 45%, var(--accent-2));
  border-color: transparent;
  color: #06121a;
  font-weight: 650;
}
.btn-primary:hover {
  color: #041016;
  filter: brightness(1.06);
  background: linear-gradient(100deg, var(--accent), #7dd3fc 45%, var(--accent-2));
}
.btn-danger {
  border-color: rgba(248, 113, 113, 0.3);
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.07);
}
.btn-danger:hover {
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.45);
  color: #fecaca;
}
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-soft);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: transparent;
}
.btn-sm {
  font-size: 12px;
  padding: 5px 9px;
  border-radius: 8px;
  gap: 5px;
}
.btn-icon {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 8px;
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
.btn-icon:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}
.btn-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

/* badges + status */
.badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
}
.badge-static {
  color: #93c5fd;
  border-color: rgba(147, 197, 253, 0.25);
  background: rgba(59, 130, 246, 0.08);
}
.badge-node {
  color: #86efac;
  border-color: rgba(134, 239, 172, 0.22);
  background: rgba(34, 197, 94, 0.08);
}
.badge-python {
  color: #fcd34d;
  border-color: rgba(252, 211, 77, 0.22);
  background: rgba(250, 204, 21, 0.08);
}
.badge-domain {
  color: var(--accent);
  border-color: rgba(110, 231, 255, 0.25);
  background: rgba(110, 231, 255, 0.07);
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
}
.badge-tunnel {
  color: #c4b5fd;
  border-color: rgba(196, 181, 253, 0.25);
  background: rgba(139, 92, 246, 0.08);
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
}
.badge-danger {
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.3);
  background: rgba(248, 113, 113, 0.08);
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5c6b7f;
  flex: none;
}
.status-pill.running .dot {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.12);
}
.status-pill.starting .dot {
  background: var(--warn);
  animation: pulse 1.1s ease-in-out infinite;
}
.status-pill.error .dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.12);
}
.status-pill.running {
  color: #a7f3d0;
  border-color: rgba(52, 211, 153, 0.25);
}
.status-pill.error {
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.3);
}
.status-pill.starting {
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.25);
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

/* site grid */
.site-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 14px;
}
.site-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(170deg, rgba(19, 27, 40, 0.72), rgba(13, 18, 28, 0.85));
  transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
  overflow: hidden;
}
.site-card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(110, 231, 255, 0.25), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}
.site-card:hover {
  border-color: #2a3a50;
  transform: translateY(-1px);
  box-shadow: 0 18px 40px -28px rgba(0, 0, 0, 0.9);
}
.site-card:hover::after {
  opacity: 1;
}
.site-card.is-error {
  border-color: rgba(248, 113, 113, 0.3);
}
.site-top {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}
.site-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  flex: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
}
.site-icon.static {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(147, 197, 253, 0.22);
}
.site-icon.node {
  color: #86efac;
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(134, 239, 172, 0.22);
}
.site-icon.python {
  color: #fcd34d;
  background: rgba(250, 204, 21, 0.09);
  border-color: rgba(252, 211, 77, 0.22);
}
.site-identity {
  min-width: 0;
  flex: 1;
}
.site-name {
  font-size: 14.5px;
  font-weight: 620;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-key {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.site-links {
  display: grid;
  gap: 6px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  padding: 10px 0;
}
.link-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 12px;
}
.link-label {
  flex: none;
  width: 58px;
  color: #64748b;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.link-value {
  min-width: 0;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-soft);
}
.link-value a {
  color: var(--text-soft);
}
.link-value a:hover {
  color: var(--accent);
}
.link-value.muted {
  color: var(--muted);
}
.link-value.is-missing {
  color: var(--red);
}
.copy-btn {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  background: transparent;
  color: #5d6c80;
  cursor: pointer;
}
.copy-btn:hover {
  color: var(--accent);
  background: rgba(110, 231, 255, 0.08);
  border-color: rgba(110, 231, 255, 0.15);
}
.site-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11.5px;
  color: var(--muted);
  flex-wrap: wrap;
}
.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.site-error {
  font-size: 12px;
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.06);
  border: 1px solid rgba(248, 113, 113, 0.18);
  border-radius: 8px;
  padding: 7px 9px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.site-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: auto;
}
.site-actions .spacer {
  flex: 1;
}

/* desktop apps */
.app-desc {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}
.app-card .link-value.mono {
  font-size: 11px;
}
.app-suggestions {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}
.app-suggestion {
  text-align: left;
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-soft);
  cursor: pointer;
  font: inherit;
}
.app-suggestion:hover {
  border-color: rgba(110, 231, 255, 0.35);
  background: rgba(110, 231, 255, 0.05);
}
.app-suggestion.is-added {
  opacity: 0.5;
  cursor: default;
}
.app-suggestion-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}
.app-suggestion-cmd {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
}
.app-suggestion-path {
  font-size: 10.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-suggestion-reason {
  font-size: 10.5px;
  color: #64748b;
}
.app-log-view {
  height: min(52vh, 480px);
  margin-top: 8px;
}
.app-log-view .log-line {
  white-space: pre-wrap;
  word-break: break-word;
}

/* cluster sync */
.cluster-sync-panel {
  margin-bottom: 14px;
}
.cluster-sync-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 0 4px;
}
.chip-danger {
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.07);
}
.cluster-matrix {
  max-height: 360px;
  overflow: auto;
}
.cluster-matrix td.sync-cell {
  white-space: nowrap;
  font-size: 11.5px;
  color: var(--muted);
}
.sync-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 6px;
  background: #475569;
  vertical-align: 1px;
}
.sync-dot.ok {
  background: #34d399;
}
.sync-dot.error {
  background: #f87171;
}
.sync-dot.warn {
  background: #fbbf24;
}
.sync-dot.paused {
  background: #64748b;
}
.sync-dot.local {
  background: transparent;
  border: 1px dashed #64748b;
}
.server-card.is-maintenance {
  border-color: rgba(251, 191, 36, 0.32);
  background: linear-gradient(170deg, rgba(35, 31, 18, 0.6), rgba(16, 17, 14, 0.85));
}

/* panels + forms */
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(175deg, rgba(19, 27, 40, 0.7), rgba(12, 17, 25, 0.75));
  overflow: hidden;
}
.panel-head {
  padding: 16px 18px 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  justify-content: space-between;
}
.panel-title {
  font-size: 14px;
  font-weight: 620;
}
.panel-sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 3px;
}
.panel-body {
  padding: 16px 18px 18px;
  display: grid;
  gap: 14px;
}
.cols-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 14px;
  align-items: start;
}
.field {
  display: grid;
  gap: 6px;
}
.field-label {
  font-size: 12px;
  font-weight: 550;
  color: var(--text-soft);
}
.field-help {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.45;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
input[type="text"],
input[type="password"],
input[type="url"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 9px 11px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(7, 10, 15, 0.6);
  color: var(--text);
  outline: none;
  font-size: 13.5px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  resize: vertical;
  min-height: 84px;
}
input:focus,
select:focus,
textarea:focus {
  border-color: rgba(110, 231, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(110, 231, 255, 0.08);
}
input::placeholder,
textarea::placeholder {
  color: #4b5a6e;
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2377869a' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 32px;
}
.switch-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line-soft);
}
.switch-row:last-child {
  border-bottom: 0;
}
.switch-copy {
  display: grid;
  gap: 2px;
}
.switch-copy b {
  font-size: 12.5px;
  font-weight: 550;
  color: var(--text-soft);
}
.switch-copy span {
  font-size: 11.5px;
  color: var(--muted);
}
.switch {
  position: relative;
  width: 38px;
  height: 22px;
  flex: none;
  margin-top: 2px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.switch i {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #1b2637;
  border: 1px solid #2a3a50;
  transition: background 0.15s, border-color 0.15s;
  cursor: pointer;
}
.switch i::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #93a1b4;
  top: 2px;
  left: 2px;
  transition: transform 0.16s, background 0.16s;
}
.switch input:checked + i {
  background: rgba(110, 231, 255, 0.25);
  border-color: rgba(110, 231, 255, 0.5);
}
.switch input:checked + i::after {
  transform: translateX(16px);
  background: var(--accent);
}
.switch input:disabled + i {
  opacity: 0.5;
  cursor: not-allowed;
}

/* dropzone */
.dropzone {
  border: 1.5px dashed #2a3a50;
  border-radius: 12px;
  padding: 26px 18px;
  display: grid;
  place-items: center;
  gap: 8px;
  text-align: center;
  background: rgba(7, 10, 15, 0.35);
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer;
}
.dropzone:hover,
.dropzone.drag {
  border-color: rgba(110, 231, 255, 0.55);
  background: rgba(110, 231, 255, 0.04);
}
.dropzone-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(110, 231, 255, 0.08);
  border: 1px solid rgba(110, 231, 255, 0.2);
  color: var(--accent);
}
.dropzone b {
  font-size: 13.5px;
  font-weight: 560;
}
.dropzone span {
  font-size: 12px;
  color: var(--muted);
}
.file-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  font-size: 12.5px;
}
.file-chip .grow {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.progress {
  height: 6px;
  border-radius: 999px;
  background: #16202e;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.18s;
}

/* callouts */
.callout {
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  padding: 11px 13px;
  font-size: 12.5px;
  color: var(--text-soft);
  display: grid;
  gap: 4px;
}
.callout-title {
  font-weight: 600;
  color: var(--text);
  font-size: 12.5px;
}
.callout.info {
  border-color: rgba(110, 231, 255, 0.22);
  background: rgba(110, 231, 255, 0.05);
}
.callout.warn {
  border-color: rgba(251, 191, 36, 0.25);
  background: rgba(251, 191, 36, 0.06);
}
.callout.danger {
  border-color: rgba(248, 113, 113, 0.25);
  background: rgba(248, 113, 113, 0.06);
}
.callout.success {
  border-color: rgba(52, 211, 153, 0.25);
  background: rgba(52, 211, 153, 0.06);
}
.callout code {
  color: var(--accent);
}

/* tables */
.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
th {
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: rgba(255, 255, 255, 0.015);
}

/* empty state */
.empty {
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 42px 20px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}
.empty-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #5e6f85;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
}
.empty b {
  color: var(--text-soft);
  font-size: 13.5px;
  font-weight: 560;
}
.empty p {
  font-size: 12.5px;
  max-width: 46ch;
}

/* drawer */
.drawer-root {
  position: relative;
  z-index: 40;
}
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 5, 9, 0.66);
  backdrop-filter: blur(3px);
  animation: fade 0.18s ease;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(590px, 100vw);
  background: var(--bg-soft);
  border-left: 1px solid var(--line);
  box-shadow: -30px 0 80px -30px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  animation: slide-in 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 41;
}
.drawer-head {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: none;
}
.drawer-title {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.015em;
}
.drawer-tabs {
  display: flex;
  gap: 2px;
  padding: 10px 16px 0;
  border-bottom: 1px solid var(--line-soft);
  flex: none;
  overflow-x: auto;
}
.tab {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 8px 11px 10px;
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
}
.tab:hover {
  color: var(--text-soft);
}
.tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px 30px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.drawer-body > * {
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
}
.drawer-foot {
  border-top: 1px solid var(--line-soft);
  padding: 12px 20px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex: none;
  background: rgba(9, 13, 20, 0.8);
}
@keyframes slide-in {
  from {
    transform: translateX(26px);
    opacity: 0.6;
  }
}
@keyframes fade {
  from {
    opacity: 0;
  }
}

/* facts + urls */
.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.fact {
  background: rgba(15, 21, 32, 0.92);
  padding: 10px 13px;
  display: grid;
  gap: 2px;
  min-width: 0;
}
.fact-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
}
.fact-value {
  font-size: 12.5px;
  color: var(--text-soft);
  overflow-wrap: anywhere;
}
.url-list {
  display: grid;
  gap: 8px;
}
.url-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.018);
  font-size: 12px;
  min-width: 0;
}
.url-row .type {
  flex: none;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  width: 68px;
}
.url-row a {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-soft);
}
.url-row a:hover {
  color: var(--accent);
}

/* domain */
.domain-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.018);
  padding: 14px;
  display: grid;
  gap: 10px;
}
.domain-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.domain-name {
  font-size: 15px;
  font-weight: 620;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
.ns-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.chip {
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(110, 231, 255, 0.07);
  border: 1px solid rgba(110, 231, 255, 0.16);
  color: #a5f3fc;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.chip:hover {
  background: rgba(110, 231, 255, 0.14);
  border-color: rgba(110, 231, 255, 0.4);
}
a.chip {
  text-decoration: none;
}
.steps {
  display: grid;
  gap: 9px;
  counter-reset: step;
}
.step {
  display: flex;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-soft);
}
.step::before {
  counter-increment: step;
  content: counter(step);
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid rgba(110, 231, 255, 0.3);
  background: rgba(110, 231, 255, 0.07);
}
.dns-result {
  display: grid;
  gap: 6px;
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px;
  background: rgba(7, 10, 15, 0.4);
}
.dns-row {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-soft);
  overflow-wrap: anywhere;
}
.dns-row .kind {
  color: var(--accent);
  width: 44px;
  flex: none;
}

/* logs */
.log-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.log-view {
  margin: 0;
  height: min(56vh, 520px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #06090d;
  padding: 11px 12px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.6;
  color: #b6c2d2;
  white-space: pre-wrap;
  word-break: break-word;
}
.log-line {
  display: flex;
  gap: 8px;
}
.log-line .t {
  color: #44546a;
  flex: none;
}
.log-line.system {
  color: #7dd3fc;
}
.log-line.stderr,
.log-line.error {
  color: #fca5a5;
}
.log-line.stdout {
  color: #c3cedd;
}

/* modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(3, 5, 9, 0.72);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fade 0.15s ease;
}
.modal {
  width: min(560px, 100%);
  max-height: 86vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  animation: pop 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}
.modal.wide {
  width: min(760px, 100%);
}
@keyframes pop {
  from {
    transform: translateY(8px) scale(0.99);
    opacity: 0.7;
  }
}
.modal-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.modal-body {
  padding: 16px 18px;
  overflow-y: auto;
  display: grid;
  gap: 12px;
}
.modal-foot {
  padding: 13px 18px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.confirm-check {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 12.5px;
  color: var(--text-soft);
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.confirm-check input {
  margin-top: 3px;
}
.scan-list {
  display: grid;
  gap: 6px;
}
.scan-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.015);
  font-size: 12.5px;
}
.scan-row .path {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.scan-row .grow {
  flex: 1;
  min-width: 0;
}

/* servers + cluster */
.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 14px;
  align-items: start;
}
.server-local-panel {
  grid-column: 1 / -1;
}
.server-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(170deg, rgba(19, 27, 40, 0.72), rgba(13, 18, 28, 0.85));
}
.server-head {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}
.server-name {
  font-size: 14.5px;
  font-weight: 620;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.server-url {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.server-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
  gap: 8px;
}
.server-metrics > div {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.018);
  min-width: 0;
}
.server-metrics span {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.server-metrics b {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-soft);
  overflow-wrap: anywhere;
}
.server-metrics.compact {
  grid-template-columns: repeat(2, minmax(80px, 1fr));
}
.server-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.token-box {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(7, 10, 15, 0.45);
}
.token-box-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.token-box-head strong {
  font-size: 12.5px;
  color: var(--text-soft);
}
.token-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.token-line code {
  flex: 1;
  min-width: 200px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #06090d;
  color: #a5f3fc;
  font-size: 11px;
  overflow-wrap: anywhere;
}
.discover-list {
  display: grid;
  gap: 6px;
}
.discover-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.015);
  min-width: 0;
}
.discover-row .grow,
.target-row .grow {
  flex: 1;
  min-width: 0;
}
.replica-list {
  display: grid;
  gap: 8px;
}
.replica-option {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.018);
}
.replica-main {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  flex: 1;
  min-width: 230px;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--text-soft);
}
.replica-main input {
  margin-top: 3px;
  flex: none;
}
.replica-main b {
  color: var(--text);
  font-weight: 600;
}
.replica-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.target-list {
  display: grid;
  gap: 6px;
}
.target-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.015);
  min-width: 0;
}
.metric-bar {
  height: 4px;
  margin-top: 5px;
  border-radius: 99px;
  background: #18222f;
  overflow: hidden;
}
.metric-bar i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.alert-list {
  display: grid;
  gap: 6px;
}
.alert-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--warn);
  border-radius: 9px;
  background: rgba(251, 191, 36, 0.04);
  font-size: 12.5px;
}
.alert-row.error {
  border-left-color: var(--danger);
  background: rgba(248, 113, 113, 0.05);
}
.alert-icon {
  flex: none;
  color: var(--warn);
  margin-top: 1px;
}
.alert-row.error .alert-icon {
  color: var(--danger);
}
.alert-row .grow {
  flex: 1;
  min-width: 0;
}
.alert-row b {
  color: var(--text);
  font-weight: 550;
}
.hardware-line {
  font-size: 10.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}
.connection-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
  color: var(--text-soft);
}
.connection-line code {
  color: #a5f3fc;
  font-size: 10.5px;
}
.conn-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  border: 1px solid rgba(110, 231, 255, 0.2);
  background: rgba(110, 231, 255, 0.06);
  border-radius: 5px;
  padding: 2px 6px;
}
.conn-speed {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  margin-left: auto;
}
.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.chart-card {
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: rgba(7, 10, 15, 0.4);
  padding: 7px 9px 5px;
  min-width: 0;
}
.chart-card:nth-child(3) {
  grid-column: 1 / -1;
}
.chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 2px;
}
.chart-head b {
  color: var(--text-soft);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
}
.spark {
  display: block;
  width: 100%;
  height: 46px;
}
.live-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.12);
  animation: pulse 1.4s ease-in-out infinite;
  vertical-align: middle;
}
.server-sites {
  border-top: 1px solid var(--line-soft);
  padding-top: 8px;
  display: grid;
  gap: 5px;
}
.site-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.site-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10.5px;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  padding: 2px 6px;
}
.site-chip b {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
}

/* toasts */

.toasts {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 90;
  display: grid;
  gap: 8px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(15, 21, 32, 0.97);
  box-shadow: var(--shadow);
  font-size: 12.5px;
  color: var(--text-soft);
  animation: toast-in 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  overflow-wrap: anywhere;
}
.toast.success {
  border-color: rgba(52, 211, 153, 0.35);
}
.toast.error {
  border-color: rgba(248, 113, 113, 0.4);
}
.toast .ico {
  flex: none;
  margin-top: 1px;
}
.toast.success .ico {
  color: var(--success);
}
.toast.error .ico {
  color: var(--danger);
}
.toast.info .ico {
  color: var(--accent);
}
.toast b {
  color: var(--text);
  font-weight: 550;
}
@keyframes toast-in {
  from {
    transform: translateY(-6px);
    opacity: 0;
  }
}

/* integrations + activity */
.int-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 14px;
  align-items: start;
}
.int-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 16px 18px 0;
}
.int-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  flex: none;
}
.int-logo.cf {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.22);
}
.int-logo.gd {
  color: #38d1c4;
  background: rgba(56, 209, 196, 0.08);
  border-color: rgba(56, 209, 196, 0.22);
}
.int-logo.ns {
  color: #a5b4fc;
  background: rgba(165, 180, 252, 0.08);
  border-color: rgba(165, 180, 252, 0.22);
}
.int-status {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
}
.activity {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.act-row {
  display: flex;
  gap: 12px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line-soft);
  align-items: flex-start;
  background: rgba(15, 21, 32, 0.35);
}
.act-row:last-child {
  border-bottom: 0;
}
.act-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(110, 231, 255, 0.06);
  border: 1px solid rgba(110, 231, 255, 0.14);
  color: var(--accent);
  flex: none;
}
.act-body {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  color: var(--text-soft);
  overflow-wrap: anywhere;
}
.act-body b {
  color: var(--text);
  font-weight: 550;
}
.act-time {
  flex: none;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.footer-note {
  margin-top: 26px;
  font-size: 11.5px;
  color: #566275;
  line-height: 1.6;
}
.mono-block {
  font-family: var(--mono);
  font-size: 11.5px;
  background: #06090d;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  overflow-x: auto;
  color: #a9b7c8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.inline-code {
  font-family: var(--mono);
  font-size: 0.92em;
  color: #a5f3fc;
}
.kv {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 12px;
  padding: 4px 0;
}
.kv span:first-child {
  color: var(--muted);
}
.kv span:last-child {
  text-align: right;
  overflow-wrap: anywhere;
}

/* responsive */
@media (max-width: 960px) {
  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .sidebar {
    position: sticky;
    top: 0;
    height: auto;
    z-index: 20;
    padding: 10px 12px;
    gap: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
  }
  .brand {
    flex: none;
    padding: 0 6px 0 0;
  }
  .brand-text span {
    display: none;
  }
  .nav-section {
    display: flex;
    flex: 1;
    gap: 2px;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .nav-label {
    display: none;
  }
  .nav-item {
    width: auto;
    padding: 8px 10px;
    font-size: 12.5px;
    white-space: nowrap;
    flex: none;
  }
  .nav-badge {
    display: none;
  }
  .sidebar-foot {
    display: none;
  }
  .workspace {
    height: auto;
    min-height: calc(100vh - 56px);
  }
  main#main {
    overflow: visible;
    padding-top: 18px;
  }
  .gate-card {
    grid-template-columns: 1fr;
  }
  .gate-aside {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 28px;
    gap: 18px;
  }
  .gate-form {
    padding: 28px;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .topbar {
    padding: 18px 16px 14px;
    flex-direction: column;
    gap: 12px;
  }
  .topbar-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .site-grid {
    grid-template-columns: 1fr;
  }
  .facts {
    grid-template-columns: 1fr;
  }
  .field-row {
    grid-template-columns: 1fr;
  }
  .charts-grid,
  .chart-grid {
    grid-template-columns: 1fr;
  }
  .chart-card:nth-child(3) {
    grid-column: auto;
  }
  .btn-row {
    width: 100%;
  }
  .drawer {
    width: 100vw;
  }
}

/* ---------------------------------------------------------------- */
/* live server locations                                             */
/* ---------------------------------------------------------------- */

.location-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 14px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}
.server-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.server-key {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-soft);
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.server-key:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.05);
}
.server-key b {
  font-weight: 600;
  color: var(--muted);
  font-size: 10.5px;
}
.server-key[data-active="true"] {
  background: rgba(255, 255, 255, 0.07);
}
.server-key .dot,
.server-block-head .dot {
  box-shadow: none;
}
.view-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.view-switch .live-at {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.server-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.server-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  max-width: 100%;
  white-space: nowrap;
}
.server-chip .name {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 118px;
}
.server-chip b {
  font-weight: 600;
  opacity: 0.6;
  font-size: 10px;
}
.server-chip .dot.ok {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.12);
}
.server-chip .dot.warn {
  background: var(--warn);
  animation: pulse 1.1s ease-in-out infinite;
}
.server-chip .dot.error {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.12);
}
.server-chip .dot.off {
  background: #5c6b7f;
}

.server-view {
  display: grid;
  gap: 14px;
}
.server-block {
  border-left: 3px solid var(--srv-line, var(--line));
}
.server-block-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.server-block-head .panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.server-block-head .panel-sub {
  margin-top: 2px;
}
.server-sites td {
  vertical-align: middle;
  padding: 9px 12px;
}
.server-sites th {
  padding: 8px 12px;
}
.server-sites .srv-site-id {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
}
.server-sites .srv-site-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.server-sites .srv-empty {
  color: var(--muted);
  font-size: 12px;
  padding: 14px 12px;
}

@media (max-width: 720px) {
  .location-bar {
    align-items: flex-start;
  }
  .server-chip .name {
    max-width: 92px;
  }
  .server-block-head {
    flex-wrap: wrap;
  }
}

/* data sync status bar + database badge */
.data-sync-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 12px;
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  font-size: 13px;
}
.data-sync-bar.ok { border-color: rgba(52, 211, 153, 0.28); }
.data-sync-bar.warn { border-color: rgba(251, 191, 36, 0.35); }
.data-sync-bar.bad { border-color: rgba(248, 113, 113, 0.45); }
.ds-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.ds-engine {
  padding: 2px 9px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  color: #86efac;
  background: rgba(34, 197, 94, 0.10);
  border: 1px solid rgba(134, 239, 172, 0.32);
}
.data-sync-bar.warn .ds-engine {
  color: #fcd34d;
  background: rgba(250, 204, 21, 0.09);
  border-color: rgba(252, 211, 77, 0.30);
}
.data-sync-bar.bad .ds-engine {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.10);
  border-color: rgba(239, 68, 68, 0.40);
}
.ds-meta { color: var(--text-soft); }
.ds-checked { margin-left: auto; color: var(--muted); font-size: 12px; }
.badge-db {
  color: #7dd3fc;
  border-color: rgba(125, 211, 252, 0.32);
  background: rgba(56, 189, 248, 0.10);
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
}

/* restore page */
.restore-wrap { display: flex; flex-direction: column; gap: 10px; }
.restore-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.restore-head h2 { margin: 0; font-size: 16px; }
.restore-head p { margin: 4px 0 0; }
.restore-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.restore-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
.restore-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
.restore-table tr:last-child td { border-bottom: 0; }
.restore-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.restore-error { color: var(--danger); }
.restore-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}
.restore-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.restore-card-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.restore-point {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid var(--line-soft);
  font-size: 12.5px;
}
.restore-point .muted { margin-left: 8px; }

/* security page */
.sev {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  vertical-align: middle;
}
.sev-critical { color: #fca5a5; border-color: rgba(248, 113, 113, 0.4); background: rgba(248, 113, 113, 0.1); }
.sev-high { color: #fdba74; border-color: rgba(251, 146, 60, 0.4); background: rgba(251, 146, 60, 0.1); }
.sev-medium { color: #fcd34d; border-color: rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.08); }
.sev-low { color: #93c5fd; border-color: rgba(96, 165, 250, 0.35); background: rgba(96, 165, 250, 0.08); }
.sev-info { color: var(--muted); background: rgba(255, 255, 255, 0.03); }
