/* close-hub styles: Month-End Close hub (#/close), Sunday packet (#/close-packet) and donor batch (#/close-donor).
   Every class is prefixed ci- so it can't collide with the other close pages. Uses the tokens in app.css. */

/* ================================================================ Hub */
.ci-welcome { margin-top: 24px; max-width: 680px; font-size: 17px; }
.ci-section { margin-top: 56px; }
.ci-section:focus { outline: none; }
.ci-section > h2 { margin-bottom: 4px; }
.ci-section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; }
.ci-intro { margin-top: 8px; max-width: 680px; color: var(--muted); font-size: 16px; }
.ci-fine { margin-top: 12px; color: var(--muted); font-size: 13px; }
.ci-eyebrow { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }

/* Calendar */
.ci-beats { list-style: none; margin: 24px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 24px; }
.ci-beat-card { border-top: 2px solid var(--accent); padding-top: 14px; }
.ci-beat-when { font-size: 13px; font-weight: 700; color: var(--good); }
.ci-beat-title { margin-top: 2px; font-size: 17px; font-weight: 700; }
.ci-beat-text { margin-top: 6px; color: var(--muted); font-size: 15px; }

/* Checklist */
.ci-progress { color: var(--muted); font-size: 15px; font-variant-numeric: tabular-nums; }
.ci-bar { height: 4px; margin-top: 12px; border-radius: 2px; background: var(--line-soft); overflow: hidden; }
.ci-bar span { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
.ci-lessons { list-style: none; margin: 16px 0 0; padding: 0; }
.ci-lesson { margin-top: 32px; }
.ci-lesson-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.ci-lesson-head h3 { font-size: 17px; }
.ci-lesson-no { display: inline-block; min-width: 76px; margin-right: 8px; color: var(--muted); font-size: 14px; font-weight: 600; }
.ci-lesson-meta { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.ci-steps { list-style: none; margin: 0; padding: 0; }
.ci-step { padding: 16px 0 10px 84px; border-bottom: 1px solid var(--line-soft); }
.ci-step-task { font-weight: 600; }
.ci-due { display: inline-block; margin-left: 10px; padding: 0 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; font-weight: 600; line-height: 20px; vertical-align: 1px; white-space: nowrap; }
.ci-step-detail { margin-top: 2px; color: var(--muted); font-size: 15px; max-width: 640px; }
.ci-links { list-style: none; margin: 4px 0 0; padding: 0; }
.ci-links .row { padding: 8px 0; gap: 12px; }
.ci-links .row-title { font-size: 15px; }
.ci-links .row-no { width: 28px; font-size: 14px; }
.ci-links .row-go { font-size: 14px; }
.ci-links .row-inline-meta { font-size: 14px; }
.ci-jump { margin: 6px 0; font-size: 15px; }

/* Packet downloads */
.ci-packet-main { margin-top: 20px; }
.ci-files { list-style: none; margin: 24px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; border-top: 1px solid var(--line); }
.ci-files li { border-bottom: 1px solid var(--line-soft); }
.ci-files a { display: flex; gap: 12px; padding: 10px 0; font-size: 15px; text-decoration: none; }
.ci-files a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: #C3C9CD; }
.ci-file-no { flex: none; width: 22px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Report package */
.ci-reports { padding-top: 40px; border-top: 1px solid var(--line); }
.ci-report { margin-top: 40px; }
.ci-report h3 { font-size: 17px; }
.ci-report-sub { margin: 4px 0 12px; color: var(--muted); font-size: 14px; }
.ci-fs td, .ci-fs th { white-space: nowrap; }
.ci-fs td { padding-top: 7px; padding-bottom: 7px; }
.ci-fs td:first-child, .ci-fs th:first-child { white-space: normal; min-width: 180px; }
.ci-fs tr.ci-sec th { padding: 20px 0 6px; font-size: 15px; font-weight: 700; color: var(--ink); border-bottom: 1px solid var(--line); }
.ci-fs tr:first-child.ci-sec th { padding-top: 8px; }
.ci-fs tr.ci-head td { padding-top: 12px; padding-bottom: 4px; font-size: 13px; font-weight: 600; color: var(--muted); border-bottom: 0; }
.ci-fs tr.ci-row td:first-child { padding-left: 14px; }
.ci-fs tr.ci-row.contra td { color: var(--muted); }
.ci-fs tr.ci-row.flat td { font-weight: 600; }
.ci-fs tr.ci-row.flat td:first-child { padding-left: 0; }
.ci-funds td:not(:first-child), .ci-funds th:not(:first-child) { width: 17%; }
.ci-fs tr.ci-sub td { font-weight: 600; border-top: 1px solid var(--line); }
.ci-fs tr.ci-tot td, .ci-fs tfoot tr.ci-tot td { font-weight: 700; border-top: 1px solid var(--ink); }
.ci-fs tr.ci-grand td { font-weight: 700; border-top: 1px solid var(--ink); border-bottom: 3px double var(--ink); }
.ci-fs .ci-chg { color: var(--muted); }
.ci-balanced { display: flex; align-items: center; gap: 6px; margin-top: 12px; color: var(--good); font-weight: 600; font-size: 15px; }
.ci-balanced.off { color: var(--bad); }

/* Statement of Activities: sticky first column, scrolls sideways */
.ci-soa-wrap:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.ci-soa { min-width: 1000px; }
.ci-soa td, .ci-soa th { padding-left: 6px; padding-right: 6px; }
/* On a laptop the statement is wider than the reading column, so it steps out to the wide layout width. */
@media (min-width: 1180px) {
  .ci-soa-wrap { margin-left: -100px; margin-right: -100px; }
  .ci-soa { min-width: 0; font-size: 13px; }
  .ci-soa .ci-stick { min-width: 180px; }
}
.ci-soa .ci-stick { position: sticky; left: 0; z-index: 1; background: var(--bg); min-width: 200px; max-width: 220px; white-space: normal; box-shadow: 1px 0 0 var(--line-soft); }
.ci-soa thead .ci-colgroup th { padding-bottom: 4px; text-align: center; font-size: 12px; border-bottom: 1px solid var(--line-soft); }
.ci-soa thead .ci-colgroup th.ci-restr-h { background: var(--subtle); border-radius: var(--radius) var(--radius) 0 0; }
.ci-soa .ci-total-col { font-weight: 600; padding-left: 16px; }
.ci-soa tr.ci-head td { padding-left: 0; }

/* Notes and lock */
.ci-notes { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); max-width: 760px; }
.ci-notes li { padding: 14px 0; border-bottom: 1px solid var(--line-soft); font-size: 15px; }
.ci-note-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin-bottom: 2px; }
.ci-note-fig { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.ci-lock p { margin-top: 8px; max-width: 680px; }
.ci-lock-steps { margin: 12px 0 0; padding-left: 22px; max-width: 680px; }
.ci-lock-steps li + li { margin-top: 6px; }

/* ================================================================ Paper documents (packet + donor) */
.ci-paper { position: relative; margin: 0; padding: 20px 24px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); font-size: 15px; box-shadow: 0 1px 2px rgba(16, 29, 38, .05); }
.ci-stamp { position: absolute; top: 16px; right: 16px; padding: 1px 6px; border: 1px solid currentColor; border-radius: 4px; color: var(--bad); font-size: 11px; font-weight: 700; letter-spacing: .06em; }
.ci-struck { color: var(--muted); }
.ci-pen { color: var(--good); font-weight: 700; }
.ci-initials { margin-left: 6px; color: var(--good); font-size: 11px; font-style: italic; font-weight: 600; }

/* ================================================================ Packet */
.ci-packet-docs { margin-top: 40px; }
.ci-docs-row { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.ci-count-table { width: 100%; margin-top: 16px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ci-count-table th { padding: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--muted); text-align: left; border-bottom: 1px solid var(--line); }
.ci-count-table td { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.ci-count-table .num { text-align: right; white-space: nowrap; padding-left: 12px; }
.ci-count-table tr.ci-count-sum td, .ci-count-table tr.ci-count-grand td { font-weight: 700; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); }
.ci-count-table tr.ci-count-grand td { border-bottom: 3px double var(--ink); }
.ci-sigs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; margin-top: 20px; }
.ci-sigs-k { grid-column: 1 / -1; font-size: 13px; color: var(--muted); font-weight: 600; }
.ci-sig { display: flex; flex-direction: column; }
.ci-sig-line { display: flex; align-items: flex-end; height: 36px; border-bottom: 1px solid var(--ink); }
.ci-script { font-family: 'Segoe Script', 'Brush Script MT', 'Snell Roundhand', cursive; font-style: italic; font-size: 21px; line-height: 1.1; padding-left: 4px; }
.ci-sig-name { margin-top: 2px; font-size: 13px; color: var(--muted); }
.ci-env-list { list-style: none; margin: 12px 0 0; padding: 0; font-variant-numeric: tabular-nums; }
.ci-env-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.ci-env-memo { display: block; font-size: 13px; color: var(--muted); }
.ci-checks-h { margin: 32px 0 12px; font-size: 16px; }
.ci-checks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: 12px; }
.ci-check { position: relative; padding: 10px 12px 12px; border: 1px solid var(--field); border-radius: var(--radius); background: var(--subtle); font-size: 13px; line-height: 1.4; }
.ci-check-top { display: flex; justify-content: space-between; gap: 8px; }
.ci-check-from { font-weight: 700; }
.ci-check-no { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ci-check-pay { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 0 8px; margin-top: 8px; }
.ci-check-k { font-size: 10px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.ci-check-pay .ci-check-k { grid-column: 1 / -1; }
.ci-check-payee { min-width: 0; padding-bottom: 1px; border-bottom: 1px solid var(--field); font-weight: 600; }
.ci-check-amt { padding: 1px 6px; border: 1px solid var(--field); border-radius: 4px; background: var(--bg); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ci-check-memo { display: flex; align-items: baseline; gap: 8px; min-height: 22px; margin-top: 8px; border-bottom: 1px solid var(--field); }
.ci-check.is-returned > :not(.ci-returned) { opacity: .4; }
.ci-returned { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-5deg); padding: 2px 8px; border: 2px solid var(--bad); border-radius: 4px; background: var(--bg); color: var(--bad); font-size: 12px; font-weight: 700; white-space: nowrap; }

.ci-fix + .ci-fix { margin-top: 32px; }
.ci-fix .step-sub { margin-bottom: 2px; }
.ci-fix-note { margin-bottom: 12px; color: var(--muted); font-size: 14px; }
.ci-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 820px; }
.ci-answer-list { color: var(--ink); }

.ci-slip { max-width: 520px; }
.ci-slip-head { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--ink); }
.ci-slip-meta { text-align: right; font-size: 14px; color: var(--muted); }
.ci-slip-meta .ci-stamp { position: static; display: inline-block; margin-bottom: 6px; }
.ci-slip-row { display: grid; grid-template-columns: minmax(0, 1fr) 168px; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.ci-slip-row.total { border-top: 1px solid var(--ink); border-bottom: 0; font-weight: 700; margin-top: -1px; }
.ci-slip-k { font-weight: 600; }
.ci-slip-sub { display: block; font-size: 13px; font-weight: 400; color: var(--muted); }
.ci-slip-v { text-align: right; }
.ci-slip-v .cell-note { text-align: right; }

/* ================================================================ Donor system (GiftLedger) */
.ci-gl { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg); }
.ci-gl-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; padding: 12px 20px; background: var(--ink); color: #fff; }
.ci-gl-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.ci-gl-brand::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.ci-gl-crumb { font-size: 14px; color: #C9D0D5; }
.ci-gl-crumb strong { color: #fff; font-weight: 600; }
.ci-gl-status { margin-left: auto; padding: 1px 10px; border-radius: 999px; background: var(--accent); color: var(--ink); font-size: 12px; font-weight: 700; }
.ci-gl-status.closed { background: #fff; }
.ci-gl-summary { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px 40px; padding: 20px; border-bottom: 1px solid var(--line); }
.ci-gl-funds { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 14px; }
.ci-gl-funds .k { display: block; font-size: 12px; font-weight: 600; color: var(--muted); }
.ci-gl-funds .unassigned .ci-fund-amt { color: var(--muted); }
.ci-fund-amt { font-weight: 600; font-variant-numeric: tabular-nums; }
.ci-gl > .sheet-wrap { padding: 0 20px; }
.ci-gl-table { margin-top: 12px; }
.ci-gl-table td { vertical-align: top; padding-top: 12px; padding-bottom: 12px; }
.ci-gl-table td.input-cell { padding-top: 8px; padding-bottom: 8px; }
.ci-gl-table .ci-col-no { width: 32px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ci-gl-table .ci-donor { min-width: 150px; font-weight: 600; }
.ci-gl-table .ci-donor input { height: 34px; font-weight: 400; min-width: 160px; }
.ci-gl-table .ci-method { color: var(--muted); }
.ci-ref { display: block; font-size: 12px; color: var(--muted); }
.ci-gl-table .ci-memo { min-width: 150px; max-width: 240px; }
.ci-gl-table .ci-amt { width: 96px; }
.ci-gl-table .ci-amt input { width: 104px; }
.ci-gl-table .ci-fund-cell { width: 250px; }
.ci-fund-line { display: flex; align-items: center; gap: 12px; }
.sheet .ci-fund-line select, .sheet .ci-split select { width: 160px; }
.ci-fund-line .link-btn { font-size: 14px; }
.ci-split { display: grid; gap: 6px; }
.ci-split-line { display: flex; align-items: center; gap: 8px; }
.sheet .ci-split-line .amt-input { width: 92px; }
.ci-split-line .icon-btn { width: 28px; height: 28px; }
.ci-split-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin-top: 2px; font-size: 13px; }
.ci-split-tools .link-btn { font-size: 13px; }
.ci-split-sum { color: var(--bad); font-variant-numeric: tabular-nums; }
.ci-split-sum.ok { color: var(--good); }
.ci-earmark { max-width: 280px; }
.ci-gl-row.added td { background: var(--subtle); }
.ci-gl-row.added.row-bad td, .sheet tr.ci-gl-row.row-bad td { background: var(--bad-bg); }
.ci-remove { font-size: 13px; }
.ci-gl-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 16px 20px; border-top: 1px solid var(--line-soft); }
.ci-gl-foot .ci-fine { margin-top: 0; }
.ci-add-line { min-height: 36px; padding: 6px 16px; }

.ci-summary { margin-top: 32px; }
.ci-summary h3 { font-size: 17px; }
.ci-sum-table { max-width: 480px; }
.ci-summary-notes { list-style: none; margin: 20px 0 0; padding: 0; max-width: 720px; color: var(--muted); font-size: 15px; }
.ci-summary-notes li + li { margin-top: 10px; }
.ci-summary-notes strong { color: var(--ink); }
.ci-next-link { margin-top: 16px; font-size: 15px; }

.ci-payout .doc-lines td.num { font-variant-numeric: tabular-nums; }
.ci-payout tr.ci-pay-gross td { font-weight: 700; border-top: 1px solid var(--line); }
.ci-q2 { margin: 28px 0 8px; }
.ci-payout-split .form-grid { grid-template-columns: minmax(0, 1fr); max-width: 420px; }
.ci-payout-split .form-grid .wide { grid-column: auto; }

/* ================================================================ Responsive */
@media (max-width: 900px) {
  .ci-docs-row { grid-template-columns: minmax(0, 1fr); }
  .ci-payout-split > .ci-paper { order: -1; max-width: 480px; }
}
@media (max-width: 720px) {
  .ci-welcome { font-size: 16px; }
  .ci-section { margin-top: 44px; }
  .ci-beats { grid-template-columns: minmax(0, 1fr); }
  .ci-files { grid-template-columns: minmax(0, 1fr); }
  .ci-step { padding-left: 0; }
  .ci-lesson-no { display: block; min-width: 0; margin: 0 0 2px; }
  .ci-due { margin-left: 8px; }
  .ci-fs td:first-child, .ci-fs th:first-child { min-width: 150px; }
  .ci-soa { min-width: 940px; }
  .ci-fs:not(.ci-soa) td:first-child, .ci-fs:not(.ci-soa) th:first-child { position: sticky; left: 0; z-index: 1; background: var(--bg); min-width: 140px; max-width: 150px; box-shadow: 1px 0 0 var(--line-soft); }
  .ci-soa .ci-stick { min-width: 150px; max-width: 150px; }
  .ci-paper { padding: 16px; }
  .ci-stamp { top: 12px; right: 12px; }
  .ci-checks { grid-template-columns: minmax(0, 1fr); }
  .ci-grid-4 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ci-slip-row { grid-template-columns: minmax(0, 1fr) 140px; }
  .ci-slip-head { flex-direction: column; }
  .ci-slip-meta { text-align: left; }

  /* GiftLedger batch: one block per gift so the fund picker stays on screen */
  .ci-gl-bar, .ci-gl-summary, .ci-gl-foot { padding-left: 16px; padding-right: 16px; }
  .ci-gl-status { margin-left: 0; }
  .ci-gl > .sheet-wrap { padding: 0 16px; }
  .ci-gl-table thead { display: none; }
  .ci-gl-table, .ci-gl-table tbody { display: block; }
  .ci-gl-table tr { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; grid-template-areas: "no donor amt" "no method method" "no memo memo" "no fund fund"; column-gap: 8px; row-gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
  .ci-gl-table td { padding: 0 !important; border: 0 !important; width: auto !important; min-width: 0 !important; max-width: none !important; }
  .ci-gl-table td:nth-child(1) { grid-area: no; }
  .ci-gl-table td:nth-child(2) { grid-area: donor; }
  .ci-gl-table td:nth-child(3) { grid-area: method; font-size: 13px; }
  .ci-gl-table td:nth-child(3) .ci-ref { display: inline; margin-left: 6px; }
  .ci-gl-table td:nth-child(4) { grid-area: memo; font-size: 14px; }
  .ci-gl-table td:nth-child(5) { grid-area: amt; }
  .ci-gl-table td:nth-child(6) { grid-area: fund; margin-top: 8px !important; }
  .ci-gl-table tr.row-bad, .ci-gl-table tr.added { padding: 12px 8px; border-radius: var(--radius); }
  .ci-gl-table tr.row-bad { background: var(--bad-bg); }
  .ci-gl-table tr.added { background: var(--subtle); }
  .ci-gl-table tr td { background: none !important; }
  .ci-gl-table .ci-donor input { min-width: 0; width: 100%; }
  .sheet .ci-fund-line select { flex: 1; width: auto; min-width: 0; height: 40px; }
  .sheet .ci-split select { flex: 1; width: auto; min-width: 0; }
  .ci-earmark { max-width: none; }
}
