:root {
  --bg: #f5f5f1;
  --ink: #23251f;
  --muted: #696f64;
  --line: #dcded5;
  --panel: #ffffff;
  --accent: #1d6b5f;
  --accent-dark: #154d45;
  --warn: #9a3f2f;
  --ok: #236b42;
}

* {
  box-sizing: border-box;
}

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

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

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 26px;
  line-height: 1.1;
}

nav {
  display: flex;
  gap: 8px;
}

a {
  color: inherit;
}

nav a,
.button-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  background: #fff;
}

nav a.active,
.button-link,
button {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

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

.panel,
.total-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 32px rgba(35, 37, 31, 0.06);
}

.panel {
  padding: clamp(18px, 3vw, 28px);
  margin-bottom: 18px;
}

.form-panel {
  max-width: 640px;
}

.wide {
  max-width: none;
}

.section-head {
  display: grid;
  gap: 6px;
  margin-bottom: 22px;
}

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

.section-head h2 {
  font-size: 22px;
}

.section-head p,
.empty {
  color: var(--muted);
  line-height: 1.5;
}

.stack,
.payout-form {
  display: grid;
  gap: 16px;
}

.payout-form {
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  align-items: end;
}

label {
  display: grid;
  gap: 7px;
  font-size: 14px;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid #c8cbc0;
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  background: #fff;
}

input:focus {
  outline: 3px solid rgba(29, 107, 95, 0.18);
  border-color: var(--accent);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check-row input {
  width: 18px;
  min-height: 18px;
}

button {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

button:hover,
nav a.active:hover,
.button-link:hover {
  background: var(--accent-dark);
}

.alert {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 6px;
  font-weight: 700;
}

.alert.error {
  color: var(--warn);
  background: #fff1ed;
}

.alert.success {
  color: var(--ok);
  background: #edf8f1;
}

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

.total-card {
  padding: 22px;
}

.total-card h3 {
  margin-bottom: 16px;
  font-size: 18px;
}

dl {
  display: grid;
  gap: 12px;
  margin: 0;
}

dl div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
  font-weight: 800;
}

.pending {
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 20px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

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

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

td:nth-child(2) {
  min-width: 220px;
  white-space: normal;
}

@media (max-width: 760px) {
  .topbar,
  .section-head.horizontal {
    align-items: stretch;
    flex-direction: column;
  }

  nav {
    width: 100%;
  }

  nav a {
    flex: 1;
    justify-content: center;
  }

  .totals-grid,
  .payout-form {
    grid-template-columns: 1fr;
  }
}
