:root {
  color-scheme: light;
  --ink: #1a1a1a;
  --bg: #ffffff;
  --bg-alt: #f4f6f5;
  --border: #c9cfcd;
  --accent: #14532d;      /* dark green, AA on white */
  --accent-bg: #e8f3ec;
  --link: #0b4a8f;        /* AA blue */
  --danger: #8a1f1f;
  --danger-bg: #fbe9e9;
  --focus: #0b4a8f;
}

* { box-sizing: border-box; }

html {
  font-size: 18px;
}

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

a { color: var(--link); }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

header.site-header {
  background: var(--accent);
  color: #fff;
  padding: 0.75rem 1rem;
}
header.site-header h1 {
  margin: 0 0 0.5rem 0;
  font-size: 1.3rem;
}
nav.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
nav.site-nav a {
  color: #fff;
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-weight: 600;
  min-height: 48px;
  display: flex;
  align-items: center;
}
nav.site-nav a:hover, nav.site-nav a:focus-visible, nav.site-nav a[aria-current="page"] {
  background: rgba(255,255,255,0.2);
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

label { font-weight: 600; }

select, input[type="text"], input[type="number"], input[type="date"] {
  font-size: 1rem;
  padding: 0.5rem;
  min-height: 48px;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

button, .btn {
  font-size: 1rem;
  font-weight: 700;
  padding: 0.6rem 1rem;
  min-height: 48px;
  border-radius: 6px;
  border: 2px solid var(--accent);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
button.secondary, .btn.secondary {
  background: #fff;
  color: var(--accent);
}
button.danger { background: var(--danger); border-color: var(--danger); }

.status-banner {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-weight: 600;
}
.status-banner.error { background: var(--danger-bg); color: var(--danger); border: 2px solid var(--danger); }
.status-banner.info { background: var(--accent-bg); color: var(--accent); border: 2px solid var(--accent); }

.grand-total {
  background: var(--accent-bg);
  border: 2px solid var(--accent);
  border-radius: 10px;
  padding: 1.25rem;
  text-align: center;
  margin-bottom: 1.5rem;
}
.grand-total .amount {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.card {
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem;
  background: var(--bg-alt);
}
.card .label { font-size: 0.95rem; font-weight: 700; color: #444; }
.card .value { font-size: 1.6rem; font-weight: 800; }
/* generational reference, per the client — do not remove. */
.card .fund-subtitle { font-size: 0.62rem; font-style: italic; color: #5f5f5f; margin: 0.1rem 0 0.2rem; }

.headcounts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.headcounts .card .value { font-size: 1.4rem; }

.chart-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
@media (min-width: 700px) {
  .chart-grid { grid-template-columns: 1fr 1fr; }
}
.chart-box {
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  background: #fff;
}
.chart-box h2 { margin-top: 0; font-size: 1.1rem; }

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}
th, td {
  text-align: left;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--border);
}
th {
  background: var(--bg-alt);
  position: sticky;
  top: 0;
}
tr:hover { background: var(--accent-bg); }
.table-wrap { overflow-x: auto; border: 2px solid var(--border); border-radius: 10px; }

.badge {
  display: inline-block;
  background: var(--danger);
  color: #fff;
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-size: 0.85rem;
  margin-left: 0.4rem;
}

.print-only { display: none; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media print {
  header.site-header, .toolbar, .no-print { display: none !important; }
  .print-only { display: block; }
  body { font-size: 12pt; }
  main { max-width: none; padding: 0; }
  .chart-box, .card { border: 1px solid #999; }
  a { color: var(--ink); text-decoration: none; }
}

/* Reports: dated header shown on-screen at the top of the printed page and
   also visible before printing so editors know it'll be there. */
.report-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 3px solid var(--accent);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}
.report-header h1 { margin: 0; font-size: 1.4rem; }
.report-header .report-meta { font-size: 0.9rem; color: #444; }

.report-section { margin-bottom: 1.75rem; }
.report-section h2 { border-bottom: 1px solid var(--border); padding-bottom: 0.25rem; }

.page-break-before { break-before: page; }
.needs-attention {
  background: var(--danger-bg);
  border: 2px solid var(--danger);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}
.needs-attention h2 { color: var(--danger); margin-top: 0; border: none; }

@media print {
  .page-break-before { break-before: page; }
  /* Rows must not split across a page break, but the table itself must be
     allowed to span pages — a 58-row detail table has to break somewhere.
     thead as table-header-group repeats the header row on every page the
     table spans, so a continued table is never orphaned without its
     column labels. */
  tr { break-inside: avoid; }
  thead { display: table-header-group; }
  .table-wrap { overflow: visible; border: none; }
  /* Summary/total boxes must never straddle a page break. */
  .grand-total, .card, .needs-attention { break-inside: avoid; }
  .report-section h2 { break-after: avoid; }
}

/* T-Shirt Manifest "Received" column: an interactive checkbox on screen
   (hidden in print via .no-print on the input itself), a plain CSS-drawn
   mark in print that reflects the SAVED state — checked prints ✓, unchecked
   prints an empty box — so the printed sheet always matches reality
   instead of always rendering blank regardless of what's been checked off. */
.receive-mark { display: none; }
@media print {
  .receive-mark { display: inline-block; font-size: 14pt; width: 1em; text-align: center; }
  .received-cell[data-received="true"] .receive-mark::after { content: "✓"; }
  .received-cell[data-received="false"] .receive-mark::after { content: "☐"; }
}
