/* App theme layer loaded after Stisla. Keep this file token-based and reversible. */
:root {
  --app-bg: #f4f6f9;
  --app-surface: #ffffff;
  --app-surface-soft: #f8fafc;
  --app-surface-muted: #eef1f7;
  --app-border: #e4e6fc;
  --app-text: #191d21;
  --app-heading: #191d21;
  --app-muted: #6c757d;
  --app-primary: #6777ef;
  --app-primary-soft: rgba(103, 119, 239, 0.12);
  --app-success: #47c363;
  --app-warning: #ffa426;
  --app-danger: #fc544b;
  --app-shadow: 0 10px 30px rgba(51, 73, 94, 0.08);
}

body[data-theme="dark"] {
  --app-bg: #15171c;
  --app-surface: #1e2229;
  --app-surface-soft: #252a33;
  --app-surface-muted: #2b313c;
  --app-border: #343b48;
  --app-text: #edf2f7;
  --app-heading: #f8fafc;
  --app-muted: #aab4c0;
  --app-primary: #7f8cff;
  --app-primary-soft: rgba(127, 140, 255, 0.16);
  --app-success: #5fd37a;
  --app-warning: #ffc15a;
  --app-danger: #ff6b63;
  --app-shadow: 0 14px 38px rgba(0, 0, 0, 0.32);
  background-color: var(--app-bg);
  color: var(--app-text);
  color-scheme: dark;
}

body[data-theme="dark"] #app,
body[data-theme="dark"] .main-wrapper,
body[data-theme="dark"] .main-content,
body[data-theme="dark"] .section,
body[data-theme="dark"] .section-body {
  background-color: var(--app-bg);
  color: var(--app-text);
}

body[data-theme="dark"] .section-header,
body[data-theme="dark"] .card,
body[data-theme="dark"] .modal-content,
body[data-theme="dark"] .dropdown-menu {
  background-color: var(--app-surface);
  border-color: var(--app-border);
  box-shadow: var(--app-shadow);
  color: var(--app-text);
}

body[data-theme="dark"] .card-header,
body[data-theme="dark"] .card-body,
body[data-theme="dark"] .modal-header,
body[data-theme="dark"] .modal-body,
body[data-theme="dark"] .modal-footer {
  background-color: transparent;
  border-color: var(--app-border);
  color: var(--app-text);
}

body[data-theme="dark"] .section-header h1,
body[data-theme="dark"] .card-header h1,
body[data-theme="dark"] .card-header h2,
body[data-theme="dark"] .card-header h3,
body[data-theme="dark"] .card-header h4,
body[data-theme="dark"] .card-header h5,
body[data-theme="dark"] .card-header h6,
body[data-theme="dark"] h1,
body[data-theme="dark"] h2,
body[data-theme="dark"] h3,
body[data-theme="dark"] h4,
body[data-theme="dark"] h5,
body[data-theme="dark"] h6 {
  color: var(--app-heading);
}

body[data-theme="dark"] p,
body[data-theme="dark"] label,
body[data-theme="dark"] .dropdown-title,
body[data-theme="dark"] .media-title,
body[data-theme="dark"] .font-weight-bold {
  color: var(--app-text);
}

body[data-theme="dark"] a:not(.btn):not(.dropdown-item) {
  color: var(--app-primary);
}

body[data-theme="dark"] .bg-white,
body[data-theme="dark"] .bg-light,
body[data-theme="dark"] .bg-whitesmoke {
  background-color: var(--app-surface-soft) !important;
}

body[data-theme="dark"] .text-dark {
  color: var(--app-text) !important;
}

body[data-theme="dark"] .text-muted,
body[data-theme="dark"] .small,
body[data-theme="dark"] small {
  color: var(--app-muted) !important;
}

body[data-theme="dark"] .border,
body[data-theme="dark"] .border-top,
body[data-theme="dark"] .border-right,
body[data-theme="dark"] .border-bottom,
body[data-theme="dark"] .border-left,
body[data-theme="dark"] .dropdown-divider,
body[data-theme="dark"] hr {
  border-color: var(--app-border) !important;
}

body[data-theme="dark"] .main-footer {
  background-color: var(--app-surface);
  border-top-color: var(--app-border);
  color: var(--app-muted);
}

body[data-theme="dark"] .main-footer .footer-content {
  color: var(--app-muted);
}

body[data-theme="dark"] .dropdown-menu {
  overflow-x: hidden;
}

body[data-theme="dark"] .dropdown-item {
  color: var(--app-text);
}

body[data-theme="dark"] .dropdown-item:hover,
body[data-theme="dark"] .dropdown-item:focus {
  background-color: var(--app-primary);
  color: #ffffff;
}

body[data-theme="dark"] .dropdown-item.active {
  background-color: var(--app-primary-soft);
  color: var(--app-primary);
}

body[data-theme="dark"] .dropdown-item.active:hover,
body[data-theme="dark"] .dropdown-item.active:focus {
  background-color: var(--app-primary);
  color: #ffffff;
}

body[data-theme="dark"] .topbar-nav .dropdown-menu,
body[data-theme="dark"] .topbar-user-nav .dropdown-menu {
  background-color: var(--app-surface) !important;
  border-color: var(--app-border) !important;
  box-shadow: var(--app-shadow) !important;
  color: var(--app-text) !important;
}

body[data-theme="dark"] .topbar-nav .dropdown-title,
body[data-theme="dark"] .topbar-user-nav .dropdown-title,
body[data-theme="dark"] .dropdown-menu .dropdown-title {
  color: var(--app-muted) !important;
}

body[data-theme="dark"] .topbar-nav .dropdown-item,
body[data-theme="dark"] .topbar-user-nav .dropdown-item,
body[data-theme="dark"] .topbar-nav .theme-toggle-label {
  color: var(--app-text) !important;
}

body[data-theme="dark"] .topbar-nav .dropdown-item:hover,
body[data-theme="dark"] .topbar-nav .dropdown-item:focus,
body[data-theme="dark"] .topbar-user-nav .dropdown-item:hover,
body[data-theme="dark"] .topbar-user-nav .dropdown-item:focus {
  background-color: var(--app-primary) !important;
  color: #ffffff !important;
}

body[data-theme="dark"] .topbar-nav .dropdown-item.active {
  background-color: var(--app-primary-soft) !important;
  color: var(--app-primary) !important;
}

body[data-theme="dark"] .topbar-nav .dropdown-item.active:hover,
body[data-theme="dark"] .topbar-nav .dropdown-item.active:focus {
  background-color: var(--app-primary) !important;
  color: #ffffff !important;
}

body[data-theme="dark"] .topbar-nav .theme-toggle-item:hover,
body[data-theme="dark"] .topbar-nav .theme-toggle-item:focus {
  background-color: var(--app-surface-soft);
  color: var(--app-text);
}

body[data-theme="dark"] .btn-light,
body[data-theme="dark"] .btn-secondary {
  background-color: var(--app-surface-soft);
  border-color: var(--app-border);
  color: var(--app-text);
}

body[data-theme="dark"] .badge-light {
  background-color: var(--app-surface-muted);
  color: var(--app-text);
}

body[data-theme="dark"] .close,
body[data-theme="dark"] .modal-header .close {
  color: var(--app-text);
  opacity: 0.85;
  text-shadow: none;
}

body[data-theme="dark"] .modal-title,
body[data-theme="dark"] .modal label,
body[data-theme="dark"] .modal .form-label,
body[data-theme="dark"] .modal .custom-control-label,
body[data-theme="dark"] .modal .invalid-feedback,
body[data-theme="dark"] .modal .text-muted,
body[data-theme="dark"] .modal .small,
body[data-theme="dark"] .modal small {
  color: var(--app-text);
}

