/* Dark Mode - Bootstrap 5 data-bs-theme="dark" overrides */

[data-bs-theme="dark"] {
  --bs-body-bg: #1a1d23;
  --bs-body-color: #e1e4e8;
}

/* Sidebar */
[data-bs-theme="dark"] .app-sidebar {
  background: #12151a !important;
  border-right-color: #2d333b !important;
}

[data-bs-theme="dark"] .sidebar-header {
  border-bottom-color: #2d333b !important;
}

[data-bs-theme="dark"] .app-title h2,
[data-bs-theme="dark"] .app-title p {
  color: #e1e4e8 !important;
}

[data-bs-theme="dark"] .nav-link-stitch {
  color: #adbac7 !important;
}

[data-bs-theme="dark"] .nav-link-stitch.text-danger {
  color: #f47067 !important;
}

[data-bs-theme="dark"] .nav-link-stitch:hover,
[data-bs-theme="dark"] .nav-link-stitch.active {
  background: #2d333b !important;
  color: #fff !important;
}

[data-bs-theme="dark"] .nav-section-label {
  color: #768390 !important;
}

/* Header */
[data-bs-theme="dark"] .app-header {
  background: #1a1d23 !important;
  border-bottom-color: #2d333b !important;
}

[data-bs-theme="dark"] .app-header h1 {
  color: #e1e4e8 !important;
}

/* Main content */
[data-bs-theme="dark"] .app-main {
  background: #1a1d23 !important;
}

[data-bs-theme="dark"] .app-content {
  background: #1a1d23 !important;
}

/* Cards - Standard Bootstrap */
[data-bs-theme="dark"] .card:not(.bg-warning):not(.bg-success):not(.bg-danger):not(.bg-secondary):not(.bg-primary):not(.bg-info) {
  background: #22272e !important;
  border-color: #2d333b !important;
  color: #e1e4e8 !important;
}

[data-bs-theme="dark"] .card:not(.bg-warning):not(.bg-success):not(.bg-danger):not(.bg-secondary):not(.bg-primary):not(.bg-info) .card-header {
  background: #2d333b !important;
  border-bottom-color: #373e47 !important;
  color: #e1e4e8 !important;
}

[data-bs-theme="dark"] .card:not(.bg-warning):not(.bg-success):not(.bg-danger):not(.bg-secondary):not(.bg-primary):not(.bg-info) .card-body {
  background: #22272e !important;
  color: #e1e4e8 !important;
}

/* Card Stitch */
[data-bs-theme="dark"] .card-stitch {
  background: #22272e !important;
  border-color: #2d333b !important;
  color: #e1e4e8 !important;
}

