/* money-close-shadow.css - the Month close checklist (money-close.js) and the Shadow books vs QuickBooks report (money-reports-shadow.js),
   Richard approved the mockups 2026-11-22 (money-close-2026-11-21). Builds on money-books.css (mw-card, mw-t, mw-chip, mw-tabs) and
   money-ledger.css (lg-*). Tokens only, so both themes follow; borders, not shadows. On a phone every row and table stacks into cards. */

/* ── banners (info, warn, ok) ── */
.ck-ab { display: flex; align-items: center; gap: var(--s-3); border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px 14px; margin: 0 0 var(--s-3); font-size: var(--text-sm); line-height: 1.45; background: var(--surface-2); }
.ck-ab .ic { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--surface-3); color: var(--ink-2); }
.ck-ab .tx { flex: 1; min-width: 0; color: var(--ink); overflow-wrap: anywhere; }
.ck-ab.is-info { background: var(--accent-soft); border-color: var(--accent); }
.ck-ab.is-info .ic { background: var(--accent); color: var(--surface); }
.ck-ab.is-warn { background: var(--warn-soft); border-color: var(--warn); }
.ck-ab.is-warn .ic { background: var(--warn); color: var(--surface); }
.ck-ab.is-ok { background: var(--success-soft); border-color: var(--success); }
.ck-ab.is-ok .ic { background: var(--success); color: var(--surface); }

/* ── Month close: the checklist beside the months ── */
.ck-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: var(--s-4); align-items: start; }
.ck-col { display: grid; gap: var(--s-4); min-width: 0; }
.ck-h { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; padding: 14px var(--s-4); border-bottom: 1px solid var(--border-subtle); }
.ck-h h3 { margin: 2px 0 0; font-size: var(--text-lg); font-weight: 750; }
.ck-sum { display: flex; gap: var(--s-3); margin-left: auto; font-size: var(--text-sm); }
.ck-h .ds-btn[disabled] { opacity: .55; cursor: not-allowed; }
.ck-anyway { min-height: 36px; }
.ck-over { display: grid; gap: var(--s-2); padding: 10px 12px; border: 1px solid var(--warn); border-radius: var(--r-md); background: var(--warn-soft); }
.ck-over[hidden] { display: none; }
.ck-over-note { margin: 0; font-size: var(--text-sm); color: var(--ink); line-height: 1.45; }
.ck-card .ck-ab { margin: 10px var(--s-4); }
.ck-list { list-style: none; margin: 0; padding: 0; }
.ck-r { display: grid; grid-template-columns: 120px minmax(0, 1fr) 70px 180px; gap: var(--s-3); align-items: center; padding: 11px var(--s-4); border-bottom: 1px solid var(--border-subtle); }
.ck-r:last-child { border-bottom: 0; }
.ck-t b { display: block; font-size: var(--text-sm); font-weight: 700; }
.ck-t p { margin: 2px 0 0; font-size: var(--text-xs); color: var(--ink-3); line-height: 1.45; overflow-wrap: anywhere; }
.ck-r.is-na .ck-t b, .ck-r.is-na .ck-t p { color: var(--ink-3); }
.ck-n { text-align: right; font-size: var(--text-md); font-weight: 750; }
.ck-a { text-align: right; }
.ck-a .ds-btn, .ck-pick { min-height: 36px; }
.ck-months tbody tr[data-month] { cursor: pointer; }
.ck-months td { height: 44px; }