body[data-theme="dark"] .modal .text-muted,
body[data-theme="dark"] .modal .small,
body[data-theme="dark"] .modal small {
  color: var(--app-muted) !important;
}

body[data-theme="dark"] .alert {
  border-color: var(--app-border);
}

body[data-theme="dark"] .alert-light,
body[data-theme="dark"] .alert-secondary {
  background-color: var(--app-surface-soft);
  color: var(--app-text);
}

body[data-theme="dark"] ::selection {
  background-color: rgba(127, 140, 255, 0.35);
  color: #ffffff;
}

body[data-theme="dark"] :focus-visible {
  outline: 2px solid var(--app-primary);
  outline-offset: 2px;
}

body[data-theme="dark"] .btn:focus,
body[data-theme="dark"] .btn.focus,
body[data-theme="dark"] .form-control:focus,
body[data-theme="dark"] .custom-select:focus,
body[data-theme="dark"] .custom-switch-input:focus ~ .custom-switch-indicator,
body[data-theme="dark"] .select2-container--focus .select2-selection,
body[data-theme="dark"] .select2-container--open .select2-selection {
  box-shadow: 0 0 0 0.16rem rgba(127, 140, 255, 0.2) !important;
}

/* Phase 3: forms, dense tables, plugins, and feedback components. */
body[data-theme="dark"] .form-control,
body[data-theme="dark"] .custom-select,
body[data-theme="dark"] .input-group-text,
body[data-theme="dark"] .bootstrap-tagsinput,
body[data-theme="dark"] input[type="date"],
body[data-theme="dark"] input[type="month"],
body[data-theme="dark"] input[type="number"],
body[data-theme="dark"] input[type="text"],
body[data-theme="dark"] input[type="email"],
body[data-theme="dark"] input[type="password"],
body[data-theme="dark"] select,
body[data-theme="dark"] textarea {
  background-color: #171b22;
  border-color: var(--app-border);
  color: var(--app-text) !important;
  -webkit-text-fill-color: var(--app-text);
  caret-color: var(--app-text);
}

body[data-theme="dark"] .modal .form-control,
body[data-theme="dark"] .modal .custom-select,
body[data-theme="dark"] .modal .input-group-text,
body[data-theme="dark"] .modal input,
body[data-theme="dark"] .modal select,
body[data-theme="dark"] .modal textarea {
  color: var(--app-text) !important;
  -webkit-text-fill-color: var(--app-text);
  caret-color: var(--app-text);
}

body[data-theme="dark"] .form-control:focus,
body[data-theme="dark"] .custom-select:focus,
body[data-theme="dark"] input:focus,
body[data-theme="dark"] select:focus,
body[data-theme="dark"] textarea:focus {
  background-color: #171b22;
  border-color: var(--app-primary);
  color: var(--app-text) !important;
  -webkit-text-fill-color: var(--app-text);
  caret-color: var(--app-text);
}

body[data-theme="dark"] .form-control::placeholder,
body[data-theme="dark"] input::placeholder,
body[data-theme="dark"] textarea::placeholder {
  color: #7f8a99 !important;
  -webkit-text-fill-color: #7f8a99;
  opacity: 1;
}

body[data-theme="dark"] .form-control::-webkit-input-placeholder,
body[data-theme="dark"] input::-webkit-input-placeholder,
body[data-theme="dark"] textarea::-webkit-input-placeholder {
  color: #7f8a99 !important;
  -webkit-text-fill-color: #7f8a99;
}

body[data-theme="dark"] .form-control::-moz-placeholder,
body[data-theme="dark"] input::-moz-placeholder,
body[data-theme="dark"] textarea::-moz-placeholder {
  color: #7f8a99 !important;
  opacity: 1;
}

body[data-theme="dark"] .form-control:-ms-input-placeholder,
body[data-theme="dark"] input:-ms-input-placeholder,
body[data-theme="dark"] textarea:-ms-input-placeholder,
body[data-theme="dark"] .form-control::-ms-input-placeholder,
body[data-theme="dark"] input::-ms-input-placeholder,
body[data-theme="dark"] textarea::-ms-input-placeholder {
  color: #7f8a99 !important;
}

body[data-theme="dark"] .form-control[readonly],
body[data-theme="dark"] .form-control:disabled,
body[data-theme="dark"] .custom-select:disabled,
body[data-theme="dark"] input:disabled,
body[data-theme="dark"] select:disabled,
body[data-theme="dark"] textarea:disabled {
  background-color: var(--app-surface-muted);
  color: var(--app-muted) !important;
  -webkit-text-fill-color: var(--app-muted);
  opacity: 1;
}

body[data-theme="dark"] .invalid-feedback,
body[data-theme="dark"] .invalid-tooltip,
body[data-theme="dark"] .is-invalid ~ .invalid-feedback {
  color: #ff918b;
}

body[data-theme="dark"] .form-control.is-invalid,
body[data-theme="dark"] .custom-select.is-invalid,
body[data-theme="dark"] .was-validated .form-control:invalid,
body[data-theme="dark"] .was-validated .custom-select:invalid {
  border-color: var(--app-danger);
}

body[data-theme="dark"] .form-control.border-0,
body[data-theme="dark"] .form-control.bg-transparent {
  background-color: transparent !important;
  color: var(--app-text);
}

body[data-theme="dark"] .table .form-control,
body[data-theme="dark"] .table .custom-select,
body[data-theme="dark"] .table input,
body[data-theme="dark"] .table select,
body[data-theme="dark"] .table textarea {
  background-color: transparent !important;
  border-color: transparent !important;
  outline: 0 !important;
  box-shadow: none !important;
  color: var(--app-text) !important;
}

body[data-theme="dark"] .table .form-control:focus,
body[data-theme="dark"] .table .custom-select:focus,
body[data-theme="dark"] .table input:focus,
body[data-theme="dark"] .table select:focus,
body[data-theme="dark"] .table textarea:focus {
  background-color: transparent !important;
  border-color: transparent !important;
  outline: 0 !important;
  box-shadow: none !important;
  color: var(--app-text) !important;
}

body[data-theme="dark"] .table .select2-container--default .select2-selection--single,
body[data-theme="dark"] .table .select2-container--default .select2-selection--multiple,
body[data-theme="dark"] .table .select2-container .select2-selection--single,
body[data-theme="dark"] .table .select2-container .select2-selection--multiple {
  background-color: transparent !important;
  border-color: transparent !important;
  outline: 0 !important;
  box-shadow: none !important;
}

body[data-theme="dark"] .table .select2-container--focus .select2-selection,
body[data-theme="dark"] .table .select2-container--open .select2-selection {
  background-color: transparent !important;
  border-color: transparent !important;
  outline: 0 !important;
  box-shadow: none !important;
}

body[data-theme="dark"] .table .select2-container--default .select2-selection--single .select2-selection__rendered,
body[data-theme="dark"] .table .select2-container--default .select2-selection--multiple .select2-selection__rendered {
  color: var(--app-text) !important;
}

body[data-theme="dark"] .input-group-text i,
body[data-theme="dark"] .form-text {
  color: var(--app-muted);
}

body[data-theme="dark"] #createVoucherModal .js-tax-percent-input,
body[data-theme="dark"] #createVoucherModal .js-tax-percent-input:focus,
body[data-theme="dark"] #createVoucherModal .js-tax-percent-input + .input-group-append .input-group-text {
  background-color: #171b22 !important;
  border-color: var(--app-border) !important;
  color: var(--app-text) !important;
  box-shadow: none !important;
  outline: 0 !important;
}

