/*
 * Dark Theme — Costless WMS (UAT preview)
 * Applied via body.dark-theme class, toggled by JS, persisted in localStorage.
 */

body.dark-theme {
    --dt-bg:          #121212;
    --dt-bg-2:        #1e1e2e;
    --dt-bg-3:        #252538;
    --dt-bg-4:        #2e2e45;
    --dt-border:      #3a3a55;
    --dt-text:        #e0e0e8;
    --dt-text-muted:  #8888aa;
    --dt-text-head:   #d8e0f0;
    --dt-accent:      #4e80cc;
    --dt-accent-2:    #5a9aee;
    --dt-success:     #2ecc71;
    --dt-warning:     #f0a500;
    --dt-danger:      #e74c3c;
    --dt-info:        #3498db;
    --dt-input-bg:    #1e1e2e;
    --dt-input-border:#3a3a55;

    background-color: var(--dt-bg) !important;
    color: var(--dt-text) !important;
}

/* ── Page structure ─────────────────────────────────── */
body.dark-theme .content-wrapper,
body.dark-theme main,
body.dark-theme .container,
body.dark-theme .container-fluid {
    background: var(--dt-bg) !important;
    color: var(--dt-text) !important;
}

body.dark-theme .content-header {
    background: var(--dt-bg-2) !important;
    border-bottom: 1px solid var(--dt-border) !important;
    color: var(--dt-text) !important;
}

body.dark-theme h1, body.dark-theme h2, body.dark-theme h3,
body.dark-theme h4, body.dark-theme h5, body.dark-theme h6 {
    color: var(--dt-text);
}

/* ── Navbar ─────────────────────────────────────────── */
body.dark-theme .navbar {
    background-color: #0d0d1a !important;
    border-bottom: 1px solid var(--dt-border);
}

body.dark-theme .navbar .dropdown-menu {
    background-color: var(--dt-bg-3);
    border: 1px solid var(--dt-border);
}

body.dark-theme .navbar .dropdown-item {
    color: var(--dt-text);
}

body.dark-theme .navbar .dropdown-item:hover,
body.dark-theme .navbar .dropdown-item:focus {
    background-color: var(--dt-bg-4);
    color: var(--dt-accent-2);
}

body.dark-theme .navbar .dropdown-divider {
    border-color: var(--dt-border);
}

/* ── Clickable card headers (filter panels etc.) ───── */
body.dark-theme .card-header[style*="cursor"],
body.dark-theme .filter-header {
    background-color: var(--dt-bg-3) !important;
    color: var(--dt-text) !important;
    border-bottom-color: var(--dt-border) !important;
}

body.dark-theme .card-header[style*="cursor"]:hover,
body.dark-theme .filter-header:hover {
    background-color: var(--dt-bg-4) !important;
}

/* ── Cards ──────────────────────────────────────────── */
body.dark-theme .card {
    background-color: var(--dt-bg-2) !important;
    border-color: var(--dt-border) !important;
    color: var(--dt-text) !important;
}

body.dark-theme .card-header {
    background: var(--dt-bg-3) !important;
    border-bottom-color: var(--dt-border) !important;
    color: var(--dt-text) !important;
}

body.dark-theme .card-body {
    background-color: var(--dt-bg-2) !important;
    color: var(--dt-text) !important;
}

body.dark-theme .card-footer {
    background-color: var(--dt-bg-3) !important;
    border-top-color: var(--dt-border) !important;
}

/* ── Tables ─────────────────────────────────────────── */
/* Override Bootstrap 5 CSS variables so --bs-table-bg doesn't win */
body.dark-theme .table {
    --bs-table-bg:            var(--dt-bg-2);
    --bs-table-color:         var(--dt-text);
    --bs-table-border-color:  var(--dt-border);
    --bs-table-striped-bg:    #18182a;
    --bs-table-striped-color: var(--dt-text);
    --bs-table-hover-bg:      var(--dt-bg-4);
    --bs-table-hover-color:   var(--dt-text);
    --bs-table-active-bg:     var(--dt-bg-4);
    background: var(--dt-bg-2) !important;
    color: var(--dt-text) !important;
    border-color: var(--dt-border) !important;
}

