:root {
  --bg: #0c111f;
  --card: #151d31;
  --line: #27314b;
  --text: #e8ecf8;
  --muted: #9da9c7;
  --accent: #63b3ff;
  --ok: #39d98a;
  --warn: #ffb020;
  --bad: #ff6b6b;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(1200px 800px at 20% -10%, #1d2b4f 0%, var(--bg) 55%);
  color: var(--text);
}

.hidden { display: none !important; }
.center-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
}

h1, h2, h3 { margin: 0 0 10px; }
h1 { font-size: 20px; }
h3 { font-size: 16px; }
label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }

input, select, button {
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #101828;
  color: var(--text);
  padding: 0 10px;
}
button {
  background: #1f335f;
  border-color: #35548f;
  cursor: pointer;
}
button:hover { filter: brightness(1.08); }
button.ghost {
  background: transparent;
  border-color: var(--line);
}

.error { color: var(--bad); min-height: 18px; }
.muted { color: var(--muted); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(12, 17, 31, 0.95);
  backdrop-filter: blur(8px);
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 14px;
}
.tabs button {
  background: transparent;
  border-color: var(--line);
}
.tabs button.active {
  border-color: var(--accent);
  color: #d4e7ff;
  background: rgba(99, 179, 255, 0.15);
}

main { padding: 0 14px 20px; }
.actions {
  display: flex;
  gap: 8px;
  align-items: end;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.metric {
  background: #121b2d;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
}
.metric .label { color: var(--muted); font-size: 12px; }
.metric .value { font-size: 20px; font-weight: 700; margin-top: 4px; }

.split-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.table-wrap { overflow: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th, td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 8px 6px;
  vertical-align: top;
  white-space: nowrap;
}
th { color: var(--muted); font-weight: 600; position: sticky; top: 0; background: var(--card); }

pre {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 12px;
  white-space: pre-wrap;
}

.json-box {
  max-height: 460px;
  overflow: auto;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  align-items: end;
}

.badge {
  display: inline-block;
  border-radius: 99px;
  padding: 2px 8px;
  font-size: 11px;
  line-height: 1.4;
  border: 1px solid var(--line);
}
.badge.ok { background: rgba(57, 217, 138, 0.2); color: #8df1bd; border-color: rgba(57, 217, 138, 0.45); }
.badge.warn { background: rgba(255, 176, 32, 0.2); color: #ffd289; border-color: rgba(255, 176, 32, 0.45); }
.badge.bad { background: rgba(255, 107, 107, 0.2); color: #ffc1c1; border-color: rgba(255, 107, 107, 0.45); }

.linkish {
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
}