body[data-theme="dark"] #createVoucherModal .js-tax-percent-input:focus {
  border-color: var(--app-border) !important;
}

body[data-theme="dark"] .custom-switch-indicator {
  background-color: var(--app-surface-muted);
  border-color: var(--app-border);
}

body[data-theme="dark"] .custom-switch-input:checked ~ .custom-switch-indicator {
  background-color: var(--app-primary);
  border-color: var(--app-primary);
}

body[data-theme="dark"] .custom-switch-input:disabled ~ .custom-switch-indicator {
  opacity: 0.72;
  cursor: wait;
}

body[data-theme="dark"] .table {
  color: var(--app-text);
  background-color: transparent;
}

body[data-theme="dark"] .table th,
body[data-theme="dark"] .table td {
  border-color: var(--app-border);
  color: var(--app-text);
}

body[data-theme="dark"] .table-bordered,
body[data-theme="dark"] .table-bordered th,
body[data-theme="dark"] .table-bordered td {
  border-color: var(--app-border);
}

body[data-theme="dark"] .table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(255, 255, 255, 0.025);
}

body[data-theme="dark"] .table-hover tbody tr:hover {
  background-color: rgba(127, 140, 255, 0.1);
  color: var(--app-text);
}

body[data-theme="dark"] .table thead th,
body[data-theme="dark"] thead.bg-light,
body[data-theme="dark"] .thead-light th {
  background-color: #242a35 !important;
  border-color: var(--app-border);
  color: var(--app-heading);
}

body[data-theme="dark"] .thead-dark th,
body[data-theme="dark"] .table-dark th,
body[data-theme="dark"] .table-dark td {
  background-color: #11151b;
  border-color: var(--app-border);
  color: var(--app-heading);
}

body[data-theme="dark"] .table-responsive {
  scrollbar-color: #475263 var(--app-surface);
}

body[data-theme="dark"] .table-responsive::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}

body[data-theme="dark"] .table-responsive::-webkit-scrollbar-track {
  background-color: var(--app-surface);
}

body[data-theme="dark"] .table-responsive::-webkit-scrollbar-thumb {
  background-color: #475263;
  border-radius: 8px;
}

body[data-theme="dark"] .select2-container--default .select2-selection--single,
body[data-theme="dark"] .select2-container--default .select2-selection--multiple,
body[data-theme="dark"] .select2-container .select2-selection--single,
body[data-theme="dark"] .select2-container .select2-selection--multiple {
  background-color: #171b22;
  border-color: var(--app-border);
  color: var(--app-text);
}

body[data-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered,
body[data-theme="dark"] .select2-container--default .select2-selection--multiple .select2-selection__rendered {
  color: var(--app-text);
}

body[data-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__placeholder,
body[data-theme="dark"] .select2-container--default .select2-search--inline .select2-search__field::placeholder {
  color: #7f8a99;
}

body[data-theme="dark"] .select2-dropdown {
  background-color: var(--app-surface);
  border-color: var(--app-border);
  box-shadow: var(--app-shadow);
  color: var(--app-text);
}

body[data-theme="dark"] .select2-results__option,
body[data-theme="dark"] .select2-results__group {
  color: var(--app-text);
}

body[data-theme="dark"] .select2-container--default .select2-results__option[aria-selected="true"] {
  background-color: var(--app-surface-muted);
}

body[data-theme="dark"] .select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: var(--app-primary);
  color: #ffffff;
}

body[data-theme="dark"] .select2-container--default .select2-selection--multiple .select2-selection__choice {
  background-color: var(--app-primary-soft);
  border-color: var(--app-border);
  color: var(--app-text);
}

body[data-theme="dark"] .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
  color: var(--app-muted);
}

body[data-theme="dark"] .select2-search--dropdown .select2-search__field,
body[data-theme="dark"] .select2-container--default .select2-search--dropdown .select2-search__field,
body[data-theme="dark"] .select2-container--default .select2-search--inline .select2-search__field {
  background-color: #171b22;
  border-color: var(--app-border) !important;
  color: var(--app-text);
}

