﻿/* ============================================================
   Dark Mode Theme
   Separate stylesheet - scoped to <html class="dark-mode">
   ============================================================ */

html.dark-mode {
    color-scheme: dark;
    --dm-bg: #0f141a;
    --dm-bg-elevated: #141a22;
    --dm-surface: #1a222d;
    --dm-surface-hover: #202a37;
    --dm-surface-active: #263241;
    --dm-border: #2a3542;
    --dm-border-strong: #384657;
    --dm-text: #e6ecf4;
    --dm-text-secondary: #a9b5c3;
    --dm-text-muted: #77828f;
    --dm-primary: #2196f3;
    --dm-primary-hover: #1e88e5;
    --dm-primary-soft: rgba(33, 150, 243, 0.14);
    --dm-success: #4caf50;
    --dm-warning: #ff9800;
    --dm-danger: #e51c23;
    --dm-info: #9c27b0;
    --dm-scrollbar: #2f3b49;
    --dm-scrollbar-hover: #3d4c5e;
}

/* ---------- Base ---------- */
html.dark-mode body {
    background-color: #0f141a;
    color: #e6ecf4;
}

html.dark-mode ::selection {
    background: rgba(33, 150, 243, 0.45);
    color: #ffffff;
}

html.dark-mode ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

html.dark-mode ::-webkit-scrollbar-track {
    background: #0f141a;
}

html.dark-mode ::-webkit-scrollbar-thumb {
    background: #2f3b49;
    border-radius: 6px;
    border: 2px solid #0f141a;
}

html.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: #3d4c5e;
}

html.dark-mode ::-webkit-scrollbar-corner {
    background: #0f141a;
}

/* Smooth theme switching */
html.dark-mode body,
html.dark-mode .card,
html.dark-mode .modal-content,
html.dark-mode .dropdown-menu,
html.dark-mode .form-control,
html.dark-mode .table,
html.dark-mode #topbar,
html.dark-mode #sidebar {
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

/* ---------- Text helpers ---------- */
html.dark-mode .text-muted {
    color: #77828f !important;
}

html.dark-mode .text-dark {
    color: #e6ecf4 !important;
}

html.dark-mode .bg-white {
    background-color: #1a222d !important;
}

html.dark-mode .bg-light {
    background-color: #1a222d !important;
}

html.dark-mode .border {
    border-color: #2a3542 !important;
}

html.dark-mode .border-top {
    border-top-color: #2a3542 !important;
}

html.dark-mode .border-bottom {
    border-bottom-color: #2a3542 !important;
}

html.dark-mode .border-left {
    border-left-color: #2a3542 !important;
}

html.dark-mode .border-right {
    border-right-color: #2a3542 !important;
}

html.dark-mode hr {
    border-top-color: #2a3542;
}

html.dark-mode code,
html.dark-mode pre,
html.dark-mode kbd {
    background-color: #263241;
    color: #e6ecf4;
}

/* ---------- Topbar ----------
   The main app header (#topbar) is themed in app-layout.css.
   Only generic .navbar.bg-primary (public layouts) is styled here. */
html.dark-mode .navbar.bg-primary {
    background: linear-gradient(135deg, #1b2431 0%, #16202c 100%) !important;
    border-bottom: 1px solid #2a3542;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

html.dark-mode .navbar.bg-primary .navbar-brand {
    color: #e6ecf4;
}

html.dark-mode .navbar.bg-primary .nav-link {
    color: #a9b5c3;
}

html.dark-mode .navbar.bg-primary .nav-link:hover,
html.dark-mode .navbar.bg-primary .nav-link:focus {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
}

html.dark-mode .navbar.bg-primary .dropdown-menu {
    background-color: #1a222d !important;
    border: 1px solid #2a3542 !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
    color: #e6ecf4;
}

html.dark-mode .navbar.bg-primary .dropdown-item {
    color: #a9b5c3;
}

html.dark-mode .navbar.bg-primary .dropdown-item:hover,
html.dark-mode .navbar.bg-primary .dropdown-item:focus {
    background-color: #202a37;
    color: #ffffff;
}

html.dark-mode .navbar.bg-primary .dropdown-divider {
    border-top-color: #2a3542;
}

html.dark-mode .navbar.bg-primary .navbar-toggler {
    border-color: #384657;
}

/* ---------- Cards & Containers ---------- */
html.dark-mode .card {
    background-color: #1a222d;
    border-color: #2a3542;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

html.dark-mode .card-header {
    background-color: #141a22;
    border-bottom-color: #2a3542;
    color: #e6ecf4;
}

html.dark-mode .card-footer {
    background-color: #141a22;
    border-top-color: #2a3542;
}

html.dark-mode .card-body,
html.dark-mode .list-group-item {
    color: #e6ecf4;
}

html.dark-mode .list-group-item {
    background-color: #1a222d;
    border-color: #2a3542;
}

html.dark-mode .list-group-item:hover {
    background-color: #202a37;
}

html.dark-mode .list-group-item.active {
    background-color: #2196f3;
    border-color: #2196f3;
}

html.dark-mode .jumbotron {
    background-color: #1a222d;
    border: 1px solid #2a3542;
}

html.dark-mode .well {
    background-color: #141a22;
    border-color: #2a3542;
}

/* ---------- Tables ---------- */
html.dark-mode .table {
    color: #e6ecf4;
    background-color: transparent;
}

html.dark-mode .table th,
html.dark-mode .table td {
    border-top-color: #2a3542;
}

html.dark-mode .table thead th {
    background-color: #141a22;
    border-bottom: 2px solid #384657;
    color: #e6ecf4;
    font-weight: 600;
}

/* Thead with bg-primary keeps its blue background */
html.dark-mode .table thead.bg-primary th,
html.dark-mode .table thead.table-header.bg-primary th {
    background-color: transparent !important;
    color: #ffffff !important;
    border-bottom: none !important;
}

html.dark-mode .table thead.bg-primary th a,
html.dark-mode .table thead.table-header.bg-primary th a,
html.dark-mode .table thead.bg-primary th .th-sort-link,
html.dark-mode .table thead.bg-primary th .sort-icon {
    color: #ffffff;
}

html.dark-mode .table thead.bg-success th,
html.dark-mode .table thead.bg-danger th,
html.dark-mode .table thead.bg-info th,
html.dark-mode .table thead.bg-warning th,
html.dark-mode .table thead.bg-dark th,
html.dark-mode .table thead.bg-secondary th {
    background-color: transparent !important;
    border-bottom: none !important;
}

html.dark-mode .table tbody tr:hover,
html.dark-mode .table tbody tr:nth-of-type(odd):hover {
    background-color: #202a37 !important;
}

html.dark-mode .table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.02);
}

html.dark-mode .table-hover tbody tr:hover {
    background-color: #202a37;
}

html.dark-mode .table-bordered,
html.dark-mode .table-bordered th,
html.dark-mode .table-bordered td {
    border-color: #2a3542;
}

html.dark-mode .table-dark {
    background-color: #141a22;
}

html.dark-mode .table-dark th,
html.dark-mode .table-dark td {
    border-color: #384657;
}

html.dark-mode .sortedby {
    background: rgba(33, 150, 243, 0.14);
}

html.dark-mode td .is-editable {
    border-bottom-color: #384657;
}

html.dark-mode .page-list-record-detail input {
    background: transparent;
    border-color: #384657;
    color: #e6ecf4;
}

html.dark-mode .page-list-record-detail .info {
    background: #263241;
    color: #a9b5c3;
}

/* ---------- Forms ---------- */
html.dark-mode .form-control,
html.dark-mode .custom-select,
html.dark-mode select.form-control,
html.dark-mode textarea.form-control {
    background-color: transparent;
    border-color: #384657;
    color: #e6ecf4;
}

html.dark-mode .form-control::placeholder {
    color: #77828f;
}

html.dark-mode .form-control:focus,
html.dark-mode .custom-select:focus {
    background-color: transparent;
    border-color: #2196f3;
    color: #e6ecf4;
    box-shadow: 0 0 0 0.2rem rgba(33, 150, 243, 0.25);
}

html.dark-mode .form-control:disabled,
html.dark-mode .form-control[readonly],
html.dark-mode .custom-select:disabled {
    background-color: transparent;
    color: #77828f;
}

html.dark-mode .input-group-text {
    background-color: transparent;
    border-color: #384657;
    color: #a9b5c3;
}

html.dark-mode .custom-file-label {
    background-color: transparent;
    border-color: #384657;
    color: #a9b5c3;
}

html.dark-mode .custom-file-label::after {
    background-color: #263241;
    color: #a9b5c3;
}

html.dark-mode .custom-control-label::before {
    background-color: transparent;
    border-color: #384657;
}

html.dark-mode .custom-control-input:checked ~ .custom-control-label::before {
    background-color: #2196f3;
    border-color: #2196f3;
}

html.dark-mode fieldset {
    border-color: #2a3542;
}

html.dark-mode legend {
    color: #a9b5c3;
}

html.dark-mode input[type="date"]::-webkit-calendar-picker-indicator,
html.dark-mode input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(0.8);
}

