:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --ink: #172026;
  --muted: #65717c;
  --line: #d9dee5;
  --panel: #ffffff;
  --green: #287d5a;
  --red: #b84a4a;
  --amber: #9f6b1d;
  --blue: #2f6fb0;
  --shadow: 0 10px 30px rgba(23, 32, 38, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

.topbar {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  padding: 24px clamp(18px, 4vw, 48px);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 32px;
  font-weight: 750;
  line-height: 1.1;
}

h2 {
  font-size: 18px;
  line-height: 1.25;
}

.eyebrow,
.metric-label,
.toolbar span,
.section-title p,
th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.range {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  white-space: nowrap;
}

main {
  display: grid;
  gap: 20px;
  padding: 24px clamp(18px, 4vw, 48px) 40px;
}

.summary {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
}

.metric,
.toolbar,
.chart-band,
.table-band {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  min-height: 102px;
  padding: 18px;
}

.metric strong {
  display: block;
  font-size: 38px;
  line-height: 1.1;
  margin-top: 10px;
}

.toolbar {
  align-items: end;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(220px, 1fr) 180px 160px;
  padding: 16px;
}

label {
  display: grid;
  gap: 7px;
}

input,
select {
  background: #fbfcfd;
  border: 1px solid #cbd3dc;
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  min-height: 40px;
  padding: 8px 10px;
}

.chart-band,
.table-band {
  overflow: hidden;
}

.section-title {
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 16px 18px;
}

.sankey {
  height: min(58vh, 560px);
  min-height: 360px;
  width: 100%;
}

.table-wrap {
  overflow: auto;
}

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

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

th {
  padding: 0;
}

.sort-button {
  align-items: center;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  gap: 6px;
  justify-content: flex-start;
  min-height: 42px;
  padding: 13px 14px;
  text-align: left;
  text-transform: inherit;
  width: 100%;
}

.sort-button:hover,
.sort-button:focus-visible {
  background: #eef3f7;
  outline: none;
}

.sort-icon {
  color: var(--ink);
  display: inline-block;
  min-width: 12px;
}

td {
  font-size: 14px;
  line-height: 1.35;
}

tr:hover td {
  background: #f9fbfc;
}

.status {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
  padding: 7px 9px;
  text-transform: capitalize;
}

.status.ignored {
  background: #fff4de;
  color: var(--amber);
}

.status.refused {
  background: #fde8e8;
  color: var(--red);
}

.status.accepted {
  background: #e3f4ec;
  color: var(--green);
}

a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

@media (max-width: 820px) {
  .topbar,
  .section-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .summary,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .sankey {
    height: 430px;
  }
}
