:root {
  color-scheme: light;
  --bg: #f6f3ee;
  --surface: #ffffff;
  --ink: #1f2933;
  --muted: #6b7280;
  --line: #d9ded8;
  --accent: #23645a;
  --accent-dark: #163f39;
  --warn: #9a4f11;
  --shadow: 0 18px 50px rgba(31, 41, 51, 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;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 32px clamp(18px, 4vw, 56px) 18px;
}

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

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 4.6rem);
  line-height: 0.98;
}

h2 {
  margin-bottom: 0;
  font-size: 1.35rem;
}

h3 {
  margin-bottom: 10px;
}

.admin-link,
.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 750;
  text-decoration: none;
}

.danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid #d8b5a2;
  border-radius: 8px;
  background: #fff6f1;
  color: #8a3516;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 22px;
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto 46px;
}

.layout.single {
  grid-template-columns: 1fr;
}

.layout.confirmation-layout {
  grid-template-columns: minmax(0, 760px);
  justify-content: center;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: clamp(18px, 3vw, 30px);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 18px;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.stack {
  display: grid;
  gap: 16px;
  margin-bottom: 28px;
}

.participant {
  display: grid;
  grid-template-columns: 1fr 160px 1fr;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.participant h3 {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 1rem;
}

.field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
}

.field.compact {
  max-width: 280px;
  margin-bottom: 18px;
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cbd4ce;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  font: inherit;
  background: white;
}

input:focus {
  outline: 3px solid rgba(35, 100, 90, 0.18);
  border-color: var(--accent);
}

.choice {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 24px;
  padding: 0;
  border: 0;
}

.choice legend {
  width: 100%;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 750;
}

.choice label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  font-weight: 750;
}

.choice input {
  width: auto;
  min-height: auto;
}

.sandwich-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: -8px 0 28px;
}

.summary {
  display: grid;
  gap: 12px;
  margin: 6px 0 22px;
  padding: 18px;
  border-radius: 8px;
  background: #eef5f1;
}

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

.grand-total {
  padding-top: 12px;
  border-top: 1px solid #cddbd3;
  font-size: 1.18rem;
}

.primary {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

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

.confirmation {
  align-self: start;
}

.confirmation h2 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1;
}

.transfer-box {
  display: grid;
  grid-template-columns: 1fr 150px;
  gap: 16px;
  align-items: center;
  margin: 18px 0;
  padding: 16px;
  border: 1px solid #cddbd3;
  border-radius: 8px;
  background: #eef5f1;
}

.cash-box {
  margin: 18px 0;
  padding: 18px;
  border: 1px solid #cddbd3;
  border-radius: 8px;
  background: #eef5f1;
}

.cash-box p {
  margin-bottom: 0;
  font-size: 1.12rem;
}

.transfer-box img {
  width: 150px;
  height: 150px;
  border: 8px solid white;
  border-radius: 8px;
}

.admin-login {
  width: min(460px, 100%);
}

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

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

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

.totals-grid div {
  min-height: 74px;
  padding: 14px;
  border: 1px solid #cddbd3;
  border-radius: 8px;
  background: #eef5f1;
}

.totals-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.totals-grid strong {
  font-size: 1.25rem;
}

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

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

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

.status-select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 8px;
  background: white;
  font: inherit;
}

.pill {
  display: inline-flex;
  margin: 2px 4px 2px 0;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef5f1;
  font-size: 0.82rem;
  font-weight: 750;
}

.error {
  color: var(--warn);
  font-weight: 800;
}

.hidden {
  display: none !important;
}

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

  .layout {
    grid-template-columns: 1fr;
  }

  .participant,
  .sandwich-grid,
  .transfer-box {
    grid-template-columns: 1fr;
  }

  .transfer-box img {
    width: 180px;
    height: 180px;
  }

  .section-heading,
  .admin-head {
    align-items: flex-start;
    flex-direction: column;
  }

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