:root {
  --bg: #0f1419;
  --bg-elevated: #1a222c;
  --bg-soft: #243040;
  --line: rgba(255, 255, 255, 0.08);
  --text: #eef2f6;
  --muted: #8b9aab;
  --accent: #3d9b8f;
  --accent-2: #e8a54b;
  --danger: #e57373;
  --ok: #5ecf8a;
  --stop: #94a3b8;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --font-display: "Syne", "Segoe UI", sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(61, 155, 143, 0.22), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(232, 165, 75, 0.12), transparent 50%),
    linear-gradient(165deg, #0c1117 0%, #151c25 45%, #10161d 100%);
}

a { color: var(--accent); text-decoration: none; }
button, input, select { font: inherit; }

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 60px;
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 1.35rem;
}

.brand span { color: var(--accent); }

.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent 40%), var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.btn {
  appearance: none;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  background: var(--accent);
  color: #041210;
  font-weight: 600;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
.btn.warn { background: var(--accent-2); color: #1a1205; }
.btn.danger { background: rgba(229, 115, 115, 0.2); color: #ffc9c9; border: 1px solid rgba(229,115,115,0.35); }

.input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  outline: none;
}
.input:focus { border-color: rgba(61, 155, 143, 0.7); box-shadow: 0 0 0 3px rgba(61, 155, 143, 0.15); }

.label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 0.86rem; }
.field { margin-bottom: 14px; }

.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
th { color: var(--muted); font-weight: 500; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}
.tag::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.tag.running { background: rgba(94, 207, 138, 0.15); color: var(--ok); }
.tag.stopped { background: rgba(148, 163, 184, 0.15); color: var(--stop); }
.tag.warning { background: rgba(229, 115, 115, 0.18); color: var(--danger); }
.tag.offline { background: rgba(100, 116, 139, 0.22); color: #cbd5e1; }
.tag.other { background: rgba(232, 165, 75, 0.18); color: var(--accent-2); }
.tag.on { background: rgba(61, 155, 143, 0.15); color: var(--accent); }
.tag.off { background: rgba(229, 115, 115, 0.12); color: var(--danger); }

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #223041;
  border: 1px solid var(--line);
  color: var(--text);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: 0.25s ease;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translateY(0); }

.modal-mask {
  position: fixed; inset: 0;
  background: rgba(5, 8, 12, 0.65);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 40;
}
.modal-mask.show { display: flex; }
.modal {
  width: min(480px, 100%);
  padding: 22px;
  max-height: min(90vh, 900px);
  overflow: auto;
}
.modal.modal-lg { width: min(860px, 100%); }
.modal h3 { margin: 0 0 16px; font-family: var(--font-display); }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.modal-head h3 { margin: 0; }
.modal-desc {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}
.modal-table { max-height: min(60vh, 520px); overflow: auto; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.rise { animation: rise 0.45s ease both; }
.rise-delay-1 { animation-delay: 0.08s; }
.rise-delay-2 { animation-delay: 0.16s; }
