:root {
  --bg: #0f1419;
  --bg2: #171d25;
  --bg3: #1e2630;
  --line: #2a3441;
  --text: #e7ecf2;
  --muted: #8b98a8;
  --accent: #3d9cfd;
  --ok: #3ecf8e;
  --warn: #e6b84d;
  --danger: #f07178;
  --font: "IBM Plex Sans", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", "Consolas", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); }
body {
  background:
    radial-gradient(900px 500px at 10% -10%, #1a2a3d 0%, transparent 55%),
    radial-gradient(700px 400px at 100% 0%, #1a2430 0%, transparent 50%),
    var(--bg);
}
a { color: var(--accent); text-decoration: none; }
button, input {
  font: inherit;
  color: inherit;
  background: var(--bg3);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.85rem;
}
button { cursor: pointer; }
button:hover { border-color: #3d4b5c; }
button.primary { background: #1d4f86; border-color: #2f6fad; }
button.warn { background: #4a3b16; border-color: #7a6225; }
button.danger { background: #4a1f24; border-color: #7a323a; }
button.ghost { background: transparent; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.active { border-color: var(--accent); color: #fff; }

.boot { padding: 3rem; text-align: center; color: var(--muted); }
.shell { max-width: 1180px; margin: 0 auto; padding: 1.1rem 1.2rem 2.5rem; }
.topbar {
  display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center;
  justify-content: space-between; margin-bottom: 1.1rem;
}
.brand { display: flex; gap: 0.55rem; align-items: center; font-weight: 650; letter-spacing: 0.02em; }
.brand .dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(62,207,142,0.15); }
.topbar nav { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.panel {
  background: color-mix(in srgb, var(--bg2) 92%, transparent);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}
.panel h2, .panel h3 { margin: 0 0 0.65rem; font-size: 1rem; }
.hint { color: var(--muted); font-size: 0.9rem; margin-bottom: 0.85rem; }
.grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.stat {
  background: var(--bg3);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 0.9rem;
}
.stat .label { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.stat .value { font-size: 1.25rem; font-weight: 650; margin-top: 0.2rem; }
.stat .sub { color: var(--muted); font-size: 0.82rem; margin-top: 0.15rem; }
.bar {
  height: 0.4rem; background: #243040; border-radius: 99px; overflow: hidden; margin-top: 0.55rem;
}
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, #2f7fdb, #3ecf8e); }
.bar.warn > span { background: linear-gradient(90deg, #c9952d, #e6b84d); }
.bar.danger > span { background: linear-gradient(90deg, #c44b54, #f07178); }

.svc {
  display: flex; flex-wrap: wrap; gap: 0.65rem; align-items: center;
  justify-content: space-between; padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}
.svc:last-child { border-bottom: 0; }
.svc .meta { min-width: 180px; }
.svc .name { font-weight: 600; }
.svc .unit { color: var(--muted); font-size: 0.82rem; font-family: var(--mono); }
.badge {
  display: inline-block; font-size: 0.75rem; padding: 0.15rem 0.45rem;
  border-radius: 999px; border: 1px solid var(--line); color: var(--muted);
}
.badge.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.badge.bad { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.badge.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.log {
  font-family: var(--mono); font-size: 0.78rem; line-height: 1.4;
  background: #0b0f14; border: 1px solid var(--line); border-radius: 10px;
  padding: 0.75rem; max-height: 320px; overflow: auto; white-space: pre-wrap;
  color: #c9d4e0;
}
.field { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.7rem; }
.field label { color: var(--muted); font-size: 0.82rem; }
.field input, .field select { width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.chip {
  background: var(--bg3); border: 1px solid var(--line); border-radius: 999px;
  padding: 0.2rem 0.55rem; font-size: 0.82rem;
}
.term-wrap {
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #0b0f14;
  padding: 0.4rem;
  min-height: 360px;
}
.term-toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 0.65rem; }
.toast {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 50;
  background: #1b2430; border: 1px solid var(--line); border-radius: 10px;
  padding: 0.7rem 0.9rem; box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}
.toast.error { border-color: #7a323a; }
.auth-wrap { min-height: 70vh; display: grid; place-items: center; padding: 1.5rem; }
.auth-card { width: min(420px, 100%); }
.auth-card h1 { margin: 0 0 0.35rem; font-size: 1.35rem; }
.subtitle { color: var(--muted); margin-bottom: 1rem; }
@media (max-width: 720px) {
  .shell { padding: 0.85rem; }
  .svc { align-items: flex-start; flex-direction: column; }
}
