/* =========================================================================
   Brand theme for the shipping system pages: burgundy #7A2232, black, white.
   Added by the SaaS layer to the <head> of every HTML page (Saas\Guard). Its
   selectors are more specific than Bootstrap / assets/css/main.css, so it wins
   wherever those load, without editing the pages.
   Colours only — no layout, size or behaviour changes. Status colours
   (success / warning / info badges) keep their meaning.
   Switch off: saas/config.php 'theme.legacy_css' => null.
   ========================================================================= */

html:root, html[data-bs-theme] {
  /* assets/css/main.css */
  --primary-color: #7A2232;
  --secondary-color: #000000;
  --all-color: #7A2232;
  --all2-color: #5E1A27;
  --all-header-color: #4A1420;
  --text-color: #111111;          /* body text (was blue): black */
  --danger-color: #7A2232;

  /* Bootstrap 5.3 */
  --bs-primary: #7A2232;
  --bs-primary-rgb: 122, 34, 50;
  --bs-primary-text-emphasis: #31090F;
  --bs-primary-bg-subtle: #F4E4E6;
  --bs-primary-border-subtle: #DDB3B9;
  --bs-link-color: #7A2232;
  --bs-link-color-rgb: 122, 34, 50;
  --bs-link-hover-color: #4A1420;
  --bs-link-hover-color-rgb: 94, 26, 39;
  --bs-focus-ring-color: rgba(122, 34, 50, .25);
  --bs-dark: #000000;
  --bs-dark-rgb: 0, 0, 0;
}
html[data-bs-theme="dark"] {
  --text-color: #FDFDFD;
  --bs-primary-text-emphasis: #EDBCC2;
  --bs-primary-bg-subtle: #24090E;
  --bs-primary-border-subtle: #6A2A34;
  --bs-link-color: #E2A0A8;
  --bs-link-color-rgb: 226, 160, 168;
  --bs-link-hover-color: #EAB5BC;
  --bs-link-hover-color-rgb: 234, 181, 188;
  --bs-body-bg: #0A0A0A;
  --bs-body-bg-rgb: 10, 10, 10;
  --bs-tertiary-bg: #141414;
  --bs-secondary-bg: #1A1A1A;
}

