/* CBP unified operational palette. Color only: do not change approved layouts.
   Screen scope intentionally leaves invoices/PDF print output untouched. */
@media screen {
  html:root {
    --cbp-primary: #4f46e5; --cbp-primary-hover: #4338ca; --cbp-link: #4338ca;
    --cbp-bg: #f5f6fc; --cbp-surface: #ffffff; --cbp-soft: #f0f3fb;
    --cbp-ink: #24324b; --cbp-muted: #53627c; --cbp-line: #dce3f0;
    --cbp-selected: #eeedff; --cbp-focus: #7770ed; --cbp-track: #dbe2f2;
    --cbp-info-bg: #eef2ff; --cbp-info-ink: #3730a3;
    --cbp-good-bg: #e9f8f1; --cbp-good-ink: #12644f;
    --cbp-warn-bg: #fff5dc; --cbp-warn-ink: #92400e;
    --cbp-danger-bg: #fff0f2; --cbp-danger-ink: #a11d38;
    --cbp-purple-bg: #f3edff; --cbp-purple-ink: #6b21a8;
    --cbp-gray-bg: #edf1f7; --cbp-gray-ink: #475569;
    --erp-brand: var(--cbp-primary);
  }
  html[data-bs-theme="dark"] {
    --cbp-link: #b9b7ff; --cbp-bg: #11182b; --cbp-surface: #1b2740;
    --cbp-soft: #222f4a; --cbp-ink: #f0f4fc; --cbp-muted: #bcc9df;
    --cbp-line: #425372; --cbp-selected: #302e57; --cbp-focus: #bbb7ff; --cbp-track: #3c4c6e;
    --cbp-info-bg: #302e57; --cbp-info-ink: #c5c2ff;
    --cbp-good-bg: #183e38; --cbp-good-ink: #9ce8ce;
    --cbp-warn-bg: #43351f; --cbp-warn-ink: #ffe0a0;
    --cbp-danger-bg: #4a2537; --cbp-danger-ink: #ffb8c8;
    --cbp-purple-bg: #3c2c56; --cbp-purple-ink: #e0b9ff;
    --cbp-gray-bg: #30415d; --cbp-gray-ink: #d8e2f3;
  }
  html:root body {
    --tblr-primary: var(--cbp-primary); --tblr-primary-rgb: 79,70,229;
    --tblr-primary-lt: var(--cbp-info-bg); --tblr-primary-lt-fg: var(--cbp-info-ink);
    --tblr-link-color: var(--cbp-link); --tblr-link-hover-color: var(--cbp-link);
    --tblr-body-bg: var(--cbp-bg); --tblr-body-color: var(--cbp-ink);
    --tblr-secondary: var(--cbp-muted); --tblr-border-color: var(--cbp-line);
    --tblr-bg-surface: var(--cbp-surface); --tblr-bg-surface-secondary: var(--cbp-soft);
    --tblr-bg-surface-tertiary: var(--cbp-soft);
    background-color: var(--cbp-bg); color: var(--cbp-ink);
  }
  html:root body :is(.case-inbox-page, .case-detail-page, .case-studio-page, .case-form-page, .workflow-workspace, .todo-workspace, .invoice-workspace) {
    --case-ink: var(--cbp-ink); --case-muted: var(--cbp-muted); --case-surface: var(--cbp-surface);
    --case-soft: var(--cbp-soft); --case-line: var(--cbp-line);
    --wf-ink: var(--cbp-ink); --wf-muted: var(--cbp-muted); --wf-surface: var(--cbp-surface);
    --wf-soft: var(--cbp-soft); --wf-line: var(--cbp-line); --wf-accent: var(--cbp-link); --wf-selected: var(--cbp-selected);
    --todo-ink: var(--cbp-ink); --todo-muted: var(--cbp-muted); --todo-bg: var(--cbp-surface);
    --todo-soft: var(--cbp-soft); --todo-line: var(--cbp-line);
    --inv-ink: var(--cbp-ink); --inv-muted: var(--cbp-muted); --inv-bg: var(--cbp-surface);
    --inv-soft: var(--cbp-soft); --inv-line: var(--cbp-line);
    --console-text: var(--cbp-ink); --console-muted: var(--cbp-muted); --console-bg: var(--cbp-bg);
    --console-surface: var(--cbp-surface); --console-surface-2: var(--cbp-soft); --console-line: var(--cbp-line);
    --console-blue: var(--cbp-link);
  }
  html:root body .navbar { background: var(--cbp-surface); border-color: var(--cbp-line); }
  html:root body .navbar-brand .erp-brand-text { color: var(--cbp-link); }
  html:root body .navbar .nav-link { color: var(--cbp-muted); }
  html:root body .navbar .nav-item.active > .nav-link,
  html:root body .navbar .nav-link.active { color: var(--cbp-link) !important; }
  html:root body .navbar .nav-item.active > .erp-nav-split .nav-link { color: var(--cbp-link) !important; }
  html:root body .navbar .nav-item.active::after { border-color: var(--cbp-primary); background: var(--cbp-primary); }
  html:root body .erp-header-health { background: var(--cbp-danger-bg); color: var(--cbp-danger-ink); border-color: #bd5167; }
  html:root body .erp-header-health[data-state="online"] { background: var(--cbp-good-bg); color: var(--cbp-good-ink); border-color: #49a587; }
  html:root body .erp-header-health[data-state="pending"] { background: var(--cbp-warn-bg); color: var(--cbp-warn-ink); border-color: #c48829; }
  html:root body .erp-header-health[data-state="checking"] { background: var(--cbp-gray-bg); color: var(--cbp-gray-ink); border-color: var(--cbp-line); }
  html:root body .page-header { background: var(--cbp-soft); border-color: var(--cbp-line); }
  html:root body .page-pretitle { color: var(--cbp-link); }
  html:root body .page-title { color: var(--cbp-ink); }
  html:root body .footer { background: var(--cbp-soft); border-color: var(--cbp-line); color: var(--cbp-muted); }
  html:root body .card { background-color: var(--cbp-surface); border-color: var(--cbp-line); color: var(--cbp-ink); }
  html:root body .card-header, html:root body .card-footer { background-color: var(--cbp-soft); border-color: var(--cbp-line); }
  html:root body .card-title { color: var(--cbp-ink); }
  html:root body .dropdown-menu, html:root body .modal-content { background: var(--cbp-surface); border-color: var(--cbp-line); color: var(--cbp-ink); }
  html:root body .dropdown-item { color: var(--cbp-ink); }
  html:root body .dropdown-item:hover, html:root body .dropdown-item:focus { background: var(--cbp-selected); color: var(--cbp-link); }
  html:root body .report-open-button { background: var(--cbp-selected); color: var(--cbp-link); border-color: var(--cbp-line); }
  html:root body .report-open-button:hover { background: var(--cbp-info-bg); color: var(--cbp-info-ink); border-color: var(--cbp-focus); }
  html:root body .btn-primary {
    --tblr-btn-bg: var(--cbp-primary); --tblr-btn-border-color: var(--cbp-primary);
    --tblr-btn-hover-bg: var(--cbp-primary-hover); --tblr-btn-hover-border-color: var(--cbp-primary-hover);
    --tblr-btn-active-bg: var(--cbp-primary-hover); --tblr-btn-active-border-color: var(--cbp-primary-hover);
    color: #fff !important; background: var(--cbp-primary) !important; border-color: var(--cbp-primary) !important;
    box-shadow: 0 2px 6px #4f46e51a;
  }
  html:root body .btn-primary:hover, html:root body .btn-primary:active { background: var(--cbp-primary-hover) !important; border-color: var(--cbp-primary-hover) !important; }
  html:root body :is(.btn-outline-primary, .btn-outline-azure) { color: var(--cbp-link) !important; border-color: var(--cbp-focus); background: transparent; }
  html:root body :is(.btn-outline-primary, .btn-outline-azure):hover { color: var(--cbp-link) !important; background: var(--cbp-selected); }
  html:root body .btn-outline-secondary { color: var(--cbp-muted) !important; border-color: var(--cbp-line); background: var(--cbp-surface); }
  html:root body .btn-success { color: white !important; background: #0f766e; border-color: #0f766e; }
  html:root body .btn-success:hover { background: #115e59; border-color: #115e59; }
  html:root body :is(.btn-warning, .btn-orange) { color: white !important; background: #b45309 !important; border-color: #b45309; }
  html:root body :is(.btn-warning, .btn-orange):hover { background: #92400e !important; border-color: #92400e; }
  html:root body .btn-danger { color: white !important; background: #b42343 !important; border-color: #b42343; }
  html:root body .btn-danger:hover { background: #941b36 !important; border-color: #941b36; }
  html:root body :is(.btn-outline-success, .btn-outline-green, .btn-outline-teal) { color: var(--cbp-good-ink) !important; background: transparent; border-color: #49a587; }
  html:root body :is(.btn-outline-success, .btn-outline-green, .btn-outline-teal):hover { background: var(--cbp-good-bg); }
  html:root body :is(.btn-outline-warning, .btn-outline-orange, .btn-outline-yellow) { color: var(--cbp-warn-ink) !important; background: transparent; border-color: #c48829; }
  html:root body :is(.btn-outline-warning, .btn-outline-orange, .btn-outline-yellow):hover { background: var(--cbp-warn-bg); }
  html:root body :is(.btn-outline-danger, .btn-outline-red),
  html:root body :is(.workflow-workspace, .case-detail-page, .case-inbox-page, .todo-workspace, .invoice-workspace) :is(.btn-outline-danger, .btn-outline-red) { color: var(--cbp-danger-ink) !important; background: transparent; border-color: #bd5167; }
  html:root body :is(.btn-outline-danger, .btn-outline-red):hover { background: var(--cbp-danger-bg); }
  html:root body .form-control, html:root body .form-select {
    color: var(--cbp-ink); background-color: var(--cbp-surface); border-color: var(--cbp-line);
  }
  html:root body .form-control::placeholder { color: var(--cbp-muted); opacity: 1; }
  html:root body .form-control:focus, html:root body .form-select:focus {
    border-color: var(--cbp-focus); box-shadow: 0 0 0 3px #7770ed26;
  }
  html:root body .form-check-input:checked { background-color: var(--cbp-primary); border-color: var(--cbp-primary); }
  html:root body .table { --tblr-table-color: var(--cbp-ink); --tblr-table-border-color: var(--cbp-line); }
  html:root body .table thead th { background-color: var(--cbp-soft); color: var(--cbp-muted); }
  html:root body .table-hover tbody tr:hover { background-color: var(--cbp-selected); }
  html:root body .progress { background: var(--cbp-track); }
  html:root body .progress-bar:not([class*="bg-"]) { background: linear-gradient(90deg, #4f46e5, #087f8c); }
  html:root body .text-primary { color: var(--cbp-link) !important; }
  html:root body .text-secondary { color: var(--cbp-muted) !important; }
  html:root body :is(.workflow-workspace, .case-detail-page, .case-inbox-page, .todo-workspace, .invoice-workspace) .text-primary { color: var(--cbp-link) !important; }
  html:root body :is(.workflow-workspace, .case-detail-page, .case-inbox-page, .todo-workspace, .invoice-workspace) .text-secondary { color: var(--cbp-muted) !important; }
  html:root body .alert-info { color: var(--cbp-info-ink); background: var(--cbp-info-bg); border-color: var(--cbp-line); }
  html:root body .alert-success { color: var(--cbp-good-ink); background: var(--cbp-good-bg); border-color: #49a58766; }
  html:root body .alert-warning { color: var(--cbp-warn-ink); background: var(--cbp-warn-bg); border-color: #c4882966; }
  html:root body .alert-danger { color: var(--cbp-danger-ink); background: var(--cbp-danger-bg); border-color: #bd516766; }
  html:root body :is(.case-inbox-page, .case-detail-page).page-body { background: var(--cbp-bg); }
  html:root body .case-inbox-page .case-register,
  html:root body .case-inbox-page .case-inbox__controls,
  html:root body .case-inbox-page .case-inbox__card-toolbar,
  html:root body .case-inbox-page .case-card { background: var(--cbp-surface); color: var(--cbp-ink); border-color: var(--cbp-line) !important; }
  html:root body .case-inbox-page .case-inbox__list { background: var(--cbp-bg); }
  html:root body .case-inbox-page .case-inbox__status-nav,
  html:root body .case-inbox-page .case-inbox__summary { background: var(--cbp-soft); border-color: var(--cbp-line); }
  html:root body .case-inbox-page .case-inbox__header h3, html:root body .case-inbox-page .case-inbox__summary strong { color: var(--cbp-ink); }
  html:root body .case-inbox-page .case-inbox__status-nav a { color: var(--cbp-muted); }
  html:root body .case-inbox-page .case-inbox__status-nav a strong { background: var(--cbp-gray-bg); color: var(--cbp-gray-ink); }
  html:root body .case-inbox-page .case-inbox__status-nav a.is-active { color: white !important; background: var(--cbp-primary); }
  html:root body .case-inbox-page .case-inbox__status-nav a.is-active strong { background: #fff; color: #3730a3 !important; }
  html:root body .case-inbox-page .case-inbox__search-field .form-control { color: var(--cbp-ink) !important; background: var(--cbp-surface) !important; border-color: var(--cbp-line) !important; }
  html:root body .case-inbox-page .case-inbox__search-field .form-control::placeholder { color: var(--cbp-muted) !important; }
  html:root body .case-inbox-page :is(.case-card__head, .case-card__foot, .case-card__targets, .case-inbox__header) { border-color: var(--cbp-line); }
  html:root body .case-inbox-page .case-card__head { background: linear-gradient(110deg, var(--cbp-selected), var(--cbp-surface) 85%); }
  html:root body .case-inbox-page .case-card:hover { border-color: var(--cbp-focus) !important; }
  html:root body .case-inbox-page :is(.case-card__identity h3 a, .case-card__services, .case-card__inspect, .case-inbox__card-toolbar a) { color: var(--cbp-link); }
  html:root body .case-inbox-page :is(.case-card__unit, .case-card__client, .case-card__number, .case-card__service-count, .case-inbox__eyebrow, .case-inbox__load, .case-inbox__card-toolbar) { color: var(--cbp-muted); }
  html:root body .case-inbox-page :is(.case-card__target-date, .case-card__targets li, .case-card__targets li strong, .case-card__section-label strong) { color: var(--cbp-ink); }
  html:root body .case-inbox-page .case-card__progress { background: var(--cbp-track); }
  html:root body .case-inbox-page .case-card__progress .progress-bar { background: linear-gradient(90deg, #4f46e5, #087f8c); }
  html:root body .case-detail-page .case-cockpit-tabs button.is-active,
  html:root body .invoice-workspace .invoice-tabs button.is-active { background: var(--cbp-primary); color: white !important; }
  html:root body .workflow-workspace .wf-route-step.is-active .wf-route-number { background: var(--cbp-primary); border-color: var(--cbp-primary); }
  html:root body .workflow-workspace .wf-part-tabs button[aria-selected="true"] { border-color: var(--cbp-primary); }
  html:root body .bg-blue-lt,
  html:root body :is(.workflow-workspace, .case-detail-page, .case-inbox-page, .todo-workspace, .invoice-workspace) .badge.bg-blue-lt,
  html:root body .bg-azure-lt,
  html:root body :is(.workflow-workspace, .case-detail-page, .case-inbox-page, .todo-workspace, .invoice-workspace) .badge.bg-azure-lt,
  html:root body .bg-primary-lt,
  html:root body :is(.workflow-workspace, .case-detail-page, .case-inbox-page, .todo-workspace, .invoice-workspace) .badge.bg-primary-lt,
  html:root body .bg-cyan-lt,
  html:root body :is(.workflow-workspace, .case-detail-page, .case-inbox-page, .todo-workspace, .invoice-workspace) .badge.bg-cyan-lt { background: var(--cbp-info-bg) !important; color: var(--cbp-info-ink) !important; }
  html:root body .bg-green-lt,
  html:root body :is(.workflow-workspace, .case-detail-page, .case-inbox-page, .todo-workspace, .invoice-workspace) .badge.bg-green-lt,
  html:root body .bg-success-lt,
  html:root body :is(.workflow-workspace, .case-detail-page, .case-inbox-page, .todo-workspace, .invoice-workspace) .badge.bg-success-lt,
  html:root body .bg-teal-lt,
  html:root body :is(.workflow-workspace, .case-detail-page, .case-inbox-page, .todo-workspace, .invoice-workspace) .badge.bg-teal-lt { background: var(--cbp-good-bg) !important; color: var(--cbp-good-ink) !important; }
  html:root body .bg-yellow-lt,
  html:root body :is(.workflow-workspace, .case-detail-page, .case-inbox-page, .todo-workspace, .invoice-workspace) .badge.bg-yellow-lt,
  html:root body .bg-orange-lt,
  html:root body :is(.workflow-workspace, .case-detail-page, .case-inbox-page, .todo-workspace, .invoice-workspace) .badge.bg-orange-lt,
  html:root body .bg-warning-lt,
  html:root body :is(.workflow-workspace, .case-detail-page, .case-inbox-page, .todo-workspace, .invoice-workspace) .badge.bg-warning-lt { background: var(--cbp-warn-bg) !important; color: var(--cbp-warn-ink) !important; }
  html:root body .bg-red-lt,
  html:root body :is(.workflow-workspace, .case-detail-page, .case-inbox-page, .todo-workspace, .invoice-workspace) .badge.bg-red-lt,
  html:root body .bg-danger-lt,
  html:root body :is(.workflow-workspace, .case-detail-page, .case-inbox-page, .todo-workspace, .invoice-workspace) .badge.bg-danger-lt { background: var(--cbp-danger-bg) !important; color: var(--cbp-danger-ink) !important; }
  html:root body .bg-purple-lt,
  html:root body :is(.workflow-workspace, .case-detail-page, .case-inbox-page, .todo-workspace, .invoice-workspace) .badge.bg-purple-lt,
  html:root body .bg-indigo-lt,
  html:root body :is(.workflow-workspace, .case-detail-page, .case-inbox-page, .todo-workspace, .invoice-workspace) .badge.bg-indigo-lt { background: var(--cbp-purple-bg) !important; color: var(--cbp-purple-ink) !important; }
  html:root body .bg-secondary-lt,
  html:root body :is(.workflow-workspace, .case-detail-page, .case-inbox-page, .todo-workspace, .invoice-workspace) .badge.bg-secondary-lt { background: var(--cbp-gray-bg) !important; color: var(--cbp-gray-ink) !important; }
  html:root body .text-primary, html:root body .text-blue, html:root body .text-azure { color: var(--cbp-info-ink) !important; }
  html:root body .text-success, html:root body .text-green, html:root body .text-teal { color: var(--cbp-good-ink) !important; }
  html:root body .text-warning, html:root body .text-orange, html:root body .text-yellow { color: var(--cbp-warn-ink) !important; }
  html:root body .text-danger, html:root body .text-red { color: var(--cbp-danger-ink) !important; }
  html:root body .text-purple, html:root body .text-indigo { color: var(--cbp-purple-ink) !important; }
}
