/*
PAC Control Tower — B4F Contrast Canary R2R3
TARGETED LATE-LOAD CONTRAST RECOVERY
NO LAYOUT / NO CALLBACK / NO ID / NO BUSINESS LOGIC CHANGES

Forensic root cause:
- B4F foundation file is valid and served, but several legacy/HF6 files sort after it.
- Light workspace layers make some containers white/transparent.
- Older component-specific rules keep white/cyan foregrounds.
- Result: white-on-light page headings and KPI/status values.
*/

:root {
  --pac-b4f-r2r3-text: #101828;
  --pac-b4f-r2r3-muted: #475467;
  --pac-b4f-r2r3-border: #DCE3EC;
  --pac-b4f-r2r3-surface: #FFFFFF;
  --pac-b4f-r2r3-danger: #B42318;
  --pac-b4f-r2r3-warning: #B45309;
  --pac-b4f-r2r3-success: #15803D;
}

/* -------------------------------------------------------------------------
   P0-1 / P0-3 / P0-5 — page titles on light workspace
   ------------------------------------------------------------------------- */

body .pac-page-panel .page-title-row,
body .pac-page-panel .ds-page-header {
  color: var(--pac-b4f-r2r3-text) !important;
  text-shadow: none !important;
}

body .pac-page-panel .page-title-row h1,
body .pac-page-panel .page-title-row h2,
body .pac-page-panel .page-title-row h3,
body .pac-page-panel .ds-page-header h1,
body .pac-page-panel .ds-page-header h2,
body .pac-page-panel .ds-page-header h3,
body .pac-page-panel .page-title,
body .pac-page-panel h1.page-title,
body .pac-page-panel h2.page-title {
  color: var(--pac-b4f-r2r3-text) !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

body .pac-page-panel .page-title-row p,
body .pac-page-panel .ds-page-header p {
  color: var(--pac-b4f-r2r3-muted) !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

/* Tariff page has its own title wrapper and later legacy rules. */
body .pac-page-panel .v1733-tariff-title {
  color: var(--pac-b4f-r2r3-text) !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

body .pac-page-panel .v1733-tariff-title h1,
body .pac-page-panel .v1733-tariff-title h2,
body .pac-page-panel .v1733-tariff-title h3,
body .pac-page-panel .v1733-tariff-title strong {
  color: var(--pac-b4f-r2r3-text) !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

body .pac-page-panel .v1733-tariff-title p {
  color: var(--pac-b4f-r2r3-muted) !important;
  opacity: 1 !important;
}

/* -------------------------------------------------------------------------
   P0-2 — Principal executive status on light workspace
   Legacy v1726 kept white/cyan text while later HF6 made cards light.
   ------------------------------------------------------------------------- */

body .pac-page-panel .executive-status-card {
  background: var(--pac-b4f-r2r3-surface) !important;
  background-image: none !important;
  color: var(--pac-b4f-r2r3-text) !important;
  border-color: var(--pac-b4f-r2r3-border) !important;
  text-shadow: none !important;
}

body .pac-page-panel .executive-status-label {
  color: #667085 !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

body .pac-page-panel .executive-status-value {
  color: var(--pac-b4f-r2r3-text) !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

body .pac-page-panel .executive-status-card.red .executive-status-value,
body .pac-page-panel .executive-status-card.danger .executive-status-value {
  color: var(--pac-b4f-r2r3-danger) !important;
}

body .pac-page-panel .executive-status-card.amber .executive-status-value,
body .pac-page-panel .executive-status-card.warning .executive-status-value {
  color: var(--pac-b4f-r2r3-warning) !important;
}

body .pac-page-panel .executive-status-card.green .executive-status-value,
body .pac-page-panel .executive-status-card.ok .executive-status-value {
  color: var(--pac-b4f-r2r3-success) !important;
}

body .pac-page-panel .executive-status-reason {
  color: var(--pac-b4f-r2r3-muted) !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

/* -------------------------------------------------------------------------
   P0-4 — Control Operativo KPI contrast
   Restrict to the known operations KPI container.
   Normalize the card surface so legacy white foreground cannot sit on white.
   ------------------------------------------------------------------------- */

body .pac-page-panel .v100-operations-shell #v100-operations-kpis > div,
body .pac-page-panel #v100-operations-kpis > div {
  background: var(--pac-b4f-r2r3-surface) !important;
  background-image: none !important;
  color: var(--pac-b4f-r2r3-text) !important;
  border-color: var(--pac-b4f-r2r3-border) !important;
  text-shadow: none !important;
}

body .pac-page-panel .v100-operations-shell #v100-operations-kpis > div h1,
body .pac-page-panel .v100-operations-shell #v100-operations-kpis > div h2,
body .pac-page-panel .v100-operations-shell #v100-operations-kpis > div h3,
body .pac-page-panel .v100-operations-shell #v100-operations-kpis > div strong,
body .pac-page-panel .v100-operations-shell #v100-operations-kpis > div span,
body .pac-page-panel .v100-operations-shell #v100-operations-kpis > div p,
body .pac-page-panel #v100-operations-kpis > div h1,
body .pac-page-panel #v100-operations-kpis > div h2,
body .pac-page-panel #v100-operations-kpis > div h3,
body .pac-page-panel #v100-operations-kpis > div strong,
body .pac-page-panel #v100-operations-kpis > div span,
body .pac-page-panel #v100-operations-kpis > div p {
  color: var(--pac-b4f-r2r3-text) !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

/* Keep explicit semantic status pills/badges readable. */
body .pac-page-panel #v100-operations-kpis .red,
body .pac-page-panel #v100-operations-kpis .danger,
body .pac-page-panel #v100-operations-kpis .status-red {
  color: var(--pac-b4f-r2r3-danger) !important;
}

body .pac-page-panel #v100-operations-kpis .yellow,
body .pac-page-panel #v100-operations-kpis .amber,
body .pac-page-panel #v100-operations-kpis .warning,
body .pac-page-panel #v100-operations-kpis .status-warn {
  color: var(--pac-b4f-r2r3-warning) !important;
}

body .pac-page-panel #v100-operations-kpis .green,
body .pac-page-panel #v100-operations-kpis .success,
body .pac-page-panel #v100-operations-kpis .status-ok {
  color: var(--pac-b4f-r2r3-success) !important;
}

/* Safety:
   - no display:none
   - no geometry/grid/flex changes
   - no selectors that alter Dash callback IDs or component structure
   - no table business conditional colors
*/
