:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --panel: #ffffff;
  --text: #172026;
  --muted: #66737c;
  --line: #dfe6ea;
  --primary: #1f7a63;
  --primary-dark: #155846;
  --danger: #a53b3b;
  --shadow: 0 12px 28px rgba(23, 32, 38, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

.topbar {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  padding: 32px clamp(16px, 5vw, 64px);
  background: #16342d;
  color: #ffffff;
}

.eyebrow {
  margin: 0 0 8px;
  color: #b7d8ce;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 820px;
  margin-bottom: 0;
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: 1.08;
}

h2 {
  margin-bottom: 12px;
  font-size: 1.1rem;
}

main {
  width: min(1120px, calc(100% - 32px));
  margin: 28px auto;
}

.intro {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.intro > div,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 20px;
}

.workspace {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

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

input,
select,
button {
  width: 100%;
  min-height: 44px;
  border-radius: 6px;
  font: inherit;
}

input,
select {
  border: 1px solid var(--line);
  padding: 10px 12px;
  background: #ffffff;
  color: var(--text);
}

button {
  border: 0;
  padding: 10px 14px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: var(--primary-dark);
}

.secondary-button {
  width: auto;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: transparent;
}

.secondary-button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.danger {
  border-color: var(--danger);
  color: var(--danger);
}

.danger:hover {
  background: #fff1f1;
}

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

.metrics article {
  min-height: 98px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f9fbfb;
}

.metrics span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.metrics strong {
  display: block;
  font-size: 1.3rem;
}

.insight {
  margin: 18px 0 0;
  padding: 14px;
  border-left: 4px solid var(--primary);
  background: #eef8f5;
}

.table-header {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

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

th {
  color: var(--muted);
  font-size: 0.84rem;
  text-transform: uppercase;
}

.empty {
  color: var(--muted);
  text-align: center;
}

footer {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto 32px;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 820px) {
  .topbar,
  .table-header {
    align-items: stretch;
    flex-direction: column;
  }

  .intro,
  .workspace,
  .metrics {
    grid-template-columns: 1fr;
  }

  .secondary-button {
    width: 100%;
  }
}

@media print {
  .topbar,
  .intro > div,
  .panel,
  footer {
    box-shadow: none;
  }

  form,
  #clearButton,
  #printButton {
    display: none;
  }
}
