:root {
  --bg: #f6f5f1; --card: #ffffff; --ink: #1d2433; --muted: #5d6576; --line: #dcdad2;
  --brand: #7a1f2b; --brand-ink: #ffffff; --ok: #1f6b3a; --warn: #8a5a00; --bad: #a3262e;
}
* { 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(--ink); }
header.top { background: var(--brand); color: var(--brand-ink); padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
header.top a { color: var(--brand-ink); }
header.top .title { font-weight: 700; letter-spacing: .02em; }
header.top form { margin: 0; }
main { max-width: 960px; margin: 0 auto; padding: 24px 16px 48px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 20px; margin-bottom: 20px; }
.narrow { max-width: 420px; margin: 40px auto; }
h1 { font-size: 1.5rem; margin: 0 0 12px; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }
p.muted, .muted { color: var(--muted); }
label { display: block; font-weight: 600; margin: 12px 0 4px; }
input[type=text], input[type=password] { width: 100%; padding: 10px 12px; font-size: 1rem; border: 1px solid var(--line); border-radius: 6px; }
button, .button { display: inline-block; background: var(--brand); color: var(--brand-ink); border: 0; border-radius: 6px; padding: 10px 18px; font-size: 1rem; cursor: pointer; text-decoration: none; }
button.link { background: none; color: inherit; padding: 0; text-decoration: underline; font-size: .95rem; }
.errorlist { color: var(--bad); margin: 6px 0; padding-left: 18px; }
.messages { list-style: none; padding: 0; }
.messages li { padding: 10px 14px; border-radius: 6px; margin-bottom: 8px; background: #eef3ff; }
.messages li.warning { background: #fff4dc; } .messages li.error { background: #fde8ea; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.total td { font-weight: 700; border-top: 2px solid var(--ink); }
.tag { font-size: .8rem; background: #fff4dc; color: var(--warn); padding: 2px 8px; border-radius: 999px; }
.qr { display: block; width: 220px; height: 220px; margin: 12px 0; }
code.secret { font-size: 1rem; letter-spacing: .05em; word-break: break-all; }
.codes { columns: 2; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.1rem; }
.alert { border-left: 4px solid var(--bad); padding: 10px 14px; background: #fde8ea; border-radius: 6px; }
.links a { margin-right: 16px; }
@media print { header.top, .no-print { display: none; } body { background: #fff; } .card { border: 0; } }

/* ---------- reports ---------- */
.report-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 12px; font-size: .95rem; }
.report-nav a.current { font-weight: 700; text-decoration: none; color: var(--ink); }
.report-nav .sep { color: var(--muted); }
.report-nav .print-btn { margin-left: auto; padding: 6px 14px; font-size: .9rem; }
.draft-note { background: #fff4dc; color: var(--warn); padding: 8px 12px; border-radius: 6px; font-size: .9rem; }
.report { padding: 28px; }
.report.wide { max-width: none; }
.report-head { text-align: center; margin-bottom: 16px; }
.report-head .lodge { font-weight: 700; font-size: 1.1rem; }
.report-head h1 { font-size: 1.25rem; margin: 2px 0 0; }
.report-head.second { margin-top: 28px; }
.report h2 { font-size: 1.05rem; margin: 24px 0 8px; }
.report-table { font-size: .95rem; }
.report-table th { border-bottom: 2px solid var(--ink); font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.report-table tr.none td { color: var(--muted); font-style: italic; }
.report-table tr.subtotal td { font-weight: 700; background: #f1efe8; }
.report-table tbody.section + tbody.section tr:first-child td { border-top: 10px solid var(--card); }
.report-table td.strong { font-weight: 700; }
.report-table.grid td, .report-table.grid th { padding: 6px 8px; }
.scroll { overflow-x: auto; }
a.plain { color: inherit; }
.small { font-size: .85rem; }
.legend { font-size: .85rem; color: var(--muted); margin-top: 12px; }
.open-mark { color: var(--warn); margin-left: 2px; }
.signatures { margin-top: 48px; display: grid; gap: 36px; }
.sig { display: grid; grid-template-columns: 1fr 140px; column-gap: 24px; }
.sig .line { border-bottom: 1px solid var(--ink); height: 28px; }
.sig .line.short { grid-column: 2; grid-row: 1; }
.sig .who { font-size: .85rem; color: var(--muted); }
.sig .who.short { grid-column: 2; grid-row: 2; }
.picker select { width: 100%; padding: 8px 10px; font-size: 1rem; border: 1px solid var(--line); border-radius: 6px; }
@media print {
  @page { margin: 14mm; }
  main { max-width: none; padding: 0; }
  .report { padding: 0; }
  .draft-note { border: 1px solid #ccc; }
  .report-table tr.subtotal td { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: inherit; text-decoration: none; }
  .scroll { overflow: visible; }
  .report-table.grid { font-size: 9pt; }
}
main:has(.report.wide) { max-width: 1240px; }
.report-table.grid { font-size: .9rem; }
.report-table.grid th { white-space: nowrap; }

/* ---------- deposit entry ---------- */
.entry input[type=text], .entry input[type=number], .entry input[type=date], .entry select {
  width: 100%; padding: 8px 10px; font-size: 1rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.entry input[type=number] { text-align: right; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 12px; }
.counter { margin-top: 14px; padding: 10px 14px; border-radius: 6px; background: #fff4dc; color: var(--warn); }
.counter.balanced { background: #e3f3e8; color: var(--ok); }
.counter.over { background: #fde8ea; color: var(--bad); }
.entry-table td { vertical-align: top; padding: 6px 4px; }
.entry-table th.tick, .entry-table td.tick { width: 36px; text-align: center; }
.entry-table td.tick input { width: 20px; height: 20px; margin-top: 8px; }
.entry-table tr.off td:not(.tick) { opacity: .4; }
.entry-table td.num { width: 130px; }
@media (max-width: 720px) {
  .row3 { grid-template-columns: 1fr; }
  .entry-table thead { display: none; }
  .entry-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .entry-table td { border: 0; }
  .entry-table td.num { width: auto; }
}
/* fixed column widths so the entry tables never run past the page edge */
.entry-table { table-layout: fixed; width: 100%; }
.entry-table col.c-tick { width: 44px; }
.entry-table col.c-who { width: 22%; }
.entry-table col.c-amt { width: 13%; }
.entry-table col.c-cat { width: 12%; }
.entry-table col.c-label { width: 20%; }
.entry-table col.c-pay { width: 14%; }
.entry-table col.c-note { width: 19%; }
.entry-table col.c-note-wide { width: auto; }
.entry-table td.num { width: auto; }
.entry-table input, .entry-table select { min-width: 0; max-width: 100%; box-sizing: border-box; }
.entry-table select { text-overflow: ellipsis; }
@media (max-width: 720px) { .entry-table { table-layout: auto; } .entry-table colgroup { display: none; } }

/* ---------- bank review ---------- */
.review-table col.c-date { width: 52px; }
.review-table col.c-bank { width: 20%; }
.review-table col.c-amt { width: 110px; }
.review-table col.c-who { width: 16%; }
.review-table col.c-cat { width: 12%; }
.review-table col.c-label { width: 15%; }
.review-table col.c-note { width: auto; }
.review-table td.bank-desc { font-size: .8rem; color: var(--muted); word-break: break-word; }
.review-table td.in { color: var(--ok); font-weight: 600; }
.review-table td.out { color: var(--ink); font-weight: 600; }
.review-table tr.known td { background: #f4faf5; }
.review-table tr.branch td { background: #fff8e8; vertical-align: middle; }
.button.small { padding: 6px 12px; font-size: .9rem; }
.steps li { margin-bottom: 6px; }
main:has(.wide-page) { max-width: 1440px; }
