:root {
  color-scheme: light;
  --bg: #f4f6f4;
  --panel: #ffffff;
  --ink: #17211b;
  --muted: #62706a;
  --line: #d7ddd8;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --warn: #b45309;
  --danger: #b42318;
  --ok-bg: #e7f6ef;
  --warn-bg: #fff4df;
  --shadow: 0 16px 44px rgba(23, 33, 27, 0.12);
}

* {
  box-sizing: border-box;
}

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

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

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

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.6rem, 3vw, 2.45rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  font-size: 1rem;
  letter-spacing: 0;
}

.status-pill,
.mini-label {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
}

.workspace {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  grid-template-areas:
    "inputs results"
    "notes table";
  gap: 16px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.input-panel {
  grid-area: inputs;
  padding: 18px;
}

.results-panel {
  grid-area: results;
  padding: 18px;
}

.table-panel {
  grid-area: table;
  padding: 18px;
}

.notes-panel {
  grid-area: notes;
  padding: 18px;
}

.panel-heading {
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf8;
  color: var(--ink);
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--accent);
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

.metric {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8faf8;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: 1.35rem;
  letter-spacing: 0;
}

.chart-wrap {
  width: 100%;
  height: 320px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fbfcfb;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  font-size: 0.92rem;
}

th {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

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

.badge {
  display: inline-flex;
  min-width: 70px;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 0.82rem;
  font-weight: 800;
}

.badge.pass {
  background: var(--ok-bg);
  color: var(--accent-strong);
}

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

.notes-panel ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.65;
  font-size: 0.93rem;
}

.is-warning {
  background: var(--warn-bg);
  color: var(--warn);
  border-color: #f1d19d;
}

.is-danger {
  background: #fff0ee;
  color: var(--danger);
  border-color: #ffc7c1;
}

@media (max-width: 920px) {
  .workspace {
    grid-template-columns: 1fr;
    grid-template-areas:
      "inputs"
      "results"
      "table"
      "notes";
  }

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

@media (max-width: 560px) {
  .app-shell {
    width: min(100vw - 20px, 1180px);
    padding: 18px 0;
  }

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

  .field-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .chart-wrap {
    height: 260px;
  }
}
