:root {
  --ink: #111827;
  --muted: #687182;
  --line: #dddfe5;
  --paper: #f5f5f4;
  --panel: #fff;
  --brand: #111827;
  --ok: #15803d;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
}
.topbar {
  min-height: 68px;
  padding: 12px clamp(16px, 4vw, 44px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
nav { display: flex; gap: 8px; flex-wrap: wrap; }
button {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 40px;
  padding: 0 14px;
  font: inherit;
  font-weight: 700;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
button.active, form button {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
}
main {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: clamp(16px, 4vw, 44px);
}
.view { display: none; }
.view.active { display: grid; gap: 18px; }
.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.metrics article, .table, .inline-form {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.metrics article {
  padding: 20px;
  display: grid;
  gap: 10px;
}
.metrics span, .muted { color: var(--muted); }
.metrics strong { font-size: clamp(2rem, 4vw, 3.2rem); }
.section-head h1 { margin: 0; font-size: clamp(2rem, 4vw, 3.2rem); }
.inline-form {
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px auto;
  gap: 10px;
}
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 42px;
  padding: 10px 12px;
  font: inherit;
}
.table { overflow: hidden; }
.row {
  display: grid;
  grid-template-columns: 1fr 1fr 140px;
  gap: 12px;
  padding: 14px;
  border-top: 1px solid var(--line);
}
.row:first-child { border-top: 0; }
.pill {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: #dcfce7;
  color: var(--ok);
  font-size: .78rem;
  font-weight: 700;
}
@media (max-width: 760px) {
  .topbar { align-items: stretch; flex-direction: column; }
  .metrics, .inline-form, .row { grid-template-columns: 1fr; }
}
