:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef2f5;
  --line: #d9e0e6;
  --text: #17212b;
  --muted: #667481;
  --accent: #0f766e;
  --accent-soft: #d9f2ee;
  --good: #107c41;
  --good-soft: #dff4e8;
  --warn: #a15c00;
  --warn-soft: #fff0d6;
  --bad: #b42318;
  --bad-soft: #ffe3df;
  --info: #1d5fbf;
  --info-soft: #e4efff;
  --shadow: 0 12px 28px rgba(18, 31, 46, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

a {
  color: inherit;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 248px;
  background: #111827;
  color: #f8fafc;
  padding: 20px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #0f766e;
  font-weight: 800;
}

.brand-title {
  font-weight: 800;
}

.brand-subtitle {
  color: #a8b3c1;
  font-size: 12px;
  margin-top: 2px;
}

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

.nav-link {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 650;
}

.nav-link:hover,
.nav-link.is-active {
  background: rgba(255, 255, 255, 0.11);
  color: #ffffff;
}

.main {
  margin-left: 248px;
  min-height: 100vh;
  padding: 26px 28px 44px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 22px;
}

.topbar h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
}

.topbar-meta,
.muted {
  color: var(--muted);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric-grid.compact {
  grid-template-columns: repeat(5, minmax(140px, 1fr));
}

.metric {
  min-height: 84px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: 22px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.section {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.section h2,
.two-columns h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.text-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

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

th {
  background: var(--surface-2);
  color: #3d4a56;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.badge.good {
  background: var(--good-soft);
  color: var(--good);
}

.badge.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.badge.bad {
  background: var(--bad-soft);
  color: var(--bad);
}

.badge.info {
  background: var(--info-soft);
  color: var(--info);
}

.badge.neutral {
  background: #edf0f3;
  color: #42515f;
}

.filters {
  display: grid;
  grid-template-columns: minmax(180px, 1.6fr) minmax(160px, 1fr) minmax(160px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.filters label {
  display: grid;
  gap: 6px;
}

.filters span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select,
.button {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

input,
select {
  width: 100%;
  padding: 0 11px;
}

.button {
  padding: 0 16px;
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 16px;
  align-items: stretch;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.detail-hero h2 {
  margin: 6px 0 6px;
  font-size: 24px;
  line-height: 1.15;
}

.detail-hero p {
  margin: 0;
  color: var(--muted);
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.score-card {
  display: grid;
  align-content: center;
  justify-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
}

.score-card span,
.score-card small {
  font-weight: 800;
}

.score-card strong {
  font-size: 42px;
  line-height: 1;
}

.lead-text {
  max-width: 1100px;
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
}

.two-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
}

.pill-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.pill-list li {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-2);
  line-height: 1.4;
}

.checklist-section {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.checklist-section summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  background: var(--surface-2);
  cursor: pointer;
  font-weight: 850;
}

.checklist-section .table-wrap {
  border: 0;
  border-radius: 0;
}

.score-cell {
  font-weight: 850;
  white-space: nowrap;
}

.kv {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 8px 16px;
  margin: 0;
}

.kv dt {
  color: var(--muted);
  font-weight: 800;
}

.kv dd {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.empty {
  padding: 28px 12px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1100px) {
  .metric-grid,
  .metric-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 760px) {
  .sidebar {
    position: static;
    width: auto;
    padding: 14px;
  }

  .brand {
    margin-bottom: 12px;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .main {
    margin-left: 0;
    padding: 18px 14px 30px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar h1 {
    font-size: 22px;
  }

  .metric-grid,
  .metric-grid.compact,
  .filters,
  .detail-hero,
  .two-columns {
    grid-template-columns: 1fr;
  }

  .score-card {
    min-height: 120px;
  }

  .section,
  .detail-hero,
  .filters {
    padding: 14px;
  }

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