:root {
  color-scheme: dark;
  --bg: #07090c;
  --bg2: #0c1016;
  --panel: #10161e;
  --panel2: #141b25;
  --line: #243041;
  --line2: #1a2430;
  --text: #e8eef5;
  --muted: #8b9aab;
  --faint: #5c6b7c;
  --accent: #5eb1ff;
  --ok: #3ecf8e;
  --bad: #ff5d5d;
  --warn: #e6b84d;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --nav-w: 228px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--sans);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(94,177,255,.10), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(62,207,142,.07), transparent 50%),
    linear-gradient(180deg, var(--bg2), var(--bg));
  color: var(--text);
  font-size: 14px;
}
.auth-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}
.auth-card {
  width: min(400px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-card h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.auth-card label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.auth-card input {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 13px;
}
.auth-card button, .btn {
  appearance: none;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #1a2740, #142033);
  color: var(--text);
  border-radius: 6px;
  padding: 9px 12px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.auth-card button:hover, .btn:hover { border-color: #35506c; }
.btn.primary { border-color: #3a6ea0; background: linear-gradient(180deg, #1d3a5c, #162c47); color: #d7ebff; }
.btn.ghost { background: transparent; }
.btn.danger { border-color: #6a3030; color: #ffb4b4; }
.eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); font-weight: 500;
}
.muted { color: var(--muted); font-size: 13px; margin: 0; }
.banner {
  padding: 10px 12px; border-radius: 6px; font-size: 13px;
  border: 1px solid var(--line);
}
.banner.bad { color: var(--bad); background: rgba(255,93,93,.1); border-color: rgba(255,93,93,.25); }
.banner.ok { color: var(--ok); background: rgba(62,207,142,.1); border-color: rgba(62,207,142,.25); }

/* Dashboard layout */
.layout {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
}
.sidenav {
  width: var(--nav-w);
  flex: 0 0 var(--nav-w);
  background: rgba(10, 14, 20, 0.92);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 20;
}
.sidenav-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 10px 16px;
}
.sidenav-brand .title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.sidenav-brand .sub {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--faint);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.nav-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 12px;
}
.nav-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 8px 10px 6px;
}
.nav-item {
  appearance: none;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  padding: 9px 12px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-left: 2px solid transparent;
}
.nav-item:hover {
  color: var(--text);
  background: rgba(94,177,255,.06);
}
.nav-item.active {
  color: var(--text);
  background: rgba(94,177,255,.1);
  border-left-color: var(--accent);
}
.nav-item.action {
  color: #c5daf0;
}
.sidenav-foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.userchip {
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  padding: 8px 10px; border: 1px solid var(--line2); border-radius: 6px; background: var(--panel);
}
.nav-toggle {
  display: none;
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  cursor: pointer;
}
.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 15;
}
.main {
  flex: 1;
  min-width: 0;
  padding: 20px 24px 40px;
  max-width: 1200px;
}
.top {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 16px;
}
.brand { display: flex; flex-direction: column; gap: 6px; }
h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.sub { color: var(--muted); font-size: 13px; }
.sub code {
  font-family: var(--mono); font-size: 12px; color: var(--text);
  background: var(--panel); border: 1px solid var(--line2); padding: 2px 6px; border-radius: 4px;
}
.clock {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: 12px; color: var(--muted); text-align: right;
}
.clock strong { color: var(--text); font-weight: 500; }
.view { display: none; }
.view.active { display: block; }
.metrics {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px;
  margin-bottom: 12px;
}
@media (max-width: 1100px) { .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 960px) { .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.metric {
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--line); border-radius: 8px; padding: 12px;
  min-height: 76px; display: flex; flex-direction: column; gap: 8px;
}
.metric .label {
  font-family: var(--mono); font-size: 10px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--faint);
}
.metric .value {
  font-family: var(--mono); font-size: 18px; font-weight: 500;
  font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 8px;
}
.metric .subvalue {
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.bar {
  height: 4px; border-radius: 99px; background: rgba(255,255,255,.06); overflow: hidden; margin-top: auto;
}
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--accent); width: 0%; }
.bar.ok > i { background: var(--ok); }
.bar.warn > i { background: var(--warn); }
.bar.bad > i { background: var(--bad); }
.dot {
  width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto;
  box-shadow: 0 0 0 3px rgba(255,255,255,.04);
}
.dot.ok { background: var(--ok); box-shadow: 0 0 12px rgba(62,207,142,.45); }
.dot.bad { background: var(--bad); box-shadow: 0 0 12px rgba(255,93,93,.4); }
.dot.warn { background: var(--warn); box-shadow: 0 0 12px rgba(230,184,77,.35); }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  padding: 2px 8px; border-radius: 4px; text-transform: uppercase; letter-spacing: .04em;
}
.pill.ok { color: var(--ok); background: rgba(62,207,142,.12); }
.pill.bad { color: var(--bad); background: rgba(255,93,93,.12); }
.pill.warn { color: var(--warn); background: rgba(230,184,77,.12); }
.grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
}
@media (max-width: 860px) { .grid { grid-template-columns: 1fr; } }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  min-width: 0; overflow: hidden; display: flex; flex-direction: column;
}
.card.wide { grid-column: 1 / -1; }
.card-h {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border-bottom: 1px solid var(--line2); background: rgba(255,255,255,.015);
}
.card-h h2 { margin: 0; font-size: 13px; font-weight: 600; }
.card-h .tag {
  font-family: var(--mono); font-size: 10px; color: var(--faint); letter-spacing: .06em; text-transform: uppercase;
}
pre {
  margin: 0; padding: 12px; white-space: pre-wrap; word-break: break-word;
  font-family: var(--mono); font-size: 12px; line-height: 1.45; color: #c9d4e0;
  max-height: 260px; overflow: auto;
}
.card.wide pre { max-height: 340px; }
.table-wrap { overflow: auto; max-height: 320px; }
table.data { width: 100%; border-collapse: collapse; font-size: 12px; }
table.data th, table.data td {
  padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line2); vertical-align: top;
}
table.data th {
  position: sticky; top: 0; background: #121925;
  font-family: var(--mono); font-size: 10px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--faint); font-weight: 500;
}
table.data .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
table.data .dim {
  color: var(--muted); max-width: 280px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.footer {
  margin-top: 12px;
  color: var(--faint); font-family: var(--mono); font-size: 11px;
}
.endpoints {
  margin-top: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
}
.endpoints-h {
  padding: 10px 12px; border-bottom: 1px solid var(--line2);
  font-size: 13px; font-weight: 600;
  background: rgba(255,255,255,.015);
}
.endpoint-row {
  display: grid; grid-template-columns: 120px minmax(0, 1.2fr) minmax(0, 1.4fr);
  gap: 8px 16px; padding: 10px 12px; border-bottom: 1px solid var(--line2); align-items: baseline;
}
.endpoint-row:last-child { border-bottom: 0; }
.endpoint-label {
  font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint);
}
.endpoint-host { font-family: var(--mono); font-size: 12px; color: var(--text); word-break: break-all; }
.endpoint-desc { font-size: 12px; color: var(--muted); }
@media (max-width: 720px) {
  .endpoint-row { grid-template-columns: 1fr; gap: 4px; }
}
.tool-bar {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}
.tool-hint { color: var(--muted); font-size: 13px; max-width: 520px; }
.tool-form { flex: 1; min-width: 0; }
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row.inline {
  flex-direction: row; flex-wrap: wrap; gap: 12px; align-items: flex-end;
}
.form-row.inline label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 12px; color: var(--muted); min-width: 160px; flex: 1;
}
.form-row input, .form-row select,
.form-row.inline input, .form-row.inline select {
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
  color: var(--text); padding: 9px 10px; font-family: var(--mono); font-size: 13px;
}
.empty-state {
  padding: 28px 16px; text-align: center; color: var(--muted);
  border: 1px dashed var(--line); border-radius: 8px; background: rgba(255,255,255,.02);
}
.cred-list { display: flex; flex-direction: column; gap: 12px; }
.cred-card .cred-body { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.kv { display: grid; grid-template-columns: 120px 1fr auto; gap: 8px; align-items: start; }
.kv .k { font-family: var(--mono); font-size: 11px; color: var(--faint); padding-top: 8px; text-transform: uppercase; }
.kv .v {
  font-family: var(--mono); font-size: 12px; background: var(--bg);
  border: 1px solid var(--line2); border-radius: 6px; padding: 8px 10px;
  word-break: break-all; white-space: pre-wrap;
}
.error-text { color: var(--bad); font-size: 12px; }
.hidden { display: none !important; }

@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .nav-toggle { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px; }
  .sidenav {
    position: fixed;
    left: 0; top: 0;
    transform: translateX(-105%);
    transition: transform .2s ease;
    box-shadow: 8px 0 24px rgba(0,0,0,.35);
  }
  .layout.nav-open .sidenav { transform: translateX(0); }
  .layout.nav-open .nav-backdrop { display: block; }
  .main { padding: 16px; max-width: none; }
  .kv { grid-template-columns: 1fr; }
  .kv .k { padding-top: 0; }
}
