:root {
  color-scheme: light;
  --bg: #f6f8fa;
  --panel: #ffffff;
  --ink: #17201d;
  --muted: #66716d;
  --line: #dde5e1;
  --brand: #166a5b;
  --danger: #b42318;
  --warn: #9a6700;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 9px 12px;
  cursor: pointer;
}

button.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

button.danger {
  border-color: #f3b1aa;
  color: var(--danger);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
}

textarea {
  min-height: 140px;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 12px;
}

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login form,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.login form {
  width: min(420px, 100%);
  padding: 24px;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 238px 1fr;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #eff6f3;
  padding: 18px 14px;
}

.brand {
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 18px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav button {
  text-align: left;
  background: transparent;
}

.nav button.active {
  background: #d9eee8;
  border-color: #b7d9cf;
  color: #0d5c50;
  font-weight: 700;
}

.content {
  min-width: 0;
  padding: 22px;
}

.topbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

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

.panel {
  padding: 16px;
  margin-bottom: 16px;
}

.metric {
  font-size: 26px;
  font-weight: 800;
}

.muted {
  color: var(--muted);
}

.warn {
  color: var(--warn);
  font-weight: 700;
}

.error {
  color: var(--danger);
  white-space: pre-wrap;
}

.row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #e8f4ef;
  color: #0d5c50;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
}

.pill.bad {
  background: #fde9e7;
  color: var(--danger);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  gap: 16px;
}

pre {
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 12px;
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .split {
    grid-template-columns: 1fr;
  }
}
