@font-face { font-family: Manrope; src: url(fonts/manrope-latin-wght-normal.woff2) format('woff2'); font-weight: 200 800; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Manrope; src: url(fonts/manrope-latin-ext-wght-normal.woff2) format('woff2'); font-weight: 200 800; font-display: swap; unicode-range: U+0100-02BA, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0; }

:root {
  color-scheme: light;
  --teal: #0f766e; --teal-dark: #0b5a54; --teal-deep: #083f3b; --teal-soft: #e0f1ee; --teal-line: #a9d5ce;
  --bg: #f3f7f6; --card: #fff; --ink: #10231f; --muted: #536862; --line: #dbe6e3; --field: #b9cbc6;
  --red: #b42318; --red-soft: #fdecea; --amber: #8a5300; --amber-soft: #fdf1dc; --green: #11703c; --green-soft: #e3f4e9;
  --r: 14px; --nav: 68px;
  --safe: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 500 16px/1.45 Manrope, system-ui, sans-serif; font-variant-numeric: tabular-nums; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; text-wrap: balance; overflow-wrap: anywhere; }
h2 { font-size: 1.06rem; font-weight: 750; letter-spacing: -.01em; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #2dbdb0; outline-offset: 2px; border-radius: 6px; }
.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.num { white-space: nowrap; }
.right { text-align: right; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- frame ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 6px 16px; background: var(--teal-deep); color: #fff; }
.top .brand { flex: 1; min-width: 0; color: #fff; font-weight: 750; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top .round { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: #fff; }
.top .round:hover { background: rgb(255 255 255 / .12); }
main { max-width: 1080px; margin: 0 auto; padding: 20px 16px calc(var(--nav) + var(--safe) + 36px); }
.nav { position: fixed; inset: auto 0 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); padding-bottom: var(--safe); background: var(--card); border-top: 1px solid var(--line); }
.nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: var(--nav); color: var(--muted); font-size: .74rem; font-weight: 650; }
.nav a:hover { text-decoration: none; color: var(--teal); }
.nav a[aria-current] { color: var(--teal); }
.nav .collect { color: var(--teal); }
.nav .collect span { display: grid; place-items: center; width: 56px; height: 56px; margin-top: -28px; border-radius: 50%; background: var(--teal); color: #fff; box-shadow: 0 0 0 5px var(--bg), 0 8px 18px rgb(15 118 110 / .35); }
.nav .collect .i { width: 26px; height: 26px; }
.nav .signout, .nav .brand { display: none; }

.head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.head > div { min-width: 0; }
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; margin-bottom: 4px; font-size: .9rem; font-weight: 650; }
.back .i { width: 16px; height: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- buttons and forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 18px; border: 1px solid var(--field); border-radius: 12px; background: var(--card); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; text-align: center; }
.btn:hover { text-decoration: none; border-color: var(--teal); color: var(--teal); }
.btn.teal { border-color: var(--teal); background: var(--teal); color: #fff; }
.btn.teal:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.btn.danger { border-color: #e3aaa4; color: var(--red); }
.btn.danger:hover { background: var(--red-soft); }
.btn.big { width: 100%; min-height: 54px; font-size: 1.06rem; }
.btn.sm { min-height: 40px; padding: 6px 13px; font-size: .9rem; border-radius: 10px; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .6; cursor: default; }
label, .label { display: block; font-size: .9rem; font-weight: 700; }
label .muted { font-weight: 500; }
input, select, textarea { width: 100%; min-height: 48px; margin-top: 6px; padding: 10px 14px; border: 1px solid var(--field); border-radius: 12px; background: #fff; color: var(--ink); font: inherit; font-size: 16px; }
input:hover, select:hover { border-color: var(--teal); }
input:focus, select:focus { outline: 3px solid rgb(45 189 176 / .4); outline-offset: 0; border-color: var(--teal); }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; min-height: 0; margin: 0; accent-color: var(--teal); }
.form { display: grid; gap: 18px; }
.two { display: grid; gap: 18px; }
.hint { margin-top: 6px; color: var(--muted); font-size: .86rem; font-weight: 500; }
.checkline { display: flex; align-items: center; gap: 10px; }
.search { position: relative; }
.search .i { position: absolute; left: 14px; top: 14px; color: var(--muted); pointer-events: none; }
.search input { margin: 0; padding-left: 44px; }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-bottom: 16px; }
.filters label { flex: 1 1 140px; }
.filters .btn { min-height: 48px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; }
.chips legend { padding: 0; margin-bottom: 8px; font-size: .9rem; font-weight: 700; }
.chip { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border: 1px solid var(--field); border-radius: 99px; background: #fff; color: var(--ink); font: inherit; font-size: .94rem; font-weight: 650; cursor: pointer; }
.chip:hover { border-color: var(--teal); text-decoration: none; }
.chip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.chip:has(:checked), .chip[aria-pressed=true], .chip[aria-current] { border-color: var(--teal); background: var(--teal); color: #fff; }
.chip:has(:focus-visible) { outline: 3px solid #2dbdb0; outline-offset: 2px; }

/* ---------- pieces ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.card + .card, .stack > * + * { margin-top: 16px; }
.card > h2 { margin-bottom: 12px; }
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 12px; }
.card-head a { font-size: .9rem; font-weight: 700; }
.flash { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding: 12px 16px; border-radius: 12px; background: var(--green-soft); color: var(--green); font-weight: 650; }
.flash.error { background: var(--red-soft); color: var(--red); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; background: #eaf0ee; color: var(--muted); font-size: .78rem; font-weight: 700; white-space: nowrap; }
.tag.ok { background: var(--green-soft); color: var(--green); }
.tag.warn { background: var(--amber-soft); color: var(--amber); }
.tag.bad { background: var(--red-soft); color: var(--red); }
.bad-text { color: var(--red); }
.badge { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 12px; background: var(--teal-soft); color: var(--teal-dark); font-weight: 800; letter-spacing: -.02em; }
.empty { padding: 28px 12px; text-align: center; color: var(--muted); }
.empty .btn { margin-top: 14px; }
progress { display: block; width: 100%; height: 8px; border: 0; border-radius: 99px; background: var(--teal-soft); overflow: hidden; appearance: none; -webkit-appearance: none; }
progress::-webkit-progress-bar { background: var(--teal-soft); }
progress::-webkit-progress-value { background: var(--teal); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--teal); border-radius: 99px; }

/* list of people or receipts */
.list { margin: 0; padding: 0; list-style: none; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > .card-head, .card.flush > h2 { padding: 18px 18px 0; }
.list li + li { border-top: 1px solid var(--line); }
.item { display: flex; align-items: center; gap: 14px; min-height: 68px; padding: 10px 18px; color: var(--ink); }
a.item:hover { background: #f5faf9; text-decoration: none; }
a.item:focus-visible { outline-offset: -3px; }
.item .grow { flex: 1; min-width: 0; }
.item strong { display: block; font-weight: 700; overflow-wrap: anywhere; }
.item .amt { text-align: right; font-weight: 750; white-space: nowrap; }
.item .amt small { display: block; font-size: .78rem; font-weight: 600; }
.item.void strong, .item.void .amt > span { text-decoration: line-through; color: var(--muted); }
small { font-size: .84rem; color: var(--muted); font-weight: 500; }
small.bad-text { color: var(--red); }

/* dashboard */
.hero { padding: 22px 20px; border-radius: 18px; background: var(--teal-deep); color: #fff; }
.hero .label { color: #b9dfd9; font-weight: 600; }
.hero .total { margin: 2px 0 14px; font-size: clamp(2.2rem, 9vw, 3.1rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.1; }
.hero progress, .hero progress::-webkit-progress-bar { background: rgb(255 255 255 / .18); }
.hero progress::-webkit-progress-value { background: #5fd3c6; }
.hero progress::-moz-progress-bar { background: #5fd3c6; }
.hero .under { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; margin-top: 8px; color: #d5ece8; font-size: .9rem; }
.hero .side { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid rgb(255 255 255 / .16); }
.hero .side a, .hero .side div { color: #fff; min-width: 0; }
.hero .side b { display: block; font-size: clamp(1.02rem, 4.6vw, 1.4rem); font-weight: 750; letter-spacing: -.02em; }
.hero .side span { color: #b9dfd9; font-size: .84rem; }
.grid { display: grid; gap: 16px; margin-top: 16px; }
.grid > * { margin-top: 0; min-width: 0; }

.chart { position: relative; }
.chart svg { display: block; width: 100%; max-width: 560px; height: auto; margin: 0 auto; overflow: visible; }
.chart .bar { fill: var(--teal); }
.chart g:hover .bar, .chart g:focus .bar { fill: var(--teal-dark); }
.chart g:focus { outline: none; }
.chart text { font: 600 12px Manrope, sans-serif; fill: var(--muted); }
.chart .val { fill: var(--ink); font-weight: 750; }
.chart .grid-l { stroke: #e6eeec; stroke-width: 1; }
.chart .base { stroke: var(--field); stroke-width: 1; }
.tip { position: absolute; z-index: 5; padding: 6px 10px; border-radius: 8px; background: var(--ink); color: #fff; font-size: .82rem; font-weight: 650; pointer-events: none; white-space: nowrap; transform: translate(-50%, -100%); }
details.plain summary { display: inline-block; padding: 8px 0; color: var(--teal); font-size: .9rem; font-weight: 700; cursor: pointer; }
.line { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; }
.line + .line { border-top: 1px solid var(--line); }
.line > :last-child { text-align: right; overflow-wrap: anywhere; min-width: 0; }

/* the class x division grid: 8 to 10 down, A to D across */
.matrix { display: grid; grid-template-columns: 34px repeat(4, minmax(0, 1fr)); gap: 8px; align-items: stretch; }
.matrix .h { display: grid; place-items: center; color: var(--muted); font-size: .84rem; font-weight: 700; }
.cell { display: flex; flex-direction: column; justify-content: center; gap: 5px; min-height: 76px; padding: 9px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); min-width: 0; }
a.cell:hover { border-color: var(--teal); text-decoration: none; background: #f7fbfa; }
.cell b { font-size: 1.1rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.cell small { font-size: .76rem; line-height: 1.25; }
.cell progress { height: 6px; }
.cell.done { border-color: var(--teal); background: var(--teal-soft); }
.cell.done small { color: var(--teal-dark); font-weight: 650; }
.cell.none { background: transparent; border-style: dashed; color: var(--muted); }

/* profile */
.person { display: flex; gap: 14px; align-items: center; }
.person .badge { width: 60px; height: 60px; font-size: 1.25rem; background: var(--teal); color: #fff; border-radius: 16px; }
.owed { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 20px; border: 1px solid #efc4bf; border-radius: 18px; background: #fff6f5; }
.owed.clear { border-color: var(--teal-line); background: var(--teal-soft); }
.owed b { display: block; font-size: 2.1rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; color: var(--red); }
.owed.clear b { color: var(--teal-dark); }
.owed .btn { flex: 1 1 150px; }
.owed > div:first-child { flex: 1 1 200px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; text-align: center; font-size: .86rem; }
.cal span { display: grid; place-items: center; aspect-ratio: 1; max-height: 46px; width: 100%; border-radius: 10px; color: var(--muted); }
.cal .d { aspect-ratio: auto; padding: 4px 0; font-weight: 700; font-size: .76rem; }
.cal .P { background: var(--teal-soft); color: var(--teal-dark); font-weight: 750; }
.cal .A { background: var(--red-soft); color: var(--red); font-weight: 750; text-decoration: underline; text-underline-offset: 3px; }
.monthnav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-weight: 700; }
.monthnav a, .monthnav span.off { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; }
.monthnav a:hover { background: var(--teal-soft); }
.monthnav .off { color: var(--field); }
.due { padding: 12px 18px; }
.due .top-line { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.due details { margin-top: 4px; }
.due details form { display: grid; gap: 12px; padding: 8px 0 6px; }

/* collect */
.money { position: relative; }
.money span { position: absolute; left: 18px; bottom: 15px; font-size: 1.6rem; font-weight: 800; color: var(--teal); }
.money input { min-height: 68px; padding-left: 46px; font-size: 1.8rem; font-weight: 800; letter-spacing: -.02em; border-width: 2px; }
.receipt { max-width: 520px; margin: 0 auto; }
.receipt .paid { padding: 24px 20px 20px; border-radius: 18px 18px 0 0; background: var(--teal); color: #fff; text-align: center; }
.receipt .paid .i { width: 36px; height: 36px; }
.receipt .paid b { display: block; font-size: 2.6rem; font-weight: 800; letter-spacing: -.035em; line-height: 1.2; }
.receipt.voided .paid { background: #6b2a24; }
.receipt.voided .paid b { text-decoration: line-through; }
.receipt .card { border-radius: 0 0 18px 18px; border-top: 0; }
.actions { display: grid; gap: 10px; margin-top: 16px; }
.actions .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* attendance */
.mark { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 8px 18px; cursor: pointer; }
.mark .name { flex: 1; min-width: 0; font-weight: 650; overflow-wrap: anywhere; }
.mark input { position: absolute; opacity: 0; }
.mark .state { display: grid; place-items: center; width: 96px; min-height: 42px; border-radius: 99px; background: var(--teal-soft); color: var(--teal-dark); font-size: .92rem; font-weight: 750; }
.mark .state::before { content: 'Present'; }
.mark:has(:checked) { background: #fff6f5; }
.mark:has(:checked) .state { background: var(--red); color: #fff; }
.mark:has(:checked) .state::before { content: 'Absent'; }
.mark:has(:focus-visible) { outline: 3px solid #2dbdb0; outline-offset: -3px; }
.savebar { position: sticky; bottom: calc(var(--nav) + var(--safe) + 30px); z-index: 10; display: flex; align-items: center; gap: 14px; margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 8px 24px rgb(8 63 59 / .14); }
.savebar .grow { flex: 1; font-weight: 700; }

/* tables scroll inside their card, never the page */
.scroll { position: relative; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { padding: 10px 14px; text-align: left; font-size: .8rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
td { padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
td.name { min-width: 150px; }
th.right, td.right { text-align: right; }
tr.void td { color: var(--muted); text-decoration: line-through; }
tr.void td.keep { text-decoration: none; }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; overflow-x: auto; padding: 3px; }
.tabs .chip { flex: none; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stats .card { margin: 0; padding: 14px 16px; }
.stats b { display: block; font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; overflow-wrap: anywhere; }
.feegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.narrow { max-width: 620px; margin: 0 auto; }

/* login */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 20px; background: var(--teal-deep); }
.login .card { width: 100%; max-width: 400px; padding: 30px 24px; border: 0; border-radius: 20px; }
.login .mark-logo { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 16px; border-radius: 16px; background: var(--teal); color: #fff; }
.login .mark-logo .i { width: 28px; height: 28px; }
.login h1 { margin-bottom: 4px; }
.login .form { margin-top: 22px; }
.login .flash { margin: 16px 0 0; }

@media (min-width: 620px) {
  .two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cell { padding: 12px; min-height: 84px; }
  .actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .actions .wide { grid-column: 1 / -1; }
}
@media (min-width: 960px) {
  body.app { padding-left: 232px; }
  .top { display: none; }
  main { padding: 32px 32px 60px; }
  .nav { inset: 0 auto 0 0; width: 232px; display: flex; flex-direction: column; gap: 4px; padding: 22px 14px; border: 0; background: var(--teal-deep); }
  .nav .brand { display: block; padding: 0 12px 20px; color: #fff; font-size: 1.1rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; overflow-wrap: anywhere; }
  .nav a { flex-direction: row; justify-content: flex-start; gap: 12px; height: 46px; padding: 0 12px; border-radius: 12px; color: #cfe6e2; font-size: .96rem; }
  .nav a:hover { color: #fff; background: rgb(255 255 255 / .08); }
  .nav a[aria-current] { color: #fff; background: rgb(255 255 255 / .14); }
  .nav .collect, .nav .collect:hover, .nav .collect[aria-current] { order: -1; justify-content: center; margin-bottom: 12px; height: 50px; background: var(--teal); color: #fff; font-weight: 750; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .22); }
  .nav .collect:hover { background: #12867d; }
  .nav .brand { order: -2; }
  .nav .collect span { width: auto; height: auto; margin: 0; background: none; box-shadow: none; }
  .nav .collect .i { width: 20px; height: 20px; }
  .nav .signout { display: block; margin-top: auto; }
  .nav .signout .who { padding: 0 12px 8px; color: #b9dfd9; font-size: .86rem; }
  .nav .signout button { display: flex; align-items: center; gap: 12px; width: 100%; height: 46px; padding: 0 12px; border: 0; border-radius: 12px; background: none; color: #cfe6e2; font: inherit; font-weight: 650; cursor: pointer; }
  .nav .signout button:hover { background: rgb(255 255 255 / .08); color: #fff; }
  .savebar { bottom: 20px; }
  .hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 36px; padding: 28px 30px; align-items: center; }
  .hero .side { grid-template-columns: 1fr; gap: 14px; margin: 0; padding: 0 0 0 30px; border: 0; border-left: 1px solid rgb(255 255 255 / .16); }
  .hero .side a, .hero .side div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
  .hero .side b { order: 2; }
  .grid { grid-template-columns: 1.35fr 1fr; align-items: start; }
}
@media (prefers-reduced-motion: no-preference) { .btn, .chip, a.cell { transition: background .15s, border-color .15s, color .15s; } }
@media print { .nav, .top, .filters, .tabs, .btn { display: none !important; } body.app { padding: 0; } }
.tools select { flex: 1 1 130px; width: auto; min-height: 44px; margin: 0; padding: 8px 14px; }
.quick { margin-top: 12px; }
.lead { margin: 0 0 12px; }
.boxed, .receipt .boxed { border-radius: var(--r); border-top: 1px solid var(--line); }
.head.keep { flex-wrap: nowrap; align-items: flex-start; }
.head.keep .btn { flex: none; }
.tabs { scrollbar-width: none; }
@media (max-width: 619px) {
  .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tabs { gap: 6px; }
  .tabs .chip { padding: 8px 13px; font-size: .88rem; }
  .pend .badge { display: none; }
  .filters input, .filters select { padding: 10px 8px; min-width: 0; font-size: 16px; }
}
@media (min-width: 620px) { .pend .in-class { display: none; } }
@media (max-width: 350px) { .filters { grid-template-columns: 1fr; } }
