/* ════════════════════════════════════════════════════════════════════════════════
   DARK MODE OVERRIDES FOR THIRD-PARTY LIBRARIES
   Ensures toastr, parsley, datatables, and other libraries work in dark mode
   ════════════════════════════════════════════════════════════════════════════════ */

/* ──────────────────────────────────────────────────────────────────────────────
   GLOBAL TEXT — never use dark text on dark mode
   Keep body / muted / headings / links light enough to read on dark canvases.
   Bright badge chips (warning yellow etc.) keep their own contrasting text.
   ────────────────────────────────────────────────────────────────────────────── */

[data-bs-theme="dark"] {
    --bs-body-color: #e9ecef;
    --bs-body-color-rgb: 233, 236, 239;
    --bs-emphasis-color: #ffffff;
    --bs-emphasis-color-rgb: 255, 255, 255;
    --bs-secondary-color: #ced4da;
    --bs-secondary-color-rgb: 206, 212, 218;
    --bs-tertiary-color: #adb5bd;
    --bs-tertiary-color-rgb: 173, 181, 189;
    --bs-heading-color: #f1f3f5;
    --bs-link-color: #7ec8f0;
    --bs-link-color-rgb: 126, 200, 240;
    --bs-link-hover-color: #a6dbf5;
    --bs-primary-text-emphasis: #7ec8f0;
    --bs-secondary-text-emphasis: #ced4da;
    --bs-success-text-emphasis: #75b798;
    --bs-info-text-emphasis: #7ec8f0;
    --bs-warning-text-emphasis: #ffc107;
    --bs-danger-text-emphasis: #ea868f;
}

