:root {
  --bg: #f6f4ef;
  --card: #ffffff;
  --ink: #1d2a24;
  --muted: #6b766f;
  --line: #e4e0d6;
  --brand: #1f6f4a;
  --brand-ink: #ffffff;
  --brand-soft: #e3f1e9;
  --gold: #c99a2e;
  --ok: #1f7a4d;
  --warn: #a86a00;
  --err: #b3261e;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--brand); }
h1 { font-size: 1.6rem; margin: .4rem 0 .6rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; margin: 0 0 .8rem; }
code { background: #f0ede4; padding: .1rem .35rem; border-radius: 4px; font-size: .95em; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 1.2rem; padding-bottom: 2rem; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.big { font-size: 1.25rem; color: var(--ink); }
.nowrap { white-space: nowrap; }

/* Top bar */
.topbar { background: var(--brand); color: var(--brand-ink); position: sticky; top: 0; z-index: 10; }
.topbar-inner { display: flex; align-items: center; gap: 1rem; min-height: 58px; flex-wrap: wrap; }
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.1rem; display: flex; align-items: center; gap: .55rem; }
.logo { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--gold); color: #1d2a24; font-weight: 800; }
.logo.lg { width: 56px; height: 56px; border-radius: 14px; font-size: 1.6rem; }
.topbar nav { display: flex; gap: .2rem; align-items: center; margin-left: auto; flex-wrap: wrap; }
.topbar nav a { color: #eaf5ef; text-decoration: none; padding: .45rem .7rem; border-radius: 8px; font-size: .94rem; }
.topbar nav a:hover, .topbar nav a.active { background: rgba(255,255,255,.14); color: #fff; }
.who { font-size: .82rem; opacity: .8; padding: 0 .6rem; }
.badge { background: var(--gold); color: #1d2a24; border-radius: 99px; padding: 0 .45rem; font-size: .75rem; font-weight: 700; }
.burger { display: none; margin-left: auto; font-size: 1.5rem; cursor: pointer; padding: .2rem .5rem; }
@media (max-width: 820px) {
  .burger { display: block; }
  .topbar nav { display: none; width: 100%; flex-direction: column; align-items: stretch; padding-bottom: .6rem; }
  #navtoggle:checked ~ nav { display: flex; }
  .who { padding: .4rem .7rem; }
}

/* Cards, tiles */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; margin: 0 0 1.1rem; }
.card.narrow, .auth-card { max-width: 520px; }
.auth-card { margin: 3rem auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem 1.6rem; text-align: left; }
.auth-brand { margin-bottom: .4rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .8rem; margin: .4rem 0 1.1rem; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.tile.accent { background: var(--brand); color: #fff; border-color: var(--brand); }
.tile-label { font-size: .85rem; opacity: .8; }
.tile-value { font-size: 1.45rem; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: .15rem; }
.tile-sub { font-size: .8rem; opacity: .75; }
.callout { display: block; background: #fff6df; border: 1px solid #f0d99a; color: #5b4300; text-decoration: none; padding: .85rem 1rem; border-radius: var(--radius); margin-bottom: 1.1rem; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.1rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }

/* Forms */
.stack { display: grid; gap: .85rem; }
label { display: grid; gap: .3rem; font-size: .9rem; font-weight: 600; }
label.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.hint { font-weight: 400; color: var(--muted); font-size: .82rem; }
input, select {
  font: inherit; font-weight: 400; padding: .62rem .7rem; border: 1px solid #cfcabd; border-radius: 9px; background: #fff; color: var(--ink); width: 100%;
}
input[type=checkbox] { width: auto; }
input:focus, select:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.filters, form.inline { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; margin-bottom: 1rem; }
.filters label, form.inline label { min-width: 150px; }

.btn {
  display: inline-block; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; text-align: center;
  background: var(--brand); color: var(--brand-ink); border: 1px solid var(--brand); border-radius: 9px; padding: .62rem 1rem;
}
.btn:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--brand); }
.btn-ok { background: var(--ok); border-color: var(--ok); }
.btn-danger { background: var(--err); border-color: var(--err); }
.btn-sm { padding: .35rem .65rem; font-size: .86rem; }

/* Flash */
.flash { padding: .75rem 1rem; border-radius: 10px; margin: 0 0 1rem; border: 1px solid; }
.flash-ok { background: #e7f5ec; border-color: #b6dfc5; color: #164d31; }
.flash-warn { background: #fff6df; border-color: #f0d99a; color: #5b4300; }
.flash-err { background: #fdecea; border-color: #f2bbb6; color: #7a1c15; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .94rem; }
th, td { padding: .6rem .55rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
tfoot th { border-bottom: 0; border-top: 2px solid var(--line); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos { color: var(--ok); }
.neg { color: var(--err); }
tr.inactive td { opacity: .55; }

.pill { display: inline-block; padding: .1rem .55rem; border-radius: 99px; font-size: .78rem; font-weight: 600; }
.pill-pending { background: #fff1cc; color: #7a5500; }
.pill-approved { background: #dff3e7; color: #1a5e3b; }
.pill-rejected { background: #fde2df; color: #8e1f17; }
.pill-cancelled { background: #ecebe6; color: #5d625f; }

/* Approval queue */
.queue { display: grid; gap: .2rem; }
.qhead { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; margin-bottom: .7rem; }
.qname { font-weight: 700; font-size: 1.05rem; }
.qamt { font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.qforms form.inline { margin-bottom: .4rem; }
details summary { cursor: pointer; color: var(--muted); font-size: .9rem; margin: .2rem 0 .5rem; }

/* Members edit popover */
.inline-details { display: inline-block; position: relative; }
.inline-details summary { list-style: none; display: inline-block; margin: 0; }
.inline-details summary::-webkit-details-marker { display: none; }
.popover { position: absolute; right: 0; top: 110%; z-index: 5; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .9rem; width: 260px; box-shadow: 0 8px 24px rgba(0,0,0,.12); display: grid; gap: .6rem; }

/* Monthly bars */
.bars-col { width: 45%; }
.bar { height: 12px; background: var(--brand); border-radius: 6px; min-width: 2px; opacity: .8; }

.foot { color: var(--muted); font-size: .8rem; padding-bottom: 2rem; }

@media print {
  .topbar, .no-print, .foot, .filters { display: none !important; }
  body { background: #fff; }
  .card, .tile { border-color: #ccc; }
  .tile.accent { background: #fff; color: #000; }
}
