/* SAM v1.3.5 — Business Board semantic contrast authority.
   Screen-only, page-scoped. No financial calculation or print/PDF selectors. */
@media screen {
  body.brv-ui-frontend .ipl-front-app.ipl-active-business_board .ipl-business-board {
    color:var(--sam-bb-text,#0f172a);
  }

  /* Light surfaces: keep labels/help readable without repainting semantic amounts. */
  body.brv-ui-frontend .ipl-front-app.ipl-active-business_board .ipl-business-board :is(
    .bb-front-title p,
    .bb-kpi-card small,
    .bb-kpi-card em,
    .bb-owner-card small,
    .bb-owner-card em,
    .bb-wallet-card small,
    .bb-wallet-card em,
    .bb-day-card em,
    .bb-formula-strip p,
    .bb-explain p,
    .bb-log p,
    .bb-insight-metric small,
    .bb-wallet-focus,
    .bb-wallet-selected-status,
    .bb-product-detail-small,
    .bb-product-adjust-note,
    .bb-clients-status,
    .bb-suppliers-status,
    .bb-party-pay-status,
    .bb-party-doc-status
  ) {
    color:var(--sam-bb-muted,#475569)!important;
    opacity:1!important;
    -webkit-text-fill-color:currentColor;
  }

  body.brv-ui-frontend .ipl-front-app.ipl-active-business_board .ipl-business-board :is(
    .bb-front-title h1,
    .bb-kpi-card strong,
    .bb-owner-card strong,
    .bb-wallet-card strong,
    .bb-line b,
    .bb-insight-metric strong
  ) {
    opacity:1!important;
    -webkit-text-fill-color:currentColor;
  }

  /* Dark Live Office Cash panels own their own foreground palette. */
  body.brv-ui-frontend .ipl-front-app.ipl-active-business_board .bb-live-office-cash {
    color:var(--sam-bb-dark-text,#fff)!important;
  }
  body.brv-ui-frontend .ipl-front-app.ipl-active-business_board .bb-live-office-cash .bb-live-office-heading b {
    color:var(--sam-bb-dark-heading,#fef08a)!important;
  }
  body.brv-ui-frontend .ipl-front-app.ipl-active-business_board .bb-live-office-cash .bb-live-office-heading span,
  body.brv-ui-frontend .ipl-front-app.ipl-active-business_board .bb-live-office-cash .bb-live-office-subline>span,
  body.brv-ui-frontend .ipl-front-app.ipl-active-business_board .bb-live-office-cash .bb-live-office-subline small {
    color:var(--sam-bb-dark-muted,#d1fae5)!important;
  }
  body.brv-ui-frontend .ipl-front-app.ipl-active-business_board .bb-live-office-cash .bb-live-office-heading em,
  body.brv-ui-frontend .ipl-front-app.ipl-active-business_board .bb-live-office-cash .bb-live-office-metric strong,
  body.brv-ui-frontend .ipl-front-app.ipl-active-business_board .bb-live-office-cash .bb-live-office-subline b {
    color:var(--sam-bb-dark-text,#fff)!important;
    opacity:1!important;
    -webkit-text-fill-color:var(--sam-bb-dark-text,#fff)!important;
  }
  body.brv-ui-frontend .ipl-front-app.ipl-active-business_board .bb-live-office-cash .bb-live-office-metric small {
    color:var(--sam-bb-dark-metric-muted,#ccfbf1)!important;
  }
  body.brv-ui-frontend .ipl-front-app.ipl-active-business_board .bb-live-office-cash .bb-live-office-metric em {
    color:var(--sam-bb-dark-muted,#d1fae5)!important;
  }
  body.brv-ui-frontend .ipl-front-app.ipl-active-business_board .bb-live-office-cash .bb-live-office-metric.out em,
  body.brv-ui-frontend .ipl-front-app.ipl-active-business_board .bb-live-office-cash .bb-live-office-subline .out b,
  body.brv-ui-frontend .ipl-front-app.ipl-active-business_board .bb-live-office-cash .bb-live-office-subline .other.negative b,
  body.brv-ui-frontend .ipl-front-app.ipl-active-business_board .bb-live-office-cash .bb-live-office-error {
    color:var(--sam-bb-dark-danger,#fef2f2)!important;
    -webkit-text-fill-color:var(--sam-bb-dark-danger,#fef2f2)!important;
  }
  body.brv-ui-frontend .ipl-front-app.ipl-active-business_board .bb-live-office-cash .bb-live-office-subline .md b {
    color:var(--sam-bb-dark-md,#fde047)!important;
    -webkit-text-fill-color:var(--sam-bb-dark-md,#fde047)!important;
  }

  /* Colored headers/actions must never inherit a dark theme foreground. */
  body.brv-ui-frontend .ipl-front-app.ipl-active-business_board :is(
    .bb-clients-head,.bb-suppliers-head,.bb-product-modal-head
  ),
  body.brv-ui-frontend .ipl-front-app.ipl-active-business_board :is(
    .bb-clients-head,.bb-suppliers-head,.bb-product-modal-head
  ) :is(h1,h2,h3,h4,strong,small,span) {
    color:var(--sam-bb-popup-text,#fff)!important;
    -webkit-text-fill-color:currentColor;
  }
  body.brv-ui-frontend .ipl-front-app.ipl-active-business_board :is(
    .bb-popup-pay-btn,.bb-popup-doc-btn,.bb-party-pay-save,.bb-product-adjust-save,
    .bb-clients-filters button,.bb-suppliers-filters button,.bb-product-adjust-btn,
    .bb-log-head button
  ) {
    color:var(--sam-bb-popup-text,#fff)!important;
    -webkit-text-fill-color:var(--sam-bb-popup-text,#fff)!important;
  }

  /* Neutral controls on white surfaces. */
  body.brv-ui-frontend .ipl-front-app.ipl-active-business_board :is(
    .bb-clients-filters,.bb-suppliers-filters,.bb-party-pay-body,.bb-product-adjust-form
  ) label {
    color:var(--sam-bb-control-label,#334155)!important;
    opacity:1!important;
  }
  body.brv-ui-frontend .ipl-front-app.ipl-active-business_board :is(
    .bb-clients-filters,.bb-suppliers-filters,.bb-party-pay-body,.bb-product-adjust-form
  ) :is(input,select,textarea) {
    color:var(--sam-bb-control-text,#0f172a)!important;
    background:#fff!important;
    -webkit-text-fill-color:var(--sam-bb-control-text,#0f172a)!important;
  }

  body.brv-ui-frontend .ipl-front-app.ipl-active-business_board .ipl-business-board {
    font-size:var(--sam-bb-font-size,13px);
  }
  body.brv-ui-frontend .ipl-front-app.ipl-active-business_board .ipl-business-board :is(small,.bb-front-title p,.bb-kpi-card small,.bb-kpi-card em,.bb-owner-card small,.bb-owner-card em,.bb-wallet-card small,.bb-wallet-card em,.bb-day-card em,.bb-formula-strip p,.bb-explain p,.bb-log p,.bb-insight-metric small,.bb-live-office-metric small,.bb-live-office-metric em) {
    font-size:var(--sam-bb-small-size,11px);
  }
}
