:root {
  --bg: #f6f8fc;           /* cool white */
  --card: #ffffff;
  --ink: #22252b;          /* charcoal */
  --muted: #6b7280;
  --brand: #1e40af;        /* royal blue */
  --brand-dark: #16308a;
  --accent: #93b0f5;       /* light royal (focus) */
  --line: #e2e7f0;
  --good: #2e7d32;
  --warn: #c77700;
  --bad: #b3261e;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(30,64,175,.07);
}
/* Manual theme override (topbar ☀/☾ toggle) wins; otherwise follow the system. */
:root[data-theme="dark"] {
  --bg: #17181c;         /* charcoal */
  --card: #212329;
  --ink: #eef1f7;
  --muted: #9aa2b1;
  --line: #33363f;
  --shadow: 0 2px 10px rgba(0,0,0,.45);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17181c;
    --card: #212329;
    --ink: #eef1f7;
    --muted: #9aa2b1;
    --line: #33363f;
    --shadow: 0 2px 10px rgba(0,0,0,.45);
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--brand); }
.wrap { max-width: 960px; margin: 0 auto; padding: 16px; }
.narrow { max-width: 560px; }

header.site {
  background: var(--brand); color: #fff; padding: 8px 0;
}
header.site .wrap { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
header.site .logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.02rem; color: #fff; text-decoration: none; }
header.site .logo img { height: 30px; border-radius: 8px; background:#fff; }
header.site nav a { color: #dbe4ff; text-decoration: none; margin-left: 14px; font-size: .95rem; }
header.site nav a:hover { color: #fff; }

.hero {
  background: linear-gradient(rgba(16,22,40,.6), rgba(16,22,40,.6)) center/cover no-repeat, var(--brand-dark);
  color: #fff; padding: 22px 0; text-align: center;
}
.hero h1 { margin: 0 0 6px; font-size: clamp(1.25rem, 2.6vw, 1.7rem); }
.hero p { margin: 0 auto; max-width: 620px; color: #dde5f7; font-size: .92rem; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; margin: 14px 0;
}
.card h2, .card h3 { margin-top: 0; }
.grid { display: grid; gap: 14px; }
@media (min-width: 720px) {
  .grid.cols-2 { grid-template-columns: 1fr 1fr; }
  .grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
}

label { display: block; font-weight: 600; font-size: .9rem; margin: 10px 0 4px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--ink); font: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 140px; }

button, .btn {
  display: inline-block; border: 0; border-radius: 8px; cursor: pointer;
  background: var(--brand); color: #fff; font: inherit; font-weight: 700;
  padding: 11px 18px; text-decoration: none; text-align: center;
}
button:hover, .btn:hover { background: var(--brand-dark); }
button.secondary, .btn.secondary { background: transparent; color: var(--brand); border: 2px solid var(--brand); }
button.ghost, .btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); font-weight: 500; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.small, .btn.small { padding: 6px 10px; font-size: .85rem; font-weight: 600; }

table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
tr:hover td { background: rgba(30,64,175,.06); }
.table-scroll { overflow-x: auto; }

.pill {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 700; letter-spacing: .02em;
}
.pill.green { background: rgba(46,125,50,.14); color: var(--good); }
.pill.amber { background: rgba(199,119,0,.14); color: var(--warn); }
.pill.red   { background: rgba(179,38,30,.12); color: var(--bad); }
.pill.gray  { background: rgba(122,112,103,.15); color: var(--muted); }

.stat { text-align: center; padding: 14px; }
.stat .num { font-size: 1.7rem; font-weight: 800; }
.stat .label { color: var(--muted); font-size: .85rem; }

.qty-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.qty-row:last-child { border-bottom: 0; }
.qty-row .info { flex: 1; }
.qty-row .price { font-weight: 700; white-space: nowrap; }
.qty-controls { display: flex; align-items: center; gap: 8px; }
.qty-controls button { width: 34px; height: 34px; padding: 0; border-radius: 50%; font-size: 1.1rem; }
.qty-controls .qty { min-width: 24px; text-align: center; font-weight: 700; }

.notice { padding: 12px 14px; border-radius: 8px; margin: 12px 0; font-size: .95rem; }
.notice.ok { background: rgba(46,125,50,.12); color: var(--good); }
.notice.err { background: rgba(179,38,30,.1); color: var(--bad); }
.muted { color: var(--muted); }
.right { text-align: right; }
.center { text-align: center; }
.mt { margin-top: 16px; }
.hidden { display: none !important; }

.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin: 14px 0; flex-wrap: wrap; }
.tabs button {
  background: transparent; color: var(--muted); border-radius: 8px 8px 0 0;
  padding: 9px 14px; font-weight: 600;
}
.tabs button.active { background: var(--card); color: var(--brand); border-bottom: 2px solid var(--brand); margin-bottom: -2px; }

footer.site { color: var(--muted); text-align: center; padding: 28px 0; font-size: .85rem; }

/* ==== WesPools-style topbar — injected on public pages by loadSiteChrome ==== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 10px; padding: 7px 14px;
  background: var(--brand); color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.14);
}
.topbar__zone { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar__zone--right { justify-content: flex-end; }
.topbar__burger {
  width: 38px; height: 38px; border-radius: 10px; flex: none; cursor: pointer;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.22);
  color: #fff; font-size: 1.05rem; padding: 0;
}
.topbar__burger:hover { background: rgba(255,255,255,.18); }
.topbar__brand {
  display: flex; align-items: center; gap: 9px; color: #fff; text-decoration: none;
  font-weight: 800; letter-spacing: .02em; white-space: nowrap; overflow: hidden;
}
.topbar__brand img { height: 42px; width: auto; flex: none; }
.topbar__icons { display: flex; align-items: center; gap: 2px; }
.topbar__icon {
  display: flex; flex-direction: column; align-items: center; gap: 0;
  padding: 3px 10px 4px; border-radius: 10px; text-decoration: none;
  color: #cdd9ff; font-size: .6rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
}
.topbar__icon:hover { background: rgba(255,255,255,.12); color: #fff; }
.topbar__icon.on { background: rgba(255,255,255,.16); color: #fff; }
.topbar__icon .glyph { font-size: 1.12rem; line-height: 1.25; }
.topbar__theme, .topbar__account {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.22);
  color: #fff; border-radius: 10px; font-weight: 700;
}
.topbar__theme { width: 38px; height: 38px; padding: 0; font-size: 1rem; flex: none; cursor: pointer; }
.topbar__account { padding: 8px 14px; font-size: .85rem; text-decoration: none; white-space: nowrap; }
.topbar__theme:hover, .topbar__account:hover { background: rgba(255,255,255,.18); }
@media (max-width: 700px) {
  .topbar { grid-template-columns: auto 1fr; }
  .topbar__zone--center { order: 3; grid-column: 1 / -1; justify-content: center; }
  .topbar__brand span { max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
}

/* Slide-out side menu + overlay */
.side-overlay {
  position: fixed; inset: 0; background: rgba(8,12,24,.5); z-index: 60;
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.side-overlay.on { opacity: 1; pointer-events: auto; }
.side-menu {
  position: fixed; top: 0; left: 0; bottom: 0; width: 300px; max-width: 86vw; z-index: 61;
  background: var(--card); color: var(--ink);
  box-shadow: 6px 0 28px rgba(0,0,0,.3);
  transform: translateX(-102%); transition: transform .22s ease;
  display: flex; flex-direction: column;
}
.side-menu.on { transform: none; }
.side-menu__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--brand); color: #fff; font-weight: 800;
}
.side-menu__head img { height: 30px; width: auto; margin-right: 8px; }
.side-menu__title { display: flex; align-items: center; }
.side-menu__close { background: none; border: 0; color: #fff; font-size: 1.05rem; cursor: pointer; padding: 4px 8px; }
.side-menu__nav { padding: 8px 10px 16px; overflow-y: auto; }
.side-menu__section {
  margin: 10px 0 0; padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.side-menu__section:last-child { border-bottom: 0; }
.side-menu__heading {
  margin: 0 0 4px; padding: 8px 12px; border-radius: 8px;
  background: rgba(30,64,175,.10); color: var(--brand);
  font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
}
.side-menu__link { display: block; padding: 9px 18px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; }
.side-menu__link:hover { background: rgba(30,64,175,.09); color: var(--brand); }
.side-menu__hint { padding: 6px 18px 10px; color: var(--muted); font-size: .85rem; }

/* Admin icon (only for logged-in admins) + Super Admin section-hopper dropdown */
.topbar__icon--admin { color: #ffc4be; }
.topbar__icon--admin:hover { color: #fff; }
.topbar__dropwrap { position: relative; }
.topbar__drop {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px;
  background: var(--card); color: var(--ink); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.25);
  padding: 6px; display: none; z-index: 70;
}
.topbar__drop.open { display: block; }
.topbar__drop a, .topbar__drop span {
  display: block; padding: 9px 12px; border-radius: 8px; text-decoration: none;
  color: var(--ink); font-weight: 600; font-size: .9rem;
}
.topbar__drop a:hover { background: rgba(30,64,175,.09); color: var(--brand); }
.topbar__drop span { color: var(--muted); font-weight: 500; }
.topbar__drop-logout { border-top: 1px solid var(--line); margin-top: 4px; color: var(--bad) !important; }

/* ---- Fundraiser Dashboard (sheet-style stat boxes) ---- */
.dash-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 6px 0 18px; }
@media (max-width: 920px) { .dash-grid { grid-template-columns: repeat(2, 1fr); } }
.dash-box {
  display: flex; align-items: stretch; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow);
}
.dash-box .lbl {
  flex: 1; padding: 10px 12px; color: #fff; font-weight: 800; font-size: .72rem;
  letter-spacing: .05em; text-transform: uppercase; display: flex; align-items: center;
}
.dash-box .val {
  flex: 1; min-width: 0; padding: 10px 12px; font-weight: 800; font-size: 1.12rem;
  display: flex; align-items: center; justify-content: flex-end;
}
.dash-green .lbl    { background: #2e7d32; }
.dash-red .lbl      { background: #9a1b1b; }
.dash-navy .lbl     { background: #1e3a5f; }
.dash-blue .lbl     { background: var(--brand); }
.dash-charcoal .lbl { background: #3a3d45; }

table thead tr.blue-head th  { background: var(--brand); color: #fff; }
table thead tr.steel-head th { background: #5b7fa6; color: #fff; }
tr.totals-row td { border-top: 2px solid var(--brand); background: rgba(30,64,175,.07); font-weight: 700; }
tbody tr.zebra:nth-child(odd) td { background: rgba(30,64,175,.04); }
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
thead tr.blue-head th.sortable:hover { background: var(--brand-dark); }
