:root {
  --navy: #1f3a5f;
  --slate: #44546a;
  --green: #2e7d32;
  --red: #b3261e;
  --muted: #6b6b6b;
  --bg: #f6f7f9;
  --border: #dde1e6;
}
* { box-sizing: border-box; }
body {
  font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: #222;
  margin: 0;
}
header {
  background: var(--navy);
  color: #fff;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
header .brand { font-weight: 700; letter-spacing: .02em; white-space: nowrap; margin-right: 16px; }
header nav { text-align: right; }
header nav a {
  color: #dbe3ee;
  text-decoration: none;
  margin-left: 14px;
  font-size: 14px;
  white-space: nowrap;
  line-height: 1.8;
}
header nav a:hover { color: #fff; }
main { max-width: 1100px; margin: 24px auto; padding: 0 20px; }
h1 { color: var(--navy); font-size: 22px; margin-bottom: 4px; }
h2 { color: var(--slate); font-size: 17px; margin-top: 28px; }
.subtitle { color: var(--muted); margin-bottom: 20px; font-size: 14px; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: 14px; text-align: left; }
th { background: #eef1f5; color: var(--slate); font-weight: 600; }
.card { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 18px; margin-bottom: 18px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.over { color: var(--red); font-weight: 600; }
.ok { color: var(--green); }
form.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; margin-bottom: 16px; }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
input, select { padding: 6px 8px; border: 1px solid var(--border); border-radius: 5px; font-size: 14px; }
button {
  background: var(--navy); color: #fff; border: none; border-radius: 5px;
  padding: 7px 14px; font-size: 14px; cursor: pointer;
}
button:hover { opacity: .9; }
.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; font-size: 14px; }
.flash.success { background: #e7f3e8; color: var(--green); }
.flash.error { background: #fbeaea; color: var(--red); }
.pill { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.pill.entered { background: #eef1f5; color: var(--slate); }
.pill.matched { background: #e7f3e8; color: var(--green); }
.pill.needs_review { background: #fdeee0; color: #b35b00; }
.pill.paid { background: #e2f0ff; color: #1a5aa8; }
.small { font-size: 12px; color: var(--muted); }
.bar { background: #eef1f5; border-radius: 4px; height: 8px; overflow: hidden; width: 140px; }
.bar > div { background: var(--navy); height: 100%; }
.bar > div.over { background: var(--red); }
a.btn { display: inline-block; background: var(--navy); color: #fff; padding: 6px 12px; border-radius: 5px; text-decoration: none; font-size: 13px; }
.inline-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; margin-bottom: 16px; }
.split-total { font-weight: 600; }
.split-total.bad { color: var(--red); }
.split-total.good { color: var(--green); }
table.lines input, table.lines select { width: 100%; }
td.actions { white-space: nowrap; }
button.link { background: none; color: var(--red); padding: 2px 6px; }
.meta { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; font-size: 14px; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; }
.under { color: var(--green); font-weight: 600; }
.pill.complete { background: #e7f3e8; color: var(--green); }
.pill.progress { background: #eef1f5; color: var(--slate); }
form.tight { display: inline; margin: 0; }
button.small { padding: 3px 8px; font-size: 12px; color: #fff; }
.fee-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 24px; }
.fee-summary div { display: flex; flex-direction: column; }
.fee-summary b { font-size: 18px; color: var(--navy); font-variant-numeric: tabular-nums; }
table.budget tr.group td { background: #f3f5f8; font-weight: 600; color: var(--slate); }
.issues { margin: 0; padding: 0; list-style: none; }
.issues li { font-size: 12px; }
.issues li.bad { color: var(--red); }
.issues li.warn { color: #b35b00; }
.badge-ok { color: var(--green); font-size: 12px; }
textarea { padding: 6px 8px; border: 1px solid var(--border); border-radius: 5px; font: inherit; font-size: 14px; }
.homes { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 12px; margin: 4px 0 8px; }
.homes label.home { font-size: 13px; color: inherit; display: flex; gap: 6px; align-items: center; margin: 0; }
.homes input { width: auto; }
.pill.co-draft { background: #eef1f5; color: var(--slate); }
.pill.co-sent { background: #fdeee0; color: #b35b00; }
.pill.co-approved { background: #e7f3e8; color: var(--green); }
.pill.co-declined, .pill.co-void { background: #fbeaea; color: var(--red); }
.pill.doc-pending { background: #fdeee0; color: #b35b00; }
.pill.doc-accepted { background: #e7f3e8; color: var(--green); }
.pill.doc-rejected { background: #fbeaea; color: var(--red); }
table.recode tr.suggested td { background: #fff8e6; }
table.recode td { vertical-align: top; }
.pill.approved, .pill.po-approved, .pill.waiver-received { background: #e7f3e8; color: var(--green); }
.pill.po-approved { background: #fff; color: var(--green); box-shadow: inset 0 0 0 1px #a8d5ad; }  /* approved, not sent yet */
.pill.po-accepted { background: var(--green); color: #fff; font-weight: 600; }
.pill.po-accepted::before { content: "\2713\00a0"; }
.pill.on_hold, .pill.po-pending_approval, .pill.waiver-requested { background: #fdeee0; color: #b35b00; }
.pill.po-sent, .pill.po-draft { background: #e2f0ff; color: #1a5aa8; }
.pill.po-declined, .pill.po-rejected, .pill.waiver-void { background: #fbe9e9; color: var(--red); }
.pill.po-closed { background: #eef1f5; color: var(--slate); }
details.history summary { cursor: pointer; font-weight: 600; }
details.history table { margin-top: 8px; }

/* card and debit purchases */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.grid-2 > .card { margin: 0 0 16px; }
p.tabs a.active { font-weight: 700; text-decoration: none; color: inherit; }
.pill.card-new { background: #fff3cd; color: #7a5a00; }
.pill.card-coded { background: #dff3e4; color: #1d6b34; }
.pill.card-excluded { background: #eceff1; color: #546e7a; }
.receipt-thumb { max-width: 100%; max-height: 420px; border: 1px solid #ddd; border-radius: 6px; display: block; margin-bottom: 8px; }
.receipt-row { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.receipt-row img { max-width: 160px; max-height: 200px; border: 1px solid #ddd; border-radius: 4px; }
table.recode select { min-width: 150px; }
table.recode input[type=file] { max-width: 190px; }

/* draws */
.pill.draw-draft { background: #eef1f5; color: var(--slate); }
.pill.draw-sent { background: #fff3cd; color: #7a5a00; }
.pill.draw-questioned { background: #fdeee0; color: #b35b00; }
.pill.draw-approved { background: #dff3e4; color: #1d6b34; }
.pill.draw-void { background: #eceff1; color: #546e7a; text-decoration: line-through; }
.fee-summary.card { padding: 16px 20px; }
@media print {
  header, nav, .no-print, .flash { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
}
table.dash tr.group-head td { background: #f3f5f8; font-weight: 600; cursor: pointer; }
table.dash tr.group-head:hover td { background: #e9edf3; }
table.dash tr.group-head .caret { display: inline-block; width: 1em; }
table.dash tr.group-head .caret::before { content: "▾"; }
table.dash tbody.collapsed tr.group-row { display: none; }
table.dash tbody.collapsed .caret::before { content: "▸"; }
.scope { white-space: pre-line; }
table.lines textarea { width: 100%; min-width: 260px; font: inherit; }
.pill.checkmate { background: #dff3e4; color: #1d6b34; font-weight: 600; white-space: nowrap; }
.muted { color: #8a94a3; }
a.button-link { display: inline-block; padding: 6px 12px; border-radius: 6px; background: var(--navy); color: #fff; text-decoration: none; font-size: 13px; }
.public-logo { text-align: center; padding: 24px 16px 4px; }
.public-logo img { height: 96px; width: auto; mix-blend-mode: multiply; }
table.recon td:first-child, table.recon th:first-child { position: sticky; left: 0; background: #fff; white-space: nowrap; z-index: 1; }
table.recon th.num, table.recon td.num { white-space: nowrap; }
table.recon tr.total td { border-top: 2px solid var(--navy); }
@media print { @page { size: landscape; } }
.print-only { display: none; }
@media print {
  .print-only { display: block; }
  .print-only table.recon { margin-bottom: 18px; break-inside: avoid; font-size: 11px; width: 100%; }
  table.recon td:first-child, table.recon th:first-child { position: static; }
}
table.bulk-items tr.removing td { background: #fdecec; }
table.bulk-items tr.removing input:not([type=checkbox]), table.bulk-items tr.removing textarea { text-decoration: line-through; color: #a33; }
table.lines tr.removing td { background: #fdecec; }
