/* ====================================================
   DARK THEME STYLESHEET — SISTEM LOGISTIK MANAGEMENT
   High-contrast, elegant dark mode for all admin pages
   ==================================================== */

/* ---- Root Variables in Dark Mode ---- */
[data-bs-theme="dark"] {
    --content-bg:      #0b0f19;
    --card-bg:         #1e293b;
    --border-color:    #334155;

    /* Neutrals inverted for dark theme */
    --gray-50:         #1e293b;
    --gray-100:        #334155;
    --gray-200:        #475569;
    --gray-300:        #64748b;
    --gray-400:        #94a3b8;
    --gray-500:        #cbd5e1;
    --gray-600:        #e2e8f0;
    --gray-700:        #f1f5f9;
    --gray-800:        #f8fafc;
    --gray-900:        #ffffff;

    /* Translucent brand tints */
    --primary-light:   rgba(37, 99, 235, 0.18);
    --success-light:   rgba(22, 163, 74, 0.18);
    --danger-light:    rgba(220, 38, 38, 0.18);
    --warning-light:   rgba(217, 119, 6, 0.18);

    /* Shadows */
    --shadow-xs:       0 1px 3px rgba(0, 0, 0, 0.35);
    --shadow-sm:       0 2px 6px rgba(0, 0, 0, 0.4);
    --shadow-md:       0 4px 12px rgba(0, 0, 0, 0.5);
    --shadow-lg:       0 10px 24px rgba(0, 0, 0, 0.6);
    --shadow-xl:       0 20px 32px rgba(0, 0, 0, 0.7);

    /* Override Bootstrap tertiary background for dark mode */
    --bs-tertiary-bg:  #1e293b;
    --bs-secondary-bg: #0f172a;
    --bs-body-bg:      #0b0f19;
    --bs-border-color: #334155;
}

/* ---- Base Body & Layout ---- */
[data-bs-theme="dark"] body {
    background-color: var(--content-bg);
    color: var(--gray-800);
}

[data-bs-theme="dark"] .main-content {
    background-color: var(--content-bg);
}