body.dark-theme .table th {
    background-color: #1a1a30 !important;
    color: var(--dt-text-head) !important;
    border-color: var(--dt-border) !important;
    font-weight: 600 !important;
}

body.dark-theme .table td {
    background-color: var(--dt-bg-2) !important;
    border-color: var(--dt-border) !important;
    color: var(--dt-text) !important;
}

body.dark-theme .table-hover tbody tr:hover td {
    background-color: var(--dt-bg-4) !important;
    color: var(--dt-text) !important;
}

/* Even rows */
body.dark-theme .table-striped tbody tr:nth-of-type(even) td {
    background-color: var(--dt-bg-2) !important;
    color: var(--dt-text) !important;
}

/* Odd rows — noticeably darker to make alternation visible */
body.dark-theme .table-striped tbody tr:nth-of-type(odd) td {
    background-color: #18182a !important;
    color: var(--dt-text) !important;
}

/* Override Bootstrap's rgba stripe overlay completely */
body.dark-theme .table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-accent-bg: transparent;
    background-color: #18182a !important;
    color: var(--dt-text) !important;
}

body.dark-theme .table-striped > tbody > tr:nth-of-type(even) > * {
    --bs-table-accent-bg: transparent;
    background-color: var(--dt-bg-2) !important;
    color: var(--dt-text) !important;
}

body.dark-theme tfoot tr td,
body.dark-theme tfoot tr th {
    background-color: var(--dt-bg-3) !important;
    border-color: var(--dt-border) !important;
    color: var(--dt-text) !important;
}

body.dark-theme .table-bordered,
body.dark-theme .table-bordered th,
body.dark-theme .table-bordered td {
    border-color: var(--dt-border) !important;
}

/* Bootstrap 5 thead has its own variable */
body.dark-theme .table thead,
body.dark-theme .table thead tr,
body.dark-theme .table thead th,
body.dark-theme .table thead td {
    --bs-table-bg:          #1a1a30;
    --bs-table-color:       var(--dt-text-head);
    --bs-table-accent-bg:   transparent;
    background-color: #1a1a30 !important;
    color: var(--dt-text-head) !important;
    border-color: var(--dt-border) !important;
    font-weight: 600 !important;
    letter-spacing: 0.02em;
}

/* Bootstrap 5 colored row variants */
body.dark-theme .table .table-primary,
body.dark-theme .table tr.table-primary td,
body.dark-theme .table tr.table-primary th {
    --bs-table-bg: #1a2f4a;
    background-color: #1a2f4a !important;
    color: #90b8e8 !important;
}

body.dark-theme .table .table-success,
body.dark-theme .table tr.table-success td,
body.dark-theme .table tr.table-success th {
    --bs-table-bg: #0d2e1a;
    background-color: #0d2e1a !important;
    color: #70d090 !important;
}

body.dark-theme .table .table-warning,
body.dark-theme .table tr.table-warning td,
body.dark-theme .table tr.table-warning th {
    --bs-table-bg: #2e2000;
    background-color: #2e2000 !important;
    color: #f0c060 !important;
}

body.dark-theme .table .table-danger,
body.dark-theme .table tr.table-danger td,
body.dark-theme .table tr.table-danger th {
    --bs-table-bg: #2e0d0d;
    background-color: #2e0d0d !important;
    color: #f08080 !important;
}

body.dark-theme .table .table-info,
body.dark-theme .table tr.table-info td,
body.dark-theme .table tr.table-info th {
    --bs-table-bg: #0d2535;
    background-color: #0d2535 !important;
    color: #7ec8e3 !important;
}