html.dark-mode input[type="radio"]:checked,
html.dark-mode input[type="checkbox"]:checked {
    accent-color: #2196f3;
}

/* ---------- Buttons ---------- */
html.dark-mode .btn-secondary {
    background-color: #263241;
    border-color: #384657;
    color: #e6ecf4;
}

html.dark-mode .btn-secondary:hover,
html.dark-mode .btn-secondary:focus {
    background-color: #384657;
    border-color: #384657;
    color: #ffffff;
}

html.dark-mode .btn-light {
    background-color: #263241;
    border-color: #384657;
    color: #e6ecf4;
}

html.dark-mode .btn-light:hover {
    background-color: #384657;
    color: #ffffff;
}

html.dark-mode .btn-outline-secondary {
    border-color: #384657;
    color: #a9b5c3;
}

html.dark-mode .btn-outline-secondary:hover {
    background-color: #263241;
    color: #e6ecf4;
}

html.dark-mode .btn-outline-light {
    border-color: #384657;
    color: #a9b5c3;
}

html.dark-mode .btn-outline-light:hover {
    background-color: #263241;
    color: #ffffff;
}

html.dark-mode .btn-primary {
    background-color: #2196f3;
    border-color: #2196f3;
}

html.dark-mode .btn-primary:hover {
    background-color: #1e88e5;
    border-color: #1e88e5;
}

html.dark-mode .btn-dark {
    background-color: #0c1116;
    border-color: #384657;
}

html.dark-mode .btn-link {
    color: #64b5f6;
}

html.dark-mode .btn.disabled,
html.dark-mode .btn:disabled {
    opacity: 0.45;
}

html.dark-mode .btn.btn-flat {
    background: none;
}

