:root {
  color-scheme: light dark;
  --bg: #0f1115;
  --panel: #171a21;
  --border: #2a2e38;
  --text: #e6e8ec;
  --muted: #9aa1ad;
  --accent: #5b8cff;
  --ok: #3ecf8e;
  --err: #ef5a5a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}

header h1 {
  font-size: 16px;
  margin: 0;
  font-weight: 600;
}

header .sub {
  color: var(--muted);
  font-size: 12px;
}

main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
}

section h2 {
  font-size: 14px;
  margin: 0 0 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

section p, section li {
  font-size: 14px;
  line-height: 1.6;
}

section ol, section ul {
  padding-left: 20px;
}

section li + li {
  margin-top: 6px;
}

code {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

section > pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a button { cursor: pointer; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th, td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  overflow-wrap: anywhere;
}

th {
  color: var(--muted);
  font-weight: 500;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.badge.ok { background: rgba(62,207,142,0.15); color: var(--ok); }
.badge.err { background: rgba(239,90,90,0.15); color: var(--err); }
.badge.na { background: rgba(154,161,173,0.15); color: var(--muted); }

.empty { color: var(--muted); font-size: 13px; padding: 8px 0; }

.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

select, input[type="text"], input[type="password"] {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
}

button {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
}

button.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

#login-screen form {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#login-screen h1 {
  font-size: 16px;
  margin: 0 0 4px;
}

#login-error {
  color: var(--err);
  font-size: 13px;
  min-height: 16px;
}

pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  overflow: auto;
  max-height: 400px;
  font-size: 12px;
}

.row-clickable { cursor: pointer; }
.row-clickable:hover { background: rgba(91,140,255,0.08); }

[hidden] { display: none !important; }