body.dark-theme .table .table-secondary,
body.dark-theme .table tr.table-secondary td,
body.dark-theme .table tr.table-secondary th {
    --bs-table-bg: var(--dt-bg-4);
    background-color: var(--dt-bg-4) !important;
    color: var(--dt-text-muted) !important;
}

body.dark-theme .table .table-active,
body.dark-theme .table tr.table-active td,
body.dark-theme .table tr.table-active th {
    --bs-table-bg: var(--dt-bg-4);
    background-color: var(--dt-bg-4) !important;
    color: var(--dt-text) !important;
}

/* ── Forms ──────────────────────────────────────────── */
body.dark-theme .form-control,
body.dark-theme .form-select {
    background: var(--dt-input-bg) !important;
    border-color: var(--dt-input-border) !important;
    color: var(--dt-text) !important;
    color-scheme: dark;
}

body.dark-theme .form-control:focus,
body.dark-theme .form-select:focus {
    background: var(--dt-bg-3) !important;
    border-color: var(--dt-accent) !important;
    color: var(--dt-text) !important;
    box-shadow: 0 0 0 0.2rem rgba(78,128,204,0.25);
    color-scheme: dark;
}

body.dark-theme select {
    color-scheme: dark;
}

body.dark-theme .form-control::placeholder {
    color: var(--dt-text-muted);
}

body.dark-theme .form-label,
body.dark-theme label {
    color: var(--dt-text);
}

body.dark-theme .input-group-text {
    background-color: var(--dt-bg-3) !important;
    border-color: var(--dt-input-border) !important;
    color: var(--dt-text-muted) !important;
}

body.dark-theme select option {
    background-color: var(--dt-bg-3);
    color: var(--dt-text);
}

/* ── Buttons ────────────────────────────────────────── */
body.dark-theme .btn-outline-secondary {
    color: var(--dt-text-muted);
    border-color: var(--dt-border);
}

body.dark-theme .btn-outline-secondary:hover {
    background-color: var(--dt-bg-4);
    color: var(--dt-text);
    border-color: var(--dt-accent);
}

body.dark-theme .btn-light {
    background-color: var(--dt-bg-3);
    border-color: var(--dt-border);
    color: var(--dt-text);
}

body.dark-theme .btn-light:hover {
    background-color: var(--dt-bg-4);
}

body.dark-theme .btn-primary {
    --bs-btn-bg:           #2563eb;
    --bs-btn-border-color: #2563eb;
    --bs-btn-color:        #fff;
    --bs-btn-hover-bg:     #1d4ed8;
    --bs-btn-hover-color:  #fff;
    background-color: #2563eb !important;
    border-color:     #2563eb !important;
    color:            #fff   !important;
}

body.dark-theme .btn-primary:hover {
    background-color: #1d4ed8 !important;
    border-color:     #1d4ed8 !important;
}

body.dark-theme .btn-success {
    --bs-btn-bg:           #16a34a;
    --bs-btn-border-color: #16a34a;
    --bs-btn-color:        #fff;
    --bs-btn-hover-bg:     #15803d;
    --bs-btn-hover-color:  #fff;
    background-color: #16a34a !important;
    border-color:     #16a34a !important;
    color:            #fff   !important;
}

body.dark-theme .btn-success:hover {
    background-color: #15803d !important;
    border-color:     #15803d !important;
}

body.dark-theme .btn-warning {
    --bs-btn-bg:          #d97706;
    --bs-btn-border-color:#d97706;
    --bs-btn-color:       #fff;
    background-color: #d97706 !important;
    border-color:     #d97706 !important;
    color:            #fff   !important;
}

body.dark-theme .btn-warning:hover {
    background-color: #b45309 !important;
    border-color:     #b45309 !important;
}

