/* Literal geometry of the supplied Facturación references.
   ID scope deliberately isolates these rules from the generic reference markers. */
#billing-reference-exact {
  --be-text: #1d1d1f;
  --be-muted: #8e8e93;
  --be-secondary: #5f5f66;
  --be-line: #f0f0f2;
  --be-red: #c8102e;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto 0 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", Inter, "Segoe UI", sans-serif;
  color: var(--be-text);
  font-size: 13px;
  line-height: 16px;
}
#billing-reference-exact > .be-page {
  width: 100%;
  max-width: 1080px !important;
  padding: 20px 32px 40px !important;
  margin: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 0 !important;
}
#billing-reference-exact > .be-page > * { margin-top: 0 !important; max-width: 920px !important; }
#billing-reference-exact > .be-page > .be-header { max-width: none !important; margin-bottom: 14px !important; }
#billing-reference-exact .be-header {
  min-height: 50px !important; padding: 0 !important; background: none !important;
  border: 0 !important; box-shadow: none !important; gap: 16px;
}
#billing-reference-exact .be-header h1 {
  margin: 0 !important; font-size: 22px !important; line-height: 28px !important;
  font-weight: 700 !important; letter-spacing: -.02em !important;
}
#billing-reference-exact .bd-envline { font-size: 12px !important; line-height: 16px !important; margin-top: 4px !important; color: var(--be-secondary) !important; }
#billing-reference-exact .be-header button,
#billing-reference-exact .be-header summary { height: 36px !important; font-size: 12px !important; font-weight: 500 !important; border-radius: 7px !important; }
#billing-reference-exact .be-tabs {
  display: flex !important; align-items: stretch !important; justify-content: flex-start !important;
  gap: 22px !important; height: 40px !important; min-height: 40px !important; padding: 0 !important;
  margin: 0 0 22px !important; border: 0 !important; border-bottom: 1px solid var(--be-line) !important;
  background: none !important; overflow-y: hidden !important; flex-wrap: nowrap !important;
}
#billing-reference-exact .be-tabs > button {
  display: flex !important; align-items: center !important; height: 40px !important;
  min-width: 0 !important; padding: 0 !important; margin: 0 !important;
  border: 0 !important; border-bottom: 2px solid transparent !important; border-radius: 0 !important;
  background: none !important; box-shadow: none !important;
  font-size: 12px !important; line-height: 16px !important; font-weight: 400 !important;
  color: var(--be-secondary) !important;
}
#billing-reference-exact .be-tabs > button[aria-selected=true] { color: var(--be-text) !important; font-weight: 600 !important; border-bottom-color: var(--be-red) !important; }
#billing-reference-exact .bd-period-head { margin: 0 0 18px !important; min-height: 30px; padding: 0 !important; }
#billing-reference-exact .bd-monthnav { margin-left: -8px; gap: 2px; font-size: 14px !important; font-weight: 600 !important; }
#billing-reference-exact .bd-monthnav button { height: 30px !important; width: 30px !important; padding: 0 !important; }
#billing-reference-exact .bd-figs-wrap { padding: 0 !important; margin-bottom: 24px !important; }
#billing-reference-exact .bd-figs { display: flex !important; justify-content: flex-start !important; gap: 40px !important; width: fit-content; max-width: 100%; margin: 0 !important; }
#billing-reference-exact .bd-fig-l { font-size: 12px !important; line-height: 16px !important; font-weight: 400 !important; margin: 0 0 4px !important; color: var(--be-secondary) !important; }
#billing-reference-exact .bd-fig-v { font-size: 20px !important; line-height: 26px !important; font-weight: 600 !important; letter-spacing: -.01em !important; margin: 0 !important; }
#billing-reference-exact .bd-bar { height: 4px !important; width: 240px !important; max-width: 100%; margin: 12px 0 8px !important; background: var(--be-line) !important; }
#billing-reference-exact .bd-meta { font-size: 11px !important; line-height: 15px !important; color: var(--be-muted) !important; }
#billing-reference-exact .bd-section-head { min-height: 32px !important; margin: 0 0 6px !important; padding: 0 0 8px !important; border: 0 !important; }
#billing-reference-exact .bd-h2 { font-size: 15px !important; line-height: 20px !important; font-weight: 600 !important; }
#billing-reference-exact .bd-search { width: 220px !important; height: 32px !important; padding: 0 10px !important; border-radius: 7px !important; background: #f4f4f5 !important; }
#billing-reference-exact .bd-search input { font-size: 12px !important; min-height: 0 !important; height: 28px !important; border: 0 !important; box-shadow: none !important; }
#billing-reference-exact .bd-filters-btn,
#billing-reference-exact .bd-report-actions > details > summary { height: 32px !important; padding: 0 12px !important; font-size: 12px !important; font-weight: 400 !important; border-radius: 7px !important; }
#billing-reference-exact .rp-ledger-grid,
#billing-reference-exact .ps-table-wrap { border: 0 !important; border-radius: 0 !important; box-shadow: none !important; background: transparent !important; padding: 0 !important; }
#billing-reference-exact table.ps-table { table-layout: fixed !important; width: 100% !important; max-width: 920px !important; }
#billing-reference-exact table.ps-table :is(thead,thead tr) { background: transparent !important; }
#billing-reference-exact table.ps-table thead th.ps-c {
  padding: 10px 6px !important; background: transparent !important; border: 0 !important;
  border-bottom: 1px solid #e5e5ea !important; font-size: 11px !important; line-height: 14px !important;
  font-weight: 400 !important; color: var(--be-muted) !important; text-transform: none !important;
}
#billing-reference-exact table.ps-table :is(tbody,tfoot) > tr > td.ps-c {
  padding: 12px 6px !important; border-bottom: 1px solid var(--be-line) !important;
  background: transparent !important; font-size: 12px !important; line-height: 16px !important;
}
#billing-reference-exact table.ps-table :is(thead,tbody,tfoot) > tr > :is(th,td).ps-c:first-child { padding-left: 0 !important; }
#billing-reference-exact table.ps-table :is(th,td).ps-c.ps-actions { padding-left: 0 !important; padding-right: 0 !important; }
#billing-reference-exact table.ps-table th.ps-actions { font-size: 0 !important; }
#billing-reference-exact table.ps-table th.ps-actions::after { content: none !important; }
#billing-reference-exact table.ps-table td.ps-primary .ps-main { font-size: 13px !important; font-weight: 600 !important; }
#billing-reference-exact table.ps-table td.ps-primary .ps-sub { margin-top: 3px !important; font-size: 11px !important; line-height: 14px !important; font-weight: 400 !important; color: var(--be-muted) !important; }
#billing-reference-exact .be-document-caption { position: relative; margin-top: 3px; font-size: 11px; color: var(--be-muted); font-weight: 400; }
#billing-reference-exact .be-document-caption > summary { list-style: none; cursor: pointer; text-transform: capitalize; font-size: 11px !important; line-height: 14px !important; font-weight: 400 !important; }
#billing-reference-exact .be-document-caption > summary::-webkit-details-marker { display: none; }
#billing-reference-exact .be-document-caption[open] > :not(summary) { display: block; margin-top: 6px; padding: 8px; border: 1px solid #e5e5ea; border-radius: 6px; background: var(--bd-surface); }
#billing-reference-exact .be-cc > .ref-kpi-strip,
#billing-reference-exact .be-kpis .ref-kpi-strip {
  display: grid !important; grid-auto-flow: unset !important; gap: 24px !important;
  border: 0 !important; padding: 0 !important; margin: 0 0 22px !important; background: none !important;
}
#billing-reference-exact .be-cc > .ref-kpi-strip { grid-template-columns: repeat(3,minmax(0,1fr)) !important; max-width: 640px !important; }
#billing-reference-exact .be-cc table thead tr > th:last-child { font-size: 0 !important; padding-left: 0 !important; padding-right: 0 !important; }
#billing-reference-exact .be-cc table thead tr > th:last-child::after { content: none !important; }
#billing-reference-exact .be-cc table .ps-primary > .ps-main { color: var(--be-red) !important; font-weight: 500 !important; }
#billing-reference-exact .be-kpis .ref-kpi-strip { grid-template-columns: repeat(4,minmax(0,1fr)) !important; }
#billing-reference-exact :is(.be-cc,.be-kpis) .ref-kpi-strip > * {
  align-items: flex-start !important; text-align: left !important; padding: 0 !important; border: 0 !important; background: none !important; gap: 4px !important;
}
#billing-reference-exact :is(.be-cc,.be-kpis) .ref-kpi-strip p { text-align: left !important; margin: 0 !important; }
#billing-reference-exact :is(.be-cc,.be-kpis) .ref-kpi-strip .text-2xl,
#billing-reference-exact .be-cc .ref-kpi-strip .text-xl { font-size: 20px !important; line-height: 26px !important; font-weight: 600 !important; }
#billing-reference-exact .bd-report-bar { margin: 0 0 22px !important; padding: 0 !important; min-height: 32px !important; gap: 16px !important; }
#billing-reference-exact .bd-seg[role=tablist] { border-radius: 6px !important; background: #f4f4f5 !important; padding: 3px !important; gap: 0 !important; border: 0 !important; }
#billing-reference-exact .bd-seg[role=tablist] > button { height: 26px !important; padding: 0 10px !important; margin: 0 !important; border: 0 !important; font-size: 11px !important; border-radius: 4px !important; }
#billing-reference-exact .bd-seg[role=tablist] > button[aria-selected=true] { background: var(--bd-surface) !important; color: var(--be-text) !important; box-shadow: 0 1px 2px #00000010 !important; }
#billing-reference-exact .bd-cc-meta { margin: 0 0 10px !important; font-size: 11px !important; }
#billing-reference-exact .bd-report-group .ps-fullcell { padding: 12px 0 5px !important; border: 0 !important; }
#billing-reference-exact .bd-report-group .bd-group-line > div { gap: 8px !important; }
#billing-reference-exact .bd-report-group .bd-group-line > div > span { font-size: 12px !important; line-height: 16px !important; font-weight: 500 !important; }
#billing-reference-exact .bd-group-balance { font-size: 10px !important; color: var(--be-muted) !important; }
#billing-reference-exact .bd-subtotals { font-size: 11px !important; font-weight: 400 !important; }
#billing-reference-exact .bd-receipt-heading strong { font-size: 20px !important; line-height: 26px !important; }
#billing-reference-exact .bd-receipt-total { font-size: 11px !important; }
#billing-reference-exact .bd-health { padding: 0 0 18px !important; margin-bottom: 22px !important; }
#billing-reference-exact .bd-problem { gap: 10px !important; margin-bottom: 10px !important; }
#billing-reference-exact .bd-ptitle { font-size: 12px !important; line-height: 16px !important; font-weight: 600 !important; }
#billing-reference-exact .bd-inorder { font-size: 11px !important; }
#billing-reference-exact .bd-two { gap: 40px !important; margin-top: 24px !important; }
#billing-reference-exact .bd-kv { padding: 10px 0 !important; font-size: 12px !important; }
#billing-reference-exact .bd-agerow { font-size: 12px !important; padding: 10px 0 !important; gap: 10px !important; }
#billing-reference-exact .bd-cs-board { padding: 0 !important; margin-bottom: 18px !important; }
#billing-reference-exact .bd-cs-board .bd-fig-xl { font-size: 20px !important; }
#billing-reference-exact .bd-cs-list-heading { font-size: 11px !important; padding: 10px 0 !important; }
#billing-reference-exact .bd-cs-resident > summary { padding: 12px 0 !important; }
#billing-reference-exact .bd-cs-summary-content > div:first-child p { font-size: 13px !important; line-height: 16px !important; font-weight: 600 !important; }
#billing-reference-exact .bd-cs-summary-content > .text-right p:not(.sr-only) { font-size: 13px !important; line-height: 16px !important; }
#billing-reference-exact .bd-cs-invoice-table { min-width: 1000px; }
/* Content is separated by space and row rules, never by nested decorative cards.
   Dialogs, menus, filters and form controls keep their functional boundaries. */