.select2-container--default .select2-results > .select2-results__options {
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.select2-container--default .select2-results > .select2-results__options::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.select2-container--default .select2-results__option {
  min-height: 36px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  line-height: 1.25;
}

.select2-container--default .select2-results__option:empty {
  background-color: #f4f6fb;
  color: #98a6ad;
}

.select2-container--default .select2-results__option:empty::before {
  content: "\00a0";
}

.select2-container--default .select2-results__option--highlighted[aria-selected]:empty,
.select2-container--default .select2-results__option[aria-selected="true"]:empty {
  background-color: #eef1f8;
  color: #7b8497;
}

body[data-theme="dark"] .select2-container--default .select2-results__option:empty {
  background-color: #252a33;
  color: #7f8a99;
}

body[data-theme="dark"] .select2-container--default .select2-results__option--highlighted[aria-selected]:empty,
body[data-theme="dark"] .select2-container--default .select2-results__option[aria-selected="true"]:empty {
  background-color: #2b313c;
  color: #aab4c0;
}

body[data-theme="dark"] .datepicker,
body[data-theme="dark"] .datepicker-dropdown,
body[data-theme="dark"] .daterangepicker,
body[data-theme="dark"] .daterangepicker .calendar-table {
  background-color: var(--app-surface);
  border-color: var(--app-border);
  color: var(--app-text);
}

body[data-theme="dark"] .datepicker table tr td,
body[data-theme="dark"] .datepicker table tr th,
body[data-theme="dark"] .daterangepicker td,
body[data-theme="dark"] .daterangepicker th,
body[data-theme="dark"] .daterangepicker .calendar-table td,
body[data-theme="dark"] .daterangepicker .calendar-table th {
  background-color: transparent;
  border-color: transparent;
  color: var(--app-text);
}

body[data-theme="dark"] .datepicker table tr td.day:hover,
body[data-theme="dark"] .datepicker table tr td.focused,
body[data-theme="dark"] .daterangepicker td.available:hover,
body[data-theme="dark"] .daterangepicker th.available:hover {
  background-color: var(--app-surface-soft);
  color: var(--app-text);
}

body[data-theme="dark"] .datepicker table tr td.active,
body[data-theme="dark"] .datepicker table tr td.active:hover,
body[data-theme="dark"] .daterangepicker td.active,
body[data-theme="dark"] .daterangepicker td.active:hover {
  background-color: var(--app-primary);
  color: #ffffff;
}

body[data-theme="dark"] .datepicker table tr td.old,
body[data-theme="dark"] .datepicker table tr td.new,
body[data-theme="dark"] .daterangepicker td.off,
body[data-theme="dark"] .daterangepicker td.off.in-range,
body[data-theme="dark"] .daterangepicker td.off.start-date,
body[data-theme="dark"] .daterangepicker td.off.end-date {
  background-color: transparent;
  color: #6f7b8c;
}

body[data-theme="dark"] .daterangepicker .drp-buttons {
  border-top-color: var(--app-border);
}

body[data-theme="dark"] .daterangepicker .ranges li {
  color: var(--app-text);
}

body[data-theme="dark"] .daterangepicker .ranges li:hover,
body[data-theme="dark"] .daterangepicker .ranges li.active {
  background-color: var(--app-primary);
  color: #ffffff;
}

body[data-theme="dark"] .dataTables_wrapper,
body[data-theme="dark"] .dataTables_info,
body[data-theme="dark"] .dataTables_length,
body[data-theme="dark"] .dataTables_filter,
body[data-theme="dark"] .dataTables_paginate {
  color: var(--app-text) !important;
}

body[data-theme="dark"] .dataTables_wrapper input,
body[data-theme="dark"] .dataTables_wrapper select {
  background-color: #171b22;
  border: 1px solid var(--app-border);
  color: var(--app-text);
}

body[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button {
  background: var(--app-surface-soft) !important;
  border-color: var(--app-border) !important;
  color: var(--app-text) !important;
}

body[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.current,
body[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover,
body[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--app-primary) !important;
  border-color: var(--app-primary) !important;
  color: #ffffff !important;
}

body[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
body[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
  background: var(--app-surface) !important;
  border-color: var(--app-border) !important;
  color: var(--app-muted) !important;
}

body[data-theme="dark"] #toast-container > div {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

body[data-theme="dark"] .toast {
  background-color: var(--app-surface);
  color: var(--app-text);
}

body[data-theme="dark"] .toast-title,
body[data-theme="dark"] .toast-message {
  color: #ffffff;
}

body[data-theme="dark"] #toast-container > .toast-success,
body[data-theme="dark"] .toast.toast-success {
  background-color: #47c363 !important;
  color: #ffffff !important;
}

body[data-theme="dark"] #toast-container > .toast-error,
body[data-theme="dark"] .toast.toast-error {
  background-color: #fc544b !important;
  color: #ffffff !important;
}

body[data-theme="dark"] #toast-container > .toast-warning,
body[data-theme="dark"] .toast.toast-warning {
  background-color: #ffa426 !important;
  color: #ffffff !important;
}

body[data-theme="dark"] #toast-container > .toast-info,
body[data-theme="dark"] .toast.toast-info {
  background-color: #3abaf4 !important;
  color: #ffffff !important;
}

body[data-theme="dark"] .toast.toast-success .toast-title,
body[data-theme="dark"] .toast.toast-success .toast-message,
body[data-theme="dark"] .toast.toast-error .toast-title,
body[data-theme="dark"] .toast.toast-error .toast-message,
body[data-theme="dark"] .toast.toast-warning .toast-title,
body[data-theme="dark"] .toast.toast-warning .toast-message,
body[data-theme="dark"] .toast.toast-info .toast-title,
body[data-theme="dark"] .toast.toast-info .toast-message {
  color: #ffffff !important;
}

body[data-theme="dark"] .swal2-popup,
body[data-theme="dark"] .swal-modal {
  background-color: var(--app-surface);
  color: var(--app-text);
}

body[data-theme="dark"] .swal2-title,
body[data-theme="dark"] .swal2-html-container,
body[data-theme="dark"] .swal-title,
body[data-theme="dark"] .swal-text {
  color: var(--app-text);
}

body[data-theme="dark"] .swal2-input,
body[data-theme="dark"] .swal2-textarea,
body[data-theme="dark"] .swal-content__input,
body[data-theme="dark"] .swal-content__textarea {
  background-color: #171b22;
  border-color: var(--app-border);
  color: var(--app-text);
}

body[data-theme="dark"] .swal2-styled.swal2-confirm,
body[data-theme="dark"] .swal-button.swal-button--confirm {
  background-color: var(--app-primary);
}

body[data-theme="dark"] .list-group-item,
body[data-theme="dark"] .media,
body[data-theme="dark"] .ticket-item,
body[data-theme="dark"] .summary-item {
  background-color: transparent;
  border-color: var(--app-border);
  color: var(--app-text);
}

body[data-theme="dark"] .pagination .page-link {
  background-color: var(--app-surface);
  border-color: var(--app-border);
  color: var(--app-text);
}

body[data-theme="dark"] .pagination .page-item.active .page-link {
  background-color: var(--app-primary);
  border-color: var(--app-primary);
  color: #ffffff;
}

body[data-theme="dark"] .pagination .page-item.disabled .page-link {
  background-color: var(--app-surface-soft);
  border-color: var(--app-border);
  color: var(--app-muted);
}

/* Phase 4: module-specific cleanup for high-traffic app screens. */
body[data-theme="dark"] .dashboard-refined .dashboard-hero {
  background: linear-gradient(135deg, #1e2229 0%, #202836 55%, #182030 100%);
  box-shadow: var(--app-shadow);
}

body[data-theme="dark"] .dashboard-refined .dashboard-hero-accent {
  background:
    radial-gradient(circle at top right, rgba(127, 140, 255, 0.22), transparent 34%),
    radial-gradient(circle at bottom left, rgba(58, 186, 244, 0.14), transparent 28%);
}

body[data-theme="dark"] .dashboard-refined .dashboard-hero-chip {
  background-color: var(--app-primary-soft);
  border-color: rgba(127, 140, 255, 0.26);
  color: var(--app-text);
}

body[data-theme="dark"] .dashboard-refined .dashboard-clock-panel {
  background-color: #11151b;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

body[data-theme="dark"] .dashboard-refined .dashboard-soft-card,
body[data-theme="dark"] .dashboard-refined .dashboard-kpi-card {
  background-color: var(--app-surface);
  border-color: var(--app-border);
  box-shadow: var(--app-shadow);
}

body[data-theme="dark"] .dashboard-refined .dashboard-kpi .card-statistic-2 .card-chart {
  background-color: transparent;
}

body[data-theme="dark"] .dashboard-refined .card-stats,
body[data-theme="dark"] .dashboard-refined .card-stats-title,
body[data-theme="dark"] .dashboard-refined .card-stats-item-label,
body[data-theme="dark"] .dashboard-refined .dashboard-card-subtitle,
body[data-theme="dark"] .dashboard-refined .dashboard-kpi-meta,
body[data-theme="dark"] .dashboard-refined .dashboard-product-subtitle {
  color: var(--app-muted) !important;
}

body[data-theme="dark"] .dashboard-refined .card-stats-item-count,
body[data-theme="dark"] .dashboard-refined .dashboard-kpi .card-body,
body[data-theme="dark"] .dashboard-refined .dashboard-business-value,
body[data-theme="dark"] .dashboard-refined .dashboard-expense-total {
  color: var(--app-heading) !important;
}

body[data-theme="dark"] .dashboard-refined .tickets-list .ticket-item {
  background-color: transparent !important;
  border-color: var(--app-border) !important;
  color: var(--app-text) !important;
}

body[data-theme="dark"] .dashboard-refined .tickets-list .ticket-item:hover {
  background-color: var(--app-surface-soft) !important;
}

body[data-theme="dark"] .dashboard-refined .dashboard-product-card .media,
body[data-theme="dark"] .dashboard-refined .list-unstyled-border li {
  border-color: var(--app-border) !important;
}

body[data-theme="dark"] .dashboard-refined .dashboard-business-card .ticket-title h4,
body[data-theme="dark"] .dashboard-refined .dashboard-business-card .ticket-info,
body[data-theme="dark"] .dashboard-refined .dashboard-business-card .ticket-info div:not(.dashboard-business-value),
body[data-theme="dark"] .dashboard-refined .dashboard-product-card .dashboard-product-value,
body[data-theme="dark"] .dashboard-refined .dashboard-product-card .dashboard-product-value-row,
body[data-theme="dark"] .dashboard-refined .dashboard-product-card .small {
  color: var(--app-text) !important;
}

body[data-theme="dark"] .dashboard-refined .dashboard-business-card .ticket-info .bullet {
  background-color: var(--app-border) !important;
}

body[data-theme="dark"] .dashboard-refined .dashboard-business-card .ticket-info .dashboard-business-value,
body[data-theme="dark"] .dashboard-refined .dashboard-business-card .ticket-more {
  color: var(--app-success) !important;
}

body[data-theme="dark"] .dashboard-refined .dashboard-product-card .media-title {
  color: var(--app-primary) !important;
}

body[data-theme="dark"] .dashboard-refined .dashboard-product-card .dashboard-product-label,
body[data-theme="dark"] .dashboard-refined .dashboard-product-card .dashboard-product-subtitle {
  color: var(--app-muted) !important;
}

body[data-theme="dark"] .dashboard-refined .dashboard-product-card .dashboard-product-trend-flat {
  color: var(--app-muted) !important;
}

body[data-theme="dark"] .dashboard-refined .progress {
  background-color: var(--app-surface-muted);
}

body[data-theme="dark"] .product-table,
body[data-theme="dark"] .other-products-table,
body[data-theme="dark"] .purchase-table,
body[data-theme="dark"] .cash-transaction-table,
body[data-theme="dark"] .open-sale-table,
body[data-theme="dark"] .bank-voucher-table {
  background-color: var(--app-surface);
}

body[data-theme="dark"] .product-table tbody tr,
body[data-theme="dark"] .other-products-table tbody tr,
body[data-theme="dark"] .purchase-table tbody tr,
body[data-theme="dark"] .cash-transaction-table tbody tr,
body[data-theme="dark"] .open-sale-table tbody tr,
body[data-theme="dark"] .bank-voucher-table tbody tr {
  background-color: var(--app-surface);
}

body[data-theme="dark"] .product-table .product-rate,
body[data-theme="dark"] input.product-rate {
  background-color: rgba(58, 186, 244, 0.18) !important;
  color: var(--app-heading);
}

body[data-theme="dark"] .nozzle-old-display,
body[data-theme="dark"] .nozzle-sale,
body[data-theme="dark"] .nozzle-amount,
body[data-theme="dark"] .product-test-amount,
body[data-theme="dark"] .product-total-sale,
body[data-theme="dark"] .product-total-amount,
body[data-theme="dark"] .other-rate-display,
body[data-theme="dark"] .other-amount,
body[data-theme="dark"] .other-total-amount {
  color: var(--app-heading) !important;
}

body[data-theme="dark"] .nav-pills .nav-link {
  color: var(--app-muted);
  box-shadow: none !important;
}

body[data-theme="dark"] .nav-pills .nav-link:hover {
  background-color: var(--app-surface-soft);
  color: var(--app-text);
  box-shadow: inset 0 0 0 1px rgba(127, 140, 255, 0.12) !important;
}

body[data-theme="dark"] .nav-pills .nav-link.active,
body[data-theme="dark"] .nav-pills .show > .nav-link,
body[data-theme="dark"] .nav-pills .nav-item .nav-link.active {
  background-color: var(--app-primary);
  color: #ffffff;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.26), 0 0 0 1px rgba(127, 140, 255, 0.18) !important;
}

body[data-theme="dark"].settings-shell .section-header,
body[data-theme="dark"].settings-shell .card {
  background-color: var(--app-surface);
}

body[data-theme="dark"].settings-shell .table-md th,
body[data-theme="dark"].settings-shell .table-md td {
  border-color: var(--app-border);
}

body[data-theme="dark"] #carriagePageLoader {
  background: rgba(21, 23, 28, 0.82) !important;
  backdrop-filter: blur(4px);
}

body[data-theme="dark"] #carriageVoucherTable,
body[data-theme="dark"] #createVoucherModal .table,
body[data-theme="dark"] #editVoucherModal .table,
body[data-theme="dark"] .carriage-ledger-table,
body[data-theme="dark"] .company-bill-table {
  background-color: var(--app-surface);
}

body[data-theme="dark"] #createVoucherModal .modal-content,
body[data-theme="dark"] #editVoucherModal .modal-content {
  background-color: var(--app-surface);
}

body[data-theme="dark"] #createVoucherModal .table-responsive,
body[data-theme="dark"] #editVoucherModal .table-responsive {
  border-color: var(--app-border);
}

body[data-theme="dark"] .carriage-actions .btn,
body[data-theme="dark"] .section-header-back .btn {
  border-color: var(--app-border);
}

body[data-theme="dark"] .company-toolbar,
body[data-theme="dark"] .cash-report-header,
body[data-theme="dark"] .inventory-ledger-header,
body[data-theme="dark"] .capital-report-header,
body[data-theme="dark"] .pl-report-header,
body[data-theme="dark"] .report-toolbar,
body[data-theme="dark"] .ledger-filter-control,
body[data-theme="dark"] .cash-report-filter-control,
body[data-theme="dark"] .inventory-ledger-filter-control,
body[data-theme="dark"] .capital-report-filter-control,
body[data-theme="dark"] .pl-report-filter-control {
  background-color: var(--app-surface) !important;
  border-color: var(--app-border);
  color: var(--app-text);
}

body[data-theme="dark"] .report-table,
body[data-theme="dark"] .ledger-table,
body[data-theme="dark"] .inventory-ledger-table,
body[data-theme="dark"] .cash-report-table,
body[data-theme="dark"] .capital-table,
body[data-theme="dark"] #report-table {
  background-color: var(--app-surface);
  color: var(--app-text);
}

body[data-theme="dark"] .report-table tfoot th,
body[data-theme="dark"] .report-table tfoot td,
body[data-theme="dark"] .ledger-table tfoot th,
body[data-theme="dark"] .ledger-table tfoot td,
body[data-theme="dark"] .cash-report-table tfoot th,
body[data-theme="dark"] .cash-report-table tfoot td,
body[data-theme="dark"] .inventory-ledger-table tfoot th,
body[data-theme="dark"] .inventory-ledger-table tfoot td,
body[data-theme="dark"] #report-table tfoot th,
body[data-theme="dark"] #report-table tfoot td,
body[data-theme="dark"] .summary-grand td,
body[data-theme="dark"] .summary-grand th,
body[data-theme="dark"] .cash-report-totals-row td,
body[data-theme="dark"] tfoot.bg-light th,
body[data-theme="dark"] tfoot.bg-light td,
body[data-theme="dark"] tr.bg-light td,
body[data-theme="dark"] tr.bg-light th {
  background-color: #242a35 !important;
  border-color: var(--app-border) !important;
  color: var(--app-heading) !important;
}

body[data-theme="dark"] .report-stat-card,
body[data-theme="dark"] .capital-report-card,
body[data-theme="dark"] .ledger-summary-card,
body[data-theme="dark"] .company-bill-summary-card {
  background-color: var(--app-surface-soft);
  border-color: var(--app-border);
  color: var(--app-text);
}

body[data-theme="dark"] .invoice,
body[data-theme="dark"] .invoice-print {
  background-color: var(--app-surface);
  color: var(--app-text);
}

body[data-theme="dark"] .invoice hr {
  border-color: var(--app-border);
}

body[data-theme="dark"] .company-bill-signature-label {
  background-color: var(--app-surface-soft) !important;
  color: var(--app-text);
}

body[data-theme="dark"] .login-brand,
body[data-theme="dark"] .simple-footer {
  color: var(--app-muted);
}

body[data-theme="dark"] .auth-card,
body[data-theme="dark"] .card.card-primary {
  border-color: var(--app-border);
}

body[data-theme="dark"] .main-wrapper,
body[data-theme="dark"] .section,
body[data-theme="dark"] .section-body,
body[data-theme="dark"] .card {
  max-width: 100%;
}

body[data-theme="dark"] .modal .select2-container--default .select2-selection--single,
body[data-theme="dark"] .modal .select2-container--default .select2-selection--multiple,
body[data-theme="dark"] .modal .select2-container .select2-selection--single,
body[data-theme="dark"] .modal .select2-container .select2-selection--multiple {
  background-color: #171b22 !important;
  border-color: var(--app-border) !important;
  color: var(--app-text) !important;
}

body[data-theme="dark"] .modal .select2-container--default .select2-selection--single .select2-selection__rendered,
body[data-theme="dark"] .modal .select2-container--default .select2-selection--multiple .select2-selection__rendered,
body[data-theme="dark"] .modal .select2-selection__placeholder,
body[data-theme="dark"] .modal .select2-search--inline .select2-search__field::placeholder {
  color: var(--app-text) !important;
}

body[data-theme="dark"] .modal .select2-selection__placeholder,
body[data-theme="dark"] .modal .select2-search--inline .select2-search__field::placeholder {
  color: var(--app-muted) !important;
}

body[data-theme="dark"] .modal .select2-dropdown,
body[data-theme="dark"] .modal .select2-results__option,
body[data-theme="dark"] .modal .select2-results__group,
body[data-theme="dark"] .modal .select2-search--dropdown .select2-search__field {
  background-color: var(--app-surface) !important;
  color: var(--app-text) !important;
  border-color: var(--app-border) !important;
}

.page-loader-text {
  color: #34395e;
}

body[data-theme="dark"] .page-loader-text {
  color: var(--app-text) !important;
}

body[data-theme="dark"] .btn-outline-primary,
body[data-theme="dark"] .btn-outline-secondary,
body[data-theme="dark"] .btn-outline-dark {
  border-color: var(--app-border);
  color: var(--app-text);
}

body[data-theme="dark"] .btn-outline-primary:hover,
body[data-theme="dark"] .btn-outline-secondary:hover,
body[data-theme="dark"] .btn-outline-dark:hover {
  background-color: var(--app-primary);
  border-color: var(--app-primary);
  color: #ffffff;
}

/* Dark theme stabilization pass for Stisla shadows, report pages, and plugin CSS. */
body[data-theme="dark"] .shadow,
body[data-theme="dark"] .shadow-sm,
body[data-theme="dark"] .shadow-lg,
body[data-theme="dark"] .shadow-light,
body[data-theme="dark"] .card.shadow,
body[data-theme="dark"] .card.shadow-sm,
body[data-theme="dark"] .card.shadow-lg {
  box-shadow: var(--app-shadow) !important;
}

body[data-theme="dark"] .btn {
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.16) !important;
}

body[data-theme="dark"] .btn-light,
body[data-theme="dark"] .btn-secondary,
body[data-theme="dark"] .btn-outline-primary,
body[data-theme="dark"] .btn-outline-secondary,
body[data-theme="dark"] .btn-outline-dark {
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.14) !important;
}