/* ---------- Dropdowns ---------- */
html.dark-mode .dropdown-menu {
    background-color: #1a222d;
    border: 1px solid #2a3542;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}

html.dark-mode .dropdown-item {
    color: #a9b5c3;
}

html.dark-mode .dropdown-item:hover,
html.dark-mode .dropdown-item:focus {
    background-color: #202a37;
    color: #ffffff;
}

html.dark-mode .dropdown-item.active {
    background-color: #2196f3;
    color: #ffffff;
}

html.dark-mode .dropdown-divider {
    border-top-color: #2a3542;
}

html.dark-mode .dropdown-header {
    color: #77828f;
}

/* ---------- Modals ---------- */
html.dark-mode .modal-content {
    background-color: #1a222d;
    border: 1px solid #2a3542;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

html.dark-mode .modal-header {
    border-bottom-color: #2a3542;
}

html.dark-mode .modal-footer {
    border-top-color: #2a3542;
}

html.dark-mode .modal-backdrop.show {
    opacity: 0.65;
}

html.dark-mode .close {
    color: #e6ecf4;
    text-shadow: none;
}

html.dark-mode .close:hover {
    color: #ffffff;
}

/* ---------- Alerts & Badges ---------- */
html.dark-mode .alert-secondary {
    background-color: #263241;
    border-color: #384657;
    color: #a9b5c3;
}

html.dark-mode .alert-light {
    background-color: #1a222d;
    border-color: #2a3542;
    color: #e6ecf4;
}

html.dark-mode .alert-dark {
    background-color: #0c1116;
    border-color: #384657;
    color: #a9b5c3;
}

html.dark-mode .alert-success {
    background-color: rgba(76, 175, 80, 0.16);
    border-color: rgba(76, 175, 80, 0.45);
    color: #8fdd93;
}

html.dark-mode .alert-danger {
    background-color: rgba(229, 28, 35, 0.16);
    border-color: rgba(229, 28, 35, 0.45);
    color: #f08c90;
}

html.dark-mode .alert-warning {
    background-color: rgba(255, 152, 0, 0.16);
    border-color: rgba(255, 152, 0, 0.45);
    color: #ffc36b;
}

html.dark-mode .alert-info {
    background-color: rgba(156, 39, 176, 0.16);
    border-color: rgba(156, 39, 176, 0.45);
    color: #d38add;
}

html.dark-mode .alert-primary {
    background-color: rgba(33, 150, 243, 0.14);
    border-color: rgba(33, 150, 243, 0.45);
    color: #8ec8f8;
}

html.dark-mode .badge-light {
    background-color: #263241;
    color: #a9b5c3;
}

html.dark-mode .badge-dark {
    background-color: #0c1116;
}

/* ---------- Pagination ---------- */
html.dark-mode .pagination .page-link {
    background-color: #1a222d;
    border-color: #2a3542;
    color: #a9b5c3;
}

html.dark-mode .pagination .page-link:hover {
    background-color: #202a37;
    color: #ffffff;
}

html.dark-mode .pagination .page-item.active .page-link {
    background-color: #2196f3;
    border-color: #2196f3;
    color: #ffffff;
}

html.dark-mode .pagination .page-item.disabled .page-link {
    background-color: #141a22;
    border-color: #2a3542;
    color: #77828f;
}

html.dark-mode .pager li > a,
html.dark-mode .pager li > span {
    background-color: #1a222d;
    border-color: #2a3542;
    color: #a9b5c3;
}

/* ---------- Tabs & Pills ---------- */
html.dark-mode .nav-tabs {
    border-bottom-color: #2a3542;
}

html.dark-mode .nav-tabs .nav-link {
    color: #a9b5c3;
}

html.dark-mode .nav-tabs .nav-link:hover {
    border-color: #2a3542 #2a3542 transparent;
    color: #ffffff;
}

html.dark-mode .nav-tabs .nav-link.active {
    background-color: #1a222d;
    border-color: #2a3542 #2a3542 #1a222d;
    color: #e6ecf4;
}

html.dark-mode .nav-pills .nav-link {
    color: #a9b5c3;
}

html.dark-mode .nav-pills .nav-link.active {
    background-color: #2196f3;
    color: #ffffff;
}

html.dark-mode .tab-content {
    color: #e6ecf4;
}

/* ---------- Progress ---------- */
html.dark-mode .progress {
    background-color: #263241;
}

html.dark-mode .record-count:hover,
html.dark-mode .record-progress:hover {
    background: rgba(255, 255, 255, 0.06) !important;
    color: #ffffff;
    border-color: transparent;
}

/* ---------- Custom components (custom-style.css) ---------- */
html.dark-mode .search-input .holder {
    box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.6);
}

html.dark-mode .search-input .search-result .search-link {
    background-color: #1a222d;
    border-bottom-color: #2a3542;
    color: #a9b5c3;
}

html.dark-mode .search-input .search-result .search-link:hover {
    background-color: #202a37;
}

html.dark-mode .filter-chip {
    background-color: #263241;
    color: #a9b5c3;
}

html.dark-mode .detail-list {
    border-bottom-color: #2a3542;
}

html.dark-mode .accordion-group .accordion-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

html.dark-mode .range-slider .value {
    background: #263241;
    border-color: #384657;
    color: #a9b5c3;
}

html.dark-mode .load-indicator.white {
    background: rgba(15, 20, 26, 0.9);
}

html.dark-mode .form-ajax-status {
    background: rgba(15, 20, 26, 0.7);
}

html.dark-mode .page-header,
html.dark-mode .page-footer {
    border-color: #2a3542;
}

html.dark-mode section.page .page-title {
    border-bottom-color: #2a3542;
}

html.dark-mode .popover {
    background-color: #1a222d;
    border: 1px solid #2a3542;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}

html.dark-mode .popover-header {
    background-color: #141a22;
    border-bottom-color: #2a3542;
    color: #e6ecf4;
}

html.dark-mode .popover-body {
    background-color: #1a222d;
    color: #e6ecf4;
}

html.dark-mode .bs-popover-top .arrow::after,
html.dark-mode .bs-popover-auto[x-placement^="top"] .arrow::after {
    border-top-color: #1a222d;
}

html.dark-mode .bs-popover-bottom .arrow::after,
html.dark-mode .bs-popover-auto[x-placement^="bottom"] .arrow::after {
    border-bottom-color: #1a222d;
}

html.dark-mode .bs-popover-left .arrow::after,
html.dark-mode .bs-popover-auto[x-placement^="left"] .arrow::after {
    border-left-color: #1a222d;
}

html.dark-mode .bs-popover-right .arrow::after,
html.dark-mode .bs-popover-auto[x-placement^="right"] .arrow::after {
    border-right-color: #1a222d;
}

/* ---------- Selectize ---------- */
html.dark-mode .selectize-control .selectize-input,
html.dark-mode .selectize-control.single .selectize-input,
html.dark-mode .selectize-control.single .selectize-input.input-active {
    background: transparent !important;
    background-image: none !important;
    border-color: #384657;
    color: #e6ecf4;
    box-shadow: none;
}

html.dark-mode .selectize-control .selectize-input.focus,
html.dark-mode .selectize-control .selectize-input.input-active {
    border-color: #2196f3;
    box-shadow: 0 0 0 0.2rem rgba(33, 150, 243, 0.25);
}

html.dark-mode .selectize-control .selectize-input.dropdown-active {
    background: transparent !important;
}

html.dark-mode .selectize-control .selectize-input > input {
    color: #e6ecf4 !important;
}

html.dark-mode .selectize-control .selectize-input > input::placeholder {
    color: #77828f;
}

html.dark-mode .selectize-control .selectize-input > * {
    color: #e6ecf4;
}

html.dark-mode .selectize-control .selectize-input.disabled {
    background: transparent !important;
    color: #77828f;
    opacity: 0.6;
}

html.dark-mode .selectize-control .selectize-input.dropdown-active::before {
    background: #2a3542;
}

html.dark-mode .selectize-control.single .selectize-input:after {
    border-color: #77828f transparent transparent transparent;
}

html.dark-mode .selectize-control.single .selectize-input.dropdown-active:after {
    border-color: transparent transparent #77828f transparent;
}

/* Multi-select chips */
html.dark-mode .selectize-control .item,
html.dark-mode .selectize-control.multi .selectize-input > div,
html.dark-mode .selectize-control.multi .selectize-input [data-value],
html.dark-mode .selectize-control.multi .selectize-input > div.active,
html.dark-mode .selectize-control.multi .selectize-input [data-value].active {
    background: transparent !important;
    background-image: none !important;
    color: #e6ecf4 !important;
    border: none !important;
    text-shadow: none !important;
    box-shadow: none !important;
}

html.dark-mode .selectize-control.multi .selectize-input.disabled > div,
html.dark-mode .selectize-control.multi .selectize-input.disabled > div.active,
html.dark-mode .selectize-control.multi .selectize-input.disabled [data-value] {
    background: transparent !important;
    color: #77828f !important;
    border: none !important;
}

html.dark-mode .selectize-control.plugin-remove_button [data-value] .remove {
    border-left: none;
}

html.dark-mode .selectize-control.plugin-remove_button [data-value] .remove:hover {
    background: rgba(255, 255, 255, 0.1);
}

html.dark-mode .selectize-control.plugin-drag_drop.multi > .selectize-input > div.ui-sortable-placeholder {
    background: #263241 !important;
    -webkit-box-shadow: inset 0 0 12px 4px #0f141a !important;
    box-shadow: inset 0 0 12px 4px #0f141a !important;
}

/* Dropdown */
html.dark-mode .selectize-dropdown {
    background: #1a222d !important;
    border-color: #384657;
    color: #e6ecf4;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
}

html.dark-mode .selectize-dropdown .option,
html.dark-mode .selectize-dropdown [data-selectable],
html.dark-mode .selectize-dropdown .optgroup-header {
    color: #a9b5c3;
}

html.dark-mode .selectize-dropdown .active {
    background-color: #202a37 !important;
    color: #ffffff !important;
}

html.dark-mode .selectize-dropdown .option.selected {
    background: transparent !important;
    color: #8ec8f8 !important;
}

html.dark-mode .selectize-dropdown .option.selected.active {
    background: transparent !important;
    color: #8ec8f8 !important;
}

html.dark-mode .selectize-dropdown .create {
    color: #77828f;
}

html.dark-mode .selectize-dropdown .optgroup-header {
    background: #141a22;
}

html.dark-mode .selectize-dropdown .optgroup {
    border-top-color: #2a3542;
}

html.dark-mode .selectize-dropdown.plugin-optgroup_columns .optgroup {
    border-right-color: #2a3542;
}

html.dark-mode .selectize-dropdown-header {
    border-bottom-color: #2a3542;
    background: #141a22;
}

html.dark-mode .selectize-dropdown-header-close {
    color: #77828f;
}

html.dark-mode .selectize-dropdown-header-close:hover {
    color: #e6ecf4;
}

/* ---------- Bootstrap Toggle ---------- */
html.dark-mode .toggle.btn {
    border-color: #384657;
}

html.dark-mode .toggle.btn.off {
    background-color: #263241 !important;
    color: #a9b5c3 !important;
}

html.dark-mode .toggle.btn.on {
    background-color: #2196f3 !important;
    color: #ffffff !important;
}

/* ---------- Bootstrap Editable ---------- */
html.dark-mode .editable-click,
html.dark-mode a.editable-click {
    border-bottom-color: #64b5f6;
    color: #e6ecf4;
}

html.dark-mode .editable-input.form-control {
    background-color: transparent;
    border-color: #384657;
    color: #e6ecf4;
}

html.dark-mode .editable-buttons .btn {
    background-color: #263241;
    border-color: #384657;
    color: #e6ecf4;
}

/* ---------- Dropzone ---------- */
html.dark-mode .dropzone {
    background-color: transparent;
    border-color: #384657;
}

html.dark-mode .dropzone .dz-message,
html.dark-mode .dropzone.dz-drag-hover {
    color: #a9b5c3;
}

html.dark-mode .dropzone.dz-drag-hover {
    border-color: #2196f3;
    background-color: rgba(33, 150, 243, 0.14);
}

html.dark-mode .dropzone .dz-preview {
    background: #1a222d;
}

/* ---------- Persian Datepicker ---------- */
html.dark-mode .datepicker-plot-area {
    background: #1a222d !important;
    border: 1px solid #2a3542 !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6) !important;
}

html.dark-mode .datepicker-plot-area * {
    color: #a9b5c3 !important;
}

/* Day / month / year cells */
html.dark-mode .datepicker-plot-area .datepicker-day-view .table-days td span,
html.dark-mode .datepicker-plot-area .datepicker-year-view .year-item,
html.dark-mode .datepicker-plot-area .datepicker-month-view .month-item {
    background-color: transparent !important;
    color: #a9b5c3 !important;
}

html.dark-mode .datepicker-plot-area .datepicker-day-view .table-days td span:hover,
html.dark-mode .datepicker-plot-area .datepicker-year-view .year-item:hover,
html.dark-mode .datepicker-plot-area .datepicker-month-view .month-item:hover {
    background-color: #202a37 !important;
    color: #ffffff !important;
}

html.dark-mode .datepicker-plot-area .datepicker-day-view .table-days td span.other-month {
    background-color: transparent !important;
    color: #77828f !important;
}

html.dark-mode .datepicker-plot-area .datepicker-day-view .table-days td.selected span,
html.dark-mode .datepicker-plot-area .datepicker-year-view .year-item.selected,
html.dark-mode .datepicker-plot-area .datepicker-month-view .month-item.selected {
    background-color: #2196f3 !important;
    color: #ffffff !important;
    text-shadow: none !important;
}

html.dark-mode .datepicker-plot-area .datepicker-day-view .table-days td.today span {
    background-color: rgba(33, 150, 243, 0.22) !important;
    color: #8ec8f8 !important;
}

html.dark-mode .datepicker-plot-area .datepicker-day-view .table-days td.disabled span,
html.dark-mode .datepicker-plot-area .datepicker-year-view .year-item-disable,
html.dark-mode .datepicker-plot-area .datepicker-month-view .month-item-disable {
    background-color: transparent !important;
    color: #77828f !important;
    opacity: 0.5;
}

/* Weekday header row */
html.dark-mode .datepicker-plot-area .datepicker-day-view .month-grid-box .header .header-row-cell {
    color: #a9b5c3 !important;
}

/* Navigator buttons (month / year) */
html.dark-mode .datepicker-plot-area .datepicker-navigator .pwt-btn-next,
html.dark-mode .datepicker-plot-area .datepicker-navigator .pwt-btn-switch,
html.dark-mode .datepicker-plot-area .datepicker-navigator .pwt-btn-prev {
    background-color: transparent !important;
    color: #a9b5c3 !important;
}

html.dark-mode .datepicker-plot-area .datepicker-navigator .pwt-btn-next:hover,
html.dark-mode .datepicker-plot-area .datepicker-navigator .pwt-btn-switch:hover,
html.dark-mode .datepicker-plot-area .datepicker-navigator .pwt-btn-prev:hover {
    background-color: #202a37 !important;
    color: #ffffff !important;
}

/* Time view */
html.dark-mode .datepicker-plot-area .datepicker-time-view {
    background: #141a22 !important;
    border-top-color: #2a3542 !important;
}

html.dark-mode .datepicker-plot-area .datepicker-time-view .down-btn,
html.dark-mode .datepicker-plot-area .datepicker-time-view .up-btn {
    color: #77828f !important;
}

html.dark-mode .datepicker-plot-area .datepicker-time-view .down-btn:hover,
html.dark-mode .datepicker-plot-area .datepicker-time-view .up-btn:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #e6ecf4 !important;
}

html.dark-mode .datepicker-plot-area .datepicker-time-view input,
html.dark-mode .datepicker-plot-area .datepicker-time-view > .time-segment {
    background-color: transparent !important;
    border-color: #384657 !important;
    color: #e6ecf4 !important;
}

/* Toolbox buttons (today / submit) */
html.dark-mode .datepicker-plot-area .toolbox {
    background: #141a22 !important;
    border-top-color: #2a3542 !important;
}

html.dark-mode .datepicker-plot-area .toolbox .pwt-btn-today,
html.dark-mode .datepicker-plot-area .toolbox .pwt-btn-submit,
html.dark-mode .datepicker-plot-area .toolbox .pwt-btn-calendar {
    background-color: #263241 !important;
    color: #e6ecf4 !important;
}

/* ---------- Flatpickr ---------- */
html.dark-mode .flatpickr-calendar {
    background: #1a222d;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

html.dark-mode .flatpickr-calendar.arrowTop:after {
    border-bottom-color: #1a222d;
}

html.dark-mode .flatpickr-calendar.arrowBottom:after {
    border-top-color: #1a222d;
}

html.dark-mode .flatpickr-months .flatpickr-month,
html.dark-mode .flatpickr-current-month {
    color: #e6ecf4;
    fill: #e6ecf4;
}

html.dark-mode .flatpickr-weekdays,
html.dark-mode span.flatpickr-weekday {
    color: #77828f;
}

html.dark-mode .flatpickr-day {
    color: #a9b5c3;
}

html.dark-mode .flatpickr-day:hover {
    background: #202a37;
}

html.dark-mode .flatpickr-day.today {
    border-color: #2196f3;
}

html.dark-mode .flatpickr-day.selected,
html.dark-mode .flatpickr-day.startRange,
html.dark-mode .flatpickr-day.endRange {
    background: #2196f3;
    border-color: #2196f3;
    color: #ffffff;
}

html.dark-mode .flatpickr-day.inRange,
html.dark-mode .flatpickr-day.prevMonthDay.inRange,
html.dark-mode .flatpickr-day.nextMonthDay.inRange {
    background: rgba(33, 150, 243, 0.14);
    box-shadow: -5px 0 0 rgba(33, 150, 243, 0.14), 5px 0 0 rgba(33, 150, 243, 0.14);
}

html.dark-mode .flatpickr-day.disabled,
html.dark-mode .flatpickr-day.prevMonthDay,
html.dark-mode .flatpickr-day.nextMonthDay {
    color: #77828f;
}

html.dark-mode .flatpickr-time {
    background: #141a22;
}

html.dark-mode .flatpickr-time input {
    color: #e6ecf4;
}

html.dark-mode .flatpickr-time .flatpickr-am-pm {
    color: #77828f;
}

/* ---------- Summernote ---------- */
html.dark-mode .note-editor.note-frame {
    border-color: #384657;
}

html.dark-mode .note-editor.note-frame .note-editing-area {
    background-color: transparent;
}

html.dark-mode .note-editor .note-toolbar {
    background-color: #1a222d;
    border-bottom-color: #2a3542;
}

html.dark-mode .note-editor .note-toolbar .btn {
    background-color: transparent;
    color: #a9b5c3;
}

html.dark-mode .note-editor .note-toolbar .btn:hover {
    background-color: #202a37;
    color: #ffffff;
}

html.dark-mode .note-editor .note-statusbar {
    background-color: #1a222d;
    border-top-color: #2a3542;
}

html.dark-mode .note-editable {
    background-color: transparent !important;
    color: #e6ecf4 !important;
}

html.dark-mode .note-modal .modal-content {
    background-color: #1a222d;
    color: #e6ecf4;
}

/* ---------- Smart Wizard ---------- */
html.dark-mode .sw .toolbar,
html.dark-mode .sw .navbar {
    background-color: #1a222d !important;
    border-color: #2a3542 !important;
}

html.dark-mode .sw .nav-link {
    color: #a9b5c3 !important;
}

html.dark-mode .sw .nav-link.active {
    background-color: #2196f3 !important;
    color: #ffffff !important;
}

/* ---------- Bootstrap Slider ---------- */
html.dark-mode .slider-track {
    background-color: #263241;
}

/* ---------- Misc ---------- */
html.dark-mode .flash-msg-container .alert {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}

html.dark-mode .record-count {
    background-color: #1a222d;
    border-color: #2a3542;
    color: #e6ecf4;
}

html.dark-mode .record-progress {
    background-color: #1a222d;
    border-color: #2a3542;
    color: #e6ecf4;
}

html.dark-mode .star-rating .star,
html.dark-mode .star-rating .star:before,
html.dark-mode .star-rating .star:after {
    border-bottom-color: #384657;
}

html.dark-mode .td-check-button {
    color: #77828f;
}

html.dark-mode .pagination .material-icons {
    color: inherit;
}

html.dark-mode img[src*="logo"] {
    /* Keep logos as-is */
}

/* ============================================================
   Page-Specific Overrides
   (views that define their own light backgrounds)
   ============================================================ */

/* Totals row at the end of list tables */
html.dark-mode .table tbody tr.bmyred th {
    color: #e6ecf4;
    font-weight: bold;
}

/* Inline light row highlight colors (totals rows) */
html.dark-mode [style*="#fce4d6"] {
    background-color: rgba(237, 85, 101, 0.16) !important;
}

html.dark-mode [style*="#fccac7"] {
    background-color: rgba(229, 28, 35, 0.16) !important;
}

html.dark-mode [style*="#FFC8C3"] {
    background-color: rgba(229, 28, 35, 0.16) !important;
}

html.dark-mode [style*="#afd9ee"] {
    background-color: rgba(33, 150, 243, 0.16) !important;
}

html.dark-mode [style*="color:#721c24"],
html.dark-mode [style*="color: #721c24"] {
    color: #f08c90 !important;
}

/* Balance mini-tables (payable / borrowed pages) */
html.dark-mode table[style*="background:#fff"],
html.dark-mode table[style*="background: #fff"] {
    background-color: #1a222d !important;
}

html.dark-mode tr[style*="background:#e9ecef"],
html.dark-mode tr[style*="background: #e9ecef"] {
    background-color: #141a22 !important;
}

/* Page header bars with inline light background (view/transfer pages) */
html.dark-mode div[style*="background-color: #F0F0F0"],
html.dark-mode div[style*="background-color:#F0F0F0"],
html.dark-mode div[style*="background: #F0F0F0"],
html.dark-mode div[style*="background:#F0F0F0"] {
    background-color: #1a222d !important;
}

/* Inline white boxes (pagination wrappers, notes, panels) */
html.dark-mode div[style*="background: white"],
html.dark-mode div[style*="background:white"] {
    background-color: #1a222d !important;
}

/* Inline light gray panels (daily report header/filters) */
html.dark-mode div[style*="background-color: #ECECEC"],
html.dark-mode div[style*="background-color:#ECECEC"],
html.dark-mode div[style*="background: #ECECEC"],
html.dark-mode div[style*="background:#ECECEC"],
html.dark-mode div[style*="background-color: #ececec"],
html.dark-mode div[style*="background-color:#ececec"],
html.dark-mode div[style*="background-color: #F2F2F2"],
html.dark-mode div[style*="background-color:#F2F2F2"],
html.dark-mode div[style*="background: #F2F2F2"],
html.dark-mode div[style*="background:#F2F2F2"] {
    background-color: #1a222d !important;
}

/* Balance sheet accordion rows: fix broken display after collapse/expand */
html.dark-mode body.accounts-balance_sheet .card-block.collapse.show,
html.dark-mode body.accounts-balance_sheet .card-block.collapsing,
html.dark-mode body.accounts-balance_sheet_date .card-block.collapse.show,
html.dark-mode body.accounts-balance_sheet_date .card-block.collapsing {
    display: block !important;
}

/* Balance sheet rows: dark background via class (survives style-attr rewriting by collapse JS) */
html.dark-mode body.accounts-balance_sheet .card-block,
html.dark-mode body.accounts-balance_sheet_date .card-block {
    background-color: #1a222d !important;
}

html.dark-mode body.accounts-balance_sheet .card-block[style*="55cc55"],
html.dark-mode body.accounts-balance_sheet .card-block[style*="rgb(85, 204, 85)"],
html.dark-mode body.accounts-balance_sheet .card-block[style*="rgb(85,204,85)"],
html.dark-mode body.accounts-balance_sheet_date .card-block[style*="55cc55"],
html.dark-mode body.accounts-balance_sheet_date .card-block[style*="rgb(85, 204, 85)"],
html.dark-mode body.accounts-balance_sheet_date .card-block[style*="rgb(85,204,85)"] {
    background-color: #55cc55 !important;
    color: #ffffff !important;
}

/* Black hr separators inside report headers */
html.dark-mode #report-header hr {
    background-color: #384657;
    border-color: #384657;
}

/* Generic page-content wrappers with light styles */
html.dark-mode .page-content {
    background: transparent;
    box-shadow: none;
}

/* Readonly inputs & total fields (.back) */
html.dark-mode input[readonly],
html.dark-mode .dynamic_row label,
html.dark-mode .back {
    background-color: transparent !important;
    color: #a9b5c3 !important;
}

html.dark-mode .form-control[readonly] {
    background-color: transparent !important;
    color: #a9b5c3 !important;
}

/* Item search dropdown (#display) */
html.dark-mode #display {
    background: #1a222d;
    border-color: #384657;
}