/* ── Shadow books vs QuickBooks ── */
.sb-tabs button { min-height: 44px; }
.sb-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--border-subtle); border-radius: var(--r-md); background: var(--surface); margin-bottom: var(--s-4); }
.sb-k { display: flex; flex-direction: column; gap: 2px; padding: 13px var(--s-4) 12px; border-right: 1px solid var(--border-subtle); min-width: 0; }
.sb-k:last-child { border-right: 0; }
.sb-kl { font-size: var(--text-xs); color: var(--ink-3); font-weight: 650; }
.sb-kv { font-size: var(--text-2xl); font-weight: 750; letter-spacing: var(--tracking-tight); line-height: 1.15; overflow-wrap: anywhere; }
.sb-kn { font-size: var(--text-xs); color: var(--ink-3); font-weight: 650; }
.sb-kn.is-bad { color: var(--danger-ink); }
.sb-kn.is-ok { color: var(--success-ink); }
.sb-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-4); align-items: start; margin-bottom: var(--s-4); }
.sb-ch { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); padding: 12px 14px; border-bottom: 1px solid var(--border-subtle); }
.sb-ch h3 { margin: 0; font-size: var(--text-md); font-weight: 700; }
.sb-note { margin: 0; padding: 10px 14px 0; font-size: var(--text-xs); color: var(--ink-3); line-height: 1.45; }
.sb-note:last-child { padding-bottom: 12px; }
.sb-t td.num { white-space: nowrap; }
.sb-dt td { height: auto; padding-top: 8px; padding-bottom: 8px; }
.sb-dt td.sb-why { min-width: 280px; font-size: var(--text-xs); color: var(--ink-2); line-height: 1.45; }
.sb-dt td.sb-day, .sb-dt td.sb-kind { white-space: nowrap; }
.sb-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }

@media (max-width: 1100px) {
  .ck-grid, .sb-two { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .sb-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sb-k:nth-child(2) { border-right: 0; }
  .sb-k:nth-child(-n+2) { border-bottom: 1px solid var(--border-subtle); }
}
@media (max-width: 640px) {
  .ck-h .ds-btn { flex: 1 1 100%; min-height: 44px; }
  .ck-sum { margin-left: 0; }
  .ck-r { grid-template-columns: minmax(0, 1fr) auto; gap: 6px var(--s-3); }
  .ck-s { grid-column: 1; grid-row: 1; }
  .ck-n { grid-column: 2; grid-row: 1; }
  .ck-t { grid-column: 1 / -1; grid-row: 2; }
  .ck-a { grid-column: 1 / -1; grid-row: 3; text-align: left; }
  .ck-a:empty { display: none; }
  .ck-a .ds-btn { width: 100%; min-height: 44px; justify-content: center; }
  /* every table stacks into cards: one row a card, each cell with its column name */
  .ck-months thead, .sb-t thead { display: none; }
  .ck-months, .ck-months tbody, .sb-t, .sb-t tbody { display: block; width: 100%; }
  .ck-months tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px var(--s-3); padding: var(--s-2) var(--s-4); border-bottom: 1px solid var(--border-subtle); }
  .ck-months tbody td { display: block; height: auto; padding: 0; border: 0; }
  .ck-months td.mw-ra { grid-column: 1 / -1; }
  .ck-months .ck-pick { width: 100%; min-height: 44px; justify-content: center; }
  .sb-t tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px var(--s-3); padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--border-subtle); }
  .sb-t tbody tr:last-child { border-bottom: 0; }
  .sb-t tbody tr:hover td { background: transparent; }
  .sb-t tbody td, .sb-dt td { display: block; height: auto; padding: 0; border: 0; text-align: left; white-space: normal; min-width: 0; }
  .sb-t tbody td[data-label]::before { content: attr(data-label); display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
  .sb-t tbody td:first-child[data-label]::before { display: none; }
  .sb-t tbody td:first-child { grid-column: 1 / -1; font-weight: 700; }
  .ck-months tbody tr.sel { background: var(--accent-soft); }
  .sb-dt tbody td.sb-day { grid-column: 1; }
  .sb-dt tbody td.sb-kind { grid-column: 2; justify-self: end; }
  .sb-dt tbody td.sb-kind::before { display: none; }
  .sb-dt td.sb-why, .sb-mt td.sb-open, .sb-mt td[data-label="State"] { grid-column: 1 / -1; min-width: 0; }
  .sb-mt .sb-open .ds-btn { width: 100%; min-height: 44px; }
  .sb-kv { font-size: var(--text-xl); }
}
@media print {
  .sb-tabs, [data-sh-pager], .ck-a, .ck-pick, .ck-h .ds-btn, .lg-yr { display: none !important; }
  .ck-grid, .sb-two { grid-template-columns: minmax(0, 1fr); }
}
