/* Gather Attendance: warm "Sunday Mode" theme with tabular tools (grid entry, sortable/compact tables). */
:root {
  --bg: #fbf7ef; --surface: #fff; --text: #2b2118; --muted: #8b7a63; --line: #eadfca; --soft: #f3eadb;
  --primary: #2b5f4a; --primary-text: #fff; --primary-soft: #e1f0e8; --accent: #c9822b;
  --good: #2b7a4b; --warn: #9a6200; --bad: #b3452a; --warn-bg: #fdf1d0; --bad-bg: #fde8e1; --good-bg: #e1f0e8;
  --s5: #d08a2e; --s8: #6fa287; --s10: #2b5f4a; --c1: #2b5f4a; --last: #d9c9ac; --focus: #c9822b;
  --shadow: 0 2px 0 #eadfca, 0 12px 30px rgba(90,60,20,.07); --radius: 14px; --radius-lg: 22px;
  --serif: Georgia, "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1b1712; --surface: #251f18; --text: #f3ead9; --muted: #b3a389; --line: #3a3126; --soft: #2f281f;
    --primary: #6fbf9a; --primary-text: #10241a; --primary-soft: #1f3328; --accent: #e3a04d;
    --good: #7fd6a0; --warn: #f0c36a; --bad: #f09a82; --warn-bg: #3a2f14; --bad-bg: #3b2218; --good-bg: #1f3328;
    --s5: #e3a04d; --s8: #7fb79a; --s10: #6fbf9a; --c1: #6fbf9a; --last: #6a5d49; --shadow: 0 2px 0 #14100c, 0 12px 30px rgba(0,0,0,.3);
  }
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }
a { color: var(--primary); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: -999px; z-index: 40; } .skip:focus { left: 8px; top: 8px; background: var(--surface); padding: 8px 12px; }
h1, h2, h3.serif, .serif { font-family: var(--serif); letter-spacing: -.01em; }
h1 { font-size: 2.3rem; margin: 6px 0; line-height: 1.15; } h2 { font-size: 1.4rem; margin: 26px 0 10px; font-family: var(--serif); }
.muted, .mut { color: var(--muted); } .small { font-size: .875rem; } .up { color: var(--good); } .down { color: var(--bad); }

/* ---------- top navigation (desktop) and tab bar (phone) ---------- */
header#top { position: sticky; top: 0; z-index: 20; background: var(--bg); }
.topnav { display: flex; align-items: center; gap: 36px; padding: 20px 48px; max-width: 1500px; margin: 0 auto; }
.brand { font-family: var(--serif); font-size: 1.5rem; font-weight: 700; color: var(--text); text-decoration: none; margin-right: auto; } .brand span { color: var(--primary); }
.topnav a.nl { color: var(--muted); text-decoration: none; font-weight: 500; padding: 4px 0 6px; border-bottom: 3px solid transparent; font-size: 1.02rem; }
.topnav a.nl[aria-current="page"] { color: var(--primary); font-weight: 700; border-color: var(--primary); }
.tabbar { display: none; }
body.login header#top { display: none; }
main { max-width: 1500px; margin: 0 auto; padding: 8px 48px 60px; } main:focus { outline: none; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 22px 26px; margin-bottom: 20px; }
.card.flat { box-shadow: none; border: 1px solid var(--line); }
h3.cap, .cap { font-family: system-ui, sans-serif; text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; color: var(--muted); margin: 0 0 14px; font-weight: 700; }
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 6px 0 22px; flex-wrap: wrap; }
.pagehead .sub { color: var(--muted); font-size: 1.1rem; } .pagehead .tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: 20px; } .g2 { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); } .g3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.two { display: grid; grid-template-columns: 1fr 360px; gap: 20px; align-items: start; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 12px; } .scroll { overflow-x: auto; }