html.dark-mode #display ul li {
    color: #a9b5c3;
}

html.dark-mode #display ul li:hover {
    background: #202a37;
}

/* Table borders in order/purchase/return forms */
html.dark-mode #last_row {
    border-bottom-color: #2a3542;
}

html.dark-mode .tophead {
    border-color: #2a3542;
}

html.dark-mode .table_balance {
    border-color: #384657;
}

html.dark-mode .bal-item {
    background: transparent;
    border: none;
    color: #e6ecf4;
}

html.dark-mode .bal-item .amt {
    color: #e6ecf4;
}

html.dark-mode .bal-abbr {
    color: #f08c90;
}

/* Statement tables (customer / trader / supplier) */
html.dark-mode table.stable th,
html.dark-mode table.stable td {
    border-color: #384657 !important;
}

html.dark-mode #myoptions th {
    background: #1a222d;
}

/* ---------- Login / Register / Welcome pages ---------- */
html.dark-mode #c {
    background: linear-gradient(160deg, #12203a 0%, #0f141a 55%, #0b1220 100%);
}

html.dark-mode .wrapper {
    background: #1a222d;
    border: 1px solid #2a3542;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

html.dark-mode #formContent {
    color: #e6ecf4;
}

html.dark-mode #formContent h4 {
    color: #e6ecf4;
}