body.dark-theme .btn-danger {
    --bs-btn-bg:           #dc2626;
    --bs-btn-border-color: #dc2626;
    --bs-btn-color:        #fff;
    background-color: #dc2626 !important;
    border-color:     #dc2626 !important;
    color:            #fff   !important;
}

body.dark-theme .btn-danger:hover {
    background-color: #b91c1c !important;
    border-color:     #b91c1c !important;
}

body.dark-theme .btn-secondary {
    --bs-btn-bg:           #4b5563;
    --bs-btn-border-color: #4b5563;
    --bs-btn-color:        #e5e7eb;
    background-color: #4b5563 !important;
    border-color:     #4b5563 !important;
    color:            #e5e7eb !important;
}

body.dark-theme .btn-secondary:hover {
    background-color: #374151 !important;
    border-color:     #374151 !important;
}

body.dark-theme .btn-info {
    background-color: #1a6fa8;
    border-color: #1a6fa8;
    color: #fff;
}

body.dark-theme .btn-info:hover {
    background-color: #1e82c4;
    border-color: #1e82c4;
    color: #fff;
}

body.dark-theme .btn-outline-success {
    color: #4ade80;
    border-color: #16a34a;
}

body.dark-theme .btn-outline-success:hover,
body.dark-theme .btn-outline-success.active,
body.dark-theme .btn-outline-success:active {
    background-color: #14532d;
    border-color: #16a34a;
    color: #86efac;
}

body.dark-theme .btn-outline-info {
    color: #5bc0de;
    border-color: #5bc0de;
}

body.dark-theme .btn-outline-info:hover,
body.dark-theme .btn-outline-info.active,
body.dark-theme .btn-outline-info:active {
    background-color: #1a6fa8;
    border-color: #5bc0de;
    color: #fff;
}

body.dark-theme .btn-outline-primary {
    color: var(--dt-accent-2);
    border-color: var(--dt-accent);
}

body.dark-theme .btn-outline-primary:hover {
    background-color: var(--dt-accent);
    color: #fff;
}

body.dark-theme .btn-outline-warning {
    color: var(--dt-warning);
    border-color: var(--dt-warning);
}

body.dark-theme .btn-outline-warning:hover,
body.dark-theme .btn-outline-warning.active,
body.dark-theme .btn-outline-warning:active {
    background-color: #7a5500;
    border-color: var(--dt-warning);
    color: #ffd060;
}

body.dark-theme .btn-outline-danger {
    color: #f08080;
    border-color: var(--dt-danger);
}

body.dark-theme .btn-outline-danger:hover {
    background-color: var(--dt-danger);
    color: #fff;
}

body.dark-theme .btn-outline-purple {
    color: #d4a0f0;
    border-color: #9c27b0;
}

body.dark-theme .btn-outline-purple:hover,
body.dark-theme .btn-outline-purple.active,
body.dark-theme .btn-outline-purple:active {
    background-color: #5a1275;
    border-color: #9c27b0;
    color: #ead0ff;
}

/* AdminLTE btn-tool (card collapse/expand buttons) */
body.dark-theme .btn-tool {
    background: none;
    color: var(--dt-text-muted);
    border: none;
}

body.dark-theme .btn-tool:hover {
    color: var(--dt-text);
}

/* ── Alerts ─────────────────────────────────────────── */
body.dark-theme .alert-info {
    background-color: #1a3a50;
    border-color: #1e4d6b;
    color: #7ec8e3;
}

body.dark-theme .alert-warning {
    background-color: #3a2800;
    border-color: #5a3f00;
    color: #f0c060;
}

body.dark-theme .alert-danger {
    background-color: #3a0d0d;
    border-color: #5a1515;
    color: #f08080;
}

body.dark-theme .alert-success {
    background-color: #0d3a1e;
    border-color: #155a2e;
    color: #70e090;
}

body.dark-theme .alert-secondary {
    background-color: var(--dt-bg-3);
    border-color: var(--dt-border);
    color: var(--dt-text-muted);
}