body[data-theme="dark"] .shadow-primary,
body[data-theme="dark"] .btn-primary,
body[data-theme="dark"] .btn-primary:focus,
body[data-theme="dark"] .btn-primary.focus {
  box-shadow: 0 9px 18px rgba(0, 0, 0, 0.24), 0 0 0 1px rgba(127, 140, 255, 0.15) !important;
}

body[data-theme="dark"] .shadow-success,
body[data-theme="dark"] .btn-success,
body[data-theme="dark"] .btn-success:focus,
body[data-theme="dark"] .btn-success.focus {
  box-shadow: 0 9px 18px rgba(0, 0, 0, 0.24), 0 0 0 1px rgba(95, 211, 122, 0.14) !important;
}

body[data-theme="dark"] .shadow-warning,
body[data-theme="dark"] .btn-warning,
body[data-theme="dark"] .btn-warning:focus,
body[data-theme="dark"] .btn-warning.focus {
  box-shadow: 0 9px 18px rgba(0, 0, 0, 0.24), 0 0 0 1px rgba(255, 164, 38, 0.14) !important;
}

body[data-theme="dark"] .shadow-danger,
body[data-theme="dark"] .btn-danger,
body[data-theme="dark"] .btn-danger:focus,
body[data-theme="dark"] .btn-danger.focus {
  box-shadow: 0 9px 18px rgba(0, 0, 0, 0.24), 0 0 0 1px rgba(255, 107, 99, 0.14) !important;
}