html.dark-mode #login_form input,
html.dark-mode #login_form .select-control,
html.dark-mode #login_form option {
    background-color: transparent !important;
    color: #e6ecf4 !important;
    border-color: #384657 !important;
}

html.dark-mode #login_form input:focus {
    background-color: transparent !important;
    border-color: #2196f3 !important;
}

html.dark-mode #login_form label {
    color: #64b5f6;
}

html.dark-mode #login_form input::placeholder {
    color: #77828f;
}

html.dark-mode select option,
html.dark-mode option {
    background-color: #141a22;
    color: #e6ecf4;
}

html.dark-mode .waveWrapperInner {
    background-image: linear-gradient(to bottom, #12203a 20%, #0b1220 80%);
}

html.dark-mode .check-status {
    color: #a9b5c3;
}

/* ---------- Dashboard (home) ---------- */
html.dark-mode #main_back {
    background: #0f141a;
}

html.dark-mode .card {
    color: #e6ecf4;
}

html.dark-mode .card-title,
html.dark-mode .card-title a,
html.dark-mode .card .card-title,
html.dark-mode .card .card-header .card-title {
    color: #e6ecf4;
}

html.dark-mode .card [class*=card-header-]:not(.card-header-icon):not(.card-header-text) .card-title {
    color: #ffffff !important;
}