/* ---------- controls ---------- */
button, .btn { font: inherit; font-weight: 600; border: 2px solid #cfe0d6; background: var(--surface); color: var(--primary); padding: 9px 20px; border-radius: 99px; cursor: pointer; min-height: 44px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
button.primary, .btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
button.danger { color: var(--bad); border-color: var(--bad-bg); } button:disabled { opacity: .5; cursor: not-allowed; }
.link-btn { min-height: 34px; padding: 4px 14px; font-size: .9rem; }
.btn.sm, button.sm { min-height: 34px; padding: 4px 14px; font-size: .9rem; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 2px solid var(--line); border-radius: 12px; padding: 9px 12px; min-height: 44px; max-width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--primary-soft); }
input[type=checkbox] { min-height: 0; width: 18px; height: 18px; accent-color: var(--primary); } textarea { width: 100%; min-height: 70px; }
label { font-size: .9rem; color: var(--muted); display: flex; flex-direction: column; gap: 4px; font-weight: 600; } label.inline { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-weight: 500; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-size: .9rem; color: var(--muted); font-weight: 600; } .field input, .field select { width: 100%; }
.seg { display: inline-flex; background: var(--soft); border-radius: 99px; padding: 4px; gap: 2px; }
.seg button { border: 0; background: transparent; min-height: 36px; padding: 4px 18px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--primary); box-shadow: 0 1px 3px rgba(60,40,10,.15); }
.tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; } .tabs button[aria-selected="true"] { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.pill { display: inline-block; padding: 3px 12px; border-radius: 99px; font-size: .8rem; font-weight: 600; background: var(--soft); color: var(--muted); margin: 0 4px 2px 0; }
.pill.red { background: var(--bad-bg); color: var(--bad); } .pill.amber { background: var(--warn-bg); color: var(--warn); } .pill.blue { background: #e3edf9; color: #1f4e79; }
.pill.grey { background: var(--soft); color: var(--muted); } .pill.green { background: var(--good-bg); color: var(--good); } .pill.final { background: var(--good-bg); color: var(--good); } .pill.draft { background: var(--warn-bg); color: var(--warn); }
.alert { border-left: 5px solid var(--accent); background: var(--warn-bg); padding: 10px 16px; border-radius: 12px; margin: 8px 0; } .alert.bad { border-color: var(--bad); background: var(--bad-bg); } .alert.good { border-color: var(--good); background: var(--good-bg); }
#toast { position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 12px 20px; border-radius: 99px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 50; max-width: 90vw; }
#toast.show { opacity: 1; }
details > summary { cursor: pointer; color: var(--primary); font-weight: 600; margin: 6px 0; }

/* ---------- tables (Option A tabular features) ---------- */
table { border-collapse: collapse; width: 100%; font-size: .95rem; } .tbl th, .tbl td, th, td { text-align: left; padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; color: var(--muted); white-space: nowrap; font-weight: 700; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
th.sortable { cursor: pointer; user-select: none; } th.sortable:hover { color: var(--text); } th[aria-sort] { color: var(--primary); }
.compact .tbl th, .compact .tbl td { padding: 5px 12px; font-size: .88rem; } .compact .pill { padding: 0 9px; }
tr.draftrow td { background: var(--bad-bg); } tr.focusrow td { background: var(--primary-soft); }
.pager { display: flex; justify-content: space-between; align-items: center; color: var(--muted); padding: 14px 16px 6px; } .pager a, .pager .pg { margin: 0 6px; color: var(--muted); cursor: pointer; text-decoration: none; } .pager .cur { color: var(--text); font-weight: 700; }
.sparkcell svg { display: block; }
.tinputs input.c { width: 84px; text-align: right; font-weight: 700; padding: 5px 8px; min-height: 38px; border-radius: 8px; } .tinputs input.c:disabled { background: transparent; border-color: transparent; }
.tinputs td.w { background: var(--warn-bg); }

/* ---------- dashboard ---------- */
.insights { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.insight { display: flex; gap: 16px; align-items: flex-start; } .ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; flex: none; }
.big { font-family: var(--serif); font-size: 4rem; line-height: 1; } .insight .lead { margin-top: 8px; font-size: 1.05rem; }
.chart svg { width: 100%; height: auto; display: block; } .chart text { fill: var(--muted); font-size: 11px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .85rem; margin-top: 6px; color: var(--muted); } .legend-top { display: flex; gap: 18px; font-size: .9rem; color: var(--muted); }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 6px; vertical-align: -1px; }
.chartnote { color: var(--muted); margin: 10px 0 0; }
.heat { display: flex; gap: 4px; } .heat > div { flex: 1 1 0; min-width: 0; text-align: center; } .heat .t { border-radius: 10px; padding: 14px 0; font-weight: 700; font-size: .8rem; color: #2b2118; } .heat .m { color: var(--muted); margin-top: 6px; }
.toplist .r { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); } .toplist .r:last-child { border: 0; } .toplist b { font-size: 1.15rem; }
.alertrow { margin: 0 0 12px; display: flex; gap: 10px; align-items: baseline; } .alertrow .pill { flex: none; }
.statrow { display: flex; align-items: center; gap: 36px; flex-wrap: wrap; } .statrow .file { font-weight: 700; font-size: 1.1rem; } .statrow .stat .v { font-size: 2.4rem; font-weight: 700; line-height: 1; font-family: var(--serif); } .statrow .stat .l { color: var(--muted); margin-top: 4px; } .statrow .grow { flex: 1; }
.kpi .l { text-transform: uppercase; letter-spacing: .06em; font-size: .78rem; font-weight: 700; color: var(--muted); } .kpi .v { font-family: var(--serif); font-size: 2.6rem; margin: 6px 0; } .kpi .d { color: var(--muted); }
.kpi .d.up { color: var(--good); } .kpi .d.down { color: var(--bad); }
.tile-total { display: flex; justify-content: space-between; margin: 10px 0; } .drawer { margin-bottom: 16px; }

/* ---------- entry: guided ---------- */
.hero .mut { font-size: 1.1rem; } .steps { display: flex; align-items: center; gap: 14px; margin: 14px 0 22px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 10px; font-weight: 700; background: none; border: 0; padding: 0; min-height: 0; color: var(--text); }
.dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--line); color: var(--muted); font-weight: 700; } .dot.on { background: var(--primary); color: var(--primary-text); } .dot.ok { background: var(--primary-soft); color: var(--primary); }
.steps .bar { width: 44px; height: 2px; background: var(--line); }
.svcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 20px; margin-bottom: 20px; }
.svcard { border: 3px solid transparent; padding: 24px; } .svcard.focus { border-color: var(--primary); }
.svcard h3 { font-family: var(--serif); font-size: 1.5rem; margin: 0; } .svcard .time { color: var(--muted); }
.countbox { text-align: center; margin: 14px 0 6px; } .countbox input { font-family: var(--serif); font-size: 4rem; text-align: center; border: 0; background: transparent; width: 100%; min-height: 78px; padding: 0; box-shadow: none; color: var(--text); }
.countbox input::placeholder { font-size: 2.2rem; color: #c9b99d; } .countbox input:focus { box-shadow: none; outline: 0; }
.pillrow { display: flex; gap: 10px; justify-content: center; margin: 10px 0; flex-wrap: wrap; } .pillrow button { min-height: 40px; padding: 4px 16px; border: 0; background: var(--soft); color: var(--text); }
.pillrow button.plus { background: var(--primary); color: var(--primary-text); padding: 4px 34px; font-size: 1.2rem; }
.svfoot { display: flex; align-items: center; gap: 12px; margin-top: 14px; } .svfoot .spark { flex: 1; } .svfoot .ly { color: var(--muted); font-size: .9rem; text-align: right; } .svfoot .ly b { color: var(--text); display: block; }
.extra { display: grid; grid-template-columns: 120px 100px 1fr auto; gap: 8px; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); } .extra input { min-height: 38px; padding: 4px 8px; }
.notebox { margin-top: 10px; } .notebox input { width: 100%; }
.sumbar { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; } .sumbar .tot { font-family: var(--serif); font-size: 2.6rem; margin: 0 6px; line-height: 1; } .sumbar .grow { flex: 1; }
.chk { display: flex; gap: 10px; margin: 8px 0; } .chk .ok { color: var(--good); font-weight: 700; } .chk .warn { color: var(--bad); font-weight: 700; width: 1ch; }
.flagpills { display: flex; flex-wrap: wrap; gap: 8px; }
.fp { background: var(--soft); color: var(--muted); border: 0; border-radius: 99px; padding: 4px 14px; min-height: 32px; font-weight: 600; font-size: .95rem; } .fp.on { background: var(--primary-soft); color: var(--primary); } .fp:disabled { opacity: 1; cursor: default; }
.fpadd { min-height: 32px; padding: 2px 12px; border-radius: 99px; width: 140px; font-size: .9rem; }
.review td, .review th { font-size: 1rem; } .spark { width: 150px; height: 36px; display: block; }

