
.fund-ledger { margin: 24px 0; border: 1px solid var(--border); border-radius: 16px; background: var(--bg2); overflow: hidden; }
.fund-ledger-heading { padding: 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.fund-ledger-heading h2 { font-size: 17px; margin: 0 0 6px; color: var(--text); }
.fund-ledger-heading span, .fund-ledger-note { color: var(--muted2); font-size: 12px; }
.fund-ledger .table-wrap { border: 0; border-radius: 0; overflow-x: auto; }
.fund-ledger-table { width: 100%; min-width: 850px; }
#contributionLedger .fund-ledger-table { min-width: 0; table-layout: fixed; }
.fund-ledger-table th { vertical-align: top; font-size: 11px; }
.fund-ledger-table td { font-size: 12px; padding: 15px 12px; }
.fund-ledger-table th label { display: flex; flex-direction: column; gap: 8px; }
.fund-ledger-table input, .fund-ledger-table select { width: 100%; min-width: 120px; border: 1px solid var(--border2); border-radius: 7px; background: var(--bg2); color: var(--text); padding: 8px; font: inherit; text-transform: none; }
.fund-ledger-table input { min-width: 180px; }
.fund-member-toggle { border: 0; background: transparent; color: var(--text); font: inherit; font-weight: 700; cursor: pointer; text-align: left; padding: 6px 0; }
.fund-member-toggle:hover, .fund-member-toggle[aria-expanded=true] { color: var(--green); }
.fund-positive { color: var(--green); } .fund-negative { color: var(--red); } .fund-zero { color: var(--muted2); }
.fund-status { display: inline-block; border-radius: 20px; padding: 4px 10px; font-size: 11px; background: var(--bg3); white-space: nowrap; }
.fund-history { border-left: 3px solid var(--green); background: var(--bg3); padding: 16px; }
.fund-history h3 { margin: 0 0 12px; font-size: 14px; }
.fund-history table { width: 100%; }
.fund-pagination { display: flex; gap: 16px; justify-content: flex-end; align-items: center; padding-top: 12px; }
.fund-pagination button { border: 1px solid var(--border2); background: var(--bg2); color: var(--text); border-radius: 7px; padding: 8px 12px; cursor: pointer; }
.fund-pagination button:disabled { opacity: .4; cursor: default; }
.fund-ledger [hidden] { display: none !important; }
.fund-expense-meta { display: block; color: var(--muted2); margin-top: 5px; }
.fund-ledger-note { padding: 12px 20px; margin: 0; }
.fund-ledger button:focus-visible, .member-avatar-replace:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }

/* Fit the contribution ledger without clipping columns or hiding overflow. */
#contributionLedger .fund-ledger-table th,
#contributionLedger .fund-ledger-table td { padding: 12px 6px; white-space: normal; overflow-wrap: anywhere; }
#contributionLedger .fund-ledger-table th { letter-spacing: .04em; font-size: 10px; }
#contributionLedger .fund-ledger-table input,
#contributionLedger .fund-ledger-table select { min-width: 0; max-width: 100%; box-sizing: border-box; padding: 7px 5px; }
#contributionLedger .contribution-edit-btn { min-width: 0; max-width: 100%; white-space: normal; padding: 7px 8px; }
#contributionLedger .fund-status { white-space: normal; padding: 4px 6px; }
#contributionLedger .fund-history { padding: 12px; min-width: 0; }
#contributionLedger .fund-history table { table-layout: fixed; min-width: 0; }
#contributionLedger .fund-pagination { flex-wrap: wrap; gap: 8px; }
#contributionLedger .fund-inactive { color: var(--muted2); font-size: 11px; }
@media (max-width: 900px) {
  #contributionLedger .fund-ledger-table > colgroup { display: none; }
  #contributionLedger .fund-ledger-table,
  #contributionLedger .fund-ledger-table > thead,
  #contributionLedger .fund-ledger-table > tbody { display: block; }
  #contributionLedger .fund-ledger-table > thead > tr { display: grid; grid-template-columns: 1fr 1fr; }
  #contributionLedger .fund-ledger-table > thead th { display: none; }
  #contributionLedger .fund-ledger-table > thead th:nth-child(2),
  #contributionLedger .fund-ledger-table > thead th:last-child { display: block; }
  #contributionLedger [data-member-row] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 8px; border-top: 1px solid var(--border); }
  #contributionLedger [data-member-row] > td { display: flex; flex-direction: column; gap: 4px; min-width: 0; border: 0; }
  #contributionLedger [data-member-row] > td::before { content: attr(data-label); color: var(--muted2); font-size: 10px; }
  #contributionLedger [data-member-detail], #contributionLedger [data-members-empty],
  #contributionLedger [data-member-detail] > td, #contributionLedger [data-members-empty] > td { display: block; }
}

/* Center the expense ledger headings and category filter. */
#expenseLedger .fund-ledger-table > thead > tr > th {
  text-align: center;
  vertical-align: middle;
}
#expenseLedger .fund-ledger-table > thead label {
  align-items: center;
  text-align: center;
}
#expenseLedger .fund-ledger-table > thead select {
  text-align: center;
  text-align-last: center;
}