body.dark-theme .alert-light {
    background-color: var(--dt-bg-3) !important;
    border-color: var(--dt-border) !important;
    color: var(--dt-text) !important;
}

body.dark-theme .alert-light .text-warning,
body.dark-theme .alert-light i.text-warning {
    color: var(--dt-warning) !important;
}

/* badge.text-dark overrides — keep text readable in dark mode */
body.dark-theme .badge.text-dark,
body.dark-theme .badge.bg-warning.text-dark {
    color: #fff !important;
}

/* .form-label color override (list.css sets #495057) */
body.dark-theme .form-label,
body.dark-theme label,
body.dark-theme .filter-panel .form-label {
    color: var(--dt-text) !important;
}

/* filter-panel card header (list.css sets #f8f9fa hover) */
body.dark-theme .filter-panel .card-header,
body.dark-theme .filter-panel .card-header:hover {
    background-color: var(--dt-bg-3) !important;
    color: var(--dt-text) !important;
    border-color: var(--dt-border) !important;
}

/* page-header border */
body.dark-theme .page-header {
    border-bottom-color: var(--dt-border) !important;
}

/* ── Badges ─────────────────────────────────────────── */
body.dark-theme .badge.bg-light {
    background-color: var(--dt-bg-3) !important;
    color: var(--dt-text) !important;
}

/* ── Modals ─────────────────────────────────────────── */
body.dark-theme .modal-content {
    background-color: var(--dt-bg-2);
    border-color: var(--dt-border);
    color: var(--dt-text);
}

body.dark-theme .modal-header {
    background-color: var(--dt-bg-3);
    border-bottom-color: var(--dt-border);
}

body.dark-theme .modal-footer {
    background-color: var(--dt-bg-3);
    border-top-color: var(--dt-border);
}

body.dark-theme .modal-backdrop {
    background-color: #000;
}

/* ── Dropdowns ──────────────────────────────────────── */
body.dark-theme .dropdown-menu {
    background-color: var(--dt-bg-3);
    border-color: var(--dt-border);
}

body.dark-theme .dropdown-item {
    color: var(--dt-text);
}

body.dark-theme .dropdown-item:hover,
body.dark-theme .dropdown-item:focus {
    background-color: var(--dt-bg-4);
    color: var(--dt-accent-2);
}

body.dark-theme .dropdown-divider {
    border-color: var(--dt-border);
}

/* ── List groups ────────────────────────────────────── */
body.dark-theme .list-group-item {
    background-color: var(--dt-bg-2);
    border-color: var(--dt-border);
    color: var(--dt-text);
}

body.dark-theme .list-group-item-action:hover {
    background-color: var(--dt-bg-4);
    color: var(--dt-text);
}

body.dark-theme .list-group-item.active {
    background-color: var(--dt-accent);
    border-color: var(--dt-accent);
}

/* ── Misc ───────────────────────────────────────────── */
body.dark-theme .text-muted {
    color: var(--dt-text-muted) !important;
}

body.dark-theme .bg-light {
    background-color: var(--dt-bg-3) !important;
    color: var(--dt-text) !important;
}

body.dark-theme .bg-white {
    background-color: var(--dt-bg-2) !important;
}

body.dark-theme hr,
body.dark-theme .border-top,
body.dark-theme .border-bottom {
    border-color: var(--dt-border) !important;
}

body.dark-theme a {
    color: var(--dt-accent-2);
}

body.dark-theme a:hover {
    color: #80b4ff;
}

body.dark-theme .breadcrumb {
    background-color: transparent;
}

body.dark-theme .breadcrumb-item.active {
    color: var(--dt-text-muted);
}

body.dark-theme .breadcrumb-item + .breadcrumb-item::before {
    color: var(--dt-text-muted);
}

body.dark-theme .pagination .page-link {
    background-color: var(--dt-bg-3);
    border-color: var(--dt-border);
    color: var(--dt-text);
}

