/* Project Relentless: design language.

   Taken from the logo
   - deep navy, teal and one gold sweep;
   - round shapes cut by clean gaps (the quarter-circle corners, the pill buttons);
   - the ridge and sweep at the foot of the title band;
   - bold condensed capitals, with a gold bar as the divider.

   Added, so the app does not lean on three colours alone
   - warm sand and paper for backgrounds, stone for quiet labels;
   - clay (late, declined, remove), leaf (done, agreed), dusk (meeting, CSR fund).
   Colour always comes with words, never on its own.

   Phones first: one column, big tap targets, no web fonts, no images to download. */

:root {
  --navy: #0b3558;
  --navy-deep: #072440;
  --teal: #00909a;
  --teal-ink: #00676e;
  --gold: #fdb913;

  --sand: #f4eee2;
  --paper: #fffdf8;
  --stone: #ece5d6;
  --line: #e2d8c5;
  --edge: #8f8672;
  --ink: #14283b;
  --muted: #56677a;

  --clay: #b0442d;
  --clay-soft: #f8e3dc;
  --leaf: #2c6b40;
  --leaf-soft: #dff0e2;
  --dusk: #4c3f80;
  --dusk-soft: #e8e3f5;
  --mist: #d7eef0;
  --gold-soft: #fff0c2;
  --gold-ink: #6a4a00;

  --display: "Roboto Condensed", "Bahnschrift", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  padding-bottom: 78px; /* room for the bottom bar on phones */
  background: var(--sand);
  color: var(--ink);
  font: 16px/1.5 var(--body);
}
body.signed-out { padding-bottom: 0; }
a { color: var(--teal-ink); }
p { margin: 0 0 10px; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }

.wrap { width: 100%; max-width: 880px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: var(--navy-deep); padding: 8px 12px; z-index: 20; }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---- Top bar and wordmark ---- */
.top {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; min-height: 44px; }
.mark { width: 40px; height: 40px; flex: none; }
.mark.big { width: 104px; height: 104px; }
.word {
  font: 700 1rem/1 var(--display); font-stretch: condensed;
  letter-spacing: .03em; text-transform: uppercase; color: var(--navy); white-space: nowrap;
}
.word i { display: inline-block; width: 3px; height: 1em; margin: 0 .38em; background: var(--gold); vertical-align: -.12em; border-radius: 1px; }
.out { margin-left: auto; }
.out button {
  min-height: 40px; padding: 0 14px;
  font: 700 .8rem var(--display); font-stretch: condensed; letter-spacing: .05em; text-transform: uppercase;
  color: var(--navy); background: none; border: 1.5px solid var(--line); border-radius: 999px; cursor: pointer;
}

/* ---- Navigation: bottom bar on phones, in the top bar on wider screens ---- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex;
  background: var(--navy-deep);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav a {
  flex: 1; display: grid; justify-items: center; gap: 2px;
  padding: 8px 4px 9px;
  border-top: 3px solid transparent;
  color: #c7d5e2; text-decoration: none;
  font: 700 .7rem var(--display); font-stretch: condensed; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap;
}
.nav a.on { color: #fff; border-top-color: var(--gold); }
.nav svg { width: 22px; height: 22px; fill: currentColor; }

/* ---- Title band, with the ridge and sweep from the logo ---- */
.band { position: relative; overflow: hidden; background: var(--navy-deep); color: #fff; padding: 18px 0 42px; }
.band h1 {
  margin: 0;
  font: 700 1.9rem/1.05 var(--display); font-stretch: condensed;
  letter-spacing: .02em; text-transform: uppercase; overflow-wrap: anywhere;
}
.kicker {
  margin: 0 0 6px;
  font: 700 .8rem var(--display); font-stretch: condensed; letter-spacing: .12em; text-transform: uppercase; color: var(--gold);
}
.back { display: inline-block; margin-bottom: 8px; padding: 6px 0; color: var(--mist); font-size: .9rem; text-decoration: none; }
.back:hover { text-decoration: underline; }
.ridge { position: absolute; right: 0; bottom: -1px; width: 200px; height: 44px; display: block; }

main.wrap { display: grid; gap: 16px; margin-top: 18px; }

/* ---- Cards: one tight corner, three round ones ---- */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px 20px 20px 20px;
  padding: 16px;
  min-width: 0;
}
.h2 {
  margin: 0 0 12px;
  font: 700 1.15rem/1.2 var(--display); font-stretch: condensed;
  letter-spacing: .04em; text-transform: uppercase; color: var(--navy);
}
.h2::before { content: ""; display: inline-block; width: 4px; height: .95em; margin-right: .5em; background: var(--gold); border-radius: 2px; vertical-align: -.1em; }
.count { margin-left: 4px; padding: 1px 9px; border-radius: 999px; background: var(--stone); color: var(--muted); font-size: .85rem; letter-spacing: 0; }
.empty, .hint, .none { color: var(--muted); }
.hint { font-size: .86rem; }
.none { font-style: italic; }

