:root {
  --bg: #081018;
  --card: #121c27;
  --card-2: #182330;
  --line: #2a3b4d;
  --text: #eef5fb;
  --muted: #8ea3b8;
  --accent: #3ee0b4;
  --accent-dim: #16352e;
  --warn: #ffb020;
  --bad: #ff6b6b;
  --run: #3ee0b4;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  background:
    radial-gradient(900px 420px at 8% -10%, #143247 0%, transparent 60%),
    radial-gradient(700px 380px at 100% 0%, #102433 0%, transparent 50%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}
.shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 48px;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 18px;
}
.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
h1 { margin: 0 0 4px; font-size: 1.7rem; letter-spacing: -0.03em; }
.muted { color: var(--muted); margin: 0; font-size: 0.9rem; }
.section-title {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
button, .btn-link {
  background: var(--accent);
  color: #06231b;
  border: 0;
  border-radius: 10px;
  padding: 9px 14px;
  font-weight: 700;
  cursor: pointer;
}
button:disabled { opacity: 0.6; cursor: wait; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
button.ghost, a.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
a.btn-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.nodes-panel, .stat, .host-card, .vm-card, .alert, .node-row {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.nodes-panel {
  margin-bottom: 18px;
  padding: 16px;
  border-radius: 16px;
}
.nodes-head h2 { margin: 0 0 4px; font-size: 1.05rem; }
#nodeForm {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
#nodeForm label, .login-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--muted);
}
#nodeForm input, .login-card input, .toolbar input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0c141c;
  color: var(--text);
  outline: none;
}
#nodeForm input:focus, .toolbar input:focus, .login-card input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(62, 224, 180, 0.15);
}
#nodeForm .check { flex-direction: row; align-items: center; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; grid-column: 1 / -1; }
#nodeForm #hostMsg { grid-column: 1 / -1; }
.node-list { margin-top: 14px; display: grid; gap: 8px; }
.node-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-radius: 10px;
  padding: 10px 12px;
}
.node-row .mini { display: flex; gap: 8px; }
.stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.stat {
  border-radius: 14px;
  padding: 12px 14px;
}
.stat span { color: var(--muted); font-size: 0.78rem; }
.stat b { display: block; margin-top: 4px; font-size: 1.35rem; }
.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}
.toolbar input {
  flex: 1;
  min-width: 0;
  font-size: 0.95rem;
}
.filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.86rem;
  white-space: nowrap;
}
.host-bar-wrap { margin-bottom: 16px; }
.host-bar {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.host-card {
  min-width: 190px;
  text-align: left;
  color: var(--text);
  border-radius: 14px;
  padding: 12px 14px;
  display: grid;
  gap: 3px;
  cursor: pointer;
  font-weight: 700;
}
.host-card code { color: var(--accent); font-size: 0.88rem; }
.host-card.active {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.alerts { display: grid; gap: 8px; margin-bottom: 14px; }
.alert {
  border-radius: 10px;
  padding: 10px 12px;
  color: #ffd7a0;
  font-size: 0.9rem;
}
.alert.bad { color: #ffc4c4; border-color: #5a2430; }
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}
.vm-card {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  padding: 10px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
  background: linear-gradient(180deg, #182433, #101924);
}
.vm-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 2px;
  background: var(--tone, #3ee0b4);
}
.tone-mint { --tone: #22e38a; }
.tone-blue { --tone: #3aa0ff; }
.tone-violet { --tone: #b06bff; }
.tone-pink { --tone: #ff4fd8; }
.vm-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.brand-name {
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  font-weight: 800;
  color: #d7e6f3;
}
.hero-ip {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--tone);
  line-height: 1.15;
  word-break: break-all;
}
.vm-meta { color: var(--muted); font-size: 0.72rem; }
.power { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.power button, .btn-open {
  flex: 1 1 58px;
  font-size: 0.7rem;
  padding: 6px 6px;
  text-align: center;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 700;
}
.btn-open {
  background: var(--tone);
  color: #06140f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.power-stop { border-color: #5a2430 !important; color: #ffb4a8 !important; }
.vm-card h3 { margin: 0; font-size: 0.82rem; line-height: 1.25; word-break: break-word; color: #c5d4e2; font-weight: 600; }
.pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  margin: 0 5px 4px 0;
  background: #243140;
}
.pill.dup { background: #4a2218; color: #ffb4a8; }
.status {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
}
.status.run { color: #22e38a; background: rgba(34, 227, 138, 0.12); }
.status.stop { color: #ff8aa0; background: rgba(255, 107, 107, 0.12); }
.empty-msg { padding: 24px 0; }
code { font-family: ui-monospace, Menlo, monospace; }
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(420px, 100%);
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  display: grid;
  gap: 12px;
  box-shadow: var(--shadow);
}
.login-card h1 { margin: 0; }
@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .toolbar { flex-direction: column; align-items: stretch; }
}
@media (max-width: 640px) {
  .shell { width: calc(100% - 20px); }
  header { flex-direction: column; align-items: flex-start; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