html.dark-mode .card-description,
html.dark-mode .description {
    color: #77828f;
}

/* Dashboard card links (colors only - design unchanged) */
html.dark-mode #main_back .card {
    background: #1a222d;
    box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.5);
}

html.dark-mode #main_back .card .card-header {
    background: transparent;
    border-bottom: none;
}

html.dark-mode #main_back .card .card-category,
html.dark-mode #main_back .card .card-category:not([class*=text-]) {
    color: #77828f;
}

html.dark-mode #main_back .card .card-footer {
    background: transparent;
}

html.dark-mode #main_back .card .stats {
    color: #77828f;
}

/* ---------- Notes manager ---------- */
html.dark-mode .notes-manager {
    background: #0f141a;
}

html.dark-mode .notes-controls,
html.dark-mode .add-note-section,
html.dark-mode .note-card,
html.dark-mode .empty-state,
html.dark-mode .edit-modal-content {
    background: #1a222d;
}

html.dark-mode .note-card {
    border-color: #2a3542;
}

html.dark-mode .note-card:hover {
    border-color: #667eea;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

html.dark-mode .note-card.completed {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.12) 0%, rgba(76, 175, 80, 0.14) 100%);
    border-color: #4caf50;
}

html.dark-mode .note-header-row {
    border-bottom-color: #2a3542;
}