html .btn-primary {
  --bs-btn-bg: #7A2232; --bs-btn-border-color: #7A2232;
  --bs-btn-hover-bg: #5E1A27; --bs-btn-hover-border-color: #5E1A27;
  --bs-btn-active-bg: #4A1420; --bs-btn-active-border-color: #4A1420;
  --bs-btn-disabled-bg: #7A2232; --bs-btn-disabled-border-color: #7A2232;
  --bs-btn-focus-shadow-rgb: 150, 75, 88; --bs-btn-color: #fff; --bs-btn-hover-color: #fff; --bs-btn-active-color: #fff;
}
html .btn-outline-primary {
  --bs-btn-color: #7A2232; --bs-btn-border-color: #7A2232;
  --bs-btn-hover-bg: #7A2232; --bs-btn-hover-border-color: #7A2232; --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: #7A2232; --bs-btn-active-border-color: #7A2232; --bs-btn-active-color: #fff;
  --bs-btn-disabled-color: #7A2232; --bs-btn-disabled-border-color: #7A2232; --bs-btn-focus-shadow-rgb: 122, 34, 50;
}
html .btn-dark { --bs-btn-bg: #000; --bs-btn-border-color: #000; --bs-btn-hover-bg: #1A1A1A; --bs-btn-hover-border-color: #1A1A1A; --bs-btn-active-bg: #262626; --bs-btn-active-border-color: #262626; }
html .btn-link { --bs-btn-color: var(--bs-link-color); --bs-btn-hover-color: var(--bs-link-hover-color); --bs-btn-active-color: var(--bs-link-hover-color); }

html .form-control:focus, html .form-select:focus { border-color: #BC8C93; box-shadow: 0 0 0 .25rem rgba(122, 34, 50, .25); }
html .form-check-input:focus { border-color: #BC8C93; box-shadow: 0 0 0 .25rem rgba(122, 34, 50, .25); }
html .form-check-input:checked { background-color: #7A2232; border-color: #7A2232; }
html .form-range::-webkit-slider-thumb { background-color: #7A2232; }
html .form-range::-moz-range-thumb { background-color: #7A2232; }

html .nav-pills { --bs-nav-pills-link-active-bg: #7A2232; }
html .pagination { --bs-pagination-active-bg: #7A2232; --bs-pagination-active-border-color: #7A2232; --bs-pagination-focus-box-shadow: 0 0 0 .25rem rgba(122, 34, 50, .25); }
html .progress, html .progress-stacked { --bs-progress-bar-bg: #7A2232; }
html .dropdown-menu { --bs-dropdown-link-active-bg: #7A2232; }
html .list-group { --bs-list-group-active-bg: #7A2232; --bs-list-group-active-border-color: #7A2232; }
html .accordion { --bs-accordion-active-color: #4A1420; --bs-accordion-active-bg: #F9F0F1; --bs-accordion-btn-focus-box-shadow: 0 0 0 .25rem rgba(122, 34, 50, .25); }
html .spinner-border.text-primary, html .spinner-grow.text-primary { color: #7A2232 !important; }

/* main.css fixed blues */
html:not([data-bs-theme="dark"]) body { background: linear-gradient(135deg, #F7F7F7 0%, #E2E2E2 100%); }
html .notification-badge { background: #7A2232; }

/* Select2 (used across the system) */
html .select2-container--default .select2-results__option--highlighted.select2-results__option--selectable { background-color: #7A2232; }
html .select2-container--default.select2-container--focus .select2-selection--multiple,
html .select2-container--open .select2-selection--single { border-color: #BC8C93; }

::selection { background: rgba(122, 34, 50, .22); }

/* Dark mode: main.css uses blue-tinted slate greys; same rules in neutral black / grey */
html[data-bs-theme="dark"] body { background: linear-gradient(135deg, #000000 0%, #141414 100%); }
html[data-bs-theme="dark"] .navbar { background: #0A0A0A; }
html[data-bs-theme="dark"] .notification-dropdown { background: #141414 !important; border-color: #262626; color: #EDEDED; }
html[data-bs-theme="dark"] .stat-card { background: #141414 !important; color: #EDEDED; }
html[data-bs-theme="dark"] .stat-label { color: #CFCFCF; }
html[data-bs-theme="dark"] .service-card, html[data-bs-theme="dark"] .activity-card, html[data-bs-theme="dark"] .table-container { background: #141414; color: #EDEDED; }
html[data-bs-theme="dark"] table thead th { background: #262626; color: #FFFFFF; }
html[data-bs-theme="dark"] .table-stats { background: #262626; }
html[data-bs-theme="dark"] .stat-item strong { color: #E2A0A8; }
html[data-bs-theme="dark"] .pagination-info { color: #CFCFCF; }
html[data-bs-theme="dark"] .toast-item { background: #141414; color: #EDEDED; }
html[data-bs-theme="dark"] .toast-item.success, html[data-bs-theme="dark"] .toast-item.error { background: #0A0A0A; }
html[data-bs-theme="dark"] .modal-content, html[data-bs-theme="dark"] .modal-body { background: #141414 !important; color: #EDEDED !important; }
html[data-bs-theme="dark"] .modal-footer { background: #1C1C1C !important; }
html[data-bs-theme="dark"] .modal-header { background: linear-gradient(135deg, #7A2232, #4A1420) !important; }
html[data-bs-theme="dark"] .modal-body span, html[data-bs-theme="dark"] .form-label, html[data-bs-theme="dark"] .form-check-label, html[data-bs-theme="dark"] .fw-bold { color: #EDEDED !important; }
html[data-bs-theme="dark"] .text-muted { color: #A3A3A3 !important; }
html[data-bs-theme="dark"] .small { color: #CFCFCF !important; }
html[data-bs-theme="dark"] .select2-container--default .select2-selection--single,
html[data-bs-theme="dark"] .select2-dropdown { background: #141414 !important; border-color: #262626 !important; }
html[data-bs-theme="dark"] .select2-results__option--selected { background: #262626 !important; }

/* Dark mode: #7A2232 is unreadable as TEXT on black. Pages colour titles and outline buttons with
   inline var(--all-color) (also used for backgrounds), so only those text uses get the light tint. */
html[data-bs-theme="dark"] [style^="color:var(--all-color)"],
html[data-bs-theme="dark"] [style^="color: var(--all-color)"],
html[data-bs-theme="dark"] [style*=";color:var(--all-color)"],
html[data-bs-theme="dark"] [style*="; color:var(--all-color)"],
html[data-bs-theme="dark"] [style*=" color: var(--all-color)"] { color: #E2A0A8 !important; }
html[data-bs-theme="dark"] [style*="--bs-btn-color: var(--all-color)"] { --bs-btn-color: #E2A0A8 !important; --bs-btn-border-color: #E2A0A8 !important; }
html[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-color: #E2A0A8; --bs-btn-border-color: #E2A0A8; }
html[data-bs-theme="dark"] .text-primary { color: #E2A0A8 !important; }
