/* Area payments – page styles (docs/AREAS.md). Only classes of this area's pages (.pg-b root, .b-*); shared tokens in theme.css.
   Calm cards with thin borders, no thick coloured left borders, no all-caps labels; tables stack into cards on phones; 44 px touch targets. */
.pg-b .num { font-variant-numeric: tabular-nums; }
.pg-b .num.neg, .pg-b .b-late { color: var(--danger); }
.pg-b .num.pos { color: var(--success); }
.pg-b .b-block { display: block; }
.pg-b .b-struck { text-decoration: line-through; opacity: .7; }
.pg-b .card-body { padding: 16px 18px; }
.pg-b .linkish { background: none; border: 0; padding: 0; color: var(--info-brand); cursor: pointer; font: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* summary strip */
.b-sum { margin-bottom: var(--gap); }
.b-sum-row { display: flex; flex-wrap: wrap; gap: 10px 28px; align-items: center; padding: 14px 18px; }
.b-fig { display: flex; flex-direction: column; gap: 2px; min-width: 110px; }
.b-fig .lbl, .b-total .lbl, .b-facts .lbl { font-size: var(--fs-xs); color: var(--text-3); }
.b-fig b { font-size: var(--fs-lg); }
.b-hint { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: var(--fs-sm); background: var(--info-bg); border-radius: var(--radius); padding: 8px 10px; }

/* report bar: month switcher, contract filter, bulk bar */
.b-month { display: inline-flex; align-items: center; gap: 4px; }
.b-month .input { width: 150px; height: 38px; font-size: var(--fs-sm); }
.b-ctr { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: var(--fs-sm); }
.b-bulk { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 18px 12px; padding: 8px 12px; border-radius: var(--radius); background: var(--primary-soft); font-size: var(--fs-sm); }
.b-bulk[hidden] { display: none; }

/* tables */
.b-tbl th.sel-col, .b-tbl td.sel-col { width: 44px; padding-right: 0; }
.b-tbl .tick { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; cursor: pointer; }
.b-tbl .tick input { width: 18px; height: 18px; accent-color: var(--primary); }
.b-tbl td.acts { text-align: right; white-space: nowrap; }
.b-tbl th.sortable { cursor: pointer; user-select: none; }
.b-tbl th .arr { margin-left: 4px; }
.row-acts { display: inline-flex; gap: 6px; align-items: center; justify-content: flex-end; }

/* overdue total */
.b-total { margin-bottom: var(--gap); }
.b-total .card-body { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; }
.b-total-main { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.b-total-main b { font-size: var(--fs-xl); }
.b-total-side { margin-left: auto; }

/* detail: facts grid, rent split */
.b-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px 18px; margin-bottom: 14px; }
.b-facts > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.b-facts a { color: inherit; }
.b-split { width: 100%; max-width: 440px; border-collapse: collapse; font-size: var(--fs-sm); }
.b-split td { padding: 6px 0; border-bottom: 1px solid var(--border); }
.b-split td.r { text-align: right; }
.b-split tr.sum td { font-weight: 650; border-bottom-color: var(--border-strong); }
.b-rule { margin-top: 10px; }
.b-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.b-form-foot .row { display: flex; gap: 8px; flex-wrap: wrap; }
.b-inline { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 10px 12px; align-items: end; border-top: 1px solid var(--border); }
.b-inline .full { grid-column: 1 / -1; }
.b-sugg { display: flex; gap: 8px; flex-wrap: wrap; min-width: 0; }
/* long suggestion texts (e.g. "Back payment utility statement 2025 (NK-…)" from area C) wrap instead of widening the form on phones */
.b-sugg .btn { white-space: normal; text-align: left; height: auto; min-height: 44px; max-width: 100%; }
.b-sugg .btn span { min-width: 0; overflow-wrap: anywhere; }
.b-ro { display: flex; align-items: center; background: var(--surface-2); color: var(--text); text-decoration: none; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.b-steps { margin: -6px 0 14px; }
.b-settle-sum { border-top: 1px solid var(--border); }
.b-settle { padding: 4px 18px 10px; }
.b-settle li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 10px 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.b-settle li:last-child { border-bottom: 0; }
.b-letters { display: flex; flex-direction: column; gap: 12px; }
.b-letter-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.b-letter-row .row { display: flex; gap: 8px; flex-wrap: wrap; }

/* reminder dialog */
.b-rem { display: flex; flex-direction: column; gap: 14px; }
.b-fs { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; margin: 0; }
.b-fs legend { font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); padding: 0 4px; }
.b-item { display: grid !important; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 6px 0; min-height: 44px; }
.b-item .xs { grid-column: 2 / -1; }
.b-rem-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.b-calc-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 14px; }
.b-letter { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; font-size: var(--fs-sm); max-height: 260px; overflow: auto; }
.b-letter-body { white-space: pre-wrap; margin-top: 8px; line-height: 1.5; }
.b-bulk-list li { padding: 6px 0; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); }

@media (max-width: 900px) {
  .b-calc-grid, .b-rem-opts { grid-template-columns: 1fr; }
  .b-inline { grid-template-columns: 1fr 1fr; }
}
/* phones: 44 px targets, tables as stacked cards */
@media (max-width: 720px) {
  .pg-b .btn, .b-rem .seg button, .modal .btn { min-height: 44px; }
  .pg-b .btn-icon { min-width: 44px; }
  .b-month .input { width: 132px; height: 44px; }
  .pg-b .report-bar .input { height: 44px; }
  .b-hint { margin-left: 0; }
  .b-total-side { margin-left: 0; }
  .b-inline { grid-template-columns: 1fr; }
  .b-settle li { grid-template-columns: minmax(0, 1fr) auto; }
  .pg-b .b-tbl thead { display: none; }
  .pg-b .b-tbl, .pg-b .b-tbl tbody, .pg-b .b-tbl tr, .pg-b .b-tbl td { display: block; width: 100%; }
  .pg-b .b-tbl tr { position: relative; padding: 10px 14px 10px; border-bottom: 1px solid var(--border); }
  .pg-b .b-tbl td { border: 0 !important; padding: 3px 0 !important; text-align: left !important; display: flex; justify-content: space-between; gap: 12px; min-height: 0; }
  .pg-b .b-tbl td[data-l]:not([data-l=""])::before { content: attr(data-l); color: var(--text-3); font-size: var(--fs-xs); font-weight: 500; flex: none; }
  .pg-b .b-tbl td.sel-col { position: absolute; right: 8px; top: 6px; width: auto; display: block; }
  .pg-b .b-tbl td.acts { justify-content: flex-end; padding-top: 8px !important; }
  .pg-b .b-tbl td .cv { text-align: right; min-width: 0; overflow-wrap: anywhere; }
  .pg-b .b-tbl .tick { min-width: 44px; min-height: 44px; }
  .pg-b .table-wrap:has(> .b-tbl) { overflow: visible; }
  .pg-b .b-tbl tr:has(> td.sel-col) { padding-right: 56px; }
}
.b-tbl td.nw { white-space: nowrap; }
.b-acct { display: inline-block; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
/* overview: icon-only row actions on medium screens so all columns fit */
@media (min-width: 721px) and (max-width: 1499px) { .b-ov .row-acts .btn:not(.btn-icon) span { display: none; } .b-ov .row-acts .btn:not(.btn-icon) { padding: 0 10px; } }
@media (max-width: 720px) { .b-acct { max-width: 60vw; } }