html.dark-mode .note-text {
    color: #e6ecf4;
}

html.dark-mode .note-date-time {
    color: #77828f;
}

html.dark-mode .form-custom {
    background: transparent;
    border-color: #384657;
    color: #e6ecf4;
}

html.dark-mode .form-custom:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

html.dark-mode .empty-state h3 {
    color: #a9b5c3;
}

html.dark-mode .empty-state i {
    color: #384657;
}

html.dark-mode .edit-modal-content {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

/* ---------- Options: settings page ---------- */
html.dark-mode .settings-section {
    background: #1a222d;
    border-color: #2a3542;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

html.dark-mode .settings-section-body {
    background: #141a22;
}

html.dark-mode .settings-section-body .form-group {
    background: #1a222d;
    border-color: #2a3542;
}

html.dark-mode .settings-section-body .form-group:hover {
    border-color: rgba(33, 150, 243, 0.55);
    box-shadow: 0 3px 10px rgba(33, 150, 243, 0.15);
}

html.dark-mode .settings-section-body .control-label {
    color: #e6ecf4;
}

html.dark-mode .settings-footer {
    background: #1a222d;
    border-top-color: #2a3542;
}

/* ---------- Options: capital & report pages ---------- */
html.dark-mode .group-container,
html.dark-mode .action-bar {
    background-color: #1a222d;
}

html.dark-mode .group-content {
    background-color: #141a22;
}

html.dark-mode .table-container {
    background: #1a222d;
    border-color: #2a3542;
}

html.dark-mode .custom-table td {
    border-bottom-color: #2a3542;
}

html.dark-mode .custom-table tr:hover td {
    background-color: #202a37;
}

html.dark-mode .summary-box {
    background: #141a22;
    color: #e6ecf4;
}

html.dark-mode .table-title {
    color: #e6ecf4;
}

/* ---------- Financial reports (daily + range) ---------- */
html.dark-mode .financial-report {
    background: linear-gradient(135deg, #0f141a 0%, #101a26 100%);
}

html.dark-mode .section,
html.dark-mode .stat-card,
html.dark-mode .filter-section,
html.dark-mode .page-card,
html.dark-mode .section-card,
html.dark-mode .summary-card,
html.dark-mode .cash-card {
    background: #1a222d;
    border-color: #2a3542;
}

html.dark-mode .section h4 {
    color: #e6ecf4;
}

html.dark-mode .stat-card .stat-label,
html.dark-mode .cash-card .cash-detail,
html.dark-mode .no-data-msg {
    color: #77828f;
}

html.dark-mode .cash-card.neutral .cash-amount {
    color: #e6ecf4;
}

html.dark-mode .currency-card {
    background: #1a222d;
    border-color: #2a3542;
}

html.dark-mode .table-custom {
    border-color: #2a3542;
}

html.dark-mode .table-custom thead {
    background: #141a22;
}

html.dark-mode .table-custom th {
    color: #e6ecf4;
    border-bottom-color: #384657;
}

html.dark-mode .table-custom td {
    border-color: #2a3542;
}

html.dark-mode .table-custom tbody tr:hover {
    background-color: #202a37 !important;
}

html.dark-mode .table-custom tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.02);
}

html.dark-mode .currency-summary-row {
    border-bottom-color: #2a3542;
    background: #141a22;
}

html.dark-mode .currency-badge {
    background: #1a222d;
    border-color: #2a3542;
    color: #a9b5c3;
}

html.dark-mode .summary-card .sc-row {
    border-bottom-color: #2a3542;
}

html.dark-mode .summary-card .sc-row.section-divider {
    border-top-color: #384657;
}

html.dark-mode .summary-card .sc-row .sc-label {
    color: #77828f;
}

html.dark-mode .btn-print {
    background: #1a222d;
    color: #64b5f6;
    border-color: #64b5f6;
}

html.dark-mode .btn-print:hover {
    background: #202a37;
}

html.dark-mode .date-picker {
    border-color: #384657;
    background: transparent;
    color: #e6ecf4;
}

html.dark-mode .summary-row {
    background: #263241;
}

/* ---------- Items rate page ---------- */
html.dark-mode .rates-wrapper {
    background: #0f141a;
}

html.dark-mode .rates-container {
    background: #1a222d;
    border-color: #2a3542;
}

html.dark-mode .stats-section {
    background: #141a22;
    border-bottom-color: #2a3542;
}

html.dark-mode .stat-card {
    background: #1a222d;
    border-color: #2a3542;
}

html.dark-mode .stat-label {
    color: #77828f;
}

html.dark-mode .rates-table {
    background: #1a222d;
}

html.dark-mode .rates-table thead {
    background: #141a22;
}

html.dark-mode .rates-table th {
    color: #e6ecf4;
    border-bottom-color: #384657;
}

html.dark-mode .rates-table td {
    border-bottom-color: #2a3542;
}

html.dark-mode .rates-table tr:hover {
    background: #202a37;
}

html.dark-mode .form-input {
    background: transparent;
    border-color: #384657;
    color: #e6ecf4;
}

html.dark-mode .form-input:focus {
    border-color: #2196f3;
    outline: none;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

html.dark-mode .date-input {
    background: transparent;
    color: #77828f;
}

html.dark-mode .delete-btn {
    background: #1a222d;
}

html.dark-mode .table-footer {
    background: #141a22;
    border-top-color: #2a3542;
}

html.dark-mode .no-data {
    color: #77828f;
}

html.dark-mode .badge-defined {
    background: rgba(76, 175, 80, 0.15);
    color: #8fdd93;
    border-color: rgba(76, 175, 80, 0.4);
}

html.dark-mode .badge-undefined {
    background: rgba(229, 28, 35, 0.15);
    color: #f08c90;
    border-color: rgba(229, 28, 35, 0.4);
}

/* ---------- Partners view ---------- */
html.dark-mode .pv-root {
    background: #0f141a;
}

html.dark-mode .pv-topbar h4 {
    color: #e6ecf4;
}

html.dark-mode .pv-info-item,
html.dark-mode .pv-card {
    background: #1a222d;
}

html.dark-mode .pv-info-label {
    color: #77828f;
}

html.dark-mode .pv-info-value {
    color: #e6ecf4;
}

html.dark-mode .pv-table thead tr {
    background: #141a22;
}

html.dark-mode .pv-table th {
    color: #a9b5c3;
    border-bottom-color: #2a3542;
}

html.dark-mode .pv-table td {
    border-bottom-color: #2a3542;
}

html.dark-mode .pv-table tbody tr:hover {
    background: #202a37;
}

html.dark-mode .pv-empty {
    color: #77828f;
}

/* ---------- Employees: save salaries ---------- */
html.dark-mode body.employees-save_salaries input,
html.dark-mode body.employees-save_salaries select,
html.dark-mode body.employees-save_salaries table {
    border-color: #384657 !important;
}

html.dark-mode body.employees-save_salaries tr.h th {
    border-color: #384657 !important;
}

/* ---------- Table borders: never black in dark mode ---------- */
html.dark-mode .table th,
html.dark-mode .table td,
html.dark-mode table th,
html.dark-mode table td,
html.dark-mode table tr {
    border-color: #384657 !important;
}

html.dark-mode table,
html.dark-mode table.table,
html.dark-mode table.table-sm,
html.dark-mode table.stable {
    border-color: #384657 !important;
}

/* Inline black borders (receipts, transfer checks, bill frames) */
html.dark-mode [style*="border: 1px solid black"],
html.dark-mode [style*="border:1px solid black"],
html.dark-mode [style*="border: 2px solid black"],
html.dark-mode [style*="border:2px solid black"],
html.dark-mode [style*="border-top: 1px solid black"],
html.dark-mode [style*="border-top:1px solid black"],
html.dark-mode [style*="border-bottom: 1px solid black"],
html.dark-mode [style*="border-bottom:1px solid black"] {
    border-color: #384657 !important;
}

/* ---------- Orders: summary bill / small printer / receipt ---------- */
html.dark-mode body.orders-summary_bill th,
html.dark-mode body.orders-small_printer th,
html.dark-mode body.cust_receipts-small_receipt th,
html.dark-mode #main-page-modal th {
    background: #141a22 !important;
}

html.dark-mode #main-page-modal .table thead.bg-primary th {
    background-color: transparent !important;
    color: #ffffff !important;
}

