/* ============================================================
   Hardy Legacy Foundation · officers' app
   "Pennant & ledger"
   ============================================================ */
/* Fonts: Alumni Sans and Public Sans, SIL Open Font License, bundled locally */
@font-face { font-family: "Alumni Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/alumni-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Alumni Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/alumni-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Alumni Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/alumni-sans-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/public-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/public-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/public-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/public-sans-latin-700-normal.woff2") format("woff2"); }

:root {
  --brand: #14382F;
  --brand-2: #1C4A3F;
  --brand-3: #2A5D50;
  --accent: #EFBE3A;
  --accent-soft: #FBEFC9;
  --accent-ink: #7A5A0B;
  --side-text: #C9D9D1;
  --side-muted: var(--side-muted);
  --paper: #EEF1EC;
  --white: #FFFFFF;
  --ink: #1E2B27;
  --ink-2: #4B5A55;
  --ink-3: #75837D;
  --rule: #D9DFD9;
  --rule-2: #C7D0C9;
  --brick: #B0412D;
  --brick-soft: #F6E1DC;
  --ok: #24704F;
  --ok-soft: #DDEEE3;

  --display: "Alumni Sans", "Arial Narrow", sans-serif;
  --text: "Public Sans", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --side-w: 248px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.55 var(--text);
  font-variant-numeric: tabular-nums;
}
a { color: var(--brand-2); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

h1 {
  font: 700 3.1rem/1 var(--display);
  letter-spacing: .005em;
  color: var(--brand);
  margin: 0 0 1.4rem;
}
h1 .muted { font-weight: 500; }
h2 {
  font: 600 1.02rem/1.3 var(--text);
  color: var(--ink);
  margin: 0 0 .9rem;
}
.muted { color: var(--ink-3); }
.small { font-size: .84rem; }

/* ---------- App shell ---------- */
body.app { padding-left: var(--side-w); }
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w);
  background: var(--brand);
  color: var(--side-text);
  display: flex; flex-direction: column;
  padding: 1.4rem 1rem 1rem;
  z-index: 10;
}
.mark { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: #fff; padding: 0 .4rem; }
.mark:hover { color: #fff; }
.mark-name { font: 700 1.55rem/.95 var(--display); letter-spacing: .01em; }
.pennant { flex: none; display: block; }

.btn.record {
  margin: 1.6rem .2rem 1.2rem;
  background: var(--accent); color: var(--brand); border-color: var(--accent);
  text-align: center;
}
.btn.record:hover { filter: brightness(1.08); background: var(--accent); color: var(--brand); }

.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a {
  display: flex; align-items: center; gap: .75rem;
  padding: .55rem .7rem; border-radius: 6px;
  color: var(--side-text); text-decoration: none; font-weight: 500;
}
.side nav a:hover { background: var(--brand-2); color: #fff; }
.side nav a[aria-current="page"] {
  background: var(--brand-2); color: #fff;
  box-shadow: inset 3px 0 0 var(--accent);
}
.ico { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.side nav a[aria-current="page"] .ico { color: var(--accent); }

.me {
  margin-top: auto;
  display: grid; grid-template-columns: auto 1fr; gap: .1rem .65rem; align-items: center;
  padding: .9rem .5rem 0; border-top: 1px solid var(--brand-3);
}
.avatar {
  grid-row: span 2;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand-3); color: var(--accent);
  font: 700 1.15rem/1 var(--display);
}
.me-name { color: #fff; font-weight: 600; font-size: .9rem; line-height: 1.25; }
.me-name small { display: block; color: var(--side-muted); font-weight: 400; font-size: .78rem; }
.side nav a.nav-logout { display: none; }
.logout { grid-column: 2; color: var(--side-muted); font-size: .82rem; }
.logout:hover { color: var(--accent); }

main { max-width: 1340px; padding: 2.2rem 2.4rem 3rem; }

/* ---------- Surfaces ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 1.3rem 1.4rem;
  margin-bottom: 1.4rem;
}
.card.flush { padding: 0; overflow-x: auto; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .8rem; }
.card-head h2 { margin: 0; }
.card-head a { font-size: .88rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.4rem; }
.page-head h1 { margin: 0; }
.crumb { margin: 0 0 .4rem; font-size: .88rem; }
.crumb a { color: var(--ink-2); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; align-items: start; margin-bottom: 1.4rem; }
.grid2.wide-left { grid-template-columns: minmax(0, 2.1fr) minmax(320px, 1fr); }
.grid2 > .card { margin-bottom: 0; }

/* ---------- Ledger strip (dashboard figures) ---------- */
.tiles {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 10px;
  margin-bottom: 1.4rem;
  overflow: hidden;
}
.tile { padding: 1.1rem 1.4rem 1.2rem; border-left: 1px solid var(--rule); }
.tile:first-child { border-left: 0; background: var(--brand); }
.tile span { display: block; color: var(--ink-2); font-size: .86rem; }
.tile strong {
  display: block; margin-top: .15rem;
  font: 700 3.3rem/1 var(--display);
  color: var(--brand);
}
.tile:first-child span { color: var(--side-muted); }
.tile:first-child strong { color: var(--accent); }

/* ---------- Campaign progress ---------- */
.camp { padding: .9rem 0; border-top: 1px solid var(--rule); }
.card-head + .camp, .camp:first-of-type { border-top: 0; padding-top: .3rem; }
.camp-top, .camp-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-size: .9rem; }
.camp-top a { text-decoration: none; }
.camp-top a strong { font: 700 1.7rem/1.05 var(--display); color: var(--brand); }
.camp-top a:hover strong { text-decoration: underline; }
.bar { position: relative; height: 10px; background: var(--paper); border-radius: 5px; margin: .55rem 0 .45rem; overflow: hidden; }
.bar.thin { height: 6px; margin: .45rem 0 0; max-width: 240px; }
.bar > div { height: 100%; background: var(--accent); border-radius: 5px; min-width: 4px; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; }
td, th { padding: .6rem .7rem; text-align: left; vertical-align: top; border-top: 1px solid var(--rule); }
tr:first-child td { border-top: 0; }
table.list th {
  font-size: .8rem; font-weight: 600; color: var(--ink-2);
  background: #F6F8F5; border-top: 0; border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
table.list tbody tr:hover td { background: #F8FAF7; }
.card.flush table.list th:first-child, .card.flush table.list td:first-child { padding-left: 1.4rem; }
.card.flush table.list th:last-child, .card.flush table.list td:last-child { padding-right: 1.4rem; }
.num { text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
tr.dim td { color: var(--ink-3); }
tr.dim td a { color: var(--ink-3); }

/* ---------- Status pills ---------- */
.pill {
  display: inline-block; vertical-align: 1px;
  font-size: .74rem; font-weight: 600; line-height: 1.5;
  padding: 0 .55rem; border-radius: 99px;
  background: var(--paper); color: var(--ink-2);
}
.pill.active { background: var(--ok-soft); color: var(--ok); }
.pill.planning { background: var(--accent-soft); color: var(--accent-ink); }
.pill.completed { background: #E2E8F2; color: #34507A; }
.pill.cancelled { background: var(--brick-soft); color: var(--brick); }

/* ---------- Forms ---------- */
form label { display: block; font-size: .86rem; font-weight: 600; color: var(--ink-2); margin-bottom: .9rem; }
input, select, textarea {
  display: block; width: 100%; margin-top: .3rem;
  font: 400 .95rem/1.4 var(--text); color: var(--ink);
  padding: .55rem .7rem;
  background: var(--white);
  border: 1px solid var(--rule-2); border-radius: 6px;
}
input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 55%, transparent); }
input::placeholder { color: #9AA6A0; }
label.check { display: flex; align-items: center; gap: .55rem; font-weight: 400; color: var(--ink); }
label.check input { width: 17px; height: 17px; margin: 0; accent-color: var(--brand); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.row3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: .9rem; }
.filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: 1.1rem; }
.filters input, .filters select { width: auto; margin: 0; min-width: 170px; }
.filters label.inl { display: flex; align-items: center; gap: .45rem; margin: 0; font-weight: 500; }
.filters label.inl input { min-width: 0; }
.addline { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-top: .9rem; }
.addline input, .addline select { width: auto; margin: 0; flex: 1; min-width: 110px; }
.addline label.check { margin: 0; }
form.inline { display: inline; margin: 0; }
form.inline.addline { display: flex; margin: 0; flex-wrap: nowrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; cursor: pointer; text-decoration: none;
  background: var(--brand); color: #fff;
  border: 1px solid var(--brand); border-radius: 6px;
  font: 600 .93rem/1.2 var(--text);
  padding: .62rem 1.1rem;
}
.btn:hover { background: var(--brand-2); color: #fff; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: var(--white); color: var(--brand); border-color: var(--rule-2); }
.btn.ghost:hover { border-color: var(--brand); background: var(--white); color: var(--brand); }
.btn.small { padding: .38rem .7rem; font-size: .84rem; }
.btn.wide { width: 100%; }
button.link { background: none; border: 0; padding: 0; font: inherit; font-size: .88rem; color: var(--brand-2); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
button.link.danger { color: var(--brick); }
.cancel { margin-left: .9rem; font-size: .9rem; }

/* ---------- Messages ---------- */
.flash {
  padding: .7rem 1rem .7rem 1.1rem; border-radius: 6px; margin-bottom: 1.2rem;
  background: var(--ok-soft); color: var(--ok); font-weight: 500;
  border-left: 4px solid var(--ok);
}
.flash.err { background: var(--brick-soft); color: var(--brick); border-left-color: var(--brick); }
main > .flash { max-width: 760px; animation: flash-in .35s ease-out; }
@keyframes flash-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.pager { display: flex; gap: .3rem; flex-wrap: wrap; }
.pager a { padding: .35rem .7rem; border: 1px solid var(--rule-2); border-radius: 6px; background: var(--white); text-decoration: none; color: var(--ink); }
.pager a.on { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ---------- Demo banner ---------- */
.demo-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem 1rem;
  background: var(--accent-soft); color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 8px; padding: .6rem 1rem; margin-bottom: 1.4rem; font-size: .9rem;
}
.demo-bar strong { color: var(--accent-ink); }
.demo-bar a { font-weight: 600; white-space: nowrap; }
body.gate .demo-note { margin: 1.2rem 0 0; font-size: .86rem; color: var(--ink-3); text-align: center; }
body.gate .demo-note a { color: var(--brand-2); }

/* ---------- Login / setup gate ---------- */
body.gate {
  min-height: 100vh;
  background:
    linear-gradient(115deg, var(--brand) 0 56%, var(--brand-2) 56% 100%);
  display: grid; place-items: center;
}
body.gate main { width: 100%; max-width: 440px; padding: 2rem 1.2rem; }
body.gate .card { padding: 2rem 2rem 1.6rem; border: 0; box-shadow: 0 18px 40px rgba(6, 26, 21, .35); }
.gate-mark { display: flex; align-items: center; gap: .8rem; margin-bottom: 1.4rem; }
.gate-mark h1 { font-size: 2.5rem; margin: 0; line-height: .95; }
.gate-mark p { margin: .25rem 0 0; color: var(--ink-3); font-size: .9rem; }
body.gate main > .flash { margin-bottom: 1rem; }
.card.narrow { max-width: 440px; margin: 0 auto; }

/* ---------- Responsive ---------- */
@media (max-width: 1240px) {
  .grid2.wide-left { grid-template-columns: 1fr; }
  .grid2.wide-left > .card:last-child { max-width: 640px; }
}
@media (max-width: 1020px) {
  .grid2 { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .tile:nth-child(3) { border-left: 0; }
  .tile:nth-child(n+3) { border-top: 1px solid var(--rule); }
}
@media (max-width: 760px) {
  body.app { padding-left: 0; }
  .side {
    position: sticky; top: 0; inset: auto; width: auto;
    flex-direction: row; flex-wrap: wrap; align-items: center;
    padding: .6rem .8rem; gap: .5rem;
  }
  .mark { padding: 0; gap: .5rem; }
  .mark .pennant { width: 42px; height: 26px; }
  .mark-name { font-size: 1.1rem; }
  .mark-name br { display: none; }
  .btn.record { margin: 0 0 0 auto; padding: .45rem .8rem; font-size: .85rem; }
  .side nav {
    flex-direction: row; flex-basis: 100%; gap: .2rem;
    overflow-x: auto; scrollbar-width: none; margin: .2rem -.8rem -.6rem; padding: 0 .8rem .5rem;
  }
  .side nav a { padding: .4rem .6rem; white-space: nowrap; font-size: .9rem; gap: .4rem; }
  .side nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--accent); }
  .side nav .ico { width: 16px; height: 16px; }
  .me { display: none; }
  .side nav::after { content: ""; padding-right: .2rem; }
  main { padding: 1.3rem 1rem 2.5rem; }
  h1 { font-size: 2.6rem; }
  .tile { padding: .9rem 1rem; }
  .tile strong { font-size: 2.6rem; }
  .camp-foot { flex-direction: column; align-items: flex-start; gap: .1rem; }
  .row3 { grid-template-columns: 1fr 1fr; }
  .row3 label:first-child { grid-column: 1 / -1; }
  .page-head { align-items: center; }
  .filters input, .filters select { flex: 1 1 100%; min-width: 0; }
  .card { padding: 1.1rem 1rem; }
  .side nav a.nav-logout { display: flex; color: var(--side-muted); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

.camp-foot .pct { color: var(--brand); font-weight: 700; margin-right: .3rem; }
.row2 > label, .row3 > label { min-width: 0; }
.row2 input, .row3 input { min-width: 0; }