body[data-theme="dark"] .shadow-info,
body[data-theme="dark"] .btn-info,
body[data-theme="dark"] .btn-info:focus,
body[data-theme="dark"] .btn-info.focus {
  box-shadow: 0 9px 18px rgba(0, 0, 0, 0.24), 0 0 0 1px rgba(58, 186, 244, 0.14) !important;
}

body[data-theme="dark"] .btn:hover {
  filter: brightness(1.04);
  box-shadow: 0 11px 20px rgba(0, 0, 0, 0.26), 0 0 0 1px rgba(127, 140, 255, 0.12) !important;
}

body[data-theme="dark"] .btn:active {
  filter: brightness(0.98);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.22) !important;
}

body[data-theme="dark"] .btn-link,
body[data-theme="dark"] .btn.btn-icon,
body[data-theme="dark"] .btn.no-shadow {
  box-shadow: none !important;
}

body[data-theme="dark"] .section-header .section-header-back .btn,
body[data-theme="dark"] .section-header-back .btn,
body[data-theme="dark"] .section-header-back .btn-icon {
  background-color: var(--app-surface-soft) !important;
  border: 1px solid var(--app-border) !important;
  color: var(--app-text) !important;
  box-shadow: none !important;
}

body[data-theme="dark"] .section-header .section-header-back .btn i,
body[data-theme="dark"] .section-header-back .btn i,
body[data-theme="dark"] .section-header-back .btn-icon i {
  color: var(--app-text) !important;
}

body[data-theme="dark"] .section-header .section-header-back .btn:hover,
body[data-theme="dark"] .section-header-back .btn:hover,
body[data-theme="dark"] .section-header-back .btn-icon:hover {
  background-color: var(--app-primary) !important;
  border-color: var(--app-primary) !important;
  color: #ffffff !important;
}

body[data-theme="dark"] .section-header .section-header-back .btn:hover i,
body[data-theme="dark"] .section-header-back .btn:hover i,
body[data-theme="dark"] .section-header-back .btn-icon:hover i {
  color: #ffffff !important;
}

body[data-theme="dark"] input[type="date"],
body[data-theme="dark"] input[type="month"],
body[data-theme="dark"] .datepicker.form-control,
body[data-theme="dark"] .js-month-picker,
body[data-theme="dark"] .js-year-picker,
body[data-theme="dark"] .ledger-filter-control,
body[data-theme="dark"] .cash-report-filter-control,
body[data-theme="dark"] .inventory-ledger-filter-control,
body[data-theme="dark"] .capital-report-filter-control,
body[data-theme="dark"] .pl-report-filter-control,
body[data-theme="dark"] .company-bill-filter-control,
body[data-theme="dark"] .vehicle-ledger-filter .form-control {
  background-color: #171b22 !important;
  border-color: var(--app-border) !important;
  color: var(--app-text) !important;
  color-scheme: dark;
}

body[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
body[data-theme="dark"] input[type="month"]::-webkit-calendar-picker-indicator {
  filter: invert(1) opacity(0.8);
}

body[data-theme="dark"] .daterangepicker .calendar-table,
body[data-theme="dark"] .daterangepicker .calendar-table table,
body[data-theme="dark"] .daterangepicker .calendar-table thead,
body[data-theme="dark"] .daterangepicker .calendar-table tbody,
body[data-theme="dark"] .daterangepicker .calendar-table tr {
  background-color: var(--app-surface) !important;
}

body[data-theme="dark"] .daterangepicker .month,
body[data-theme="dark"] .daterangepicker .drp-selected,
body[data-theme="dark"] .daterangepicker .prev,
body[data-theme="dark"] .daterangepicker .next,
body[data-theme="dark"] .datepicker .datepicker-switch,
body[data-theme="dark"] .datepicker .prev,
body[data-theme="dark"] .datepicker .next {
  color: var(--app-text) !important;
}

body[data-theme="dark"] table.dataTable,
body[data-theme="dark"] table.dataTable.no-footer,
body[data-theme="dark"] .dataTables_wrapper table,
body[data-theme="dark"] #carriageVoucherTable {
  background-color: var(--app-surface) !important;
  border-color: var(--app-border) !important;
  color: var(--app-text) !important;
}

