:root {
  --ink: #1b241d;
  --ink-muted: #59634f;
  --bg: #f7f8f4;
  --surface: #ffffff;
  --rule: #d8ddce;
  /* Buttons/links share the header's own purple (--header-ink below) so
     the two feel like one coordinated system, not two different themes
     stitched together. */
  --accent: #362B63;
  --accent-dark: #241C47;
  --warn-bg: #fdf2e3;
  --warn-ink: #7a4a08;
  /* Header only -- a light lavender that echoes the LEF logo's own deep
     purple, chosen so both the purple apple mark and the teal-green leaf
     stay legible (they nearly vanished against the old dark green). */
  --header-bg: #EFEAFB;
  --header-ink: #362B63;
  --header-ink-muted: #5B4E8C;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

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

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
}

.test-mode-banner {
  background: #b3261e;
  color: #fff;
  text-align: center;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 8px 12px;
}

.site-header {
  background: var(--header-bg);
  color: var(--header-ink);
  padding: 18px 0;
  border-bottom: 1px solid #DCD3F2;
}
.header-inner { display: flex; align-items: center; gap: 16px; }
.brand-logo { height: 68px; width: auto; }
.site-header .brand { display: block; font-weight: 700; font-size: 1.1rem; color: var(--header-ink); }
.site-header .brand-sub { display: block; font-size: 0.9rem; color: var(--header-ink-muted); }

main.wrap { padding: 32px 20px 64px; }

h1 { font-size: 1.6rem; margin: 0 0 12px; }
h2 { font-size: 1.15rem; margin: 24px 0 8px; }

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 24px;
  max-width: 420px;
}

label { display: block; font-weight: 600; margin: 16px 0 6px; }
label:first-of-type { margin-top: 0; }

/* Settings page (/admin/config): two columns on tablet/desktop, one on
   phone. Each field's own margin is zeroed out in favor of the grid gap,
   since label:first-of-type above would otherwise fire for every field
   (each is the only label inside its own .field div). */
.config-form {
  max-width: 900px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px 32px;
  align-items: start;
}
.config-form .field { display: flex; flex-direction: column; }
.config-form .field label,
.config-form .field .checkbox-label { margin: 0 0 6px; }
.config-form-submit { grid-column: 1 / -1; justify-self: start; margin-top: 8px; }

.radio-group { display: flex; gap: 20px; }
.radio-group label { display: flex; align-items: center; gap: 6px; font-weight: 400; margin: 0; }
@media (max-width: 640px) {
  .config-form { grid-template-columns: 1fr; }
}

input[type="text"], input[type="email"], select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  font-size: 1rem;
}

button, a.button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  margin-top: 20px;
  margin-right: 10px;
}
button:hover, a.button:hover { background: var(--accent-dark); }

a.button.secondary, button.secondary {
  background: transparent;
  color: var(--accent-dark);
  border: 1px solid var(--rule);
}
a.button.secondary:hover, button.secondary:hover { background: var(--surface); }

.choice-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.choice-row .button { margin: 0; }

.filter-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.filter-row input[type="text"] { flex: 1 1 260px; width: auto; }
.filter-row select { flex: 0 0 auto; width: auto; }

.pagination {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 14px 0;
  color: var(--ink-muted);
  font-size: 0.9rem;
}
.pagination button:disabled { opacity: 0.5; cursor: default; }

table.ledger {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 12px;
}
table.ledger th, table.ledger td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
  text-align: left;
}
table.ledger th { background: #eef1e7; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-muted); }
table.ledger td.amt, table.ledger th.amt { text-align: right; font-variant-numeric: tabular-nums; }
table.ledger tr.total td { font-weight: 700; border-top: 2px solid var(--rule); border-bottom: none; }
table.ledger tr:last-child td { border-bottom: none; }

#fund-search {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  font-size: 1rem;
  margin: 16px 0;
}

.fund-list {
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface);
}

.fund-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
}
.fund-row:last-child { border-bottom: none; }
.fund-row label { margin: 0; font-weight: 400; }
.fund-row.hidden { display: none; }

.amt-input { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.amt-input input { width: 110px; padding: 6px 8px; }

.fund-total-display {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 10px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  font-weight: 700;
}
.fund-total-display .amt { font-variant-numeric: tabular-nums; }
.fund-total-display.fund-total-secondary {
  margin-top: 4px;
  font-weight: 400;
  color: var(--ink-muted);
  background: transparent;
  border: none;
  padding: 0 16px;
}

.pay-note {
  background: #eef1e7;
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.9rem;
  color: var(--ink-muted);
  margin: 10px 0 16px;
}

.pay-note-warn {
  background: var(--warn-bg);
  border-color: #e8c98a;
  color: var(--warn-ink);
}

.pay-highlight {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

.tshirt-qualified {
  font-weight: 600;
  color: var(--accent);
  margin: 28px 0;
}

.tshirt-picker {
  margin: 28px 0;
}

.hidden { display: none !important; }

.card-fields {
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px 18px 6px;
  margin: 12px 0 6px;
}
.card-fields label { margin: 12px 0 6px; }
.card-fields label:first-of-type { margin-top: 0; }
.card-fields input, .card-fields select {
  padding: 10px 12px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  font-size: 1rem;
}
#card-number { width: 100%; }
.card-fields-row { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-end; }

.pay-method-label { font-weight: 600; margin: 20px 0 8px; }

.pay-method-toggle {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.pay-method-toggle label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 400;
  margin: 0;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-weight: 400;
  margin: 18px 0 6px;
}
.checkbox-label input { margin-top: 3px; }

.card-errors {
  color: var(--warn-ink);
  font-size: 0.9rem;
  margin-top: 10px;
  min-height: 1em;
}

.flash {
  list-style: none;
  margin: 0 0 20px;
  padding: 14px 16px;
  background: var(--warn-bg);
  color: var(--warn-ink);
  border: 1px solid #eecfa0;
  border-radius: 8px;
}
.flash li + li { margin-top: 6px; }

.note { color: var(--ink-muted); font-size: 0.9rem; }

.step-summary {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 16px 16px 16px 36px;
  margin: 0 0 24px;
  max-width: 420px;
}
.step-summary li { margin: 6px 0; }

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 20px 0;
  color: var(--ink-muted);
  font-size: 0.85rem;
}
