:root {
  --bg: #0c100b;
  --bg-2: #121810;
  --panel: #181f16;
  --panel-2: #1e271c;
  --line: #2a3527;
  --line-2: #3a4a35;
  --text: #eef4e4;
  --muted: #8fa083;
  --accent: #c8e86e;
  --accent-2: #7ec8a3;
  --warn: #e3b15a;
  --bad: #e07862;
  --ok: #7dbd73;
  --mono: "Cascadia Mono", "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: "Segoe UI", "IBM Plex Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(900px 420px at 8% -8%, #1d2a18 0%, transparent 55%),
    radial-gradient(700px 320px at 100% 0%, #15241f 0%, transparent 50%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
}

a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

.login-wrap {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 32px;
}
.login-card {
  width: min(440px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 32px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}
.login-card .kicker {
  color: var(--accent);
  letter-spacing: 0.18em;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 10px;
}
.login-card h1 { margin: 0 0 8px; font-size: 26px; letter-spacing: 0.04em; }
.login-card p { color: var(--muted); margin: 0 0 22px; line-height: 1.5; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field span { color: var(--muted); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
.field input, .field select, .field textarea {
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 10px 12px;
  outline: none;
  border-radius: 2px;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.btn {
  background: var(--accent);
  color: #15200f;
  border: 0;
  padding: 10px 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 2px;
}
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.warn { background: var(--warn); }
.btn.bad { background: var(--bad); color: #1a0d0a; }
.btn.sm { padding: 6px 10px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.err { color: var(--bad); min-height: 18px; margin: 8px 0; }

.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100%; }
.side {
  background: rgba(18, 24, 16, 0.92);
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { font-weight: 800; letter-spacing: 0.16em; font-size: 12px; color: var(--accent); margin-bottom: 6px; }
.brand-sub { color: var(--muted); font-size: 11px; margin-bottom: 26px; }
.nav { display: grid; gap: 4px; }
.nav button {
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 10px 10px;
  border-radius: 2px;
}
.nav button.active, .nav button:hover { background: var(--panel); color: var(--text); }
.side-foot { margin-top: 36px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.main { padding: 22px 28px 48px; overflow: auto; }
.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 22px;
}
.top h2 { margin: 0; font-size: 26px; }
.top .sub { color: var(--muted); margin-top: 4px; }
.top-actions { display: flex; gap: 8px; align-items: center; }

.grid { display: grid; gap: 14px; }
.grid.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
.grid.two { grid-template-columns: 1.15fr 0.85fr; }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 16px;
}
.card h3 { margin: 0 0 12px; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.metric { font-size: 22px; font-weight: 700; }
.metric small { display: block; color: var(--muted); font-size: 12px; font-weight: 500; margin-top: 4px; }

.bar {
  height: 6px;
  background: var(--bg);
  border: 1px solid var(--line);
  margin-top: 10px;
  overflow: hidden;
}
.bar > i { display: block; height: 100%; background: var(--accent); }
.bar.warn > i { background: var(--warn); }
.bar.bad > i { background: var(--bad); }

.pill {
  display: inline-block;
  padding: 3px 8px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--line);
}
.pill.ok { color: var(--ok); border-color: #355c32; }
.pill.warn { color: var(--warn); border-color: #6d5224; }
.pill.down { color: var(--bad); border-color: #6d3228; }
.pill.online { color: var(--accent-2); }
.pill.running { color: var(--warn); }

.shop-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.shop-head b { font-size: 16px; }
.shop-head .open { color: var(--muted); font-size: 12px; }
.rows { display: grid; gap: 8px; margin-top: 12px; }
.row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 8px;
  align-items: center;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.row b { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { text-align: left; padding: 9px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover { background: var(--panel-2); }
.mono { font-family: var(--mono); font-size: 12px; }

.term {
  background: #0a0e09;
  border: 1px solid var(--line);
  color: #d5e7b8;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.45;
  height: 460px;
  overflow: auto;
  padding: 12px;
  white-space: pre-wrap;
}

.checks { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0 16px; }
.checks label { display: flex; gap: 6px; align-items: center; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

.json-edit, .ports-table input {
  width: 100%;
  background: #0a0e09;
  border: 1px solid var(--line);
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: 12px;
}
.json-edit { min-height: 240px; }
.toast { color: var(--accent-2); margin-top: 10px; min-height: 18px; }
.filter {
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 8px 10px;
  min-width: 200px;
}
.kv { display: grid; gap: 8px; }
.kv div { display: grid; grid-template-columns: 140px 1fr; gap: 8px; font-size: 13px; }
.kv span { color: var(--muted); }
.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.score { font-family: var(--mono); color: var(--accent); }

@media (max-width: 1100px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; }
  .nav { grid-auto-flow: column; }
  .grid.stats, .grid.two, .grid.three, .grid.cards { grid-template-columns: 1fr; }
  .side-foot { display: none; }
}