#billing-reference-exact .be-page :is(
  .rp-ledger-surface, .rp-ledger-grid, .ref-table-card, .ref-kpi-strip,
  [data-bd="surface"], [data-bd="panel"], [data-bd="kpis"],
  .bd-health, .bd-cs-board
) {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
#billing-reference-exact .be-page :is(.ref-kpi-strip,[data-bd="kpis"]) > * {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  min-height: 0 !important;
}
#billing-reference-exact .be-identity-table col.ps-col-date { width: 76px !important; }
#billing-reference-exact .be-identity-table col.ps-col-text { width: 145px !important; }
#billing-reference-exact .be-identity-table col.ps-col-text:nth-child(3) { width: 174px !important; }
#billing-reference-exact .be-identity-table col.ps-col-primary { width: auto !important; }
#billing-reference-exact .be-identity-table col.ps-col-status { width: 92px !important; }
#billing-reference-exact .be-identity-table col.ps-col-num { width: 130px !important; }
#billing-reference-exact .be-identity-table col.ps-col-actions { width: 28px !important; }
#billing-reference-exact .be-identity-table :is(th,td).ps-c { vertical-align: top !important; }
#billing-reference-exact .be-identity-table tbody > tr > td.ps-c { padding-top: 16px !important; padding-bottom: 16px !important; }
#billing-reference-exact .be-identity-table td.ps-primary > p,
#billing-reference-exact .be-identity-table td.ps-primary > .ps-main > p,
#billing-reference-exact .be-identity-table td.be-responsible > p:first-child {
  font-size: 14px !important; line-height: 19px !important;
  font-weight: 500 !important; white-space: normal !important;
  overflow-wrap: anywhere;
}
#billing-reference-exact .be-identity-table td.be-responsible > p + p {
  font-size: 11px !important; line-height: 15px !important;
  margin-top: 3px; color: var(--be-muted) !important;
}
#billing-reference-exact .be-identity-table .ps-sub.be-due { font-size: 10px !important; line-height: 15px !important; color: var(--be-muted) !important; margin-top: 4px; }
#billing-reference-exact .be-identity-table .ps-sub.be-due::before { content: "Vto. "; }
#billing-reference-exact .be-identity-table .ps-sub.be-due :is(span,p) { font-size: 10px !important; }
#billing-reference-exact .be-identity-table td.ps-num { font-size: 13px !important; font-weight: 600 !important; }
/* Account history uses the same resident disclosure rhythm as debt composition. */
#billing-reference-exact .be-history { width: 100%; max-width: 920px; overflow-x: auto; }
#billing-reference-exact :is(.be-history-heading,.be-history-resident > summary) {
  display: grid; grid-template-columns: minmax(170px,1fr) 82px 120px 120px 130px 28px;
  align-items: center; gap: 14px; min-width: 800px;
}
#billing-reference-exact .be-history-heading {
  padding: 10px 0; font-size: 11px; color: var(--be-muted); border-bottom: 1px solid var(--be-line);
}
#billing-reference-exact .be-history-heading > span:nth-child(n+3) { text-align: right; }
#billing-reference-exact .be-history-resident { border-bottom: 1px solid var(--be-line); }
#billing-reference-exact .be-history-resident > summary { padding: 16px 0; list-style: none; cursor: pointer; }
#billing-reference-exact .be-history-resident > summary::-webkit-details-marker { display: none; }
#billing-reference-exact .be-history-person { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
#billing-reference-exact .be-history-person strong { font-size: 14px; line-height: 19px; font-weight: 500; }
#billing-reference-exact .be-history-person > span,
#billing-reference-exact .be-history-count { color: var(--be-muted); font-size: 11px; line-height: 16px; }
#billing-reference-exact .be-history-money { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; line-height: 18px; }
#billing-reference-exact .be-history-balance { font-weight: 600; color: var(--be-text) !important; }
#billing-reference-exact .be-history-chevron { text-align: center; color: var(--be-muted); font-size: 20px; }
#billing-reference-exact .be-history-resident[open] > summary .be-history-chevron { transform: rotate(90deg); }
#billing-reference-exact .be-history-resident > summary:focus-visible { outline: 2px solid var(--be-red); outline-offset: -2px; }
#billing-reference-exact .be-history-detail { padding: 0 0 16px; }
#billing-reference-exact .be-history-caption { color: var(--be-muted); font-size: 11px; line-height: 16px; margin: 0 0 10px; }
#billing-reference-exact .be-history-table col.ps-col-date { width: 76px !important; }
#billing-reference-exact .be-history-table col.ps-col-text { width: 160px !important; }
#billing-reference-exact .be-history-table col.ps-col-num { width: 120px !important; }
#billing-reference-exact .be-history-table col.ps-col-num:nth-last-child(2) { width: 130px !important; }
#billing-reference-exact .be-history-table col.ps-col-actions { width: 28px !important; }
#billing-reference-exact .be-history-table :is(th,td).ps-c { vertical-align: top !important; }
#billing-reference-exact .be-history-table .ps-sub { font-size: 11px !important; line-height: 15px !important; margin-top: 3px; }
#billing-reference-exact .be-history-table .ps-sub > span { background: transparent !important; padding: 0 !important; border: 0 !important; }
#billing-reference-exact .be-history-table .ps-sub.be-due::before { content: "Vto. "; }
#billing-reference-exact .be-history-totals {
  display: grid; grid-template-columns: minmax(266px,1fr) 120px 120px 130px 28px;
  gap: 14px; align-items: baseline; min-width: 800px; padding: 14px 0;
}
#billing-reference-exact .be-history-totals > span { font-size: 12px !important; color: var(--be-text) !important; }
#billing-reference-exact .be-receipts-table thead th { white-space: normal !important; }
#billing-reference-exact .be-receipts-table td.ps-text { vertical-align: top !important; }
#billing-reference-exact .be-receipts-table td.ps-text > .ps-main { font-size: 12px !important; font-weight: 500 !important; }
#billing-reference-exact .be-receipts-table .ps-sub { font-size: 11px !important; line-height: 15px !important; margin-top: 3px; }
#billing-reference-exact .be-receipts-table .ps-sub > span { background: transparent !important; border: 0 !important; padding: 0 !important; font-size: 11px !important; }
#billing-reference-exact .be-receipts-table :is(tfoot,tfoot tr,tfoot td) { background: transparent !important; }

