:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --panel: #ffffff;
  --text: #18202a;
  --muted: #667085;
  --line: #d9e0ea;
  --primary: #146c94;
  --danger: #b42318;
  --ok: #087443;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: inherit; }
.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 20px;
  background: #101820;
  color: white;
}
.brand { font-weight: 700; text-decoration: none; white-space: nowrap; }
.topbar nav { display: flex; flex-wrap: wrap; gap: 12px; flex: 1; }
.topbar nav a { color: #dce7f3; text-decoration: none; font-size: 14px; }
.topbar form { margin: 0; }
.container { max-width: 1180px; margin: 0 auto; padding: 28px 20px 60px; }
h1 { margin: 0 0 20px; font-size: 28px; }
h2 { margin-top: 28px; font-size: 18px; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.panel {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}
.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 700;
  background: #eef2f6;
}
.pill.ok { color: var(--ok); background: #dcfae6; }
.pill.bad { color: var(--danger); background: #fee4e2; }
.muted { color: var(--muted); font-size: 12px; }
pre {
  overflow: auto;
  background: #111827;
  color: #e5e7eb;
  padding: 14px;
  border-radius: 8px;
  line-height: 1.45;
}
button, .button-link {
  border: 0;
  border-radius: 6px;
  background: var(--primary);
  color: white;
  padding: 9px 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
button.danger { background: var(--danger); }
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  font: inherit;
}
textarea { min-height: 90px; }
label { display: grid; gap: 6px; font-weight: 650; color: #344054; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}
.form-grid button { align-self: end; min-height: 41px; }
.actions, .diagnostics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.diagnostics form {
  display: flex;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
th, td { border-bottom: 1px solid var(--line); padding: 10px; text-align: left; vertical-align: top; }
th { background: #eef2f6; }
.checkbox { display: flex; flex-direction: row; align-items: center; gap: 8px; }
.checkbox input { width: auto; }
.inline-confirm { display: flex; gap: 10px; max-width: 420px; margin-top: 14px; }
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}
.login-box {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
}
.login-box h1 { font-size: 24px; }
.error { color: var(--danger); margin: 0; font-weight: 700; }
@media (max-width: 760px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .diagnostics form { width: 100%; flex-direction: column; }
}