/* ---------- quick count (phone) ---------- */
.quick { max-width: 460px; margin: 0 auto; } .quick .big { font-size: 7.5rem; text-align: center; margin: 4px 0; cursor: pointer; user-select: none; -webkit-user-select: none; font-variant-numeric: tabular-nums; }
.quick .pm { display: flex; gap: 16px; justify-content: center; margin: 22px 0; } .quick .pm button { border: 0; font-size: 3rem; height: 96px; } .quick .minus { width: 96px; border-radius: 50%; background: var(--soft); color: var(--muted); } .quick .plus { width: 150px; border-radius: 48px; background: var(--primary); color: var(--primary-text); }
.quick .adds { display: flex; gap: 10px; justify-content: center; margin-bottom: 20px; } .quick .adds button { background: var(--surface); min-height: 44px; padding: 4px 20px; }
.quick .hint { text-align: center; color: var(--muted); } .quick .hint b { color: var(--text); }
.quick .savebtn { width: 100%; min-height: 64px; font-size: 1.15rem; } .online { background: var(--good-bg); color: var(--good); padding: 3px 12px; border-radius: 99px; font-weight: 600; font-size: .85rem; } .online.off { background: var(--warn-bg); color: var(--warn); }
.chips { display: flex; gap: 8px; margin: 0 0 16px; flex-wrap: wrap; justify-content: center; } .chips button { min-height: 38px; padding: 2px 16px; } .chips button[aria-pressed="true"] { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.morelist a { display: flex; align-items: center; gap: 16px; padding: 18px 4px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: 1.15rem; } .morelist a:last-child { border: 0; } .morelist .ic { font-size: 1.5rem; width: 36px; text-align: center; }

@media (max-width: 1000px) { .insights, .two { grid-template-columns: 1fr; } h1 { font-size: 1.9rem; } .big { font-size: 3.4rem; } }
@media (max-width: 800px) {
  .topnav { display: none; } .tabbar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; height: 74px; background: var(--surface); border-top: 1px solid var(--line); justify-content: space-around; align-items: center; z-index: 30; }
  .tabbar a { text-align: center; color: var(--muted); text-decoration: none; font-size: .75rem; padding: 6px 14px; } .tabbar a i { display: block; font-style: normal; font-size: 24px; } .tabbar a[aria-current="page"] { color: var(--primary); font-weight: 700; }
  main { padding: 8px 16px 100px; } .g2 { grid-template-columns: 1fr; } .card { padding: 18px; }
  .brandbar { display: block; padding: 14px 16px 0; font-family: var(--serif); font-weight: 700; font-size: 1.2rem; }
  body.quickpage .brandbar { display: none; }
}
.brandbar { display: none; }
@media print {
  header#top, .noprint, #toast, .skip, .tabbar { display: none !important; } body { background: #fff; color: #000; } .card { box-shadow: none; border: 0; padding: 0; break-inside: avoid; } main { max-width: none; padding: 0; }
}
.g4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.chips { gap: 6px; } .chips button { padding: 2px 12px; font-size: .92rem; }