body.dark-theme .pagination .page-item.active .page-link {
    background-color: var(--dt-accent);
    border-color: var(--dt-accent);
}

body.dark-theme .pagination .page-link:hover {
    background-color: var(--dt-bg-4);
}

/* ── Select2 ────────────────────────────────────────── */
body.dark-theme .select2-container--bootstrap-5 .select2-selection {
    background-color: var(--dt-input-bg);
    border-color: var(--dt-input-border);
    color: var(--dt-text);
}

body.dark-theme .select2-container--bootstrap-5 .select2-dropdown {
    background-color: var(--dt-bg-3);
    border-color: var(--dt-border);
    color: var(--dt-text);
}

body.dark-theme .select2-container--bootstrap-5 .select2-results__option {
    color: var(--dt-text);
}

body.dark-theme .select2-container--bootstrap-5 .select2-results__option--highlighted {
    background-color: var(--dt-accent);
    color: #fff;
}

body.dark-theme .select2-container--bootstrap-5 .select2-selection__rendered {
    color: var(--dt-text);
}

/* ── PO ship-to text colors (light + dark) ─────────── */
.po-shipto-expediter { color: #9c27b0; }
.po-shipto-store     { color: #856404; }

body.dark-theme .po-shipto-expediter { color: #d4a0f0 !important; }
body.dark-theme .po-shipto-store     { color: #f0c060 !important; }

/* ── PO legend badges (light + dark) ───────────────── */
.po-legend-altship  { background-color: rgba(255,193,7,0.15); color: #856404; border: 1px solid rgba(255,193,7,0.3); }
.po-legend-diverted { background-color: rgba(156,39,176,0.12); color: #6a1b9a; border: 1px solid rgba(156,39,176,0.3); }
.po-legend          { background-color: rgba(13,202,240,0.1); }

body.dark-theme .po-legend           { background-color: rgba(13,202,240,0.08) !important; border-color: rgba(13,202,240,0.2) !important; }
body.dark-theme .po-legend-altship   { background-color: rgba(180,130,0,0.30) !important; color: #f0c060 !important; border-color: rgba(180,130,0,0.4) !important; }
body.dark-theme .po-legend-diverted  { background-color: rgba(156,39,176,0.30) !important; color: #d4a0f0 !important; border-color: rgba(156,39,176,0.5) !important; }

/* ── PO row highlights (light mode) ────────────────── */
tr.po-row-diverted td   { background-color: rgba(156, 39, 176, 0.12) !important; }
tr.po-row-expediter td  { background-color: rgba(156, 39, 176, 0.25) !important; }
tr.po-row-altship td    { background-color: rgba(255, 193, 7, 0.15) !important; }

/* ── PO row highlights (dark mode) ─────────────────── */
body.dark-theme tr.po-row-diverted td  { background-color: rgba(156, 39, 176, 0.20) !important; color: var(--dt-text) !important; }
body.dark-theme tr.po-row-expediter td { background-color: rgba(156, 39, 176, 0.40) !important; color: var(--dt-text) !important; }
body.dark-theme tr.po-row-altship td   { background-color: rgba(180, 130, 0, 0.25) !important;  color: var(--dt-text) !important; }

body.dark-theme tr.po-row-diverted:hover td,
body.dark-theme tr.po-row-expediter:hover td,
body.dark-theme tr.po-row-altship:hover td {
    filter: brightness(1.15);
}

/* ── Theme toggle button ────────────────────────────── */
#theme-toggle {
    cursor: pointer;
    background: none;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.8);
    transition: all 0.2s;
}

#theme-toggle:hover {
    border-color: rgba(255,255,255,0.6);
    color: #fff;
}

/* ── ABC Dashboard ─────────────────────────────────── */
body.dark-theme .abc-card {
    background: linear-gradient(135deg, #3a3f7a 0%, #4a3568 100%) !important;
    color: #e0e0e8 !important;
}
body.dark-theme .abc-card.class-a {
    background: linear-gradient(135deg, #7a2060 0%, #7a2030 100%) !important;
    color: #e0e0e8 !important;
}
body.dark-theme .abc-card.class-b {
    background: linear-gradient(135deg, #1a4a7a 0%, #0a3a5a 100%) !important;
    color: #e0e0e8 !important;
}
body.dark-theme .abc-card.class-c {
    background: linear-gradient(135deg, #1a5a38 0%, #0a4a38 100%) !important;
    color: #e0e0e8 !important;
}
body.dark-theme .metric-card {
    background: var(--dt-bg-2) !important;
    border-color: var(--dt-border) !important;
    color: var(--dt-text) !important;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(0, 0, 0, 0.4) !important;
}
body.dark-theme .classification-badge.A {
    background-color: #8b1a1a !important;
    color: #ffaaaa !important;
}
body.dark-theme .classification-badge.B {
    background-color: #1a3a6b !important;
    color: #90b8e8 !important;
}
body.dark-theme .classification-badge.C {
    background-color: #0d3a1e !important;
    color: #70d090 !important;
}

/* ── Transaction List ──────────────────────────────── */
body.dark-theme .group-header td {
    background-color: #1a2a3a !important;
    color: var(--dt-text) !important;
}
body.dark-theme .group-header:hover td {
    background-color: var(--dt-bg-4) !important;
}
body.dark-theme .group-details {
    background-color: var(--dt-bg) !important;
}
body.dark-theme .group-details td {
    background-color: var(--dt-bg) !important;
    border-left-color: var(--dt-accent) !important;
    color: var(--dt-text) !important;
}
body.dark-theme .qty-positive {
    color: var(--dt-success) !important;
}
body.dark-theme .qty-negative {
    color: var(--dt-danger) !important;
}
body.dark-theme .group-stats {
    color: var(--dt-text-muted) !important;
}

/* ── AdminLTE Info Boxes (Pricing Override Summary) ── */
body.dark-theme .info-box {
    background: var(--dt-bg-2) !important;
    border-color: var(--dt-border) !important;
    color: var(--dt-text) !important;
    box-shadow: 0 0 1px rgba(0, 0, 0, 0.4) !important;
}
body.dark-theme .info-box-content {
    background: var(--dt-bg-2) !important;
    color: var(--dt-text) !important;
}
body.dark-theme .info-box-text {
    color: var(--dt-text-muted) !important;
}
body.dark-theme .info-box-number {
    color: var(--dt-text) !important;
}

/* ── Warehouse Report to Stores ─────────────────── */
body.dark-theme .summary-box {
    background-color: var(--dt-bg-2) !important;
    border-color: var(--dt-border) !important;
    color: var(--dt-text) !important;
}
body.dark-theme .summary-box h4 {
    color: var(--dt-accent) !important;
}
body.dark-theme .warehouse-table th {
    background-color: var(--dt-bg-3) !important;
    border-color: var(--dt-border) !important;
    color: var(--dt-text) !important;
}
body.dark-theme .warehouse-table td {
    border-color: var(--dt-border) !important;
    color: var(--dt-text) !important;
}
body.dark-theme .warehouse-table tr:hover td {
    background-color: var(--dt-bg-4) !important;
}
body.dark-theme .report-date {
    color: var(--dt-text-muted) !important;
}

/* ── Delivery Calendar — card gradients ─────────── */
body.dark-theme .store-delivery-item {
    background: linear-gradient(90deg, rgba(40, 167, 69, 0.35) 0%, transparent 20%) !important;
}
body.dark-theme .store-delivery-item .delivery-unconfirmed {
    background: linear-gradient(90deg, rgba(23, 162, 184, 0.35) 0%, transparent 20%) !important;
}
body.dark-theme .delivery-unscheduled {
    background: linear-gradient(90deg, rgba(255, 193, 7, 0.4) 0%, transparent 20%) !important;
}
body.dark-theme .delivery-unscheduled.overdue {
    background: linear-gradient(90deg, rgba(220, 53, 69, 0.4) 0%, transparent 20%) !important;
}
body.dark-theme .local-delivery-item {
    background: linear-gradient(90deg, rgba(255, 193, 7, 0.4) 0%, transparent 20%) !important;
}
body.dark-theme .local-confirmed-item {
    background: linear-gradient(90deg, rgba(255, 193, 7, 0.35) 0%, transparent 20%) !important;
}
body.dark-theme .delivery-unscheduled::before {
    color: #ffc107 !important;
    text-shadow: none !important;
}
body.dark-theme .delivery-unscheduled.overdue::before {
    color: #ff6b6b !important;
}

/* ── Gross Margin Report ─────────────────────────── */
body.dark-theme .filter-form {
    background-color: var(--dt-bg-3) !important;
    border-color: var(--dt-border) !important;
    color: var(--dt-text) !important;
}
body.dark-theme .margin-table th {
    background-color: var(--dt-bg-3) !important;
    border-color: var(--dt-border) !important;
    color: var(--dt-text) !important;
}
body.dark-theme .margin-table td {
    border-color: var(--dt-border) !important;
    color: var(--dt-text) !important;
}
body.dark-theme .store-total-row {
    background-color: #0d3a1e !important;
    color: var(--dt-text) !important;
}
body.dark-theme .store-total-row:hover {
    background-color: #1a5a38 !important;
}
body.dark-theme .category-row {
    background-color: var(--dt-bg) !important;
}
body.dark-theme .dept-row:hover {
    background-color: var(--dt-bg-4) !important;
}
body.dark-theme .category-name {
    color: var(--dt-text-muted) !important;
}
body.dark-theme .margin-bar {
    background-color: var(--dt-bg-4) !important;
}

/* ── Price Intelligence ──────────────────────────── */
body.dark-theme .pi-nav .nav-link {
    color: var(--dt-text-muted) !important;
}
body.dark-theme .pi-nav .nav-link:hover {
    background: var(--dt-bg-4) !important;
    color: var(--dt-text) !important;
}
body.dark-theme .pi-nav .nav-link.active {
    background: #1a237e !important;
    color: white !important;
}
body.dark-theme .filter-bar {
    background: var(--dt-bg-3) !important;
    color: var(--dt-text) !important;
}
body.dark-theme .cat-summary-card {
    background: var(--dt-bg-2) !important;
    border-color: var(--dt-border) !important;
    color: var(--dt-text) !important;
}
body.dark-theme .cat-summary-card.win {
    border-color: var(--dt-success) !important;
    background: #0d3a1e !important;
}
body.dark-theme .cat-summary-card.lose {
    border-color: var(--dt-danger) !important;
    background: #3a0d0d !important;
}
body.dark-theme .cl-card {
    background: #2a2a1a !important;
    border-color: #a07800 !important;
    color: var(--dt-text) !important;
}
body.dark-theme .cl-card .cl-price {
    color: #7ba7e8 !important;
}
body.dark-theme .cl-card .cl-story {
    color: var(--dt-text-muted) !important;
}
body.dark-theme .comp-cheaper {
    background-color: #3a0d0d !important;
}
body.dark-theme .comp-more-expensive {
    background-color: #0d3a1e !important;
}
body.dark-theme .match-group {
    background: var(--dt-bg-3) !important;
    border-color: var(--dt-border) !important;
}
body.dark-theme .story-text {
    color: var(--dt-text-muted) !important;
}
body.dark-theme .unmatched-section h6 {
    color: var(--dt-text-muted) !important;
}
body.dark-theme .category-section h5 {
    color: var(--dt-text) !important;
    border-bottom-color: #3d4db7 !important;
}