/* ---- Tiles: a number with a quarter-circle corner ---- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile {
  position: relative; overflow: hidden;
  display: grid; gap: 2px; align-content: end; min-height: 92px;
  padding: 14px 16px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 4px 20px 20px 20px;
  color: inherit; text-decoration: none;
}
.tile::after { content: ""; position: absolute; top: 0; right: 0; width: 40px; height: 40px; border-radius: 0 0 0 100%; background: var(--teal); }
.tile:nth-child(2)::after { background: var(--gold); }
.tile:nth-child(3)::after { background: var(--leaf); }
.tile:nth-child(4)::after { background: var(--clay); }
.tile b { font: 700 clamp(1.2rem, 6.2vw, 1.7rem)/1.1 var(--display); font-stretch: condensed; color: var(--navy); white-space: nowrap; }
.tile span { color: var(--muted); font-size: .9rem; }
a.tile:hover b { text-decoration: underline; }

/* ---- Lists of things you can open ---- */
.list { display: grid; }
.row {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  padding: 12px 0; border-top: 1px solid var(--line);
  color: inherit; text-decoration: none;
}
.list .row:first-child { border-top: 0; padding-top: 2px; }
.row-main { display: grid; gap: 2px; min-width: 0; }
.row-main strong { color: var(--navy); overflow-wrap: anywhere; }
.row:hover strong { text-decoration: underline; }
.row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.sub { color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.sub.next { color: var(--ink); }

/* ---- Chips: colour with a word, never colour alone ---- */
.chip {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 999px;
  background: var(--stone); color: var(--ink);
  font: 700 .76rem/1.4 var(--display); font-stretch: condensed; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap;
}
.chip.k-sponsor, .chip.st-sent, .pipeline .st-sent, .track .st-sent.on { background: var(--mist); color: var(--teal-ink); }
.chip.k-donor, .chip.st-replied, .pipeline .st-replied, .track .st-replied.on, .chip.due-soon, .chip.deal-talking { background: var(--gold-soft); color: var(--gold-ink); }
.chip.k-csr, .chip.st-meeting, .pipeline .st-meeting, .track .st-meeting.on { background: var(--dusk-soft); color: var(--dusk); }
.chip.st-agreed, .pipeline .st-agreed, .track .st-agreed.on, .chip.done, .chip.deal-agreed { background: var(--leaf-soft); color: var(--leaf); }
.chip.st-declined, .pipeline .st-declined, .track .st-declined.on { background: var(--clay-soft); color: var(--clay); }
.chip.st-draft, .pipeline .st-draft, .track .st-draft.on { background: var(--stone); color: var(--ink); }
.chip.due-late { background: var(--clay); color: #fff; }

/* ---- Proposals by stage ---- */
.pipeline { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pipeline a { display: grid; gap: 0; padding: 10px 12px; border-radius: 4px 14px 14px 14px; text-decoration: none; }
.pipeline b { font: 700 1.5rem/1.1 var(--display); font-stretch: condensed; }
.pipeline span { font: 700 .76rem var(--display); font-stretch: condensed; letter-spacing: .05em; text-transform: uppercase; }
.pipeline a:hover span { text-decoration: underline; }

.stages { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; }
.stages a {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--paper);
  color: var(--navy); text-decoration: none;
  font: 700 .84rem var(--display); font-stretch: condensed; letter-spacing: .05em; text-transform: uppercase;
}
.stages a b { color: var(--muted); }
.stages a.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.stages a.on b { color: var(--gold); }

.track { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0 0 14px; padding: 0; }
.track li {
  padding: 5px 12px; border: 1.5px dashed var(--line); border-radius: 999px; color: var(--muted);
  font: 700 .8rem var(--display); font-stretch: condensed; letter-spacing: .05em; text-transform: uppercase;
}
.track li.on { border: 1.5px solid currentColor; }

/* ---- Buttons: pills ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 20px;
  border: 2px solid var(--navy); border-radius: 999px;
  background: var(--paper); color: var(--navy);
  font: 700 .95rem var(--display); font-stretch: condensed; letter-spacing: .05em; text-transform: uppercase; text-decoration: none;
  cursor: pointer;
}
.btn.primary { background: var(--navy); color: #fff; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--navy-deep); }
.btn.ghost { border-color: var(--line); color: var(--ink); }
.btn.danger { border-color: var(--clay); color: var(--clay); }
.btn.small { min-height: 40px; padding: 0 14px; font-size: .84rem; }
.btn.wide { width: 100%; }
.btn:hover { filter: brightness(.95); }
.bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.card > .bar { margin-top: 14px; }

/* ---- Forms ---- */
.field { display: grid; gap: 5px; margin-bottom: 14px; min-width: 0; }
.field label, legend { font-weight: 600; font-size: .93rem; }
.opt { color: var(--muted); font-weight: 400; font-size: .8rem; }
input, select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px;
  border: 1.5px solid var(--edge); border-radius: 10px;
  background: #fff; color: var(--ink); font: 16px/1.4 var(--body);
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); outline: 3px solid var(--mist); outline-offset: 0; }
.grid2 { display: grid; gap: 0 12px; }
fieldset.group { margin: 0 0 14px; padding: 12px 12px 0; border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.or { text-align: center; color: var(--muted); font-size: .9rem; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filters .field { margin-bottom: 0; }
.filters .grow { flex: 1 1 180px; }

details.edit { margin-top: 12px; border-top: 1px solid var(--line); }
details.edit summary { display: flex; align-items: center; min-height: 46px; color: var(--teal-ink); font-weight: 700; cursor: pointer; }
details.edit[open] summary { margin-bottom: 8px; }
details.edit form + form { margin-top: 12px; }
.move { margin-top: 4px; }

/* ---- Detail blocks ---- */
.dl { display: grid; gap: 12px 18px; margin: 0; }
.dl dt { font: 700 .74rem var(--display); font-stretch: condensed; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.dl dd { margin: 0; overflow-wrap: anywhere; }
.item { padding: 14px 0; border-top: 1px solid var(--line); }
.item:first-of-type { border-top: 0; padding-top: 0; }
.item header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.item h3 { margin: 0; font: 700 1.1rem/1.2 var(--display); font-stretch: condensed; letter-spacing: .02em; color: var(--navy); }
.amount { margin: 4px 0 10px; font: 700 1.5rem/1.1 var(--display); font-stretch: condensed; color: var(--navy); }

.owed { list-style: none; margin: 0; padding: 0; }
.owed li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.owed-text { display: grid; gap: 4px; justify-items: start; min-width: 0; flex: 1 1 220px; }
.owed-acts { display: flex; gap: 6px; align-items: flex-start; }
.owed .is-done strong { text-decoration: line-through; color: var(--muted); }

.history { list-style: none; margin: 0; padding: 0; }
.history li { display: grid; grid-template-columns: 6.2em 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.history li:first-child { border-top: 0; padding-top: 0; }
.when { color: var(--muted); font-size: .88rem; }
.note { display: block; margin-top: 4px; }

.build { list-style: none; margin: 0; padding: 0; }
.build li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.build li:first-child { border-top: 0; }
.build b { font-weight: 600; }
.build span { color: var(--muted); font-size: .88rem; }
.build .done span { color: var(--leaf); font-weight: 700; }

/* ---- Money in, totals and the impact report ---- */
.tiles.one { grid-template-columns: 1fr; }
.chip.m-donation { background: var(--gold-soft); color: var(--gold-ink); }
.chip.m-sponsorship, .chip.src-own { background: var(--mist); color: var(--teal-ink); }
.chip.src-club, .chip.src-league, .chip.src-endeva { background: var(--dusk-soft); color: var(--dusk); }
.plain { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.sheet .h2 { margin-top: 20px; }
.sheet-head { display: grid; gap: 4px; padding-bottom: 14px; border-bottom: 3px solid var(--gold); }
.sheet-head h2 { margin: 8px 0 0; font: 700 1.5rem/1.15 var(--display); font-stretch: condensed; text-transform: uppercase; letter-spacing: .02em; color: var(--navy); }
.sheet-head p { margin: 0; color: var(--muted); }
.figures { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.figure { display: grid; gap: 1px; padding: 12px; background: var(--sand); border-radius: 4px 14px 14px 14px; }
.figure b { font: 700 1.6rem/1.1 var(--display); font-stretch: condensed; color: var(--navy); }
.figure span { font-weight: 600; }
.figure small { color: var(--muted); font-size: .78rem; }
.sheet-foot { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }
@media (min-width: 560px) { .figures { grid-template-columns: repeat(3, 1fr); } }
@media print {
  body { background: #fff; padding: 0; }
  .top, .band, .nav, .foot, .noprint, .skip, .flash { display: none !important; }
  main.wrap { margin: 0; padding: 0; max-width: none; }
  .sheet { border: 0; padding: 0; }
  .figure { border: 1px solid var(--line); break-inside: avoid; }
}

/* ---- Messages ---- */
.flash { margin: 0; padding: 12px 14px; border-radius: 4px 14px 14px 14px; border-left: 5px solid; font-weight: 600; }
.flash.ok { background: var(--leaf-soft); color: var(--leaf); }
.flash.err { background: var(--clay-soft); color: var(--clay); }
.card .flash { margin-bottom: 12px; }

.aside { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0; color: var(--muted); font-size: .9rem; }
.foot { padding-top: 18px; padding-bottom: 22px; color: var(--muted); font-size: .8rem; }

/* ---- Sign in ---- */
.login { width: 100%; max-width: 430px; margin: 0 auto; }
.login-brand { display: grid; justify-items: center; gap: 8px; margin: 4px 0 16px; }
.login-brand .word { font-size: 1.35rem; }

/* ---- Wider screens ---- */
@media (min-width: 560px) {
  .grid2 { grid-template-columns: 1fr 1fr; }
  .dl { grid-template-columns: 1fr 1fr; }
  .dl .full { grid-column: 1 / -1; }
  .pipeline { grid-template-columns: repeat(6, 1fr); }
}
@media (min-width: 760px) {
  body { padding-bottom: 0; }
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .band { padding: 26px 0 48px; }
  .band h1 { font-size: 2.4rem; }
  .ridge { width: 280px; height: 62px; }
  .word { font-size: 1.1rem; }
  .nav { position: static; margin-left: auto; padding: 0; background: none; gap: 2px; }
  .nav a {
    flex: none; display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 12px; border-top: 0; border-bottom: 3px solid transparent;
    color: var(--navy); font-size: .92rem;
  }
  .nav a.on { color: var(--navy); border-bottom-color: var(--gold); }
  .nav svg { width: 18px; height: 18px; }
  .out { margin-left: 8px; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .row strong { transition: filter .12s; }
}
