/* Fundraising app styles. Colours and fonts come only from the shared AFINARA tokens (tokens.css). */
:root {
  --bg: var(--af-bg-page);
  --surface: var(--af-bg-surface);
  --surface2: var(--af-bg-subtle);
  --line: var(--af-line);
  --fg: var(--af-ink-primary);
  --muted: var(--af-ink-secondary);
  --accent: var(--af-action-bg);
  --accent-fg: var(--af-action-text);
  --warn: var(--af-status-warn-ink);
  --warn-soft: var(--af-status-warn-bg);
  --ok: var(--af-status-ok-ink);
  --ok-soft: var(--af-status-ok-bg);
  --bad: var(--af-status-error-ink);
  --font: var(--af-font-ui);
}
* { box-sizing: border-box; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--af-focus-ring); outline-offset: 2px; }
[hidden] { display: none !important; }

.fr-wrap { max-width: 1480px; margin: 0 auto; padding: 16px 16px 48px; display: flex; flex-direction: column; gap: 16px; font-family: var(--font); color: var(--fg); }
.fr-head { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: flex-end; justify-content: space-between; }
.stats { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.stat { display: flex; flex-direction: column; min-width: 0; }
.stat b { font-size: 20px; font-weight: 500; font-variant-numeric: tabular-nums; }
.stat span { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.stat.alert b { color: var(--warn); }
.tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
input[type=search], .tools select { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; min-width: 0; min-height: 36px; }
.fr-tabs { display: flex; gap: 2px; overflow-x: auto; padding: 4px 16px; }
.tab { border: 0; background: none; padding: 8px 14px; border-radius: 6px; color: var(--muted); font-weight: 500; white-space: nowrap; cursor: pointer; min-height: 36px; }
.tab[aria-selected="true"] { background: var(--af-bg-selected-subtle); color: var(--fg); }
.tab .n { font-size: 11px; margin-left: 6px; color: var(--muted); }
#notice { display: none; background: var(--warn-soft); color: var(--warn); padding: 8px 12px; border-radius: 6px; }
#notice.show { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }

.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(172px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.col { background: var(--surface2); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 8px; min-height: 140px; }
.col.over { outline: 2px dashed var(--accent); }
.col h3 { margin: 2px 4px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; font-weight: 600; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 10px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; text-align: left; width: 100%; min-width: 0; }
.card:hover { border-color: var(--accent); }
.card:active { transform: scale(0.985); transition: transform 80ms ease-out; }
.card .nm { font-weight: 600; overflow-wrap: anywhere; }
.card .meta, .meta { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.card .next { font-size: 12px; margin-top: 4px; padding-top: 6px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.tag { font-size: 11px; font-weight: 500; padding: 1px 6px; border-radius: 3px; background: var(--surface2); color: var(--muted); display: inline-block; font-variant-numeric: tabular-nums; }
.tag.due { background: var(--warn-soft); color: var(--warn); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.empty { color: var(--muted); padding: 28px; text-align: center; background: var(--surface); border: 1px dashed var(--line); border-radius: 8px; }

.tbl { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th { text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 9px 12px; border-bottom: 1px solid var(--line); }
td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr[data-open] { cursor: pointer; }
tbody tr[data-open]:hover { background: var(--surface2); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.group { display: flex; flex-direction: column; gap: 6px; }
.group h3 { margin: 8px 0 0; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.group h3.late { color: var(--warn); }
.row { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 9px 12px; }
.row .who, .nrow .who { font-weight: 600; cursor: pointer; background: none; border: 0; padding: 0; text-align: left; min-height: 24px; }
.row .what { grid-column: 2; color: var(--muted); overflow-wrap: anywhere; }
.row .acts { grid-row: 1 / span 2; grid-column: 3; display: flex; gap: 6px; align-items: center; }
.when { font-size: 12px; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }

.tree { display: flex; flex-direction: column; gap: 10px; }
.node { display: flex; flex-direction: column; gap: 6px; border-left: 2px solid var(--line); padding-left: 10px; }
.tree > .node { border-left: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.nrow { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }

#scrim { position: fixed; inset: 0; background: var(--af-backdrop); display: none; z-index: 200; }
#scrim.show { display: block; }
#panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100%); background: var(--surface); border-left: 1px solid var(--line); z-index: 201; transform: translateX(100%); visibility: hidden; transition: transform .3s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s .3s; overflow-y: auto; padding: 20px 20px 40px; padding-top: max(20px, env(safe-area-inset-top, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); font-family: var(--font); color: var(--fg); }
#panel.show { transform: none; visibility: visible; transition-delay: 0s; }
@media (prefers-reduced-motion: reduce) { #panel { transition: opacity .15s; transform: none; opacity: 0; } #panel.show { opacity: 1; } }
.ph { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.ph h2 { margin: 0; font-size: 18px; font-weight: 600; }
.f { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.f label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); min-width: 0; }
.f label.w, .f .w { grid-column: 1 / -1; }
.f input, .f select, .f textarea, .al input, .al select, .al textarea { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--fg); min-width: 0; width: 100%; min-height: 40px; }
.f textarea, .al textarea { resize: vertical; min-height: 64px; }
.btns { display: flex; gap: 8px; margin: 14px 0; flex-wrap: wrap; align-items: center; }
.sec { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.sec h3 { margin: 0 0 10px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.al { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.al .w { grid-column: 1 / -1; }
.cl { display: block; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.chk { max-height: 170px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; display: flex; flex-direction: column; gap: 5px; background: var(--bg); }
.f .chk label { flex-direction: row; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--fg); min-height: 28px; }
.f .chk input { width: auto; min-height: 0; }
.tl { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 10px; }
.tl li { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 10px; align-items: baseline; }
.tl .t { grid-column: 2; overflow-wrap: anywhere; }
.tl .x { background: none; border: 0; color: var(--muted); padding: 4px 8px; cursor: pointer; }
.tl .x:hover { color: var(--bad); }
.round { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.round input { width: 120px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 4px 8px; font-variant-numeric: tabular-nums; min-height: 32px; }
.round input.cur { width: 56px; text-transform: uppercase; }
.foot { margin: 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.danger { color: var(--bad); }
.ro-note { color: var(--muted); font-size: 12px; margin: 0 0 10px; }

@media (max-width: 768px), (pointer: coarse) {
  .af-btn, .tab, .card, .tl .x, input[type=search] { min-height: 44px; }
  .row .who, .nrow .who { min-height: 44px; }
  .round input { min-height: 44px; }
  .f input:not([type=checkbox]), .f select, .f textarea, .al input, .al select, .al textarea { min-height: 44px; }
}
@media (max-width: 520px) { .f, .al { grid-template-columns: 1fr; } .row { grid-template-columns: 1fr; } .row .acts { grid-row: auto; grid-column: 1; } .row .what { grid-column: 1; } }
