/* Stone Surgeons CRM — Accountant page (#/accountant). Uses the app's tokens (--line, --ink, --muted, --ok, --err, --accent). */
.acct-head { margin-bottom: 12px; }
.acct-tabs { flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.acct-sub { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.acct-sub .chip { display: inline-flex; align-items: center; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; font-weight: 600;
  color: var(--ink); text-decoration: none; background: rgba(255, 255, 255, .6); }
.acct-sub .chip:hover { border-color: var(--accent, #2a78d6); }
.acct-sub .chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.acct-card { margin-bottom: 14px; }
.acct-card h3 { margin-top: 0; }
.acct-card h4 { margin: 14px 0 6px; font-size: 14px; }
.acct-warn { background: #fff6e5; border-color: #f3d79a; color: #6b4700; }
:not(.msg).ok { color: var(--ok, #1d7a46); font-weight: 600; }
.grow-r { margin-left: auto; }

/* phones: the CRM centres <main> with margin:auto, which makes it as wide as its widest table. Accountant tables
   scroll inside their own box instead of widening the page. */
#main.acct-main { width: 100%; min-width: 0; box-sizing: border-box; }
.acct-wrap, .tbl-wrap:has(> table.acct-tbl) { contain: inline-size; }
.acct-head .row-end, .acct-sub { min-width: 0; }
.filters.acct-filters { flex-wrap: wrap; min-width: 0; }   /* doubled class: glass.css loads after this file */
.acct-filters > *, .acct-filters .in, .acct-filters select, .acct-filters .f { min-width: 0; max-width: 100%; }
select.acct-sel { max-width: 100%; min-width: 0; text-overflow: ellipsis; }

/* tables: text columns wrap and read left to right (base .src-tbl right-aligns + no-wraps every column); money columns stay right */
.acct-tbl td:not(:first-child), .acct-tbl th:not(:first-child) { text-align: left; white-space: normal; }
.acct-tbl td.num, .acct-tbl th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.acct-tbl tr.acct-total td { font-weight: 700; border-top: 1px solid var(--line); }
.acct-tbl tr.acct-grp td { padding-top: 14px; color: var(--ink); }
.acct-tbl tr.acct-neg td { background: #fff4f3; }
.acct-fs td:first-child { min-width: 240px; }
.acct-lines { margin: 8px 0; }
.acct-tbl .in-sm { width: 88px; min-width: 0; padding: 6px 8px; }
.acct-tbl td { vertical-align: middle; }
.acct-edit select.in { min-width: 220px; }
.acct-edit input.in-sm { width: 110px; }
.acct-totals { font-weight: 700; margin: 8px 0; }
.acct-budget input.in-sm { width: 82px; padding: 4px 6px; }
.acct-budget td:first-child { white-space: nowrap; }
.acct-sel { max-width: 100%; }

/* journal entries + bank lines */
.acct-entry { padding: 10px 14px; margin-bottom: 8px; }
.acct-entry > summary { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; cursor: pointer; list-style: none; }
.acct-entry > summary::-webkit-details-marker { display: none; }
.acct-entry.is-void { opacity: .6; }
.acct-entry-date { color: var(--muted); font-size: 13px; min-width: 96px; font-variant-numeric: tabular-nums; }
.acct-txn { padding: 12px 14px; margin-bottom: 10px; border-left: 4px solid var(--line); }
.acct-txn.is-out { border-left-color: var(--err); }
.acct-txn.is-in { border-left-color: var(--ok, #1d7a46); }
.acct-txn-top { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; margin-bottom: 8px; }
.acct-txn-top .num { margin-left: auto; font-weight: 800; font-variant-numeric: tabular-nums; }
.acct-matches { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0 10px; }
.acct-txn-form { margin-bottom: 6px; }
.acct-st { text-transform: capitalize; }
.acct-posted, .acct-paid, .acct-filed, .acct-sent, .acct-done, .acct-issued { background: #e7f6ee; color: #14633a; }
.acct-draft, .acct-open, .acct-to_issue { background: #eef2f7; color: #33475e; }
.acct-void, .acct-failed { background: #fdecea; color: #8a1f17; }
.acct-approved, .acct-replied { background: #fff6e5; color: #6b4700; }

/* receipts + letters */
.acct-receipt { display: grid; grid-template-columns: minmax(160px, 280px) 1fr; gap: 16px; align-items: start; }
.acct-receipt-img { width: 100%; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.acct-checks { list-style: none; padding: 0; margin: 6px 0; display: grid; gap: 3px; font-size: 14px; }
.acct-mail { background: rgba(255, 255, 255, .7); border: 1px solid var(--line); border-radius: 10px; padding: 12px; white-space: pre-wrap; font: 14px/1.5 inherit; }
.acct-json { font: 12.5px/1.45 ui-monospace, Consolas, monospace; width: 100%; }
.acct-person { align-self: center; min-width: 140px; }

/* overview */
.acct-alerts { display: grid; gap: 8px; margin-bottom: 14px; }
.acct-alert { display: block; padding: 10px 14px; border-radius: 10px; text-decoration: none; font-weight: 600; font-size: 14px; border: 1px solid var(--line); color: var(--ink); background: #f3f8fe; }
.acct-alert.warn { background: #fff6e5; border-color: #f3d79a; color: #6b4700; }
.acct-alert.bad { background: #fdecea; border-color: #f3b4ad; color: #8a1f17; }
.acct-alert:hover { filter: brightness(.97); }
.acct-deadlines, .acct-close { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 6px; }
.acct-deadlines li { display: flex; gap: 10px; align-items: baseline; }
.acct-deadlines li.soon .acct-entry-date { color: var(--err); font-weight: 700; }

.nav-badge.acct-badge-late { background: var(--err); color: #fff; }
.acct-home-alerts { margin: 0 0 14px; }

/* print sheets */
.acct-sheet-head h1 { margin: 0 0 4px; font-size: 22px; }
.acct-sheet-head p { margin: 0 0 2px; }
.acct-sheet h2 { font-size: 16px; margin: 18px 0 6px; }
.acct-sheet .tbl-wrap { overflow: visible; }

@media (max-width: 720px) {
  #main.acct-main .tile { min-width: 0; }
  #main.acct-main .tile b { font-size: clamp(19px, 6.2vw, 28px); overflow-wrap: anywhere; }
  .acct-receipt { grid-template-columns: 1fr; }
  .acct-fs td:first-child { min-width: 0; }
  .acct-entry-date { min-width: 0; }
}
@media print {
  .acct-sheet .acct-tbl td, .acct-sheet .acct-tbl th { padding: 3px 6px; font-size: 11px; }
}