/* Facturas follows Recibos' three-line document rhythm, without changing data.
   Condición repeats paymentMethod already visible in the document caption. */
#billing-reference-exact .be-invoices-view col.ps-col-text:nth-child(4) { width: 198px !important; }
#billing-reference-exact .be-invoices-view td.ps-text { vertical-align: top !important; }
#billing-reference-exact .be-invoices-view td.ps-text > .ps-main { font-size: 12px !important; font-weight: 500 !important; }
#billing-reference-exact .be-invoices-view .ps-sub { font-size: 11px !important; line-height: 15px !important; margin-top: 3px; }
#billing-reference-exact .be-invoices-view .be-invoice-condition { display: none !important; }
#billing-reference-exact .be-invoices-view .be-document-caption { margin-top: 3px; }
#billing-reference-exact .be-invoices-view .be-document-caption > summary { line-height: 15px !important; }
@media(max-width:767px) {
  #billing-reference-exact > .be-page { padding: 20px 16px 32px !important; }
  #billing-reference-exact .be-header { flex-wrap: wrap !important; }
  #billing-reference-exact .be-tabs { overflow-x: auto !important; }
  #billing-reference-exact .bd-figs { gap: 24px !important; flex-wrap: wrap !important; }
  #billing-reference-exact .be-kpis .ref-kpi-strip { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
  #billing-reference-exact .ps-table-scroll { overflow-x: auto !important; }
  #billing-reference-exact table.ps-table { min-width: 740px !important; }
  #billing-reference-exact .bd-cs-residents { overflow-x: auto !important; }
  #billing-reference-exact .bd-cs-list-heading, #billing-reference-exact .bd-cs-resident { min-width: 740px; }
}