/* Content Header */
[data-bs-theme="dark"] .content-header {
    background: #1e293b;
    border-bottom: 1px solid #334155;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

[data-bs-theme="dark"] .content-header h1 {
    color: #f8fafc;
}

[data-bs-theme="dark"] .content-header .user-info {
    color: #94a3b8;
}

[data-bs-theme="dark"] .hamburger-menu {
    background: #1e293b;
    border: 1px solid #334155;
    color: #f8fafc;
}

/* Theme Toggle Button */
.btn-theme-toggle {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.btn-theme-toggle:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
    transform: translateY(-1px);
}

[data-bs-theme="dark"] .btn-theme-toggle {
    border-color: #334155;
    background: #0f172a;
    color: #e2e8f0;
}

[data-bs-theme="dark"] .btn-theme-toggle:hover {
    background: #243248;
    border-color: #475569;
    color: #38bdf8;
}

/* ---- Cards & Panels ---- */
[data-bs-theme="dark"] .card {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .card-header {
    background-color: #1e293b !important;
    border-bottom-color: #334155 !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .card-body {
    background-color: transparent !important;
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .card-footer {
    background-color: #0f172a !important;
    border-top-color: #334155 !important;
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .card.premium-card {
    background: #1e293b;
    border-color: #334155;
}

[data-bs-theme="dark"] .premium-header {
    background: #1e293b;
    border-bottom-color: #334155;
}

/* ---- Tables & DataTables ---- */
[data-bs-theme="dark"] .table {
    color: #e2e8f0;
    border-color: #334155;
}

[data-bs-theme="dark"] .table thead,
[data-bs-theme="dark"] .table thead th,
[data-bs-theme="dark"] .table-light,
[data-bs-theme="dark"] thead.bg-dark,
[data-bs-theme="dark"] .premium-table th {
    background-color: #0f172a !important;
    color: #94a3b8 !important;
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .table tbody td,
[data-bs-theme="dark"] .premium-table td {
    border-color: #334155 !important;
    color: #e2e8f0;
}

[data-bs-theme="dark"] .table-hover tbody tr:hover td,
[data-bs-theme="dark"] .premium-table tbody tr:hover td {
    background-color: rgba(37, 99, 235, 0.15) !important;
}

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

[data-bs-theme="dark"] .table-responsive {
    border-color: #334155 !important;
}

/* DataTables elements */
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_length,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_filter,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_info,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_paginate {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .page-link {
    background-color: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}

[data-bs-theme="dark"] .page-link:hover {
    background-color: #334155;
    border-color: #475569;
    color: #38bdf8;
}

[data-bs-theme="dark"] .page-item.active .page-link {
    background-color: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

[data-bs-theme="dark"] .page-item.disabled .page-link {
    background-color: #0f172a;
    border-color: #334155;
    color: #64748b;
}

/* ---- Forms & Controls ---- */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: #0f172a !important;
    border-color: #3b82f6 !important;
    color: #f8fafc !important;
    box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.25) !important;
}

[data-bs-theme="dark"] .form-control::placeholder {
    color: #64748b !important;
}

[data-bs-theme="dark"] .form-label {
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .input-group-text {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .form-check-input {
    background-color: #0f172a;
    border-color: #475569;
}

[data-bs-theme="dark"] .form-check-input:checked {
    background-color: #2563eb;
    border-color: #2563eb;
}

[data-bs-theme="dark"] .search-modern {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .search-modern:focus {
    background-color: #0f172a !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.25) !important;
}

/* ---- Modals ---- */
[data-bs-theme="dark"] .modal-content {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6) !important;
}

[data-bs-theme="dark"] .modal-header,
[data-bs-theme="dark"] .modal-footer {
    border-color: #334155 !important;
}

/* ---- Dropdowns ---- */
[data-bs-theme="dark"] .dropdown-menu {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5) !important;
}

[data-bs-theme="dark"] .dropdown-item {
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus {
    background-color: #334155 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .dropdown-divider {
    border-color: #334155 !important;
}

/* ---- Typography & Text Utility Inversion ---- */
[data-bs-theme="dark"] h1, [data-bs-theme="dark"] h2, [data-bs-theme="dark"] h3,
[data-bs-theme="dark"] h4, [data-bs-theme="dark"] h5, [data-bs-theme="dark"] h6,
[data-bs-theme="dark"] .h1, [data-bs-theme="dark"] .h2, [data-bs-theme="dark"] .h3,
[data-bs-theme="dark"] .h4, [data-bs-theme="dark"] .h5, [data-bs-theme="dark"] .h6 {
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .text-dark,
[data-bs-theme="dark"] .text-gray-800,
[data-bs-theme="dark"] .text-gray-900,
[data-bs-theme="dark"] .text-black {
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .text-gray-700,
[data-bs-theme="dark"] .text-gray-600 {
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .text-gray-500,
[data-bs-theme="dark"] .text-secondary {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .text-muted {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .text-body {
    color: #e2e8f0 !important;
}

/* ---- Breadcrumbs ---- */
[data-bs-theme="dark"] .breadcrumb {
    background: transparent !important;
}

[data-bs-theme="dark"] .breadcrumb-item a {
    color: #38bdf8 !important;
    text-decoration: none;
}

[data-bs-theme="dark"] .breadcrumb-item a:hover {
    color: #7dd3fc !important;
    text-decoration: underline;
}

[data-bs-theme="dark"] .breadcrumb-item.active {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .breadcrumb-item + .breadcrumb-item::before {
    color: #64748b !important;
}

/* ---- Bootstrap Utility Overrides ---- */
[data-bs-theme="dark"] .bg-white {
    background-color: #1e293b !important;
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .bg-light,
[data-bs-theme="dark"] .bg-light-subtle {
    background-color: #0f172a !important;
    color: #e2e8f0 !important;
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .bg-secondary-subtle {
    background-color: rgba(100, 116, 139, 0.25) !important;
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .bg-primary-subtle {
    background-color: rgba(37, 99, 235, 0.2) !important;
    color: #93c5fd !important;
}

[data-bs-theme="dark"] .bg-success-subtle {
    background-color: rgba(22, 163, 74, 0.2) !important;
    color: #86efac !important;
}

[data-bs-theme="dark"] .bg-warning-subtle {
    background-color: rgba(217, 119, 6, 0.2) !important;
    color: #fde68a !important;
}

[data-bs-theme="dark"] .bg-danger-subtle {
    background-color: rgba(220, 38, 38, 0.2) !important;
    color: #fca5a5 !important;
}

[data-bs-theme="dark"] .bg-info-subtle {
    background-color: rgba(14, 165, 233, 0.2) !important;
    color: #7dd3fc !important;
}

/* ---- Alerts in Dark Theme ---- */
[data-bs-theme="dark"] .alert-warning {
    background-color: rgba(245, 158, 11, 0.15) !important;
    border: 1px solid rgba(245, 158, 11, 0.35) !important;
    color: #fde68a !important;
}

[data-bs-theme="dark"] .alert-info {
    background-color: rgba(14, 165, 233, 0.15) !important;
    border: 1px solid rgba(14, 165, 233, 0.35) !important;
    color: #7dd3fc !important;
}

[data-bs-theme="dark"] .alert-success {
    background-color: rgba(34, 197, 94, 0.15) !important;
    border: 1px solid rgba(34, 197, 94, 0.35) !important;
    color: #86efac !important;
}

[data-bs-theme="dark"] .alert-danger {
    background-color: rgba(239, 68, 68, 0.15) !important;
    border: 1px solid rgba(239, 68, 68, 0.35) !important;
    color: #fca5a5 !important;
}

[data-bs-theme="dark"] .alert-secondary,
[data-bs-theme="dark"] .alert-light {
    background-color: rgba(100, 116, 139, 0.15) !important;
    border: 1px solid rgba(100, 116, 139, 0.35) !important;
    color: #cbd5e1 !important;
}

/* ---- Badges in Dark Theme ---- */
[data-bs-theme="dark"] .badge.bg-light {
    background-color: #0f172a !important;
    color: #cbd5e1 !important;
    border: 1px solid #334155 !important;
}

[data-bs-theme="dark"] .badge.bg-white {
    background-color: #334155 !important;
    color: #f8fafc !important;
    border: 1px solid #475569 !important;
}

[data-bs-theme="dark"] .badge.text-dark {
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .badge.text-secondary {
    color: #cbd5e1 !important;
}

/* ---- Buttons in Dark Theme ---- */
[data-bs-theme="dark"] .btn-light {
    background-color: #334155 !important;
    border-color: #475569 !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .btn-light:hover {
    background-color: #475569 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .btn-outline-secondary {
    border-color: #475569 !important;
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .btn-outline-secondary:hover {
    background-color: #334155 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .btn-outline-dark {
    border-color: #64748b !important;
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .btn-outline-dark:hover {
    background-color: #334155 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* ---- Form controls & Selects in Dark Theme ---- */
[data-bs-theme="dark"] select option {
    background-color: #0f172a !important;
    color: #f8fafc !important;
}

/* ---- Nav Tabs & Pills in Dark Theme ---- */
[data-bs-theme="dark"] .nav-tabs {
    border-bottom-color: #334155 !important;
}

[data-bs-theme="dark"] .nav-tabs .nav-link {
    color: #94a3b8;
    border-color: transparent;
}

[data-bs-theme="dark"] .nav-tabs .nav-link:hover {
    border-color: #334155 #334155 transparent;
    color: #f8fafc;
}

[data-bs-theme="dark"] .nav-tabs .nav-link.active {
    background-color: #1e293b !important;
    border-color: #334155 #334155 transparent !important;
    color: #38bdf8 !important;
}

[data-bs-theme="dark"] .nav-pills .nav-link {
    color: #94a3b8;
}

[data-bs-theme="dark"] .nav-pills .nav-link.active {
    background-color: #2563eb !important;
    color: #ffffff !important;
}

/* ---- List Groups in Dark Theme ---- */
[data-bs-theme="dark"] .list-group-item {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .list-group-item-action:hover,
[data-bs-theme="dark"] .list-group-item-action:focus {
    background-color: #334155 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .border {
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .border-top {
    border-top-color: #334155 !important;
}

[data-bs-theme="dark"] .border-bottom {
    border-bottom-color: #334155 !important;
}

[data-bs-theme="dark"] .border-end {
    border-end-color: #334155 !important;
}

[data-bs-theme="dark"] .border-start {
    border-start-color: #334155 !important;
}

[data-bs-theme="dark"] hr {
    border-color: #334155 !important;
    opacity: 1;
}

[data-bs-theme="dark"] .vr {
    background-color: #334155 !important;
    opacity: 1 !important;
}

/* ---- Dashboard Stat Widgets & Activity ---- */
[data-bs-theme="dark"] .dashboard-stat-card {
    background: #1e293b;
    border-color: #334155;
}

[data-bs-theme="dark"] .dashboard-stat-card .stat-value {
    color: #f8fafc;
}

[data-bs-theme="dark"] .dashboard-stat-card .stat-label {
    color: #94a3b8;
}

[data-bs-theme="dark"] .stat-card-content h2 {
    color: #f8fafc;
}

[data-bs-theme="dark"] .stat-card-content h6 {
    color: #94a3b8;
}

[data-bs-theme="dark"] .stat-icon.primary {
    background: rgba(37, 99, 235, 0.2);
    color: #60a5fa;
}

[data-bs-theme="dark"] .stat-icon.success {
    background: rgba(22, 163, 74, 0.2);
    color: #4ade80;
}

[data-bs-theme="dark"] .stat-icon.warning {
    background: rgba(217, 119, 6, 0.2);
    color: #fbbf24;
}

[data-bs-theme="dark"] .stat-icon.danger {
    background: rgba(220, 38, 38, 0.2);
    color: #f87171;
}

/* Dashboard Summary Pills */
[data-bs-theme="dark"] .pill-total {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.25), rgba(99, 102, 241, 0.35)) !important;
    color: #a5b4fc !important;
    border: 1px solid rgba(165, 180, 252, 0.2);
}

[data-bs-theme="dark"] .pill-approved {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(52, 211, 153, 0.35)) !important;
    color: #6ee7b7 !important;
    border: 1px solid rgba(110, 231, 183, 0.2);
}

[data-bs-theme="dark"] .pill-pending {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(251, 191, 36, 0.35)) !important;
    color: #fde68a !important;
    border: 1px solid rgba(253, 230, 138, 0.2);
}

[data-bs-theme="dark"] .pill-road {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.25), rgba(56, 189, 248, 0.35)) !important;
    color: #7dd3fc !important;
    border: 1px solid rgba(125, 211, 252, 0.2);
}

[data-bs-theme="dark"] .pill-arrived {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.25), rgba(74, 222, 128, 0.35)) !important;
    color: #86efac !important;
    border: 1px solid rgba(134, 239, 172, 0.2);
}

[data-bs-theme="dark"] .pill-units {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.25), rgba(244, 114, 182, 0.35)) !important;
    color: #f9a8d4 !important;
    border: 1px solid rgba(249, 168, 212, 0.2);
}

[data-bs-theme="dark"] .mutasi-doc {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(168, 85, 247, 0.35)) !important;
    color: #c4b5fd !important;
    border: 1px solid rgba(196, 181, 253, 0.2);
}

[data-bs-theme="dark"] .mutasi-unit {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.25), rgba(250, 204, 21, 0.35)) !important;
    color: #fde047 !important;
    border: 1px solid rgba(253, 224, 71, 0.2);
}

[data-bs-theme="dark"] .activity-log-item {
    border-bottom-color: #334155;
}

[data-bs-theme="dark"] .activity-log-item:hover {
    background: rgba(255, 255, 255, 0.04) !important;
}

[data-bs-theme="dark"] .activity-name {
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .activity-action-badge {
    background: rgba(99, 102, 241, 0.25) !important;
    color: #a5b4fc !important;
}

[data-bs-theme="dark"] .activity-desc {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .activity-time {
    color: #64748b !important;
}

/* ---- Rekap Aging Custom ---- */
[data-bs-theme="dark"] .aging-table tbody td.model-cell {
    background: #1e293b !important;
    color: #f8fafc !important;
    border-right-color: #334155 !important;
}

[data-bs-theme="dark"] .aging-table tbody td {
    border-bottom-color: #334155 !important;
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .aging-table thead th {
    border-bottom-color: #334155 !important;
}

/* ---- Badges & Soft Badges ---- */
[data-bs-theme="dark"] .badge-success-soft {
    background-color: rgba(22, 163, 74, 0.2);
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.3);
}

[data-bs-theme="dark"] .badge-warning-soft {
    background-color: rgba(202, 138, 4, 0.2);
    color: #facc15;
    border-color: rgba(250, 204, 21, 0.3);
}

[data-bs-theme="dark"] .badge-info-soft {
    background-color: rgba(14, 165, 233, 0.2);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.3);
}

[data-bs-theme="dark"] .badge-secondary-soft {
    background-color: rgba(100, 116, 139, 0.2);
    color: #cbd5e1;
    border-color: rgba(148, 163, 184, 0.3);
}

[data-bs-theme="dark"] .badge-danger-soft {
    background-color: rgba(220, 38, 38, 0.2);
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.3);
}

/* ---- Page Transition Overlay & Loader ---- */
[data-bs-theme="dark"] .page-transition-overlay {
    background: #0b0f19 !important;
}

[data-bs-theme="dark"] .loader-logo {
    border-radius: 50% !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 0 3px rgba(255, 255, 255, 0.15) !important;
    background-color: #ffffff;
}

[data-bs-theme="dark"] .loader-spinner {
    border-color: #1e293b !important;
    border-top-color: #38bdf8 !important;
}

/* ---- SweetAlert2 Dark Mode ---- */
[data-bs-theme="dark"] .swal2-popup {
    background-color: #1e293b !important;
    color: #f8fafc !important;
    border: 1px solid #334155 !important;
}

[data-bs-theme="dark"] .swal2-title,
[data-bs-theme="dark"] .swal2-html-container {
    color: #f8fafc !important;
}

/* ============================================================
   TARGETED DARK MODE: Inline Style Overrides for Templates
   ============================================================ */

/* ---- Soft Badges: fix hardcoded light colors ---- */
[data-bs-theme="dark"] .badge-success-soft {
    background-color: rgba(22, 163, 74, 0.2) !important;
    color: #4ade80 !important;
    border-color: rgba(74, 222, 128, 0.3) !important;
}

[data-bs-theme="dark"] .badge-warning-soft {
    background-color: rgba(202, 138, 4, 0.2) !important;
    color: #fde68a !important;
    border-color: rgba(250, 204, 21, 0.3) !important;
}

[data-bs-theme="dark"] .badge-info-soft {
    background-color: rgba(14, 165, 233, 0.2) !important;
    color: #7dd3fc !important;
    border-color: rgba(56, 189, 248, 0.3) !important;
}

[data-bs-theme="dark"] .badge-secondary-soft {
    background-color: rgba(100, 116, 139, 0.2) !important;
    color: #cbd5e1 !important;
    border-color: rgba(148, 163, 184, 0.3) !important;
}

[data-bs-theme="dark"] .badge-danger-soft {
    background-color: rgba(220, 38, 38, 0.2) !important;
    color: #fca5a5 !important;
    border-color: rgba(248, 113, 113, 0.3) !important;
}

/* ---- bg-warning text-dark / bg-info text-dark in dark mode ---- */
[data-bs-theme="dark"] .badge.bg-warning.text-dark {
    background-color: #d97706 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .badge.bg-info.text-dark {
    background-color: #0284c7 !important;
    color: #ffffff !important;
}

/* ---- Month Card sub-stat bg-light panel ---- */
[data-bs-theme="dark"] .bg-light.rounded-end,
[data-bs-theme="dark"] .card-body .bg-light.rounded-end {
    background-color: rgba(15, 23, 42, 0.7) !important;
    border-color: #334155 !important;
}

/* ---- card body with bg-white class ---- */
[data-bs-theme="dark"] .card-body.bg-white {
    background-color: #1e293b !important;
    color: #e2e8f0 !important;
}

/* ---- card with bg-white class ---- */
[data-bs-theme="dark"] .card.bg-white {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

/* ---- premium-header gradient ---- */
[data-bs-theme="dark"] .premium-header {
    background: linear-gradient(145deg, #1e293b, #0f172a) !important;
    border-bottom-color: #334155 !important;
}

/* ---- Accordion ---- */
[data-bs-theme="dark"] .accordion-item {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .accordion-button {
    background-color: #1e293b !important;
    color: #f8fafc !important;
    box-shadow: none !important;
}

[data-bs-theme="dark"] .accordion-button:not(.collapsed) {
    background-color: #0f172a !important;
    color: #38bdf8 !important;
}

[data-bs-theme="dark"] .accordion-button::after {
    filter: invert(0.8);
}

[data-bs-theme="dark"] .accordion-body {
    background-color: #0f172a !important;
    color: #e2e8f0 !important;
}

/* ---- Progress bars ---- */
[data-bs-theme="dark"] .progress {
    background-color: #0f172a !important;
}

/* ---- Input group in light bg ---- */
[data-bs-theme="dark"] .input-group-text.bg-white,
[data-bs-theme="dark"] .input-group-text.bg-light {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #94a3b8 !important;
}

/* ---- Stat and info box overrides ---- */
[data-bs-theme="dark"] .stat-box,
[data-bs-theme="dark"] [class*="stat-item"],
[data-bs-theme="dark"] [class*="info-box"] {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

/* ---- Mobile card rows ---- */
[data-bs-theme="dark"] .mobile-card,
[data-bs-theme="dark"] .mobile-row,
[data-bs-theme="dark"] .unit-card {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

/* ---- Popover & Tooltip ---- */
[data-bs-theme="dark"] .popover {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .popover-body {
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .popover-header {
    background-color: #0f172a !important;
    color: #f8fafc !important;
    border-bottom-color: #334155 !important;
}

/* ---- Form sections with hardcoded light borders/bg ---- */
[data-bs-theme="dark"] .form-section,
[data-bs-theme="dark"] div[id$="Section"][style*="background"],
[data-bs-theme="dark"] div[style*="background: #fffbeb"],
[data-bs-theme="dark"] div[style*="background:#fffbeb"] {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

/* ---- Icon badges / circles ---- */
[data-bs-theme="dark"] .sc-icon,
[data-bs-theme="dark"] .ic-icon {
    background-color: #334155 !important;
    color: #f8fafc !important;
}

/* ---- Modal Body / Dialogs ---- */
[data-bs-theme="dark"] .modal-body[style*="background-color: #f8f9fa"],
[data-bs-theme="dark"] .modal-body[style*="background:#f8f9fa"] {
    background-color: #0f172a !important;
    color: #e2e8f0 !important;
}

/* ---- Custom tabs list background ---- */
[data-bs-theme="dark"] .custom-tabs[style*="background"],
[data-bs-theme="dark"] .custom-tabs {
    background: #1e293b !important;
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .custom-tabs .nav-link {
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .custom-tabs .nav-link.active {
    background-color: #2563eb !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4) !important;
}

/* ============================================================
   GLOBAL DARK MODE TYPOGRAPHY & FORM READABILITY
   ============================================================ */

/* ---- Global Text & Headings Contrast ---- */
[data-bs-theme="dark"] body {
    color: #f1f5f9;
}

[data-bs-theme="dark"] h1,
[data-bs-theme="dark"] h2,
[data-bs-theme="dark"] h3,
[data-bs-theme="dark"] h4,
[data-bs-theme="dark"] h5,
[data-bs-theme="dark"] h6 {
    color: #f8fafc !important;
}

[data-bs-theme="dark"] label,
[data-bs-theme="dark"] .form-label,
[data-bs-theme="dark"] .form-group label {
    color: #f1f5f9 !important;
    font-weight: 600;
}

[data-bs-theme="dark"] .text-muted,
[data-bs-theme="dark"] small.text-muted,
[data-bs-theme="dark"] .text-secondary {
    color: #94a3b8 !important;
}

/* ---- Global Form Controls, Inputs, Selects, Textareas ---- */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .form-ctrl,
[data-bs-theme="dark"] input[type="text"],
[data-bs-theme="dark"] input[type="number"],
[data-bs-theme="dark"] input[type="date"],
[data-bs-theme="dark"] input[type="password"],
[data-bs-theme="dark"] input[type="email"],
[data-bs-theme="dark"] textarea,
[data-bs-theme="dark"] select {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus,
[data-bs-theme="dark"] .form-ctrl:focus,
[data-bs-theme="dark"] input:focus,
[data-bs-theme="dark"] textarea:focus,
[data-bs-theme="dark"] select:focus {
    background-color: #0f172a !important;
    border-color: #38bdf8 !important;
    color: #f8fafc !important;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25) !important;
}

[data-bs-theme="dark"] .form-control::placeholder,
[data-bs-theme="dark"] .form-ctrl::placeholder,
[data-bs-theme="dark"] input::placeholder,
[data-bs-theme="dark"] textarea::placeholder {
    color: #64748b !important;
}

/* ---- Mobilisasi & Scan UI Full High-Contrast Overrides ---- */
[data-bs-theme="dark"] .scan-wrapper {
    color: #f1f5f9;
}

[data-bs-theme="dark"] .scan-topbar h1 {
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .scan-topbar .back-btn {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .scan-topbar .back-btn:hover {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #38bdf8 !important;
}

[data-bs-theme="dark"] .scan-hint {
    color: rgba(255, 255, 255, 0.8) !important;
}

[data-bs-theme="dark"] .scan-field::placeholder {
    color: rgba(255, 255, 255, 0.55) !important;
}

[data-bs-theme="dark"] .form-section .fs-title {
    color: #38bdf8 !important;
    font-weight: 700;
}

[data-bs-theme="dark"] .form-section .fs-title::after {
    background: #334155 !important;
}

/* Warning & Photo Section Overrides */
[data-bs-theme="dark"] #fotoUnitSection,
[data-bs-theme="dark"] #manualInputSection,
[data-bs-theme="dark"] #batchFotoUnitSection {
    background-color: rgba(245, 158, 11, 0.08) !important;
    border-color: rgba(245, 158, 11, 0.4) !important;
}

[data-bs-theme="dark"] #fotoUnitSection .fs-title,
[data-bs-theme="dark"] #manualInputSection .fs-title,
[data-bs-theme="dark"] #batchFotoUnitSection .fs-title {
    color: #fbbf24 !important;
}

[data-bs-theme="dark"] #fotoUnitSection p,
[data-bs-theme="dark"] #manualInputSection p,
[data-bs-theme="dark"] #batchFotoUnitSection p {
    color: #fde68a !important;
}

[data-bs-theme="dark"] #btnUnitCamera,
[data-bs-theme="dark"] #btnUnitUploadLabel,
[data-bs-theme="dark"] #btnBatchUnitCamera,
[data-bs-theme="dark"] #btnBatchUnitUploadLabel {
    background: rgba(245, 158, 11, 0.2) !important;
    border-color: rgba(245, 158, 11, 0.45) !important;
    color: #fbbf24 !important;
    font-weight: 700;
}

[data-bs-theme="dark"] #btnUnitCamera:hover,
[data-bs-theme="dark"] #btnUnitUploadLabel:hover {
    background: rgba(245, 158, 11, 0.35) !important;
    color: #ffffff !important;
}

/* Lookup Results & Live Cards */
[data-bs-theme="dark"] .lookup-result {
    background-color: #1e293b !important;
    border-color: rgba(34, 197, 94, 0.4) !important;
}

[data-bs-theme="dark"] .lookup-result .lk-noka {
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .lookup-field {
    background-color: #0f172a !important;
}

[data-bs-theme="dark"] .lookup-field .lf-label {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .lookup-field .lf-value {
    color: #f8fafc !important;
}

/* Queue Table */
[data-bs-theme="dark"] .queue-table-wrap {
    background: #1e293b !important;
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .queue-table th {
    background: #0f172a !important;
    color: #94a3b8 !important;
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .queue-table td {
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .queue-table input.inline-input {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] #emptyQueueMsg {
    color: #94a3b8 !important;
}

/* Stock Opname Scan V2 Card Overrides */
[data-bs-theme="dark"] .data-display-card {
    background-color: #1e293b !important;
    border-left-color: #38bdf8 !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .verification-checkbox {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .scan-item {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .mismatch-input {
    background-color: rgba(245, 158, 11, 0.15) !important;
    color: #fde68a !important;
}

/* Mobilisasi Out Type Selectors */
[data-bs-theme="dark"] .type-selector-bar {
    background: #1e293b !important;
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .type-selector-bar .ts-label {
    color: #38bdf8 !important;
}

[data-bs-theme="dark"] .type-opt {
    background: #0f172a !important;
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .type-opt .opt-label {
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .type-opt.selected-do {
    background: rgba(59, 130, 246, 0.2) !important;
    border-color: #3b82f6 !important;
}

[data-bs-theme="dark"] .type-opt.selected-do .opt-label {
    color: #60a5fa !important;
}

[data-bs-theme="dark"] .type-opt.selected-penarikan {
    background: rgba(245, 158, 11, 0.2) !important;
    border-color: #f59e0b !important;
}

[data-bs-theme="dark"] .type-opt.selected-penarikan .opt-label {
    color: #fbbf24 !important;
}

[data-bs-theme="dark"] .type-opt.selected-pameran {
    background: rgba(139, 92, 246, 0.2) !important;
    border-color: #8b5cf6 !important;
}

[data-bs-theme="dark"] .type-opt.selected-pameran .opt-label {
    color: #c084fc !important;
}

[data-bs-theme="dark"] .type-select {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .spdd-warning {
    background: rgba(245, 158, 11, 0.15) !important;
    border-color: rgba(245, 158, 11, 0.4) !important;
    color: #fde68a !important;
}

/* ============================================================
   STOCK CABANG & DATA TABLES GLOBAL ENHANCEMENTS
   ============================================================ */

/* ---- Stat Cards Global ---- */
[data-bs-theme="dark"] .stat-card {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .stat-card .sc-value {
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .stat-card .sc-label {
    color: #94a3b8 !important;
}

/* ---- Tab Nav Containers ---- */
[data-bs-theme="dark"] .tab-nav {
    background: #1e293b !important;
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .tab-nav-inner {
    border-bottom-color: #334155 !important;
}

[data-bs-theme="dark"] .tab-btn {
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .tab-btn:hover {
    background: #243248 !important;
    color: #38bdf8 !important;
}

[data-bs-theme="dark"] .tab-btn.active {
    background: #0f172a !important;
    color: #f8fafc !important;
    border-bottom-color: #38bdf8 !important;
}

[data-bs-theme="dark"] .tab-btn:not(.active) .tab-count {
    background: #334155 !important;
    color: #cbd5e1 !important;
}

/* ---- Branch Cards (Stock Cabang Index) ---- */
[data-bs-theme="dark"] .branch-card {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .branch-card h6 {
    color: #f8fafc !important;
}

/* ---- DataTables Global Overrides ---- */
[data-bs-theme="dark"] .dataTables_wrapper,
[data-bs-theme="dark"] .dataTables_wrapper label,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_length,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_filter,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_info,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_paginate {
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .dataTables_wrapper .dataTables_filter input,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_length select {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.current) {
    background: #334155 !important;
    color: #38bdf8 !important;
    border-color: #475569 !important;
}

/* ---- Stock Opname Dashboard Cards & Rows ---- */
[data-bs-theme="dark"] .opname-stat-card.scanned {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%) !important;
    border-color: rgba(99, 102, 241, 0.4) !important;
    color: #f8fafc !important;
}
[data-bs-theme="dark"] .opname-stat-card.match {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 100%) !important;
    border-color: rgba(16, 185, 129, 0.4) !important;
    color: #f8fafc !important;
}
[data-bs-theme="dark"] .opname-stat-card.mismatch {
    background: linear-gradient(135deg, #450a0a 0%, #7f1d1d 100%) !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
    color: #f8fafc !important;
}
[data-bs-theme="dark"] .opname-stat-card.nyasar {
    background: linear-gradient(135deg, #082f49 0%, #075985 100%) !important;
    border-color: rgba(14, 165, 233, 0.4) !important;
    color: #f8fafc !important;
}
[data-bs-theme="dark"] .opname-stat-card.missing {
    background: linear-gradient(135deg, #451a03 0%, #78350f 100%) !important;
    border-color: rgba(245, 158, 11, 0.4) !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .checker-row {
    background: #0f172a !important;
    border-color: #334155 !important;
    border-left: 4px solid #6366f1 !important;
    color: #f8fafc !important;
}
[data-bs-theme="dark"] .scan-item-recent {
    background: #0f172a !important;
    border-color: #334155 !important;
    border-left: 4px solid #22c55e !important;
    color: #f8fafc !important;
}
[data-bs-theme="dark"] .scan-item-recent.mismatch {
    background: rgba(239, 68, 68, 0.12) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
    border-left-color: #ef4444 !important;
}

