:root {
  color-scheme: light;
  --bg: #f5f7f9;
  --panel: #ffffff;
  --line: #d7dde4;
  --text: #1b2430;
  --muted: #65758b;
  --accent: #176b87;
  --accent-2: #2f7d32;
  --danger: #b42318;
  --warn: #9a6700;
}

* { 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: var(--accent); text-decoration: none; }
.topbar {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { font-weight: 700; color: var(--text); }
.nav { display: flex; gap: 14px; flex: 1; font-size: 14px; }
.logout { margin-left: auto; }
.page { max-width: 1440px; margin: 0 auto; padding: 24px; }
.band {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  padding: 18px 0 22px;
}
.eyebrow { margin: 0 0 6px; color: var(--accent); font-size: 12px; font-weight: 700; text-transform: uppercase; }
h1, h2 { margin: 0 0 10px; letter-spacing: 0; }
h1 { font-size: 28px; }
h2 { font-size: 18px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.metrics div, .login-panel, .grid > div, .report {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.metrics div { padding: 14px; display: flex; justify-content: space-between; align-items: center; }
.metrics span { color: var(--muted); }
.metrics strong { font-size: 22px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.grid.narrow-left { grid-template-columns: minmax(280px, 0.38fr) minmax(0, 1fr); }
.grid > div, .report { padding: 16px; overflow: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 14px; }
th { color: var(--muted); background: #f0f3f6; font-weight: 650; }
.empty { color: var(--muted); text-align: center; padding: 28px; }
.pos { color: var(--accent-2); font-weight: 700; }
.neg { color: var(--danger); font-weight: 700; }
.badge { display: inline-block; border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; font-size: 12px; background: #eef2f5; }
.badge.ok { background: #e8f3ea; color: #1f6b2a; border-color: #b8d5bd; }
.badge.failed { background: #fdebea; color: #9d1c12; border-color: #f3b8b3; }
.badge.skipped_missing_credentials, .badge.skipped, .badge.skipped_budget { background: #fff4d6; color: #7c5600; border-color: #ead28b; }
button, select, input, textarea {
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}
button {
  min-height: 36px;
  padding: 0 12px;
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  cursor: pointer;
}
.button-link {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
}
input, select { min-height: 36px; padding: 0 10px; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.login-shell { min-height: calc(100vh - 110px); display: grid; place-items: center; }
.login-panel { width: min(420px, 100%); padding: 26px; display: grid; gap: 14px; }
.login-panel label, .stack { display: grid; gap: 8px; }
.login-panel input, .stack input { width: 100%; }
.error { color: var(--danger); font-weight: 650; }
.settings-form { display: grid; gap: 12px; }
.settings-form textarea { width: 100%; min-height: 560px; padding: 14px; font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace; font-size: 13px; line-height: 1.45; }
.comment-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.comment-grid div { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px; display: grid; gap: 4px; }
.comment-grid span { color: var(--muted); font-size: 13px; }
.report pre { white-space: pre-wrap; font-family: inherit; line-height: 1.55; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section-head h2, .section-head h3 { margin: 0; }
h3 { margin: 0 0 8px; font-size: 15px; }
.report-block { margin-bottom: 16px; }
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 16px 0; }
.chart-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  overflow: hidden;
}
.chart-panel svg { display: block; width: 100%; height: auto; min-height: 180px; }
.recommendation-table th, .recommendation-table td { font-size: 13px; padding: 8px 10px; }
.recommendation-table td:nth-child(8) { min-width: 260px; }
@media (max-width: 860px) {
  .topbar { height: auto; align-items: flex-start; padding: 12px; flex-wrap: wrap; }
  .nav { order: 3; width: 100%; overflow-x: auto; }
  .page { padding: 14px; }
  h1 { font-size: 24px; line-height: 1.25; word-break: keep-all; }
  .band { align-items: stretch; flex-direction: column; }
  .metrics, .grid.two, .grid.narrow-left, .comment-grid, .chart-grid { grid-template-columns: 1fr; }
  table { display: block; overflow-x: auto; }
}