[data-bs-theme="dark"] body,
[data-bs-theme="dark"].main-body,
body[data-bs-theme="dark"] {
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .text-dark,
[data-bs-theme="dark"] .text-black,
[data-bs-theme="dark"] .text-body,
[data-bs-theme="dark"] .text-body-emphasis,
[data-bs-theme="dark"] .text-black-50 {
    color: var(--bs-body-color) !important;
}

[data-bs-theme="dark"] .text-muted,
[data-bs-theme="dark"] .text-secondary,
[data-bs-theme="dark"] .text-body-secondary,
[data-bs-theme="dark"] .text-body-tertiary,
[data-bs-theme="dark"] .form-text,
[data-bs-theme="dark"] .form-label,
[data-bs-theme="dark"] .pp-breadcrumb,
[data-bs-theme="dark"] .pp-muted-small {
    color: var(--bs-secondary-color) !important;
}

/* Dark navy / Bootstrap primary is unreadable on dark bg — use light sky */
[data-bs-theme="dark"] .text-primary,
[data-bs-theme="dark"] a.text-primary,
[data-bs-theme="dark"] h1.text-primary,
[data-bs-theme="dark"] h2.text-primary,
[data-bs-theme="dark"] h3.text-primary,
[data-bs-theme="dark"] h4.text-primary,
[data-bs-theme="dark"] h5.text-primary,
[data-bs-theme="dark"] h6.text-primary {
    color: #7ec8f0 !important;
}

[data-bs-theme="dark"] .text-info {
    color: #7ec8f0 !important;
}

[data-bs-theme="dark"] .text-success {
    color: #75b798 !important;
}

[data-bs-theme="dark"] .text-warning {
    color: #ffc107 !important;
}

[data-bs-theme="dark"] .text-danger {
    color: #ea868f !important;
}

[data-bs-theme="dark"] h1,
[data-bs-theme="dark"] h2,
[data-bs-theme="dark"] h3,
[data-bs-theme="dark"] h4,
[data-bs-theme="dark"] h5,
[data-bs-theme="dark"] h6,
[data-bs-theme="dark"] .pp-page-title,
[data-bs-theme="dark"] label,
[data-bs-theme="dark"] .table,
[data-bs-theme="dark"] .table > :not(caption) > * > *,
[data-bs-theme="dark"] table.dataTable,
[data-bs-theme="dark"] table.dataTable thead th,
[data-bs-theme="dark"] table.dataTable tbody td {
    color: var(--bs-body-color);
}

/* Theme warning is burnt orange #dd5600 (dark-ish) — needs light text, never dark */
[data-bs-theme="dark"] .badge.bg-warning,
[data-bs-theme="dark"] .badge.bg-warning.text-dark,
[data-bs-theme="dark"] .btn-warning.text-dark,
[data-bs-theme="dark"] .progress-bar.bg-warning {
    color: #fff !important;
}

[data-bs-theme="dark"] .alert-warning {
    color: var(--bs-warning-text-emphasis, #eb9a66) !important;
}

/* ──────────────────────────────────────────────────────────────────────────────
   TOASTR NOTIFICATIONS - DARK MODE SUPPORT
   ────────────────────────────────────────────────────────────────────────────── */

[data-bs-theme="dark"] .toast-container > .toast {
    background-color: #2d3748;
    color: #e2e3e5;
    border: 1px solid #495057;
}

[data-bs-theme="dark"] .toast-header {
    background-color: #1a202c;
    border-bottom: 1px solid #495057;
    color: #e2e3e5;
}

[data-bs-theme="dark"] .toast-body {
    color: #e2e3e5;
}

[data-bs-theme="dark"] .toast-header .btn-close {
    filter: invert(0.8);
}

/* Toastr success */
[data-bs-theme="dark"] .toast.toast-success {
    background-color: rgba(16, 185, 129, 0.2);
    border-left: 4px solid #10b981;
}

[data-bs-theme="dark"] .toast.toast-success .toast-header {
    background-color: rgba(16, 185, 129, 0.15);
    border-bottom-color: #10b981;
    color: #34d399;
}

[data-bs-theme="dark"] .toast.toast-success .toast-body {
    color: #34d399;
}

/* Toastr error */
[data-bs-theme="dark"] .toast.toast-error {
    background-color: rgba(239, 68, 68, 0.2);
    border-left: 4px solid #ef4444;
}

[data-bs-theme="dark"] .toast.toast-error .toast-header {
    background-color: rgba(239, 68, 68, 0.15);
    border-bottom-color: #ef4444;
    color: #f87171;
}

[data-bs-theme="dark"] .toast.toast-error .toast-body {
    color: #f87171;
}

/* Toastr warning */
[data-bs-theme="dark"] .toast.toast-warning {
    background-color: rgba(251, 191, 36, 0.2);
    border-left: 4px solid #fbbf24;
}

[data-bs-theme="dark"] .toast.toast-warning .toast-header {
    background-color: rgba(251, 191, 36, 0.15);
    border-bottom-color: #fbbf24;
    color: #fbbf24;
}

[data-bs-theme="dark"] .toast.toast-warning .toast-body {
    color: #fbbf24;
}

/* Toastr info */
[data-bs-theme="dark"] .toast.toast-info {
    background-color: rgba(59, 130, 246, 0.2);
    border-left: 4px solid #3b82f6;
}

[data-bs-theme="dark"] .toast.toast-info .toast-header {
    background-color: rgba(59, 130, 246, 0.15);
    border-bottom-color: #3b82f6;
    color: #60a5fa;
}

[data-bs-theme="dark"] .toast.toast-info .toast-body {
    color: #60a5fa;
}

/* ──────────────────────────────────────────────────────────────────────────────
   PARSLEY VALIDATION - DARK MODE SUPPORT
   ────────────────────────────────────────────────────────────────────────────── */

[data-bs-theme="dark"] input.parsley-success,
[data-bs-theme="dark"] select.parsley-success,
[data-bs-theme="dark"] textarea.parsley-success {
    color: #34d399;
    background-color: rgba(16, 185, 129, 0.15);
    border: 1px solid #34d399;
}

[data-bs-theme="dark"] input.parsley-error,
[data-bs-theme="dark"] select.parsley-error,
[data-bs-theme="dark"] textarea.parsley-error {
    color: #f87171;
    background-color: rgba(239, 68, 68, 0.15);
    border: 1px solid #f87171;
}

[data-bs-theme="dark"] .parsley-errors-list {
    color: #f87171;
}

[data-bs-theme="dark"] .parsley-error-list {
    color: #f87171;
}

/* ──────────────────────────────────────────────────────────────────────────────
   DATATABLES - DARK MODE SUPPORT
   ────────────────────────────────────────────────────────────────────────────── */

[data-bs-theme="dark"] .dataTables_wrapper {
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .dataTables_length,
[data-bs-theme="dark"] .dataTables_filter,
[data-bs-theme="dark"] .dataTables_info,
[data-bs-theme="dark"] .dataTables_paginate {
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .dataTables_filter input,
[data-bs-theme="dark"] .dataTables_length select {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    border: 1px solid var(--bs-border-color);
}

[data-bs-theme="dark"] table.dataTable thead th,
[data-bs-theme="dark"] table.dataTable thead td {
    background-color: var(--bs-secondary-bg);
    color: var(--bs-body-color);
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] table.dataTable tbody tr {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] table.dataTable tbody tr:hover {
    background-color: var(--bs-tertiary-bg);
}

[data-bs-theme="dark"] table.dataTable tbody tr.selected {
    background-color: rgba(59, 130, 246, 0.2);
}

[data-bs-theme="dark"] table.dataTable tbody th,
[data-bs-theme="dark"] table.dataTable tbody td {
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .dataTables_paginate .paginate_button {
    background-color: var(--bs-secondary-bg);
    border-color: var(--bs-border-color);
    color: var(--bs-body-color) !important;
}

[data-bs-theme="dark"] .dataTables_paginate .paginate_button:hover {
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-body-color) !important;
}

[data-bs-theme="dark"] .dataTables_paginate .paginate_button.active {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

[data-bs-theme="dark"] .dataTables_paginate .paginate_button.disabled {
    opacity: 0.5;
}

[data-bs-theme="dark"] .btn-outline-secondary {
    color: var(--bs-body-color);
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .btn-outline-secondary:hover,
[data-bs-theme="dark"] .btn-outline-secondary:focus {
    color: var(--bs-body-color);
    background-color: var(--bs-tertiary-bg);
    border-color: var(--bs-border-color);
}

/* Primary / info buttons — theme navy (#033c73) for info; keep readable on dark bg */
[data-bs-theme="dark"] .btn-primary,
[data-bs-theme="dark"] .btn-success,
[data-bs-theme="dark"] .btn-danger,
[data-bs-theme="dark"] .btn-warning,
[data-bs-theme="dark"] .btn-info,
[data-bs-theme="dark"] .btn-secondary {
    background-image: none !important;
}

[data-bs-theme="dark"] .btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: #3db5f0;
    --bs-btn-border-color: #3db5f0;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #2fa4e7;
    --bs-btn-hover-border-color: #2fa4e7;
    --bs-btn-active-bg: #288bc4;
    --bs-btn-active-border-color: #288bc4;
}

[data-bs-theme="dark"] .btn-info {
    --bs-btn-color: #fff;
    --bs-btn-bg: #3a8ec4;
    --bs-btn-border-color: #3a8ec4;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #2f7aad;
    --bs-btn-hover-border-color: #2f7aad;
}

[data-bs-theme="dark"] .btn-outline-info {
    --bs-btn-color: #7ec8f0;
    --bs-btn-border-color: #5eb5e8;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #3a8ec4;
    --bs-btn-hover-border-color: #3a8ec4;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #2f7aad;
    --bs-btn-active-border-color: #2f7aad;
}

[data-bs-theme="dark"] .btn-outline-primary {
    --bs-btn-color: #82c8f1;
    --bs-btn-border-color: #3db5f0;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #3db5f0;
    --bs-btn-hover-border-color: #3db5f0;
}

[data-bs-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button {
    color: var(--bs-body-color) !important;
}

@media (max-width: 991.98px) {
    [data-bs-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button,
    [data-bs-theme="light"] .dataTables_wrapper .dataTables_paginate .paginate_button {
        min-height: 44px;
        min-width: 44px;
        line-height: 44px;
        padding: 0 0.75rem;
    }
}

/* Standard HTML Tables */
[data-bs-theme="dark"] table {
    background-color: var(--bs-body-bg) !important;
    color: var(--bs-body-color) !important;
}

[data-bs-theme="dark"] table thead {
    background-color: var(--bs-secondary-bg) !important;
    color: var(--bs-body-color) !important;
}

[data-bs-theme="dark"] table thead th {
    background-color: var(--bs-secondary-bg) !important;
    color: var(--bs-body-color) !important;
    border-color: var(--bs-border-color) !important;
}

[data-bs-theme="dark"] table tbody tr:not(.table-warning):not(.table-danger):not(.table-success):not(.table-info):not(.table-primary):not(.table-secondary):not(.table-light) {
    background-color: var(--bs-body-bg) !important;
    color: var(--bs-body-color) !important;
}

[data-bs-theme="dark"] table tbody tr:not(.table-warning):not(.table-danger):not(.table-success):not(.table-info):not(.table-primary):not(.table-secondary):not(.table-light):hover {
    background-color: var(--bs-tertiary-bg) !important;
    color: var(--bs-body-color) !important;
}

[data-bs-theme="dark"] tr.table-secondary > td,
[data-bs-theme="dark"] tr.table-secondary > th {
    background-color: #414449 !important;
    color: #e2e3e5 !important;
}

[data-bs-theme="dark"] tr.table-light > td,
[data-bs-theme="dark"] tr.table-light > th {
    background-color: #52585e !important;
    color: #f8f9fa !important;
}

[data-bs-theme="dark"] table tbody td {
    border-color: var(--bs-border-color) !important;
}

[data-bs-theme="dark"] table.table-hover tbody tr:not(.table-warning):not(.table-danger):not(.table-success):not(.table-info):not(.table-primary):not(.table-secondary):not(.table-light):hover {
    background-color: var(--bs-tertiary-bg) !important;
}

/* ──────────────────────────────────────────────────────────────────────────────
   FORMS & INPUTS - DARK MODE SUPPORT
   ────────────────────────────────────────────────────────────────────────────── */

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.25);
}

[data-bs-theme="dark"] .form-control::placeholder {
    color: var(--bs-secondary-color);
    opacity: 0.6;
}

[data-bs-theme="dark"] input[type="checkbox"]:not(.form-check-input) {
    accent-color: #5ec4f7;
    width: 1.1em;
    height: 1.1em;
    min-width: 1.1em;
    min-height: 1.1em;
    flex-shrink: 0;
}

[data-bs-theme="dark"] .form-check-input {
    background-color: var(--bs-secondary-bg);
    border: 1px solid rgba(255, 255, 255, 0.7);
    width: 1.15em;
    height: 1.15em;
    min-width: 1.15em;
    min-height: 1.15em;
    flex-shrink: 0;
}

[data-bs-theme="dark"] .form-check-input:not(:checked) {
    background-color: var(--bs-secondary-bg);
    border-color: rgba(255, 255, 255, 0.7);
}

[data-bs-theme="dark"] .form-check-input:checked {
    background-color: #5ec4f7;
    border-color: #5ec4f7;
}

/* ──────────────────────────────────────────────────────────────────────────────
   DROPDOWNS & POPOVERS - DARK MODE SUPPORT
   ────────────────────────────────────────────────────────────────────────────── */

[data-bs-theme="dark"] .dropdown-menu {
    background-color: var(--bs-body-bg);
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .dropdown-item {
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus {
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .dropdown-divider {
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] header .navbar .dropdown-menu .dropdown-header.pp-menu-category {
    color: rgba(255, 255, 255, 0.88);
}

/* ──────────────────────────────────────────────────────────────────────────────
   MODALS - DARK MODE SUPPORT
   ────────────────────────────────────────────────────────────────────────────── */

[data-bs-theme="dark"] .modal-content {
    background-color: var(--bs-body-bg);
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .modal-header {
    background-color: var(--bs-secondary-bg);
    border-color: var(--bs-border-color);
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .modal-body {
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .modal-footer {
    background-color: var(--bs-secondary-bg);
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .btn-close {
    filter: invert(0.8);
}

/* ──────────────────────────────────────────────────────────────────────────────
   BADGES & PILLS - DARK MODE SUPPORT
   ────────────────────────────────────────────────────────────────────────────── */

[data-bs-theme="dark"] .badge.bg-light {
    color: var(--bs-body-color);
    background-color: var(--bs-secondary-bg) !important;
}

[data-bs-theme="dark"] .badge.bg-secondary {
    background-color: #868e96 !important;
    color: #212529 !important;
}

[data-bs-theme="dark"] .badge.bg-info,
[data-bs-theme="dark"] .summary-chip.bg-info {
    background-color: #3a8ec4 !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .badge.bg-info.text-dark,
[data-bs-theme="dark"] .summary-chip.bg-info.text-dark {
    color: #fff !important;
}

[data-bs-theme="dark"] .badge.bg-warning.text-dark,
[data-bs-theme="dark"] .summary-chip.bg-warning.text-dark {
    color: #fff !important;
}

[data-bs-theme="dark"] .progress-bar.bg-info {
    background-color: #3a8ec4 !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .progress-bar.bg-warning {
    color: #fff !important;
}

/* ──────────────────────────────────────────────────────────────────────────────
   SPINNERS & LOADERS - DARK MODE SUPPORT
   ────────────────────────────────────────────────────────────────────────────── */

[data-bs-theme="dark"] .spinner-border {
    border-color: rgba(255, 255, 255, 0.25);
    border-right-color: transparent;
}

/* ──────────────────────────────────────────────────────────────────────────────
   ADVANCED MULTI-SELECT - DARK MODE SUPPORT  
   ────────────────────────────────────────────────────────────────────────────── */

[data-bs-theme="dark"] .ms-elem-selection input {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .ms-list {
    background-color: var(--bs-body-bg);
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .ms-elem-selectable,
[data-bs-theme="dark"] .ms-elem-selection {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .ms-elem-selectable:hover,
[data-bs-theme="dark"] .ms-elem-selection:hover {
    background-color: var(--bs-tertiary-bg);
}

/* ──────────────────────────────────────────────────────────────────────────────
   ALERTS & PANELS - DARK MODE SUPPORT
   ────────────────────────────────────────────────────────────────────────────── */

[data-bs-theme="dark"] .alert {
    background-color: var(--bs-secondary-bg);
    border-color: var(--bs-border-color);
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .panel {
    background-color: var(--bs-body-bg);
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .panel-heading {
    background-color: var(--bs-secondary-bg);
    border-color: var(--bs-border-color);
    color: var(--bs-body-color);
}

/* ──────────────────────────────────────────────────────────────────────────────
   SHADOWS & UTILITY - DARK MODE ADJUSTMENTS
   ────────────────────────────────────────────────────────────────────────────── */

[data-bs-theme="dark"] .box-shadow {
    box-shadow: 0 .25rem .75rem rgba(0, 0, 0, 0.3) !important;
}

[data-bs-theme="dark"] .shadow {
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, 0.3) !important;
}

[data-bs-theme="dark"] .shadow-lg {
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.4) !important;
}

/* ──────────────────────────────────────────────────────────────────────────────
   CARDS - DARK MODE SUPPORT (COMPREHENSIVE)
   ────────────────────────────────────────────────────────────────────────────── */

/* Force all cards to use dark theme colors - target structure only, not every child */
[data-bs-theme="dark"] .card {
    background-color: var(--bs-body-bg) !important;
    color: var(--bs-body-color) !important;
    border-color: var(--bs-border-color) !important;
}

/* Card headers */
[data-bs-theme="dark"] .card-header {
    background-color: var(--bs-secondary-bg) !important;
    border-color: var(--bs-border-color) !important;
    color: var(--bs-body-color) !important;
}

/* Override any specific bg classes on card headers */
[data-bs-theme="dark"] .card-header.bg-light,
[data-bs-theme="dark"] .card-header.bg-white,
[data-bs-theme="dark"] .card-header.bg-gray-100 {
    background-color: var(--bs-secondary-bg) !important;
    color: var(--bs-body-color) !important;
}

/* Card footers */
[data-bs-theme="dark"] .card-footer {
    background-color: var(--bs-secondary-bg) !important;
    border-color: var(--bs-border-color) !important;
    color: var(--bs-body-color) !important;
}

/* Card body - most important for content */
[data-bs-theme="dark"] .card-body {
    background-color: var(--bs-body-bg) !important;
    color: var(--bs-body-color) !important;
}

/* Card text elements */
[data-bs-theme="dark"] .card-title,
[data-bs-theme="dark"] .card-subtitle,
[data-bs-theme="dark"] .card-text {
    color: var(--bs-body-color) !important;
}

/* Card links */
[data-bs-theme="dark"] .card-link {
    color: var(--bs-link-color) !important;
}

[data-bs-theme="dark"] .card-link:hover {
    color: var(--bs-link-hover-color) !important;
}

/* Keep colored card headers with proper contrast */
[data-bs-theme="dark"] .card-header.bg-primary {
    background-color: var(--bs-primary) !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .card-header.bg-secondary {
    background-color: var(--bs-secondary) !important;
    color: var(--bs-body-color) !important;
}

[data-bs-theme="dark"] .card-header.bg-success {
    background-color: var(--bs-success) !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .card-header.bg-warning {
    background-color: var(--bs-warning) !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .card-header.bg-danger {
    background-color: var(--bs-danger) !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .card-header.bg-info {
    background-color: var(--bs-info) !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .card-header.bg-dark {
    background-color: #1a202c !important;
    color: var(--bs-body-color) !important;
}

/* Cards with borders */
[data-bs-theme="dark"] .card.border-danger {
    border-color: var(--bs-danger) !important;
}

/* ──────────────────────────────────────────────────────────────────────────────
   BACKGROUND & TEXT UTILITIES - DARK MODE OVERRIDES FOR CARDS
   ────────────────────────────────────────────────────────────────────────────── */

/* Override bg-light on card headers */
[data-bs-theme="dark"] .card-header.bg-light {
    background-color: var(--bs-secondary-bg) !important;
    color: var(--bs-body-color) !important;
}

/* Override bg-white on card headers */
[data-bs-theme="dark"] .card-header.bg-white {
    background-color: var(--bs-secondary-bg) !important;
    color: var(--bs-body-color) !important;
}

/* Override bg-light on cards */
[data-bs-theme="dark"] .card.bg-light {
    background-color: var(--bs-body-bg) !important;
    color: var(--bs-body-color) !important;
}

/* Override bg-white on cards */
[data-bs-theme="dark"] .card.bg-white {
    background-color: var(--bs-body-bg) !important;
    color: var(--bs-body-color) !important;
}

/* Override bg-light on any div that might contain cards */
[data-bs-theme="dark"] .bg-light {
    background-color: var(--bs-secondary-bg) !important;
    color: var(--bs-body-color) !important;
}

[data-bs-theme="dark"] .bg-white {
    background-color: var(--bs-body-bg) !important;
    color: var(--bs-body-color) !important;
}

/* ──────────────────────────────────────────────────────────────────────────────
   INLINE COLOR FIXES - AUTO-FIX HARDCODED COLORS
   Override inline styles that have hardcoded colors (gray, white, etc.)
   ────────────────────────────────────────────────────────────────────────────── */

/* Fix h1-h6 with hardcoded inline colors */
[data-bs-theme="dark"] h1[style*="color"],
[data-bs-theme="dark"] h2[style*="color"],
[data-bs-theme="dark"] h3[style*="color"],
[data-bs-theme="dark"] h4[style*="color"],
[data-bs-theme="dark"] h5[style*="color"],
[data-bs-theme="dark"] h6[style*="color"],
[data-bs-theme="dark"] span[style*="color:white"],
[data-bs-theme="dark"] span[style*="color: white"],
[data-bs-theme="dark"] div[style*="color:white"],
[data-bs-theme="dark"] div[style*="color: white"] {
    color: var(--bs-body-color) !important;
}

[data-bs-theme="dark"] h6[style*="color:gray"],
[data-bs-theme="dark"] h6[style*="color: gray"],
[data-bs-theme="dark"] span[style*="color:gray"],
[data-bs-theme="dark"] span[style*="color: gray"],
[data-bs-theme="dark"] div[style*="color:gray"],
[data-bs-theme="dark"] div[style*="color: gray"] {
    color: var(--bs-secondary-color) !important;
}

/* Fix any element with specific problematic colors */
[data-bs-theme="dark"] *[style*="color: #333"],
[data-bs-theme="dark"] *[style*="color:#333"],
[data-bs-theme="dark"] *[style*="color: #000"],
[data-bs-theme="dark"] *[style*="color:#000"],
[data-bs-theme="dark"] *[style*="color: #555"],
[data-bs-theme="dark"] *[style*="color:#555"],
[data-bs-theme="dark"] *[style*="color: black"],
[data-bs-theme="dark"] *[style*="color:black"],
[data-bs-theme="dark"] *[style*="color: #212529"],
[data-bs-theme="dark"] *[style*="color:#212529"],
[data-bs-theme="dark"] *[style*="color: #343a40"],
[data-bs-theme="dark"] *[style*="color:#343a40"],
[data-bs-theme="dark"] *[style*="color: #495057"],
[data-bs-theme="dark"] *[style*="color:#495057"],
[data-bs-theme="dark"] *[style*="color: #033c73"],
[data-bs-theme="dark"] *[style*="color:#033c73"],
[data-bs-theme="dark"] *[style*="color: #052c65"],
[data-bs-theme="dark"] *[style*="color:#052c65"],
[data-bs-theme="dark"] *[style*="color: #1a1a1a"],
[data-bs-theme="dark"] *[style*="color:#1a1a1a"] {
    color: var(--bs-body-color) !important;
}

/* Text utility overrides for dark mode */
[data-bs-theme="dark"] .text-secondary {
    color: var(--bs-secondary-color) !important;
}

[data-bs-theme="dark"] .text-muted {
    color: var(--bs-secondary-color) !important;
}

[data-bs-theme="dark"] .text-dark {
    color: var(--bs-body-color) !important;
}

[data-bs-theme="dark"] .text-light {
    color: var(--bs-body-color) !important;
}

/* ══════════════════════════════════════════════════════════════════════════════
   FINAL CATCH-ALL: NUCLEAR OPTION FOR ANY REMAINING WHITE/LIGHT BACKGROUNDS
   This catches any inline style with background colors that need converting
   ════════════════════════════════════════════════════════════════════════════ */

/* Catch any element with white background in inline style */
[data-bs-theme="dark"] *[style*="background: white"],
[data-bs-theme="dark"] *[style*="background:#fff"],
[data-bs-theme="dark"] *[style*="background: #fff"],
[data-bs-theme="dark"] *[style*="background-color: white"],
[data-bs-theme="dark"] *[style*="background-color:#fff"],
[data-bs-theme="dark"] *[style*="background-color: #fff"],
[data-bs-theme="dark"] *[style*="background: #ffffff"],
[data-bs-theme="dark"] *[style*="background-color: #ffffff"],
[data-bs-theme="dark"] *[style*="background:#ffffff"],
[data-bs-theme="dark"] *[style*="background: #f8f9fa"],
[data-bs-theme="dark"] *[style*="background-color: #f8f9fa"] {
    background-color: var(--bs-body-bg) !important;
}

/* Catch any element with light gray background */
[data-bs-theme="dark"] *[style*="background: #f0f0f0"],
[data-bs-theme="dark"] *[style*="background-color: #f0f0f0"],
[data-bs-theme="dark"] *[style*="background: #f5f5f5"],
[data-bs-theme="dark"] *[style*="background-color: #f5f5f5"] {
    background-color: var(--bs-secondary-bg) !important;
}

/* Force dark mode on all Bootstrap utility classes for backgrounds */
[data-bs-theme="dark"] .bg-primary {
    background-color: var(--bs-primary) !important;
}

[data-bs-theme="dark"] .bg-secondary {
    background-color: var(--bs-secondary-bg) !important;
}

[data-bs-theme="dark"] .bg-success {
    background-color: var(--bs-success) !important;
}

[data-bs-theme="dark"] .bg-danger {
    background-color: var(--bs-danger) !important;
}

[data-bs-theme="dark"] .bg-warning {
    background-color: var(--bs-warning) !important;
}

[data-bs-theme="dark"] .bg-info {
    background-color: var(--bs-info) !important;
}

[data-bs-theme="dark"] .bg-dark {
    background-color: #1a202c !important;
}

/* ══════════════════════════════════════════════════════════════════════════════
   CUSTOM PAGE-SPECIFIC CARDS - DARK MODE SUPPORT
   Ensures page-specific card styles like summary-card, filter-row, etc. work
   ════════════════════════════════════════════════════════════════════════════ */

[data-bs-theme="dark"] .summary-card {
    background-color: var(--bs-secondary-bg) !important;
    color: var(--bs-body-color) !important;
    border-color: var(--bs-border-color) !important;
}

[data-bs-theme="dark"] .filter-row {
    background-color: var(--bs-secondary-bg) !important;
    color: var(--bs-body-color) !important;
    border-color: var(--bs-border-color) !important;
}

[data-bs-theme="dark"] .filter-card {
    background-color: #2c3034 !important;
    color: #e9ecef !important;
    border-color: #495057 !important;
}

[data-bs-theme="dark"] .detail-card {
    background-color: #2c3034 !important;
    color: #e9ecef !important;
    border-color: #495057 !important;
}

/* Waste Pack / Packing panels — opaque dark surface + light text (never white-on-light) */
[data-bs-theme="dark"] .wp-card,
[data-bs-theme="dark"] .pk-card,
[data-bs-theme="dark"] .wp-order-box {
    background-color: #2c3034 !important;
    color: #e9ecef !important;
    border-color: #495057 !important;
}

[data-bs-theme="dark"] .wp-card h6,
[data-bs-theme="dark"] .pk-card h6,
[data-bs-theme="dark"] .wp-card strong,
[data-bs-theme="dark"] .pk-card strong,
[data-bs-theme="dark"] .wp-order-box strong {
    color: #f8f9fa !important;
}

[data-bs-theme="dark"] .wp-card .text-secondary,
[data-bs-theme="dark"] .pk-card .text-secondary,
[data-bs-theme="dark"] .wp-card .text-muted,
[data-bs-theme="dark"] .pk-card .text-muted,
[data-bs-theme="dark"] .wp-order-box .text-secondary {
    color: #adb5bd !important;
}

[data-bs-theme="dark"] .wp-card thead th,
[data-bs-theme="dark"] .pk-card thead th,
[data-bs-theme="dark"] .wp-card tbody td,
[data-bs-theme="dark"] .pk-card tbody td,
[data-bs-theme="dark"] .wp-card tbody th,
[data-bs-theme="dark"] .pk-card tbody th {
    background-color: transparent !important;
    color: #e9ecef !important;
    border-color: #495057 !important;
    --bs-table-bg: transparent;
    --bs-table-color: #e9ecef;
    --bs-table-striped-color: #e9ecef;
    --bs-table-hover-color: #e9ecef;
}

[data-bs-theme="dark"] .wp-card table,
[data-bs-theme="dark"] .pk-card table,
[data-bs-theme="dark"] .wp-card .table,
[data-bs-theme="dark"] .pk-card .table {
    --bs-table-bg: transparent;
    --bs-table-color: #e9ecef;
    --bs-table-striped-bg: rgba(255, 255, 255, 0.04);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.06);
    background-color: transparent !important;
    color: #e9ecef !important;
}

/* Badge chips keep fill-specific text (light fill → dark ink) */
[data-bs-theme="dark"] .wp-card .badge.bg-secondary,
[data-bs-theme="dark"] .pk-card .badge.bg-secondary,
[data-bs-theme="dark"] .wp-order-box .badge.bg-secondary,
[data-bs-theme="dark"] .badge-status-planned,
[data-bs-theme="dark"] .badge-status-cancelled,
[data-bs-theme="dark"] .badge-status-incomplete {
    color: #212529 !important;
}
[data-bs-theme="dark"] .wp-card .badge.bg-success,
[data-bs-theme="dark"] .wp-card .badge.bg-primary,
[data-bs-theme="dark"] .wp-card .badge.bg-danger,
[data-bs-theme="dark"] .wp-card .badge.badge-virtual,
[data-bs-theme="dark"] .badge-status-active,
[data-bs-theme="dark"] .badge-status-completed {
    color: #fff !important;
}

[data-bs-theme="dark"] .run-section-card {
    background-color: #2c3034 !important;
    color: #e9ecef !important;
    border-color: #495057 !important;
}

[data-bs-theme="dark"] .theme-modal-content {
    background-color: var(--bs-body-bg) !important;
    color: var(--bs-body-color) !important;
}

[data-bs-theme="dark"] .theme-modal-content .modal-header,
[data-bs-theme="dark"] .theme-modal-content .modal-footer {
    background-color: var(--bs-secondary-bg) !important;
    border-color: var(--bs-border-color) !important;
}

[data-bs-theme="dark"] .theme-modal-content .form-control,
[data-bs-theme="dark"] .theme-modal-content .form-select,
[data-bs-theme="dark"] .theme-modal-content .table {
    background-color: var(--bs-body-bg) !important;
    color: var(--bs-body-color) !important;
}

/* Ensure adaptive text classes always use correct colors */
[data-bs-theme="dark"] .adaptive-text {
    color: var(--bs-body-color) !important;
}

[data-bs-theme="dark"] .muted-adaptive-text {
    color: var(--bs-secondary-color) !important;
}

/* ══════════════════════════════════════════════════════════════════════════════
   DATATABLES FIXED HEADER - DARK MODE SUPPORT
   Library sets background-color: white on floating sticky headers
   ══════════════════════════════════════════════════════════════════════════════ */

[data-bs-theme="dark"] .dtfh-floatingparent,
[data-bs-theme="dark"] .dtfh-floatingparenthead,
[data-bs-theme="dark"] table.fixedHeader-floating,
[data-bs-theme="dark"] .fixedHeader-floating,
[data-bs-theme="dark"] .fixedHeader-locked {
    background-color: var(--bs-secondary-bg) !important;
    color: var(--bs-body-color) !important;
}

[data-bs-theme="dark"] .dtfh-floatingparent thead th,
[data-bs-theme="dark"] table.fixedHeader-floating thead th,
[data-bs-theme="dark"] .fixedHeader-floating thead th {
    background-color: var(--bs-secondary-bg) !important;
    color: var(--bs-body-color) !important;
    border-color: var(--bs-border-color) !important;
}

[data-bs-theme="dark"] .filter-card {
    color: var(--bs-body-color);
}

/* Print preview paper — never apply app-wide dark table overrides inside forms */
[data-bs-theme="dark"] .doc-preview-wrap .qc-form table,
[data-bs-theme="dark"] .doc-preview-wrap .sb-form table,
[data-bs-theme="dark"] .doc-sheet table {
    background-color: transparent !important;
    color: inherit !important;
}

[data-bs-theme="dark"] .doc-preview-wrap .qc-form table thead,
[data-bs-theme="dark"] .doc-preview-wrap .qc-form table thead th,
[data-bs-theme="dark"] .doc-preview-wrap .qc-form table tbody tr,
[data-bs-theme="dark"] .doc-preview-wrap .qc-form table tbody td,
[data-bs-theme="dark"] .doc-preview-wrap .sb-form table thead,
[data-bs-theme="dark"] .doc-preview-wrap .sb-form table thead th,
[data-bs-theme="dark"] .doc-preview-wrap .sb-form table tbody tr,
[data-bs-theme="dark"] .doc-preview-wrap .sb-form table tbody td {
    background-color: unset !important;
    color: unset !important;
    border-color: unset !important;
}

/* ──────────────────────────────────────────────────────────────────────────────
   LABEL PAPER — designer canvas & print previews stay white with black ink.
   Overrides the global inline color/background catch-alls above.
   ────────────────────────────────────────────────────────────────────────────── */

[data-bs-theme="dark"] #labelCanvas,
[data-bs-theme="dark"] #previewContainer,
[data-bs-theme="dark"] #previewContainer .label-sheet,
[data-bs-theme="dark"] #divLabelPreviewContent,
[data-bs-theme="dark"] #divLabelPreviewContent .label-sheet,
[data-bs-theme="dark"] #intakePanelPrintArea .label-sheet,
[data-bs-theme="dark"] #intakeLabelPrintArea .label-sheet,
[data-bs-theme="dark"] .label-paper,
[data-bs-theme="dark"] .label-preview-inner {
    background: #fff !important;
    background-color: #fff !important;
    color: #000 !important;
}

[data-bs-theme="dark"] #labelCanvas *,
[data-bs-theme="dark"] #previewContainer *,
[data-bs-theme="dark"] #previewContainer .label-sheet *,
[data-bs-theme="dark"] #divLabelPreviewContent *,
[data-bs-theme="dark"] #divLabelPreviewContent .label-sheet *,
[data-bs-theme="dark"] #intakePanelPrintArea .label-sheet *,
[data-bs-theme="dark"] #intakeLabelPrintArea .label-sheet *,
[data-bs-theme="dark"] .label-paper *,
[data-bs-theme="dark"] .label-preview-inner * {
    color: #000 !important;
    border-color: #000 !important;
}

[data-bs-theme="dark"] .label-paper .bc-stripe,
[data-bs-theme="dark"] #divLabelPreviewContent .bc-stripe,
[data-bs-theme="dark"] #previewContainer .bc-stripe {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

[data-bs-theme="dark"] #labelCanvas .field-label {
    color: #0d6efd !important;
    background: rgba(225, 240, 255, 0.95) !important;
    border-color: #0d6efd !important;
}

[data-bs-theme="dark"] #labelCanvas .label-field.type-line {
    background: #000 !important;
}

[data-bs-theme="dark"] #labelCanvas .label-field.type-barcode {
    background: repeating-linear-gradient(90deg, #000 0px, #000 2px, #fff 2px, #fff 4px) !important;
}

[data-bs-theme="dark"] #labelCanvas .label-field.type-barcode .field-label {
    color: #fff !important;
    text-shadow: 1px 1px #000 !important;
    background: transparent !important;
    border-color: transparent !important;
}

[data-bs-theme="dark"] #labelCanvas .label-field .field-content[style*="color:#1a6fc4"],
[data-bs-theme="dark"] #labelCanvas .label-field .field-content[style*="color: #1a6fc4"] {
    color: #1a6fc4 !important;
}

[data-bs-theme="dark"] #labelCanvas .label-field {
    background: rgba(255, 255, 255, 0.9) !important;
}

[data-bs-theme="dark"] #labelCanvas .label-field.type-box {
    background: rgba(0, 0, 0, 0.03) !important;
}

[data-bs-theme="dark"] #labelCanvas .label-field.selected {
    border-color: #0d6efd !important;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.5) !important;
}

[data-bs-theme="dark"] #labelCanvas .label-field:hover {
    border-color: #adb5bd !important;
}

[data-bs-theme="dark"] #canvasWrapper {
    background: var(--bs-secondary-bg) !important;
}

[data-bs-theme="dark"] #fieldContextMenu {
    background: var(--bs-body-bg) !important;
    border-color: var(--bs-border-color) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45) !important;
}

[data-bs-theme="dark"] #fieldContextMenu .ctx-item {
    color: var(--bs-body-color) !important;
}

[data-bs-theme="dark"] #fieldContextMenu .ctx-item[data-action="delete"] {
    color: var(--bs-danger) !important;
}

[data-bs-theme="dark"] #fieldContextMenu .ctx-item:hover {
    background: var(--bs-tertiary-bg) !important;
}

[data-bs-theme="dark"] #previewModal .modal-body {
    background: #555 !important;
}

/* ──────────────────────────────────────────────────────────────────────────────
   ORDER LIST — Packing Orders (/Order/Order)
   ────────────────────────────────────────────────────────────────────────────── */

[data-bs-theme="dark"] .order-section-card,
[data-bs-theme="dark"] .filter-card {
    background-color: var(--bs-secondary-bg) !important;
    border-color: var(--bs-border-color) !important;
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .order-section-header:hover {
    background-color: var(--bs-tertiary-bg) !important;
}

[data-bs-theme="dark"] tr.order-overdue td,
[data-bs-theme="dark"] tr.order-urgent td {
    color: var(--bs-body-color) !important;
}

[data-bs-theme="dark"] tr.order-overdue .badge,
[data-bs-theme="dark"] tr.order-urgent .badge,
[data-bs-theme="dark"] tr.order-overdue .progress-bar,
[data-bs-theme="dark"] tr.order-urgent .progress-bar {
    color: inherit;
}

[data-bs-theme="dark"] tr.order-missing-price td {
    color: var(--bs-body-color) !important;
}

[data-bs-theme="dark"] .orders-grid-wrap .dataTables_wrapper,
[data-bs-theme="dark"] .orders-grid-wrap table.dataTable {
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] table.table-striped.orders-grid > tbody > tr:nth-of-type(odd) > * {
    --bs-table-bg-type: var(--bs-tertiary-bg);
    --bs-table-color-type: var(--bs-body-color);
}

[data-bs-theme="dark"] .summary-chip.bg-secondary.text-white {
    color: var(--bs-body-color) !important;
}

/* ──────────────────────────────────────────────────────────────────────────────
   GRADING RUN DETAIL — nested tables inside cards
   ────────────────────────────────────────────────────────────────────────────── */

[data-bs-theme="dark"] .gr-detail .card .table-striped > tbody > tr:nth-of-type(odd):not(.plt-detail-row):not(.plt-group-detail-row) > * {
    --bs-table-bg-type: var(--bs-tertiary-bg);
    --bs-table-color-type: var(--bs-body-color);
    background-color: var(--bs-tertiary-bg) !important;
    color: var(--bs-body-color) !important;
}

[data-bs-theme="dark"] .gr-detail .card .table-striped > tbody > tr:nth-of-type(even):not(.plt-detail-row):not(.plt-group-detail-row) > * {
    background-color: var(--bs-body-bg) !important;
    color: var(--bs-body-color) !important;
}

/* ──────────────────────────────────────────────────────────────────────────────
   PROJECT-WIDE ENFORCEMENT — never leave dark / mid-gray text on dark canvas
   ────────────────────────────────────────────────────────────────────────────── */

[data-bs-theme="dark"] *[style*="color: #666"],
[data-bs-theme="dark"] *[style*="color:#666"],
[data-bs-theme="dark"] *[style*="color: #999"],
[data-bs-theme="dark"] *[style*="color:#999"],
[data-bs-theme="dark"] *[style*="color: #333"],
[data-bs-theme="dark"] *[style*="color:#333"],
[data-bs-theme="dark"] *[style*="color: #111"],
[data-bs-theme="dark"] *[style*="color:#111"],
[data-bs-theme="dark"] *[style*="color: #0d47a1"],
[data-bs-theme="dark"] *[style*="color:#0d47a1"],
[data-bs-theme="dark"] *[style*="color: navy"],
[data-bs-theme="dark"] *[style*="color:navy"] {
    color: var(--bs-secondary-color) !important;
}

/* Soft badges that use light/dark pairing stay readable */
[data-bs-theme="dark"] .badge.bg-light,
[data-bs-theme="dark"] .badge.bg-light.text-dark,
[data-bs-theme="dark"] .badge.bg-light.text-muted,
[data-bs-theme="dark"] .badge.bg-light.text-primary {
    background-color: var(--bs-secondary-bg) !important;
    color: var(--bs-body-color) !important;
    border-color: var(--bs-border-color) !important;
}

/* Outline buttons — light text + border everywhere */
[data-bs-theme="dark"] .btn-outline-secondary,
[data-bs-theme="dark"] .btn-outline-dark,
[data-bs-theme="dark"] .btn-outline-primary,
[data-bs-theme="dark"] .btn-outline-info,
[data-bs-theme="dark"] .btn-outline-warning,
[data-bs-theme="dark"] .btn-outline-success,
[data-bs-theme="dark"] .btn-outline-danger {
    --bs-btn-color: var(--bs-body-color);
    --bs-btn-border-color: var(--bs-border-color);
    --bs-btn-hover-color: var(--bs-emphasis-color);
    --bs-btn-hover-bg: var(--bs-tertiary-bg);
    --bs-btn-hover-border-color: var(--bs-border-color);
    --bs-btn-active-color: var(--bs-emphasis-color);
    --bs-btn-active-bg: var(--bs-tertiary-bg);
    --bs-btn-active-border-color: var(--bs-border-color);
    color: var(--bs-body-color);
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .btn-outline-danger {
    --bs-btn-color: #ea868f;
    --bs-btn-border-color: #ea868f;
    color: #ea868f;
    border-color: #ea868f;
}

[data-bs-theme="dark"] .btn-outline-success {
    --bs-btn-color: #75b798;
    --bs-btn-border-color: #75b798;
    color: #75b798;
    border-color: #75b798;
}

[data-bs-theme="dark"] .btn-outline-warning {
    --bs-btn-color: #ffc107;
    --bs-btn-border-color: #ffc107;
    color: #ffc107;
    border-color: #ffc107;
}

/* ══════════════════════════════════════════════════════════════════════════════
   CONTRAST SAFETY (last wins): Waste Pack / Packing / filter panels
   Always opaque dark fill + light text. Never white ink on a light card.
   ══════════════════════════════════════════════════════════════════════════════ */

[data-bs-theme="dark"] .wp-card,
[data-bs-theme="dark"] .pk-card,
[data-bs-theme="dark"] .wp-order-box,
[data-bs-theme="dark"] .filter-card {
    background-color: #2c3034 !important;
    color: #e9ecef !important;
    border-color: #495057 !important;
}

[data-bs-theme="dark"] .wp-card h6,
[data-bs-theme="dark"] .pk-card h6,
[data-bs-theme="dark"] .wp-card strong,
[data-bs-theme="dark"] .pk-card strong,
[data-bs-theme="dark"] .wp-order-box strong,
[data-bs-theme="dark"] .wp-card td,
[data-bs-theme="dark"] .pk-card td,
[data-bs-theme="dark"] .wp-card th,
[data-bs-theme="dark"] .pk-card th,
[data-bs-theme="dark"] .filter-card label,
[data-bs-theme="dark"] .filter-card .form-label {
    color: #e9ecef !important;
}

[data-bs-theme="dark"] .wp-card .text-secondary,
[data-bs-theme="dark"] .pk-card .text-secondary,
[data-bs-theme="dark"] .wp-card .text-muted,
[data-bs-theme="dark"] .pk-card .text-muted,
[data-bs-theme="dark"] .wp-order-box .text-secondary,
[data-bs-theme="dark"] .filter-card .text-secondary {
    color: #adb5bd !important;
}

[data-bs-theme="dark"] .wp-card table,
[data-bs-theme="dark"] .pk-card table,
[data-bs-theme="dark"] #tblWastePack {
    --bs-table-bg: transparent;
    --bs-table-color: #e9ecef;
    --bs-table-striped-color: #e9ecef;
    --bs-table-hover-color: #f8f9fa;
    color: #e9ecef !important;
}

[data-bs-theme="dark"] #tblWastePack thead th,
[data-bs-theme="dark"] #tblWastePack tbody td {
    background-color: #2c3034 !important;
    color: #e9ecef !important;
    border-color: #495057 !important;
}
