/* Dark mode corrections for the layers added on top of the template (tables, switches, forms, panels, popups).
   Palette is the template's own: page #0d2525, surface #152b2b, lines rgba(255,255,255,.12). */
body.dark-mode {
    --dk-surface: #152b2b;
    --dk-raised: #1b3535;
    --dk-line: rgba(255, 255, 255, .12);
    --dk-text: #e8f1f0;
    --dk-muted: #a9bdbb;
}

/* ---------- Tables ---------- */
body.dark-mode .Table_style_1 { background: var(--dk-surface) !important; border-color: var(--dk-line) !important; }
body.dark-mode .Table_style_1 table thead th { background: var(--dk-raised) !important; color: var(--dk-text) !important; border-color: var(--dk-line) !important; }
body.dark-mode .Table_style_1 table thead th p { color: var(--dk-text) !important; }
body.dark-mode .Table_style_1 table tbody tr td { background: transparent; color: var(--dk-text); border-color: var(--dk-line) !important; }
body.dark-mode .Table_style_1 table tbody tr td p, body.dark-mode .Table_style_1 table tbody tr td span:not([class*="status"]):not(.badge) { color: var(--dk-text); }
body.dark-mode .Table_style_1 table.dv-cards tbody tr { background: var(--dk-surface) !important; border-color: var(--dk-line) !important; }
body.dark-mode .Table_style_1 table.dv-cards tbody tr td::before { color: var(--dk-muted) !important; }
body.dark-mode .Table_style_1 table.dv-cards tbody tr td { border-color: var(--dk-line) !important; }
body.dark-mode .Table_style_1 .ActionsGroup .optionItem { background: transparent; border-color: var(--dk-line); }
body.dark-mode .Table_style_1 .ActionsGroup .optionItem:hover { background: var(--dk-raised); }
body.dark-mode .TableDataShow p, body.dark-mode .TableDataShow select { color: var(--dk-muted); }
body.dark-mode .TableDataShow select { background: transparent; }
body.dark-mode .TableDataShow .leftSide select option { color: #111; }

/* table / cards switch */
body.dark-mode .dv-view-switch { background: var(--dk-raised); border-color: var(--dk-line); }
body.dark-mode .dv-view-switch button:not(.is-active) { color: var(--dk-muted); }
body.dark-mode .dv-view-switch button:not(.is-active):hover { background: rgba(255, 255, 255, .08); }
body.dark-mode .dv-sort svg { fill: #5d7573; }
body.dark-mode .Table_style_1 th.dv-sortable:hover .dv-sort svg { fill: #8fa8a6; }

/* ---------- Popups ---------- */
body.dark-mode .modal .modal-content .btn-close { background: rgba(255, 255, 255, .10) !important; }
body.dark-mode .modal .modal-content .btn-close:hover { background: rgba(255, 255, 255, .18) !important; }
body.dark-mode .modal .modal-content .btn-close svg { fill: #cfdcdb; }
body.dark-mode .modal .modal-content .btn-close img { filter: brightness(1.6); }
body.dark-mode .modal-content, body.dark-mode .modal-body { color: var(--dk-text); }
body.dark-mode .modal h2, body.dark-mode .modal h3 { color: #fff; }
body.dark-mode .modal p, body.dark-mode .modal label { color: var(--dk-muted); }

/* ---------- Single-choice dropdown check, add-shipment form ---------- */
body.dark-mode .dropdown-menu .dropdown-item:has(.chiller_cb input[type="radio"]:checked)::after { background-color: #3fd1a1; }
body.dark-mode .AddCustomShippingBox { background: var(--dk-surface) !important; border-color: var(--dk-line) !important; }
body.dark-mode .AddCustomShippingBox .GridItems .ItemBox .shippingAmount { background: var(--dk-raised) !important; }
body.dark-mode .AddCustomShippingBox .GridItems .ItemBox .shippingAmount p,
body.dark-mode .AddCustomShippingBox .GridItems .ItemBox .shippingAmount span { color: var(--dk-text) !important; }
body.dark-mode .AddCustomShippingBox .ItemBox:focus-within,
body.dark-mode .AddCustomShippingBox .ItemBox:has(.dropdown.show) { background: rgba(255, 255, 255, .06) !important; }
body.dark-mode .AddCustomShippingBox .labelName, body.dark-mode .AddCustomShippingBox label { color: var(--dk-muted); }
body.dark-mode .AddCustomShippingBox .form-control, body.dark-mode .AddCustomShippingBox .select2-selection__rendered { color: var(--dk-text); }

/* ---------- Cards and tiles ---------- */
body.dark-mode .itemTahseel .icon { background: rgba(255, 255, 255, .08); }
body.dark-mode .limetedMonylabel { background: var(--dk-raised) !important; }
body.dark-mode .limetedMonylabel .rightSide p { color: var(--dk-text); }
body.dark-mode .limetedMonylabel .rightSide p + p { border-top-color: var(--dk-line); }

/* ---------- Checkboxes / radios ---------- */
body.dark-mode .chiller_cb span { background: transparent !important; border: 1.5px solid rgba(255, 255, 255, .3) !important; border-radius: 6px; }
body.dark-mode .chiller_cb input:checked ~ span { background: #007B7D !important; border-color: #007B7D !important; }

/* ---------- Select2 and pickers ---------- */
body.dark-mode .select2-dropdown { background: var(--dk-surface) !important; border-color: var(--dk-line) !important; color: var(--dk-text); }
body.dark-mode .select2-container--default .select2-results__option { color: var(--dk-text); }
body.dark-mode .select2-container--default .select2-results__option--highlighted[aria-selected], body.dark-mode .select2-container--default .select2-results__option--highlighted { background: rgba(255, 255, 255, .08) !important; color: #fff !important; }
body.dark-mode .select2-container--default .select2-results__option[aria-selected="true"] { background: rgba(0, 123, 125, .35) !important; }
body.dark-mode .select2-container--default .select2-selection__rendered { color: var(--dk-text) !important; }
body.dark-mode .select2-container--default .select2-search--dropdown .select2-search__field { background: transparent; color: var(--dk-text); border-color: var(--dk-line); }
body.dark-mode .flatpickr-calendar { background: var(--dk-surface); border-color: var(--dk-line); box-shadow: 0 12px 32px rgba(0, 0, 0, .4); }
body.dark-mode .flatpickr-calendar *, body.dark-mode .flatpickr-day { color: var(--dk-text); }
body.dark-mode .flatpickr-day:hover { background: rgba(255, 255, 255, .1); border-color: transparent; }
body.dark-mode .flatpickr-day.selected, body.dark-mode .flatpickr-day.startRange, body.dark-mode .flatpickr-day.endRange { background: #007B7D; border-color: #007B7D; color: #fff; }
body.dark-mode .flatpickr-day.inRange { background: rgba(0, 123, 125, .3); box-shadow: -5px 0 0 rgba(0, 123, 125, .3), 5px 0 0 rgba(0, 123, 125, .3); border-color: transparent; }
body.dark-mode .flatpickr-day.prevMonthDay, body.dark-mode .flatpickr-day.nextMonthDay, body.dark-mode .flatpickr-day.flatpickr-disabled { color: #627c7a; }
body.dark-mode .flatpickr-weekday, body.dark-mode .flatpickr-months .flatpickr-month { color: var(--dk-muted); fill: var(--dk-muted); }
body.dark-mode .flatpickr-months .flatpickr-prev-month svg, body.dark-mode .flatpickr-months .flatpickr-next-month svg { fill: var(--dk-text); }

/* ---------- Side panels (filters, updates, activity) ---------- */
body.dark-mode nav.super-agent, body.dark-mode #SideNotfication, body.dark-mode .leftSideNotfication { background: var(--dk-surface) !important; color: var(--dk-text); }
body.dark-mode nav.super-agent h2, body.dark-mode #SideNotfication h2 { color: #fff; }
body.dark-mode nav.super-agent p, body.dark-mode nav.super-agent label, body.dark-mode #SideNotfication p { color: var(--dk-muted); }
body.dark-mode #SideNotfication .ActivityItem { border-color: var(--dk-line); }
body.dark-mode #SideNotfication .ActivityItem .icon { background: rgba(255, 255, 255, .08); }
body.dark-mode #SideNotfication .Data p span { color: #fff; }

/* ---------- Login ---------- */
body.dark-mode .AuthnticationPage .form-check-label, body.dark-mode .AuthnticationPage label { color: var(--dk-text); }
body.dark-mode .modal .form-control, body.dark-mode .modal .form-select, body.dark-mode .modal .inputGroup .form-control { background: rgba(255, 255, 255, .05) !important; border-color: var(--dk-line) !important; color: var(--dk-text) !important; }
body.dark-mode .modal .form-control::placeholder { color: #7f9694; }

/* WCAG AA contrast (4.5:1 text, 3:1 large text/UI) */
body.dark-mode { --dk-accent: #5fd6d0; --dk-green: #6fdc9c; --dk-red: #ff8f8a; --dk-muted: #b4c7c5; }
body.dark-mode .btn_style_green_open, body.dark-mode .btn_style_green_open span { background-color: #0b7a44 !important; color: #fff !important; }
body.dark-mode .btn_style_green_open:hover { background-color: #0e8e50 !important; }
body.dark-mode .btn_style_green_light, body.dark-mode .btn_style_green_light span { color: var(--dk-accent) !important; }
body.dark-mode .Table_style_1 a, body.dark-mode .Dropstatisc a { color: var(--dk-accent); }
body.dark-mode .FilterSideBare .FilterFooter span, body.dark-mode .FilterSideBare [class*="reset"] span { color: var(--dk-accent) !important; }
body.dark-mode .settingTaps .nav-link, body.dark-mode .settingTaps .nav-link span { color: var(--dk-muted) !important; }
body.dark-mode .settingTaps .nav-link.active, body.dark-mode .settingTaps .nav-link.active span { color: #fff !important; }
body.dark-mode .createShippigBox p, body.dark-mode .createShippigBox h2 { color: #fff !important; opacity: 1 !important; }
body.dark-mode .apexcharts-legend-text, body.dark-mode .apexcharts-text { fill: var(--dk-muted) !important; color: var(--dk-muted) !important; }
body.dark-mode .calUpdateInfos h2 { filter: brightness(1.7); }
body.dark-mode .calUpdateInfos p { color: var(--dk-text) !important; }
body.dark-mode .text-danger, body.dark-mode h2[style*="#D32A28"], body.dark-mode .minus { color: var(--dk-red) !important; }
body.dark-mode .select2-selection__placeholder, body.dark-mode ::placeholder { color: #9bb3b1 !important; opacity: 1; }
body.dark-mode label, body.dark-mode .form-label { color: var(--dk-muted); }
body.dark-mode .FilterSideBare .btn_style_green span, body.dark-mode .FilterSideBare .btn_style_green { color: #fff !important; }
body.dark-mode .calUpdateInfos h2[style*="007B7D"] { color: var(--dk-accent) !important; filter: none; }
body.dark-mode .calUpdateInfos h2[style*="1DB261"] { color: var(--dk-green) !important; filter: none; }
body.dark-mode .ActionsGroup .optionItem { background: rgba(255, 255, 255, .12) !important; }
body.dark-mode .ActionsGroup .optionItem img, body.dark-mode .ActionsGroup .optionItem svg { filter: brightness(1.9) saturate(.85); }
body.dark-mode .calUpdateInfos h2[style*="007B7D" i] { color: var(--dk-accent) !important; }
body.dark-mode .calUpdateInfos h2[style*="1DB261" i] { color: var(--dk-green) !important; }
body.dark-mode button.theme-btn.btn_style_green_light, body.dark-mode button.theme-btn.btn_style_green_light * { color: var(--dk-accent) !important; }
body.dark-mode .itemStatisticBox { border-color: var(--dk-line) !important; }
body.dark-mode img[src*="price_icon"], body.dark-mode .priceIconNew { filter: invert(1) brightness(1.1); }
body.dark-mode .apexcharts-gridline, body.dark-mode .apexcharts-xaxis-tick, body.dark-mode .apexcharts-grid line { stroke: rgba(255, 255, 255, .12) !important; }
body.dark-mode .FilterSideBare .FilterHeader .closeIcon { background: rgba(255, 255, 255, .14) !important; }
body.dark-mode .FilterSideBare .FilterHeader .closeIcon img { filter: brightness(0) invert(1); opacity: 1; }
body.dark-mode .FilterSideBare .FilterHeader .closeIcon:hover { background: rgba(255, 255, 255, .24) !important; }