body[data-theme="dark"] table.dataTable thead th,
body[data-theme="dark"] table.dataTable thead td,
body[data-theme="dark"] #carriageVoucherTable thead th {
  background-color: #242a35 !important;
  border-color: var(--app-border) !important;
  color: var(--app-heading) !important;
}

body[data-theme="dark"] table.dataTable tbody tr,
body[data-theme="dark"] table.dataTable.display tbody tr,
body[data-theme="dark"] table.dataTable.stripe tbody tr,
body[data-theme="dark"] table.dataTable.row-border tbody tr,
body[data-theme="dark"] #carriageVoucherTable tbody tr {
  background-color: var(--app-surface) !important;
  color: var(--app-text) !important;
}

body[data-theme="dark"] table.dataTable.display tbody tr.odd,
body[data-theme="dark"] table.dataTable.stripe tbody tr.odd,
body[data-theme="dark"] .table-striped tbody tr:nth-of-type(odd),
body[data-theme="dark"] #carriageVoucherTable tbody tr:nth-of-type(odd) {
  background-color: #20252e !important;
}

body[data-theme="dark"] table.dataTable.display tbody tr.even,
body[data-theme="dark"] table.dataTable.stripe tbody tr.even,
body[data-theme="dark"] .table-striped tbody tr:nth-of-type(even),
body[data-theme="dark"] #carriageVoucherTable tbody tr:nth-of-type(even) {
  background-color: #1a1f27 !important;
}

body[data-theme="dark"] table.dataTable tbody th,
body[data-theme="dark"] table.dataTable tbody td,
body[data-theme="dark"] table.dataTable.row-border tbody th,
body[data-theme="dark"] table.dataTable.row-border tbody td,
body[data-theme="dark"] table.dataTable.display tbody th,
body[data-theme="dark"] table.dataTable.display tbody td,
body[data-theme="dark"] #carriageVoucherTable tbody td {
  border-color: var(--app-border) !important;
  color: var(--app-text) !important;
}

body[data-theme="dark"] table.dataTable tbody tr:hover,
body[data-theme="dark"] table.dataTable.display tbody tr:hover,
body[data-theme="dark"] #carriageVoucherTable tbody tr:hover {
  background-color: rgba(127, 140, 255, 0.12) !important;
}

body[data-theme="dark"] table.dataTable tbody tr > .sorting_1,
body[data-theme="dark"] table.dataTable.order-column tbody tr > .sorting_1,
body[data-theme="dark"] table.dataTable.display tbody tr > .sorting_1 {
  background-color: rgba(127, 140, 255, 0.08) !important;
}

body[data-theme="dark"] .vehicle-ledger-report,
body[data-theme="dark"] .vehicle-ledger-report .border,
body[data-theme="dark"] .vehicle-ledger-report .rounded,
body[data-theme="dark"] .vehicle-ledger-report .table-responsive {
  background-color: var(--app-surface) !important;
  border-color: var(--app-border) !important;
  color: var(--app-text) !important;
}

body[data-theme="dark"] .vehicle-ledger-report .report-title,
body[data-theme="dark"] .vehicle-ledger-report .report-subtitle,
body[data-theme="dark"] .vehicle-ledger-report strong,
body[data-theme="dark"] .vehicle-ledger-report p,
body[data-theme="dark"] .vehicle-ledger-report td,
body[data-theme="dark"] .vehicle-ledger-report th {
  color: var(--app-text) !important;
}

body[data-theme="dark"] .vehicle-ledger-report .text-muted,
body[data-theme="dark"] .vehicle-ledger-report .small {
  color: var(--app-muted) !important;
}

body[data-theme="dark"] .vehicle-ledger-report .ledger-table tbody tr,
body[data-theme="dark"] .vehicle-ledger-report .summary-table tbody tr,
body[data-theme="dark"] .vehicle-ledger-report .summary-table tfoot tr {
  background-color: var(--app-surface) !important;
}

body[data-theme="dark"] .vehicle-ledger-report .summary-table thead th,
body[data-theme="dark"] .vehicle-ledger-report .summary-table .bg-light,
body[data-theme="dark"] .vehicle-ledger-report .summary-table tr.bg-light {
  background-color: #242a35 !important;
  color: var(--app-heading) !important;
}

body[data-theme="dark"] .expense-tabs-card,
body[data-theme="dark"] .expense-data-card {
  background-color: var(--app-surface) !important;
  border-color: var(--app-border) !important;
  box-shadow: var(--app-shadow) !important;
}

body[data-theme="dark"] .expense-tabs .nav-link {
  background-color: var(--app-surface-soft) !important;
  border-color: var(--app-border) !important;
  color: var(--app-muted) !important;
  box-shadow: none !important;
}

body[data-theme="dark"] .expense-tabs .nav-link:hover {
  background-color: var(--app-surface-muted) !important;
  border-color: var(--app-primary) !important;
  color: var(--app-text) !important;
  box-shadow: var(--app-shadow) !important;
}

