:root {
  --bg: #0f1419;
  --bg-elev: #1a2332;
  --bg-soft: #243044;
  --ink: #e8eef6;
  --muted: #8fa3b8;
  --accent: #3d9cf0;
  --accent-2: #2dd4a8;
  --danger: #f07178;
  --warn: #e6b450;
  --line: rgba(232, 238, 246, 0.08);
  --radius: 10px;
  --font: "IBM Plex Sans", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: radial-gradient(1200px 600px at 10% -10%, #1c3a5a 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #16352f 0%, transparent 50%), var(--bg);
  color: var(--ink);
  font-family: var(--font);
  min-height: 100%;
}

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

a:hover {
  text-decoration: underline;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

header.top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1rem;
}

.brand {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand span {
  color: var(--accent-2);
  font-weight: 500;
}

nav {
  display: flex;
  gap: 1rem;
  font-size: 0.95rem;
}

.grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 900px) {
  .grid.two {
    grid-template-columns: 1fr 1fr;
  }
}

section.panel {
  background: color-mix(in srgb, var(--bg-elev) 92%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem 1.25rem;
  backdrop-filter: blur(8px);
}

section.panel h2 {
  margin: 0 0 0.85rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.muted {
  color: var(--muted);
  font-size: 0.88rem;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

form.stack {
  display: grid;
  gap: 0.55rem;
}

label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--muted);
}

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

input,
select,
textarea {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
}

button,
.btn {
  appearance: none;
  border: none;
  background: var(--accent);
  color: #061018;
  font-weight: 600;
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  cursor: pointer;
}

button.secondary,
.btn.secondary {
  background: var(--bg-soft);
  color: var(--ink);
  border: 1px solid var(--line);
}

button.danger {
  background: var(--danger);
  color: #1a0a0c;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th,
td {
  text-align: left;
  padding: 0.45rem 0.35rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-family: var(--mono);
  background: var(--bg-soft);
}

.badge.ok {
  color: var(--accent-2);
}

.badge.warn {
  color: var(--warn);
}

.badge.err {
  color: var(--danger);
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  max-width: 360px;
  display: none;
  z-index: 50;
}

.toast.show {
  display: block;
}

.vnc-frame {
  width: 100%;
  height: min(70vh, 720px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #000;
}

pre.json {
  background: #0a0e13;
  border-radius: 8px;
  padding: 0.75rem;
  overflow: auto;
  max-height: 280px;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.4;
}

.flash {
  animation: pulse 1.2s ease;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent);
  }
  100% {
    box-shadow: 0 0 0 12px transparent;
  }
}