[data-bs-theme="dark"] .card-stitch .text-danger { color: #f47067 !important; }
[data-bs-theme="dark"] .card-stitch .text-success { color: #7ee787 !important; }
[data-bs-theme="dark"] .card-stitch h3,
[data-bs-theme="dark"] .card-stitch h5 { color: #e1e4e8 !important; }

/* Menu Cards */
[data-bs-theme="dark"] .menu-card {
  background: #22272e !important;
  border-color: #2d333b !important;
  color: #adbac7 !important;
}

[data-bs-theme="dark"] .menu-card:hover {
  border-color: #539bf5 !important;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3) !important;
}

[data-bs-theme="dark"] .menu-card-title {
  color: #e1e4e8 !important;
}

[data-bs-theme="dark"] .menu-card-text {
  color: #768390 !important;
}

[data-bs-theme="dark"] .menu-icon {
  background: rgba(83, 155, 245, 0.15) !important;
  color: #539bf5 !important;
}

[data-bs-theme="dark"] .menu-card:hover .menu-icon {
  background: #539bf5 !important;
  color: #fff !important;
}

/* Notification Cards */
[data-bs-theme="dark"] .notification-card {
  background: #22272e !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
}

[data-bs-theme="dark"] .notification-card h5 {
  color: #e1e4e8 !important;
  border-bottom-color: #2d333b !important;
}

[data-bs-theme="dark"] .notification-card p {
  color: #adbac7 !important;
}

[data-bs-theme="dark"] .notification-card.notification-success {
  background: linear-gradient(to right, #22272e, #1a2e1a) !important;
}

[data-bs-theme="dark"] .notification-card.notification-warning {
  background: linear-gradient(to right, #22272e, #2e1a1a) !important;
}

[data-bs-theme="dark"] .notification-card.notification-info {
  background: linear-gradient(to right, #22272e, #1a2233) !important;
}

[data-bs-theme="dark"] .notification-card.notification-yellow {
  background: linear-gradient(to right, #22272e, #2e2a1a) !important;
}

[data-bs-theme="dark"] .notification-card.notification-gray {
  background: linear-gradient(to right, #22272e, #2d333b) !important;
}

/* Colored cards - keep their colors but adjust text readability */
[data-bs-theme="dark"] .card.bg-warning .card-body,
[data-bs-theme="dark"] .card.bg-success .card-body,
[data-bs-theme="dark"] .card.bg-danger .card-body,
[data-bs-theme="dark"] .card.bg-primary .card-body,
[data-bs-theme="dark"] .card.bg-info .card-body,
[data-bs-theme="dark"] .card.bg-secondary .card-body {
  background: transparent !important;
}

/* Tables */
[data-bs-theme="dark"] .table {
  --bs-table-bg: #22272e;
  --bs-table-color: #e1e4e8;
  --bs-table-border-color: #2d333b;
  --bs-table-striped-bg: #2d333b;
  --bs-table-hover-bg: #373e47;
}

/* Forms */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
  background-color: #22272e !important;
  border-color: #373e47 !important;
  color: #e1e4e8 !important;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
  border-color: #539bf5 !important;
  box-shadow: 0 0 0 0.2rem rgba(83, 155, 245, 0.25) !important;
}

[data-bs-theme="dark"] .form-label {
  color: #adbac7 !important;
}

/* Modals */
[data-bs-theme="dark"] .modal-content {
  background: #22272e !important;
  border-color: #2d333b !important;
  color: #e1e4e8 !important;
}

[data-bs-theme="dark"] .modal-header {
  border-bottom-color: #2d333b !important;
}

[data-bs-theme="dark"] .modal-footer {
  border-top-color: #2d333b !important;
}

/* Alerts */
[data-bs-theme="dark"] .alert-info {
  background: #1c3a5e !important;
  border-color: #2d5a8e !important;
  color: #a8d4ff !important;
}

/* Bottom nav mobile */
[data-bs-theme="dark"] .mobile-bottom-nav {
  background: #12151a !important;
  border-top-color: #2d333b !important;
}

[data-bs-theme="dark"] .mobile-bottom-nav .nav-item {
  color: #768390 !important;
}

[data-bs-theme="dark"] .mobile-bottom-nav .nav-item.active {
  color: #539bf5 !important;
}

/* Page header */
[data-bs-theme="dark"] .page-header {
  border-bottom-color: #2d333b !important;
}

[data-bs-theme="dark"] .page-title {
  color: #e1e4e8 !important;
}

/* Hover card */
[data-bs-theme="dark"] .hover-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

/* Icon circle */
[data-bs-theme="dark"] .icon-circle {
  opacity: 0.9;
}

/* Card title & text in non-colored cards */
[data-bs-theme="dark"] .card:not(.bg-warning):not(.bg-success):not(.bg-danger):not(.bg-secondary):not(.bg-primary):not(.bg-info) .card-title {
  color: #e1e4e8 !important;
}

[data-bs-theme="dark"] .card:not(.bg-warning):not(.bg-success):not(.bg-danger):not(.bg-secondary):not(.bg-primary):not(.bg-info) .card-text {
  color: #adbac7 !important;
}

/* User info box in sidebar */
[data-bs-theme="dark"] .bg-primary.bg-opacity-10 {
  background: rgba(83, 155, 245, 0.1) !important;
}

/* Dropdown */
[data-bs-theme="dark"] .dropdown-menu {
  background: #22272e !important;
  border-color: #2d333b !important;
}

[data-bs-theme="dark"] .dropdown-item {
  color: #e1e4e8 !important;
}

[data-bs-theme="dark"] .dropdown-item:hover {
  background: #2d333b !important;
}

/* Close button sidebar mobile */
[data-bs-theme="dark"] .btn-link.text-dark {
  color: #e1e4e8 !important;
}

/* Mobile sidebar dark */
@media (max-width: 767.98px) {
  [data-bs-theme="dark"] .app-sidebar {
    background-color: #12151a !important;
  }
  [data-bs-theme="dark"] .app-sidebar.show {
    background-color: #12151a !important;
  }
  [data-bs-theme="dark"] .app-sidebar.show .nav-link-stitch {
    color: #adbac7 !important;
  }
  [data-bs-theme="dark"] .app-sidebar.show .nav-link-stitch.active {
    color: #fff !important;
    background-color: #2d333b !important;
  }
  [data-bs-theme="dark"] .app-sidebar.show .nav-section-label {
    color: #768390 !important;
  }
}

/* Generic background overrides for inline styles */
[data-bs-theme="dark"] [style*="background-color: #f8f9fa"],
[data-bs-theme="dark"] [style*="background:#f8f9fa"] {
  background-color: #2d333b !important;
  background: #2d333b !important;
}

/* Form labels with inline color: #333 or #212529 */
[data-bs-theme="dark"] [style*="color: #333"],
[data-bs-theme="dark"] [style*="color: #212529"],
[data-bs-theme="dark"] [style*="color:#333"] {
  color: #adbac7 !important;
}

/* Inline white backgrounds in cards/sections */
[data-bs-theme="dark"] [style*="background: white"],
[data-bs-theme="dark"] [style*="background-color: white"],
[data-bs-theme="dark"] [style*="background:#fff"],
[data-bs-theme="dark"] [style*="background: #fff"] {
  background: #22272e !important;
  background-color: #22272e !important;
  color: #e1e4e8 !important;
}

/* Nav tabs */
[data-bs-theme="dark"] .nav-tabs .nav-link {
  background: #2d333b !important;
  border-color: #373e47 !important;
  color: #adbac7 !important;
}

[data-bs-theme="dark"] .nav-tabs .nav-link.active {
  background: #22272e !important;
  color: #539bf5 !important;
  border-bottom-color: #22272e !important;
}

/* Alert variants */
[data-bs-theme="dark"] .alert-success {
  background: #1a2e1a !important;
  border-color: #2d5a2d !important;
  color: #7ee787 !important;
}

[data-bs-theme="dark"] .alert-danger {
  background: #2e1a1a !important;
  border-color: #5a2d2d !important;
  color: #f47067 !important;
}

[data-bs-theme="dark"] .alert-warning {
  background: #2e2a1a !important;
  border-color: #5a4d2d !important;
  color: #e3b341 !important;
}

/* Text colors */
[data-bs-theme="dark"] .text-muted {
  color: #768390 !important;
}

[data-bs-theme="dark"] .text-dark {
  color: #e1e4e8 !important;
}

/* Border overrides */
[data-bs-theme="dark"] .border {
  border-color: #2d333b !important;
}

[data-bs-theme="dark"] .border-bottom {
  border-bottom-color: #2d333b !important;
}

/* List group */
[data-bs-theme="dark"] .list-group-item {
  background-color: #22272e !important;
  border-color: #2d333b !important;
  color: #e1e4e8 !important;
}

/* Pagination */
[data-bs-theme="dark"] .page-link {
  background-color: #22272e !important;
  border-color: #2d333b !important;
  color: #539bf5 !important;
}

[data-bs-theme="dark"] .page-item.active .page-link {
  background-color: #539bf5 !important;
  border-color: #539bf5 !important;
  color: #fff !important;
}

[data-bs-theme="dark"] .page-item.disabled .page-link {
  background-color: #1a1d23 !important;
  color: #768390 !important;
}

/* Dark mode toggle button */
.dark-mode-toggle {
  background: none;
  border: 1px solid #dee2e6;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.2s;
}

[data-bs-theme="dark"] .dark-mode-toggle {
  border-color: #373e47;
}

.dark-mode-toggle:hover {
  background: rgba(0,0,0,0.05);
}

[data-bs-theme="dark"] .dark-mode-toggle:hover {
  background: rgba(255,255,255,0.1);
}

/* ===== REPORT TABLES - Semantic classes untuk semua laporan ===== */
/* Gunakan class ini di semua view laporan, JANGAN inline style */
.report-thead th,
th.report-thead,
tr.report-thead th {
  background: #4472C4 !important;
  color: white !important;
  -webkit-print-color-adjust: exact;
}
.report-group-header,
.report-group-header td,
td.report-group-header {
  background: #D9E2F3 !important;
  color: #1F4E79 !important;
  font-weight: bold;
  -webkit-print-color-adjust: exact;
  --bs-table-bg: #D9E2F3;
  --bs-table-striped-bg: #D9E2F3;
  --bs-table-color: #1F4E79;
}
.report-grand-total,
.report-grand-total td,
td.report-grand-total {
  background: #4472C4 !important;
  color: white !important;
  font-weight: bold;
  -webkit-print-color-adjust: exact;
  --bs-table-bg: #4472C4;
  --bs-table-striped-bg: #4472C4;
  --bs-table-color: white;
}
.report-sub-bg {
  background: #f0f4fa !important;
}
.report-sub-thead,
.report-sub-thead th {
  background: #dce6f1 !important;
  color: #1F4E79 !important;
}

[data-bs-theme="dark"] .report-thead th,
[data-bs-theme="dark"] th.report-thead,
[data-bs-theme="dark"] tr.report-thead th {
  background: #1e3a5f !important;
  color: #e1e4e8 !important;
}
[data-bs-theme="dark"] .report-group-header,
[data-bs-theme="dark"] .report-group-header td,
[data-bs-theme="dark"] td.report-group-header {
  background: #2d4a7a !important;
  color: #e1e4e8 !important;
  --bs-table-bg: #2d4a7a;
  --bs-table-striped-bg: #2d4a7a;
  --bs-table-color: #e1e4e8;
}
[data-bs-theme="dark"] .report-grand-total,
[data-bs-theme="dark"] .report-grand-total td,
[data-bs-theme="dark"] td.report-grand-total {
  background: #1e3a5f !important;
  color: #e1e4e8 !important;
  --bs-table-bg: #1e3a5f;
  --bs-table-striped-bg: #1e3a5f;
  --bs-table-color: #e1e4e8;
}
[data-bs-theme="dark"] .report-sub-bg {
  background: #1c2530 !important;
}
[data-bs-theme="dark"] .report-sub-thead {
  background: #2d4a7a !important;
  color: #e1e4e8 !important;
}

/* ===== Standalone Pages (print/view) ===== */
[data-bs-theme="dark"] body {
  background-color: #1a1d23 !important;
  color: #e1e4e8 !important;
}

[data-bs-theme="dark"] .container-fluid,
[data-bs-theme="dark"] .container {
  color: #e1e4e8 !important;
}



[data-bs-theme="dark"] .topbar,
[data-bs-theme="dark"] .topbar h4 {
  color: #e1e4e8 !important;
}

/* Standalone table overrides */
[data-bs-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd):not(.report-group-header):not(.report-grand-total) > * {
  background-color: #262b33 !important;
  color: #e1e4e8 !important;
}

[data-bs-theme="dark"] .table-striped > tbody > tr:nth-of-type(even):not(.report-group-header):not(.report-grand-total) > * {
  background-color: #22272e !important;
  color: #e1e4e8 !important;
}

/* Penjualan print - thead (only non-print, non-inline) */
[data-bs-theme="dark"] .table thead th:not([style]) {
  background: #2d4a7a !important;
  color: #e1e4e8 !important;
  border-color: #373e47 !important;
}

/* Stok view specific */
[data-bs-theme="dark"] .model-row {
  background: #2d333b !important;
  color: #e1e4e8 !important;
}

[data-bs-theme="dark"] .model-row:hover {
  background: #373e47 !important;
}

[data-bs-theme="dark"] .model-row.expanded {
  background: #0d6efd !important;
  color: white !important;
}

[data-bs-theme="dark"] .item-row,
[data-bs-theme="dark"] .item-row td {
  background: #1c2530 !important;
  color: #e1e4e8 !important;
}

[data-bs-theme="dark"] .item-row:hover,
[data-bs-theme="dark"] .item-row:hover td {
  background: #253040 !important;
}

/* Invoice preview dark */
[data-bs-theme="dark"] .invoice-container {
  background: #22272e !important;
  color: #e1e4e8 !important;
  padding: 20px;
  border-radius: 8px;
}

[data-bs-theme="dark"] .invoice-header {
  border-bottom-color: #373e47 !important;
}

[data-bs-theme="dark"] .items-table th {
  background-color: #2d333b !important;
  color: #e1e4e8 !important;
}

[data-bs-theme="dark"] .items-table td {
  border-color: #373e47 !important;
  color: #e1e4e8 !important;
}

[data-bs-theme="dark"] .terbilang {
  background: #2d333b !important;
  color: #e1e4e8 !important;
}

[data-bs-theme="dark"] .summary-table td {
  color: #e1e4e8 !important;
}

[data-bs-theme="dark"] .total-row {
  border-top-color: #373e47 !important;
}

/* Spinner in dark mode */
[data-bs-theme="dark"] .spinner-border.text-primary {
  color: #539bf5 !important;
}

/* KPI Cabang View - Pivot Table */
[data-bs-theme="dark"] .branch-color-0,
[data-bs-theme="dark"] .branch-color-1,
[data-bs-theme="dark"] .branch-color-2,
[data-bs-theme="dark"] .branch-color-3,
[data-bs-theme="dark"] .branch-color-4,
[data-bs-theme="dark"] .branch-color-5,
[data-bs-theme="dark"] .branch-color-6,
[data-bs-theme="dark"] .branch-color-7,
[data-bs-theme="dark"] .branch-color-8,
[data-bs-theme="dark"] .branch-color-9 {
  background-color: #2d333b !important;
  color: #e1e4e8 !important;
}

[data-bs-theme="dark"] .total-column {
  background-color: #373e47 !important;
  color: #e1e4e8 !important;
}

[data-bs-theme="dark"] .merk-column {
  background-color: #22272e !important;
  color: #e1e4e8 !important;
  border-right-color: #373e47 !important;
}

[data-bs-theme="dark"] .freeze-merk thead .merk-column {
  background-color: #2d333b !important;
  color: #e1e4e8 !important;
}

[data-bs-theme="dark"] .table-light,
[data-bs-theme="dark"] .table-light th,
[data-bs-theme="dark"] .table-light td {
  background-color: #2d333b !important;
  color: #e1e4e8 !important;
}

[data-bs-theme="dark"] .table-primary,
[data-bs-theme="dark"] .table-primary td {
  background-color: #1c3a5e !important;
  color: #e1e4e8 !important;
}

[data-bs-theme="dark"] .table-secondary,
[data-bs-theme="dark"] .table-secondary td {
  background-color: #2d333b !important;
  color: #e1e4e8 !important;
}

[data-bs-theme="dark"] .table-success,
[data-bs-theme="dark"] .table-success td {
  background-color: #1a2e1a !important;
  color: #7ee787 !important;
}

[data-bs-theme="dark"] .table-warning,
[data-bs-theme="dark"] .table-warning td {
  background-color: #2e2a1a !important;
  color: #e3b341 !important;
}

[data-bs-theme="dark"] .table-danger,
[data-bs-theme="dark"] .table-danger td {
  background-color: #2e1a1a !important;
  color: #f47067 !important;
}

[data-bs-theme="dark"] .table-dark,
[data-bs-theme="dark"] .table-dark th,
[data-bs-theme="dark"] .table-dark td {
  background-color: #1a1d23 !important;
  color: #e1e4e8 !important;
}

/* KPI card header inline styles override */
[data-bs-theme="dark"] .card-header[style*="background-color: #f8f9fa"] {
  background-color: #2d333b !important;
}

[data-bs-theme="dark"] [style*="background-color: #f8f9fa"] {
  background-color: #2d333b !important;
  color: #e1e4e8 !important;
}

[data-bs-theme="dark"] [style*="background-color: #f1f3f4"] {
  background-color: #373e47 !important;
  color: #e1e4e8 !important;
}

[data-bs-theme="dark"] [style*="background-color: #e9ecef"],
[data-bs-theme="dark"] [style*="background-color:#e9ecef"] {
  background-color: #373e47 !important;
  color: #e1e4e8 !important;
}

/* Override .text-dark in dark mode */
[data-bs-theme="dark"] .card .text-dark,
[data-bs-theme="dark"] .table .text-dark,
[data-bs-theme="dark"] strong.text-dark,
[data-bs-theme="dark"] h3.text-dark,
[data-bs-theme="dark"] h5.text-dark,
[data-bs-theme="dark"] h6.text-dark,
[data-bs-theme="dark"] h4.text-dark,
[data-bs-theme="dark"] .text-center .text-dark {
  color: #e1e4e8 !important;
}

/* Inline color overrides for KPI target mode */
[data-bs-theme="dark"] [style*="color: #495057"],
[data-bs-theme="dark"] [style*="color:#495057"] {
  color: #adbac7 !important;
}

[data-bs-theme="dark"] [style*="background-color: #e8f5e8"],
[data-bs-theme="dark"] [style*="background-color:#e8f5e8"] {
  background-color: #1a2e1a !important;
  color: #e1e4e8 !important;
}

[data-bs-theme="dark"] [style*="background-color: #fff3e0"],
[data-bs-theme="dark"] [style*="background-color:#fff3e0"] {
  background-color: #2e2a1a !important;
  color: #e1e4e8 !important;
}

[data-bs-theme="dark"] [style*="background-color: #ffebee"],
[data-bs-theme="dark"] [style*="background-color:#ffebee"] {
  background-color: #2e1a1a !important;
  color: #e1e4e8 !important;
}

[data-bs-theme="dark"] [style*="border: 1px solid #dee2e6"],
[data-bs-theme="dark"] [style*="border:1px solid #dee2e6"] {
  border-color: #373e47 !important;
}

[data-bs-theme="dark"] [style*="border-color: #e9ecef"],
[data-bs-theme="dark"] [style*="border-color:#e9ecef"] {
  border-color: #373e47 !important;
}

/* Table border color in dark mode */
[data-bs-theme="dark"] .table-bordered,
[data-bs-theme="dark"] .table-bordered th,
[data-bs-theme="dark"] .table-bordered td {
  border-color: #373e47 !important;
}

[data-bs-theme="dark"] .table-responsive {
  border-color: #373e47 !important;
}

/* Negative values stay red in dark mode */
[data-bs-theme="dark"] .negative {
  color: #f47067 !important;
}

/* Badge overrides for dark mode */
[data-bs-theme="dark"] .badge.bg-light.text-dark {
  background-color: #373e47 !important;
  color: #e1e4e8 !important;
}

/* Text utilities in dark context */
[data-bs-theme="dark"] .text-secondary {
  color: #768390 !important;
}

[data-bs-theme="dark"] h2,
[data-bs-theme="dark"] h3,
[data-bs-theme="dark"] h4,
[data-bs-theme="dark"] h5 {
  color: #e1e4e8 !important;
}

/* KPI target mode - card with inline bg-color #6c757d already dark, keep white text */
[data-bs-theme="dark"] .card[style*="background-color: #6c757d"] {
  border-color: #373e47 !important;
}

/* KPI Sales View - promotor rows */
[data-bs-theme="dark"] .promotor-row-even {
  background-color: #2d333b !important;
  color: #e1e4e8 !important;
}

[data-bs-theme="dark"] .promotor-row-odd {
  background-color: #22272e !important;
  color: #e1e4e8 !important;
}

[data-bs-theme="dark"] .promotor-unmapped {
  background-color: #2e2a1a !important;
  color: #e3b341 !important;
}

[data-bs-theme="dark"] .promotor-row-even td,
[data-bs-theme="dark"] .promotor-row-odd td,
[data-bs-theme="dark"] .promotor-unmapped td {
  color: #e1e4e8 !important;
}

[data-bs-theme="dark"] .promotor-nonaktif {
  color: #f47067 !important;
}

/* KPI Sales - tfoot total row */
[data-bs-theme="dark"] .table-secondary th,
[data-bs-theme="dark"] .table-secondary td,
[data-bs-theme="dark"] tfoot.table-secondary th,
[data-bs-theme="dark"] tfoot.table-secondary td {
  background-color: #2d333b !important;
  color: #e1e4e8 !important;
}

/* Summary rounded boxes in target mode */
[data-bs-theme="dark"] .rounded-3[style*="background-color: #f8f9fa"] {
  background-color: #2d333b !important;
  border-color: #373e47 !important;
}

[data-bs-theme="dark"] .rounded-3[style*="background-color: #f8f9fa"] .text-dark,
[data-bs-theme="dark"] .rounded-3[style*="background-color: #f8f9fa"] strong {
  color: #e1e4e8 !important;
}

[data-bs-theme="dark"] .table-gradient-header {
  background: linear-gradient(135deg, #2d4a7a 0%, #1a2e4a 100%) !important;
}

[data-bs-theme="dark"] .autocomplete-list {
  background: #22272e !important;
  border-color: #373e47 !important;
}

[data-bs-theme="dark"] .autocomplete-list .item:hover {
  background: #2d333b !important;
}

[data-bs-theme="dark"] .editing-highlight {
  background-color: #2e2a1a !important;
}

[data-bs-theme="dark"] .edit-banner {
  background: #2e2a1a !important;
  border-color: #5a4d2d !important;
  color: #e3b341 !important;
}

/* ===== PRINT: Force light mode ===== */
@media print {
  [data-bs-theme="dark"] body {
    background-color: #fff !important;
    color: #000 !important;
  }
  [data-bs-theme="dark"] .card,
  [data-bs-theme="dark"] .card-header,
  [data-bs-theme="dark"] .card-body {
    background: #fff !important;
    color: #000 !important;
    border-color: #dee2e6 !important;
  }
  [data-bs-theme="dark"] .table,
  [data-bs-theme="dark"] .table th,
  [data-bs-theme="dark"] .table td {
    color: #000 !important;
    border-color: #000 !important;
  }
  [data-bs-theme="dark"] .table thead th {
    background: #4472C4 !important;
    color: #fff !important;
    -webkit-print-color-adjust: exact;
  }
  [data-bs-theme="dark"] .invoice-container {
    background: #fff !important;
    color: #000 !important;
  }
  [data-bs-theme="dark"] .items-table th {
    background-color: #f0f0f0 !important;
    color: #000 !important;
  }
  [data-bs-theme="dark"] .items-table td {
    border-color: #000 !important;
    color: #000 !important;
  }
  [data-bs-theme="dark"] .terbilang {
    background: #f9f9f9 !important;
    color: #000 !important;
  }
  [data-bs-theme="dark"] .summary-table td,
  [data-bs-theme="dark"] .text-muted {
    color: #000 !important;
  }
  [data-bs-theme="dark"] .model-row,
  [data-bs-theme="dark"] .item-row,
  [data-bs-theme="dark"] .item-row td {
    background: inherit !important;
    color: #000 !important;
  }
}

/* User Management page-specific dark mode */
[data-bs-theme="dark"] #cabangList .form-check-label,
[data-bs-theme="dark"] #gudangList .form-check-label,
[data-bs-theme="dark"] #groupItemList .form-check-label,
[data-bs-theme="dark"] #groupNotifikasiList .form-check-label {
  color: #adbac7 !important;
}
[data-bs-theme="dark"] #access .border {
  background: #22272e !important;
  color: #e1e4e8 !important;
}
[data-bs-theme="dark"] #access .border .form-check-label {
  color: #e1e4e8 !important;
}
[data-bs-theme="dark"] #cabangList,
[data-bs-theme="dark"] #gudangList,
[data-bs-theme="dark"] #groupItemList,
[data-bs-theme="dark"] #groupNotifikasiList,
[data-bs-theme="dark"] #menuAccessList {
  background: #22272e !important;
}

/* Tab buttons (market-share) */
[data-bs-theme="dark"] .tab-btn { background: #2d333b; color: #adbac7; }
[data-bs-theme="dark"] .tab-btn.active { background: #4b6cb7; color: #fff; }

/* Radio group in filter-section */
[data-bs-theme="dark"] .filter-section .form-check-label { color: rgba(255,255,255,0.9); }