body[data-theme="dark"] .expense-tabs .nav-link.active {
  background: linear-gradient(135deg, #6777ef 0%, #5361d6 100%) !important;
  border-color: #6777ef !important;
  color: #ffffff !important;
  box-shadow: 0 10px 22px rgba(103, 119, 239, 0.28) !important;
}

body[data-theme="dark"] .expense-tabs .nav-link.active .expense-tab-text,
body[data-theme="dark"] .expense-tabs .nav-link.active small {
  color: #ffffff !important;
}

body[data-theme="dark"] .expense-tab-icon,
body[data-theme="dark"] .report-stat-icon {
  background-color: var(--app-primary-soft) !important;
  color: var(--app-primary) !important;
}

body[data-theme="dark"] .expense-tabs .nav-link.active .expense-tab-icon {
  background-color: rgba(255, 255, 255, 0.16) !important;
  color: #ffffff !important;
}

body[data-theme="dark"] .report-stat-card,
body[data-theme="dark"] .expense-report-stat-card,
body[data-theme="dark"] .summary-table tfoot th,
body[data-theme="dark"] .summary-table tfoot td {
  background-color: var(--app-surface-soft) !important;
  border-color: var(--app-border) !important;
  color: var(--app-text) !important;
  box-shadow: none !important;
}

body[data-theme="dark"] .summary-table tbody tr:hover td,
body[data-theme="dark"] .summary-table tbody tr:hover th {
  background-color: rgba(127, 140, 255, 0.1) !important;
}

body[data-theme="dark"] .loading-state {
  color: var(--app-muted) !important;
}

body[data-theme="dark"] .pl-report-page .main-content,
body[data-theme="dark"] .pl-report-shell,
body[data-theme="dark"] .cash-report-shell,
body[data-theme="dark"] .inventory-ledger-shell,
body[data-theme="dark"] .capital-report-shell {
  background-color: var(--app-bg) !important;
}

body[data-theme="dark"] .pl-report-paper {
  background-color: var(--app-surface) !important;
  border-color: var(--app-border) !important;
  color: var(--app-text) !important;
  box-shadow: var(--app-shadow) !important;
}

body[data-theme="dark"] .pl-report-paper h2,
body[data-theme="dark"] .pl-table th,
body[data-theme="dark"] .pl-table td,
body[data-theme="dark"] .pl-simple-table td,
body[data-theme="dark"] .pl-summary-label,
body[data-theme="dark"] .pl-summary-value,
body[data-theme="dark"] .pl-words-title,
body[data-theme="dark"] .pl-words-text {
  color: var(--app-text) !important;
}

body[data-theme="dark"] .pl-report-meta,
body[data-theme="dark"] .pl-empty-text {
  color: var(--app-muted) !important;
}

body[data-theme="dark"] .pl-report-strip {
  background: rgba(95, 211, 122, 0.14) !important;
  color: var(--app-success) !important;
}

body[data-theme="dark"] .ledger-page .section-body,
body[data-theme="dark"] .inventory-ledger-page .section-body,
body[data-theme="dark"] .cash-report-page .section-body,
body[data-theme="dark"] .capital-report-page .section-body,
body[data-theme="dark"] .daily-report-page .section-body,
body[data-theme="dark"] .report-page .section-body {
  background-color: var(--app-bg) !important;
  color: var(--app-text) !important;
}

body[data-theme="dark"] .ledger-header-title,
body[data-theme="dark"] .ledger-filter-label,
body[data-theme="dark"] .branch-name,
body[data-theme="dark"] .report-heading,
body[data-theme="dark"] .ledger-meta-label,
body[data-theme="dark"] .ledger-meta-value,
body[data-theme="dark"] .summary-detail-table .label-cell,
body[data-theme="dark"] .summary-detail-table .value-cell,
body[data-theme="dark"] .summary-label,
body[data-theme="dark"] .summary-count,
body[data-theme="dark"] .summary-amount,
body[data-theme="dark"] .summary-balance-strip,
body[data-theme="dark"] .summary-balance-strip .text-dark,
body[data-theme="dark"] .inventory-ledger-header-title,
body[data-theme="dark"] .inventory-ledger-filter-label,
body[data-theme="dark"] .inventory-ledger-title,
body[data-theme="dark"] .inventory-ledger-empty-title,
body[data-theme="dark"] .capital-report-title,
body[data-theme="dark"] .capital-report-filter-label,
body[data-theme="dark"] .capital-section-title,
body[data-theme="dark"] .capital-report-head h3,
body[data-theme="dark"] .capital-report-head .branch,
body[data-theme="dark"] .capital-table thead th,
body[data-theme="dark"] .capital-inline-row strong,
body[data-theme="dark"] .capital-meta-chip .value,
body[data-theme="dark"] .capital-summary-card .value,
body[data-theme="dark"] .capital-management-card .amount,
body[data-theme="dark"] .capital-kpi .value {
  color: var(--app-text) !important;
}

body[data-theme="dark"] .branch-meta,
body[data-theme="dark"] .inventory-ledger-subtitle,
body[data-theme="dark"] .inventory-ledger-empty-text,
body[data-theme="dark"] .capital-section-note,
body[data-theme="dark"] .capital-report-head .subtitle,
body[data-theme="dark"] .capital-meta-chip .label,
body[data-theme="dark"] .capital-summary-card .label,
body[data-theme="dark"] .capital-management-card .title,
body[data-theme="dark"] .capital-kpi .label,
body[data-theme="dark"] .capital-dim {
  color: var(--app-muted) !important;
}

body[data-theme="dark"] .ledger-summary,
body[data-theme="dark"] .ledger-summary-body,
body[data-theme="dark"] .amount-in-words,
body[data-theme="dark"] .inventory-ledger-empty-state,
body[data-theme="dark"] .capital-tabs-wrap,
body[data-theme="dark"] .capital-meta-chip,
body[data-theme="dark"] .capital-section,
body[data-theme="dark"] .capital-table-wrap,
body[data-theme="dark"] .capital-summary-card,
body[data-theme="dark"] .capital-management-card,
body[data-theme="dark"] .capital-kpi {
  background: var(--app-surface) !important;
  border-color: var(--app-border) !important;
  box-shadow: var(--app-shadow) !important;
  color: var(--app-text) !important;
}

body[data-theme="dark"] .capital-management-card.net,
body[data-theme="dark"] .inventory-ledger-empty-state {
  background: linear-gradient(135deg, #1e2229 0%, #222a36 100%) !important;
}

body[data-theme="dark"] .inventory-ledger-opening-row td,
body[data-theme="dark"] .inventory-ledger-totals-row td,
body[data-theme="dark"] .capital-table tfoot th,
body[data-theme="dark"] .capital-table tfoot td,
body[data-theme="dark"] .capital-table thead.bg-light th,
body[data-theme="dark"] .capital-table thead th {
  background-color: #242a35 !important;
  border-color: var(--app-border) !important;
  color: var(--app-heading) !important;
}

body[data-theme="dark"] .capital-report-filter-group .input-group-text,
body[data-theme="dark"] .capital-report-filter-group .form-control {
  background-color: #171b22 !important;
  border-color: var(--app-border) !important;
  color: var(--app-text) !important;
}

body[data-theme="dark"] .capital-tabs .nav-link {
  color: var(--app-muted) !important;
}

body[data-theme="dark"] .capital-tabs .nav-link:hover,
body[data-theme="dark"] .capital-tabs .nav-link.active {
  color: #ffffff !important;
}

body[data-theme="dark"] .amount-in-words,
body[data-theme="dark"] .summary-balance-strip,
body[data-theme="dark"] .pl-summary,
body[data-theme="dark"] .pl-words {
  border-color: var(--app-border) !important;
}

body,
.main-content,
.section-header,
.card,
.card-header,
.card-body,
.modal-content,
.dropdown-menu,
.main-footer,
.form-control,
.custom-select,
.input-group-text,
.select2-container .select2-selection,
.btn-light,
.table th,
.table td {
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

@media (max-width: 575.98px) {
  body[data-theme="dark"] {
    overflow-x: hidden;
  }

  body[data-theme="dark"] .section-header,
  body[data-theme="dark"] .card,
  body[data-theme="dark"] .modal-content {
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
  }

  body[data-theme="dark"] .dropdown-menu {
    max-width: calc(100vw - 1rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  body,
  .main-content,
  .section-header,
  .card,
  .card-header,
  .card-body,
  .modal-content,
  .dropdown-menu,
  .main-footer,
  .form-control,
  .custom-select,
  .input-group-text,
  .select2-container .select2-selection,
  .btn-light,
  .table th,
  .table td {
    transition: none !important;
  }
}

@media print {
  body[data-theme="dark"],
  body[data-theme="dark"] #app,
  body[data-theme="dark"] .main-wrapper,
  body[data-theme="dark"] .main-content,
  body[data-theme="dark"] .section,
  body[data-theme="dark"] .section-body,
  body[data-theme="dark"] .card,
  body[data-theme="dark"] .invoice,
  body[data-theme="dark"] .invoice-print,
  body[data-theme="dark"] .report-print {
    background: #ffffff !important;
    color: #000000 !important;
    box-shadow: none !important;
  }

  body[data-theme="dark"] table,
  body[data-theme="dark"] th,
  body[data-theme="dark"] td {
    color: #000000 !important;
    border-color: #000000 !important;
  }

  body[data-theme="dark"] .no-print,
  body[data-theme="dark"] .topbar-nav,
  body[data-theme="dark"] .navbar-bg,
  body[data-theme="dark"] .main-footer {
    display: none !important;
  }
}