html.dark-mode .line {
    border-top-color: #384657;
}

/* ---------- Report pages: select-control ---------- */
html.dark-mode .select-control {
    background-color: transparent !important;
    color: #e6ecf4 !important;
    border-color: #384657 !important;
}

html.dark-mode .card .author a {
    color: #a9b5c3;
}

/* ---------- Print barcode page ---------- */
html.dark-mode .control-panel {
    background: #1a222d;
    border-color: #2a3542;
}

html.dark-mode .toggle-btn {
    background: #263241;
    border-color: #384657;
    color: #a9b5c3;
}

html.dark-mode .toggle-btn:hover {
    background: #202a37;
    color: #e6ecf4;
}

html.dark-mode .print-header {
    background: #1a222d;
    border-bottom-color: #2a3542;
}

html.dark-mode .header-title {
    color: #e6ecf4;
}

/* Barcode labels stay white (paper) with dark text in dark mode */
html.dark-mode .barcode-label {
    color: #000000;
}

html.dark-mode .barcode-label .product-name,
html.dark-mode .barcode-label .product-name h4,
html.dark-mode .barcode-label .product-price,
html.dark-mode .barcode-label .barcode-text {
    color: #000000;
}

/* ---------- Backup restore page ---------- */
html.dark-mode .confirmation-card.confirmed {
    background-color: rgba(76, 175, 80, 0.14) !important;
    border-color: #4caf50 !important;
}

/* ---------- Status / badge chips ---------- */
html.dark-mode .status-badge.pending {
    background: rgba(255, 152, 0, 0.16);
    color: #ffc36b;
    border-color: rgba(255, 152, 0, 0.45);
}

html.dark-mode .status-badge.completed {
    background: rgba(76, 175, 80, 0.16);
    color: #8fdd93;
    border-color: rgba(76, 175, 80, 0.45);
}

html.dark-mode .pv-status-active,
html.dark-mode .pv-badge-profit {
    background: rgba(76, 175, 80, 0.16);
    color: #8fdd93;
}

html.dark-mode .pv-status-inactive,
html.dark-mode .pv-badge-loss {
    background: rgba(229, 28, 35, 0.16);
    color: #f08c90;
}

html.dark-mode .delete-btn-disabled {
    background: #263241;
    border-color: #384657;
    color: #77828f;
}

/* ============================================================
   Print: always light
   ============================================================ */
@media print {
    html.dark-mode body,
    html.dark-mode .card,
    html.dark-mode .table {
        background: #ffffff !important;
        color: #000000 !important;
    }
}
