/* Dark Mode Theme System */
/* Theme Variables */

:root {
    /* Light Theme (Default) */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    
    --text-primary: #111827;
    --text-secondary: #374151;
    --text-muted: #6b7280;
    --text-light: #9ca3af;
    
    --border-primary: #e5e7eb;
    --border-secondary: #d1d5db;
    --border-focus: #3b82f6;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    
    --accent-primary: #3b82f6;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    
    --datatable-bg: #ffffff;
    --datatable-header-bg: #f3f4f6;
    --datatable-row-hover: #f9fafb;
    --datatable-border: #e5e7eb;
}

/* Dark Theme */
[data-theme="dark"],
.dark {
    --bg-primary: #1f2937;
    --bg-secondary: #1f2937;
    --bg-tertiary: #374151;
    --bg-card: #1f2937;
    --bg-input: #1e293b;
    
    --text-primary: #f9fafb;
    --text-secondary: #e5e7eb;
    --text-muted: #9ca3af;
    --text-light: #6b7280;
    
    --border-primary: #374151;
    --border-secondary: #4b5563;
    --border-focus: #60a5fa;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);
    
    --accent-primary: #60a5fa;
    --accent-success: #34d399;
    --accent-warning: #fbbf24;
    --accent-danger: #f87171;
    
    --datatable-bg: #1f2937;
    --datatable-header-bg: #374151;
    --datatable-row-hover: #374151;
    --datatable-border: #4b5563;
}

/* Apply theme to body and main elements */
[data-theme="dark"] body,
[data-theme="dark"] body.bg-gray-50,
.dark body,
.dark body.bg-gray-50,
[data-theme="dark"] .bg-gray-50,
.dark .bg-gray-50 {
    background-color: var(--bg-primary, #1f2937) !important;
    color: var(--text-primary, #f9fafb) !important;
}

[data-theme="dark"] .bg-white {
    background-color: var(--bg-card) !important;
}

[data-theme="dark"] .bg-gray-100 {
    background-color: var(--bg-tertiary) !important;
}

[data-theme="dark"] .bg-gray-200 {
    background-color: var(--bg-secondary) !important;
}

/* Text colors */
[data-theme="dark"] .text-gray-800,
[data-theme="dark"] .text-gray-700,
[data-theme="dark"] .text-gray-900 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .text-gray-600 {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .text-gray-500 {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .text-gray-400 {
    color: var(--text-light) !important;
}

/* Borders */
[data-theme="dark"] .border-gray-200,
[data-theme="dark"] .border-gray-300 {
    border-color: var(--border-primary) !important;
}

/* Cards and containers */
[data-theme="dark"] .shadow-lg,
[data-theme="dark"] .shadow-md,
[data-theme="dark"] .shadow-sm {
    box-shadow: var(--shadow-md) !important;
}

/* Gradient backgrounds override bg-white in dark mode - must neutralize */
[data-theme="dark"] .bg-gradient-to-r,
[data-theme="dark"] .bg-gradient-to-br,
[data-theme="dark"] .bg-gradient-to-l,
[data-theme="dark"] .bg-gradient-to-b {
    background-image: none !important;
}

/* Form inputs for Dark Mode */
[data-theme="dark"] input[type="number"],
.dark input[type="number"] {
    color-scheme: dark !important;
}


[data-theme="dark"] .from-purple-50,
[data-theme="dark"] .from-indigo-50,
[data-theme="dark"] .from-green-50,
[data-theme="dark"] .from-blue-50,
[data-theme="dark"] .from-teal-50,
[data-theme="dark"] .from-emerald-50,
[data-theme="dark"] .from-primary-50 {
    --tw-gradient-from: var(--bg-tertiary) var(--tw-gradient-from-position) !important;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important;
}

[data-theme="dark"] .to-purple-50,
[data-theme="dark"] .to-indigo-50,
[data-theme="dark"] .to-green-50,
[data-theme="dark"] .to-blue-50,
[data-theme="dark"] .to-teal-50,
[data-theme="dark"] .to-emerald-50,
[data-theme="dark"] .to-primary-50,
[data-theme="dark"] .to-white {
    --tw-gradient-to: var(--bg-tertiary) var(--tw-gradient-to-position) !important;
}

/* ========================================
   ACTION BUTTON GRADIENTS - DARK MODE
   Preserve original button colors in dark mode.
   Uses `background` shorthand to override both background-image and background-color.
   Must appear AFTER the gradient neutralization rules above.
   ======================================== */

/* Blue buttons (View Credentials, Completed Service) */
[data-theme="dark"] .bg-gradient-to-r.from-blue-500.to-blue-600 {
    background: linear-gradient(to right, #3b82f6, #2563eb) !important;
    color: #ffffff !important;
}
[data-theme="dark"] .bg-gradient-to-r.from-blue-600.to-blue-700 {
    background: linear-gradient(to right, #2563eb, #1d4ed8) !important;
    color: #ffffff !important;
}

/* Cyan & Blue database/export buttons */
[data-theme="dark"] .bg-gradient-to-r.from-cyan-600.to-blue-600,
[data-theme="dark"] .bg-gradient-to-r.from-cyan-500.to-blue-600,
[data-theme="dark"] .bg-gradient-to-r.from-cyan-600.to-blue-700,
[data-theme="dark"] .bg-gradient-to-br.from-cyan-600.to-blue-600,
[data-theme="dark"] #btnRunDiffAudit,
.dark #btnRunDiffAudit {
    background: linear-gradient(135deg, #06b6d4, #0284c7) !important;
    color: #ffffff !important;
    border: 1px solid rgba(56, 189, 248, 0.6) !important;
    box-shadow: 0 4px 16px rgba(6, 182, 212, 0.45) !important;
}

/* Green buttons (Verify, Approve, Completed Service) */
[data-theme="dark"] .bg-gradient-to-r.from-green-500.to-green-600 {
    background: linear-gradient(to right, #10b981, #059669) !important;
    color: #ffffff !important;
}
[data-theme="dark"] .bg-gradient-to-r.from-green-600.to-green-700 {
    background: linear-gradient(to right, #059669, #047857) !important;
    color: #ffffff !important;
}

/* Red buttons (Transfer Ownership, Confirm) */
[data-theme="dark"] .bg-gradient-to-r.from-red-500.to-red-600 {
    background: linear-gradient(to right, #ef4444, #dc2626) !important;
    color: #ffffff !important;
}
[data-theme="dark"] .bg-gradient-to-r.from-red-600.to-red-700 {
    background: linear-gradient(to right, #dc2626, #b91c1c) !important;
    color: #ffffff !important;
}

/* Amber/Orange buttons (Update) */
[data-theme="dark"] .bg-gradient-to-r.from-amber-500.to-orange-600 {
    background: linear-gradient(to right, #f59e0b, #ea580c) !important;
    color: #ffffff !important;
}
[data-theme="dark"] .bg-gradient-to-r.from-amber-600.to-orange-700 {
    background: linear-gradient(to right, #d97706, #c2410c) !important;
    color: #ffffff !important;
}

/* Amber buttons (Physical Backlog Certification, Warning Actions) */
[data-theme="dark"] .bg-gradient-to-r.from-amber-600.to-amber-700,
.dark .bg-gradient-to-r.from-amber-600.to-amber-700,
html[data-theme="dark"] #btnCertifyBacklogSingle,
body[data-theme="dark"] #btnCertifyBacklogSingle,
[data-theme="dark"] #btnCertifyBacklogSingle,
.dark #btnCertifyBacklogSingle {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
    background-image: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
    color: #ffffff !important;
    border: 1px solid rgba(245, 158, 11, 0.45) !important;
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.4) !important;
}

[data-theme="dark"] .bg-gradient-to-r.from-amber-600.to-amber-700:hover,
.dark .bg-gradient-to-r.from-amber-600.to-amber-700:hover,
html[data-theme="dark"] #btnCertifyBacklogSingle:hover,
body[data-theme="dark"] #btnCertifyBacklogSingle:hover,
[data-theme="dark"] #btnCertifyBacklogSingle:hover,
.dark #btnCertifyBacklogSingle:hover {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    background-image: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: #ffffff !important;
    border-color: rgba(245, 158, 11, 0.75) !important;
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.5) !important;
}

/* Yellow/Orange buttons (Modal headers) */
[data-theme="dark"] .bg-gradient-to-r.from-yellow-500.to-orange-500 {
    background: linear-gradient(to right, #eab308, #f97316) !important;
    color: #ffffff !important;
}

/* Purple buttons */
[data-theme="dark"] .bg-gradient-to-r.from-purple-500.to-purple-600 {
    background: linear-gradient(to right, #8b5cf6, #7c3aed) !important;
    color: #ffffff !important;
}

/* Indigo to Purple headers/cards (Client Information, etc.) */
[data-theme="dark"] .bg-gradient-to-r.from-indigo-600.to-purple-600,
[data-theme="dark"] .bg-gradient-to-r.from-indigo-500.to-purple-600,
[data-theme="dark"] .bg-gradient-to-r.from-purple-600.to-indigo-600,
[data-theme="dark"] .bg-gradient-to-r.from-indigo-600.to-purple-700 {
    background: linear-gradient(to right, #4f46e5, #9333ea) !important;
    color: #ffffff !important;
}

/* Emerald / Teal Executive Banners & Cards (Chat FAQs & AI Knowledge, etc.) */
[data-theme="dark"] .bg-gradient-to-r.from-emerald-700,
.dark .bg-gradient-to-r.from-emerald-700,
[data-theme="dark"] .faq-executive-banner,
.dark .faq-executive-banner {
    background: linear-gradient(135deg, #047857 0%, #0f766e 50%, #064e3b 100%) !important;
    background-image: linear-gradient(135deg, #047857 0%, #0f766e 50%, #064e3b 100%) !important;
    color: #ffffff !important;
}

/* Additional vibrant purple & indigo gradients */
[data-theme="dark"] .bg-gradient-to-r.from-purple-600.to-purple-700 {
    background: linear-gradient(to right, #7c3aed, #6d28d9) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .bg-gradient-to-r.from-indigo-600.to-indigo-700 {
    background: linear-gradient(to right, #4f46e5, #4338ca) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .bg-gradient-to-r.from-blue-600.to-indigo-600,
.dark .bg-gradient-to-r.from-blue-600.to-indigo-600,
[data-theme="dark"] .bg-gradient-to-br.from-blue-600.to-indigo-600,
.dark .bg-gradient-to-br.from-blue-600.to-indigo-600,
[data-theme="dark"] #btnExtraFunctionality,
.dark #btnExtraFunctionality {
    background: linear-gradient(to right, #2563eb, #4f46e5) !important;
    color: #ffffff !important;
}
[data-theme="dark"] .bg-gradient-to-r.from-blue-600.to-indigo-600:hover,
.dark .bg-gradient-to-r.from-blue-600.to-indigo-600:hover,
[data-theme="dark"] #btnExtraFunctionality:hover,
.dark #btnExtraFunctionality:hover {
    background: linear-gradient(to right, #1d4ed8, #4338ca) !important;
}

[data-theme="dark"] .bg-gradient-to-r.from-blue-600.to-indigo-700 {
    background: linear-gradient(to right, #2563eb, #4338ca) !important;
    color: #ffffff !important;
}

/* Emerald / Teal buttons & header badges (Dashboard Overview, Executive Console, Notifications, etc.) */
[data-theme="dark"] .bg-gradient-to-br.from-emerald-500.to-teal-700,
[data-theme="dark"] .bg-gradient-to-r.from-emerald-500.to-teal-700,
[data-theme="dark"] .bg-gradient-to-br.from-emerald-600.to-teal-700,
[data-theme="dark"] .bg-gradient-to-r.from-emerald-600.to-teal-700,
[data-theme="dark"] .bg-gradient-to-br.from-emerald-600.to-teal-600,
[data-theme="dark"] .bg-gradient-to-r.from-emerald-600.to-teal-600,
[data-theme="dark"] .bg-gradient-to-br.from-emerald-500.via-teal-600.to-lime-600 {
    background: linear-gradient(135deg, #10b981, #0f766e) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .bg-gradient-to-r.from-emerald-500.to-emerald-600,
[data-theme="dark"] .bg-gradient-to-r.from-green-500.to-emerald-600,
[data-theme="dark"] .bg-gradient-to-br.from-emerald-500.to-emerald-600 {
    background: linear-gradient(to right, #10b981, #059669) !important;
    color: #ffffff !important;
}

/* Load Dump Clients Gradient Button - Dark Mode */
[data-theme="dark"] .btn-load-dump-clients,
[data-theme="dark"] #btnLoadDiffDateRangeClients,
[data-theme="dark"] .bg-gradient-to-r.from-indigo-600.via-cyan-600.to-emerald-600,
html[data-theme="dark"] .btn-load-dump-clients,
html[data-theme="dark"] #btnLoadDiffDateRangeClients,
body[data-theme="dark"] .btn-load-dump-clients,
body[data-theme="dark"] #btnLoadDiffDateRangeClients,
.dark .btn-load-dump-clients,
.dark #btnLoadDiffDateRangeClients,
.dark .bg-gradient-to-r.from-indigo-600.via-cyan-600.to-emerald-600 {
    background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 50%, #10b981 100%) !important;
    background-image: linear-gradient(135deg, #4f46e5 0%, #06b6d4 50%, #10b981 100%) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 4px 15px -1px rgba(6, 182, 212, 0.45), 0 2px 6px -1px rgba(16, 185, 129, 0.35) !important;
}

[data-theme="dark"] .btn-load-dump-clients:hover,
[data-theme="dark"] #btnLoadDiffDateRangeClients:hover,
[data-theme="dark"] .bg-gradient-to-r.from-indigo-600.via-cyan-600.to-emerald-600:hover,
html[data-theme="dark"] .btn-load-dump-clients:hover,
html[data-theme="dark"] #btnLoadDiffDateRangeClients:hover,
body[data-theme="dark"] .btn-load-dump-clients:hover,
body[data-theme="dark"] #btnLoadDiffDateRangeClients:hover,
.dark .btn-load-dump-clients:hover,
.dark #btnLoadDiffDateRangeClients:hover,
.dark .bg-gradient-to-r.from-indigo-600.via-cyan-600.to-emerald-600:hover {
    background: linear-gradient(135deg, #4338ca 0%, #0891b2 50%, #059669 100%) !important;
    background-image: linear-gradient(135deg, #4338ca 0%, #0891b2 50%, #059669 100%) !important;
    box-shadow: 0 6px 20px -1px rgba(6, 182, 212, 0.6), 0 3px 8px -1px rgba(16, 185, 129, 0.45) !important;
}

/* Rose / Red header badges, icons & buttons (Trash Archive, Danger modals, Phantom Auditor) */
[data-theme="dark"] .bg-gradient-to-br.from-rose-500.to-red-700,
[data-theme="dark"] .bg-gradient-to-r.from-rose-500.to-red-700,
[data-theme="dark"] .bg-gradient-to-br.from-rose-600.to-red-700,
[data-theme="dark"] .bg-gradient-to-r.from-rose-600.to-red-700,
[data-theme="dark"] .bg-gradient-to-br.from-rose-500.to-pink-600,
[data-theme="dark"] .bg-gradient-to-r.from-rose-500.to-pink-600,
[data-theme="dark"] .sa-icon-box-rose,
.dark .sa-icon-box-rose {
    background: linear-gradient(135deg, #e11d48, #b91c1c) !important;
    background-image: linear-gradient(135deg, #e11d48, #b91c1c) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(225, 29, 72, 0.4) !important;
}

/* Indigo buttons & badges */
[data-theme="dark"] .bg-gradient-to-r.from-indigo-500.to-indigo-600,
[data-theme="dark"] .bg-gradient-to-br.from-indigo-500.to-indigo-600 {
    background: linear-gradient(to right, #6366f1, #4f46e5) !important;
    color: #ffffff !important;
}

/* Amber / Orange badges, icons & buttons (Collector KPI, Updates, Lifecycle Hub) */
[data-theme="dark"] .bg-gradient-to-br.from-amber-500.to-amber-600,
[data-theme="dark"] .bg-gradient-to-r.from-amber-500.to-amber-600,
[data-theme="dark"] .bg-gradient-to-br.from-amber-500.to-orange-600,
[data-theme="dark"] .bg-gradient-to-r.from-amber-500.to-orange-600,
[data-theme="dark"] .sa-icon-box-amber,
.dark .sa-icon-box-amber {
    background: linear-gradient(135deg, #f59e0b, #ea580c) !important;
    background-image: linear-gradient(135deg, #f59e0b, #ea580c) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4) !important;
}

/* Emerald / Teal badges, icons & buttons (Transfer Lineage Governance, SQL Import, Voice Governance) */
[data-theme="dark"] .bg-gradient-to-br.from-emerald-600.to-teal-700,
[data-theme="dark"] .bg-gradient-to-r.from-emerald-600.to-teal-700,
[data-theme="dark"] .bg-gradient-to-br.from-emerald-500.to-teal-700,
[data-theme="dark"] .bg-gradient-to-r.from-emerald-500.to-teal-700,
[data-theme="dark"] .bg-gradient-to-br.from-emerald-500.to-teal-600,
[data-theme="dark"] .bg-gradient-to-r.from-emerald-500.to-teal-600,
[data-theme="dark"] .sa-icon-box-emerald,
.dark .sa-icon-box-emerald {
    background: linear-gradient(135deg, #059669, #0f766e) !important;
    background-image: linear-gradient(135deg, #059669, #0f766e) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4) !important;
}

/* Cyan / Deep Blue badges, icons & buttons (Terminal Reference, Export Suite, Health Suite) */
[data-theme="dark"] .bg-gradient-to-br.from-cyan-600.to-blue-700,
[data-theme="dark"] .bg-gradient-to-r.from-cyan-600.to-blue-700,
[data-theme="dark"] .sa-icon-box-cyan,
.dark .sa-icon-box-cyan {
    background: linear-gradient(135deg, #0891b2, #0284c7) !important;
    background-image: linear-gradient(135deg, #0891b2, #0284c7) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(8, 145, 178, 0.4) !important;
}

[data-theme="dark"] .sa-icon-box-blue,
.dark .sa-icon-box-blue {
    background: linear-gradient(135deg, #0284c7, #2563eb) !important;
    background-image: linear-gradient(135deg, #0284c7, #2563eb) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4) !important;
}

/* Yellow buttons */
[data-theme="dark"] .bg-gradient-to-r.from-yellow-500.to-yellow-600,
[data-theme="dark"] .bg-gradient-to-br.from-yellow-500.to-yellow-600 {
    background: linear-gradient(to right, #eab308, #ca8a04) !important;
    color: #ffffff !important;
}

/* Orange buttons */
[data-theme="dark"] .bg-gradient-to-r.from-orange-500.to-orange-600,
[data-theme="dark"] .bg-gradient-to-br.from-orange-500.to-orange-600 {
    background: linear-gradient(to right, #f97316, #ea580c) !important;
    color: #ffffff !important;
}

/* Gray buttons (Return) */
[data-theme="dark"] .bg-gray-600 {
    background-color: #4b5563 !important;
    color: #ffffff !important;
}
[data-theme="dark"] .hover\:bg-gray-700:hover {
    background-color: #374151 !important;
}

/* Hover states with light backgrounds */
[data-theme="dark"] .hover\:bg-purple-50:hover,
[data-theme="dark"] .hover\:bg-green-50:hover,
[data-theme="dark"] .hover\:bg-blue-50:hover,
[data-theme="dark"] .hover\:bg-indigo-50:hover,
[data-theme="dark"] .hover\:bg-teal-50:hover,
[data-theme="dark"] .hover\:bg-gray-50:hover {
    background-color: var(--bg-tertiary) !important;
}

/* Custom select class (used in client-assign page) - remove CSS arrow in dark mode */
[data-theme="dark"] .custom-select {
    background-image: none !important;
}

/* Force remove native dropdown arrow for selects with custom icons - GLOBAL (both light and dark mode) */
select {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-image: none !important;
}

/* Inputs */
[data-theme="dark"] input,
[data-theme="dark"] input.bg-white,
[data-theme="dark"] input.bg-gray-100,
[data-theme="dark"] select,
[data-theme="dark"] select.bg-white,
[data-theme="dark"] textarea,
.dark input,
.dark input.bg-white,
.dark input.bg-gray-100,
.dark select,
.dark select.bg-white,
.dark textarea {
    background-color: var(--bg-input, #374151) !important;
    color: var(--text-primary, #f9fafb) !important;
    border-color: var(--border-secondary, #4b5563) !important;
}

[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="month"],
[data-theme="dark"] input[type="time"],
[data-theme="dark"] input[type="datetime-local"],
.dark input[type="date"],
.dark input[type="month"],
.dark input[type="time"],
.dark input[type="datetime-local"] {
    background-color: var(--bg-input, #374151) !important;
    color: var(--text-primary, #f9fafb) !important;
    border-color: var(--border-secondary, #4b5563) !important;
    color-scheme: dark !important;
}

[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] input[type="month"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] input[type="datetime-local"]::-webkit-calendar-picker-indicator,
.dark input[type="date"]::-webkit-calendar-picker-indicator,
.dark input[type="month"]::-webkit-calendar-picker-indicator,
.dark input[type="time"]::-webkit-calendar-picker-indicator,
.dark input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.2) !important;
    cursor: pointer;
}

/* File Inputs Dark Mode */
[data-theme="dark"] input[type="file"],
.dark input[type="file"],
[data-theme="dark"] #expenseImage,
.dark #expenseImage,
[data-theme="dark"] input[type="file"].bg-white,
.dark input[type="file"].bg-white {
    background-color: #374151 !important;
    background: #374151 !important;
    color: #f9fafb !important;
    border-color: #4b5563 !important;
}

[data-theme="dark"] input[type="file"]::file-selector-button,
.dark input[type="file"]::file-selector-button,
[data-theme="dark"] input[type="file"]::-webkit-file-upload-button,
.dark input[type="file"]::-webkit-file-upload-button,
[data-theme="dark"] #expenseImage::file-selector-button,
.dark #expenseImage::file-selector-button,
[data-theme="dark"] #expenseImage::-webkit-file-upload-button,
.dark #expenseImage::-webkit-file-upload-button {
    background-color: #475569 !important;
    background: #475569 !important;
    color: #f8fafc !important;
    border: 1px solid #64748b !important;
    border-radius: 0.375rem !important;
    padding: 0.375rem 0.75rem !important;
    margin-right: 0.75rem !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

[data-theme="dark"] input[type="file"]::file-selector-button:hover,
.dark input[type="file"]::file-selector-button:hover,
[data-theme="dark"] input[type="file"]::-webkit-file-upload-button:hover,
.dark input[type="file"]::-webkit-file-upload-button:hover,
[data-theme="dark"] #expenseImage::file-selector-button:hover,
.dark #expenseImage::file-selector-button:hover,
[data-theme="dark"] #expenseImage::-webkit-file-upload-button:hover,
.dark #expenseImage::-webkit-file-upload-button:hover {
    background-color: #64748b !important;
    background: #64748b !important;
    color: #ffffff !important;
}

/* Force remove native dropdown arrow for selects with custom icons - DARK MODE (redundant but explicit) */
[data-theme="dark"] select,
.dark select {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

[data-theme="dark"] select option,
.dark select option,
html.dark select option,
body.dark select option {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus,
.dark input:focus,
.dark select:focus,
.dark textarea:focus {
    border-color: var(--border-focus, #60a5fa) !important;
}

/* DataTables dark mode - COMPREHENSIVE */
[data-theme="dark"] .dataTables_wrapper,
[data-theme="dark"] table.dataTable,
[data-theme="dark"] #common_dataTable,
[data-theme="dark"] #loanrequest-table,
[data-theme="dark"] #spotcash-approval-table,
[data-theme="dark"] #linkedAccountsTable,
.dark #loanrequest-table,
.dark #spotcash-approval-table,
.dark #linkedAccountsTable {
    background-color: var(--datatable-bg) !important;
    color: var(--text-primary) !important;
}

/* Centralized Table Header Styling - 100% Identical to Inquiry List Table Header */
table.dataTable thead th,
table.dataTable thead th:nth-child(n),
table.dataTable thead td,
table.dataTable thead td:nth-child(n),
table.dataTable thead tr th,
table.dataTable thead tr th:nth-child(n),
table.dataTable thead tr th.sorting,
table.dataTable thead tr th.sorting_asc,
table.dataTable thead tr th.sorting_desc,
#common_dataTable thead th:not(.col-left):not(.text-left):not(.col-name),
#common_dataTable thead th:nth-child(n):not(.col-left):not(.text-left):not(.col-name),
#common_dataTable thead tr th:nth-child(n):not(.col-left):not(.text-left):not(.col-name),
#common_dataTable thead tr th.sorting:not(.col-left):not(.text-left):not(.col-name),
#common_dataTable thead tr th.sorting_asc:not(.col-left):not(.text-left):not(.col-name),
#common_dataTable thead tr th.sorting_desc:not(.col-left):not(.text-left):not(.col-name),
#loanrequest-table thead th,
#loanrequest-table thead th:nth-child(n),
#loanrequest-table thead tr th:nth-child(n),
#loanrequest-table thead tr th.sorting,
#loanrequest-table thead tr th.sorting_asc,
#loanrequest-table thead tr th.sorting_desc,
#spotcash-approval-table thead tr th.sorting,
#spotcash-approval-table thead tr th.sorting_asc,
#spotcash-approval-table thead tr th.sorting_desc,
#firstPaymentTable thead th,
#firstPaymentTable thead th:nth-child(n),
#firstPaymentTable thead tr th:nth-child(n),
#firstPaymentTable thead tr th.sorting,
#firstPaymentTable thead tr th.sorting_asc,
#firstPaymentTable thead tr th.sorting_desc,
#verifyListTable thead th,
#verifyListTable thead th:nth-child(n),
#verifyListTable thead tr th:nth-child(n),
#verifyListTable thead tr th.sorting,
#verifyListTable thead tr th.sorting_asc,
#verifyListTable thead tr th.sorting_desc,
#linkedAccountsTable thead th,
#linkedAccountsTable thead th:nth-child(n),
#collectorTable thead th,
#collectorTable thead th:nth-child(n),
#collectorRouteTable thead th,
#collectorRouteTable thead th:nth-child(n),
#collectionsTable thead th,
#collectionsTable thead th:nth-child(n),
#remittancesTable thead th,
#remittancesTable thead th:nth-child(n),
#historyBatchesTable thead th,
#historyBatchesTable thead th:nth-child(n),
#acceptedTransactionsTable thead th,
#acceptedTransactionsTable thead th:nth-child(n),
#batchLineItemsTable thead th,
#batchLineItemsTable thead th:nth-child(n) {
    background: #f0fdf4 !important;
    background-color: #f0fdf4 !important;
    color: #065f46 !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    padding: 0.75rem 1rem !important;
    text-align: center !important;
    vertical-align: middle !important;
    background-position: right 0.35rem center !important;
    white-space: nowrap !important;
    border-bottom: 2px solid #86efac !important;
    border-top: none !important;
    border-left: none !important;
    border-right: 1px solid #d1fae5 !important;
    box-shadow: none !important;
}

table.dataTable thead th.sorting_disabled,
#common_dataTable thead th.sorting_disabled,
#loanrequest-table thead th.sorting_disabled,
#spotcash-approval-table thead th.sorting_disabled,
#linkedAccountsTable thead th.sorting_disabled,
#collectorTable thead th.sorting_disabled,
#collectorRouteTable thead th.sorting_disabled,
#collectionsTable thead th.sorting_disabled,
#remittancesTable thead th.sorting_disabled,
#historyBatchesTable thead th.sorting_disabled,
#acceptedTransactionsTable thead th.sorting_disabled,
#batchLineItemsTable thead th.sorting_disabled {
    padding: 0.75rem 1rem !important;
    text-align: center !important;
}

table.dataTable thead th:last-child,
#common_dataTable thead th:last-child,
#loanrequest-table thead th:last-child,
#spotcash-approval-table thead th:last-child,
#linkedAccountsTable thead th:last-child,
#collectorTable thead th:last-child,
#collectorRouteTable thead th:last-child,
#collectionsTable thead th:last-child,
#remittancesTable thead th:last-child,
#historyBatchesTable thead th:last-child,
#acceptedTransactionsTable thead th:last-child,
#batchLineItemsTable thead th:last-child {
    border-right: none !important;
}

[data-theme="dark"] table.dataTable thead th:not(.col-left):not(.text-left):not(.text-right):not(.col-right):not(.col-name),
[data-theme="dark"] table.dataTable thead th:nth-child(n):not(.col-left):not(.text-left):not(.text-right):not(.col-right):not(.col-name),
[data-theme="dark"] table.dataTable thead td:not(.col-left):not(.text-left):not(.text-right):not(.col-right),
[data-theme="dark"] table.dataTable thead td:nth-child(n):not(.col-left):not(.text-left):not(.text-right):not(.col-right),
[data-theme="dark"] table.dataTable thead tr th:not(.col-left):not(.text-left):not(.text-right):not(.col-right):not(.col-name),
[data-theme="dark"] table.dataTable thead tr th:nth-child(n):not(.col-left):not(.text-left):not(.text-right):not(.col-right):not(.col-name),
[data-theme="dark"] table.dataTable thead tr th.sorting:not(.col-left):not(.text-left):not(.text-right):not(.col-right):not(.col-name),
[data-theme="dark"] table.dataTable thead tr th.sorting_asc:not(.col-left):not(.text-left):not(.text-right):not(.col-right):not(.col-name),
[data-theme="dark"] table.dataTable thead tr th.sorting_desc:not(.col-left):not(.text-left):not(.text-right):not(.col-right):not(.col-name),
[data-theme="dark"] #common_dataTable thead th:not(.col-left):not(.text-left):not(.text-right):not(.col-right):not(.col-name),
[data-theme="dark"] #common_dataTable thead th:nth-child(n):not(.col-left):not(.text-left):not(.text-right):not(.col-right):not(.col-name),
[data-theme="dark"] #common_dataTable thead tr th:nth-child(n):not(.col-left):not(.text-left):not(.text-right):not(.col-right):not(.col-name),
[data-theme="dark"] #common_dataTable thead tr th.sorting:not(.col-left):not(.text-left):not(.text-right):not(.col-right):not(.col-name),
[data-theme="dark"] #common_dataTable thead tr th.sorting_asc:not(.col-left):not(.text-left):not(.text-right):not(.col-right):not(.col-name),
[data-theme="dark"] #common_dataTable thead tr th.sorting_desc:not(.col-left):not(.text-left):not(.text-right):not(.col-right):not(.col-name),
[data-theme="dark"] #loanrequest-table thead th,
[data-theme="dark"] #loanrequest-table thead th:nth-child(n),
[data-theme="dark"] #loanrequest-table thead tr th:nth-child(n),
[data-theme="dark"] #loanrequest-table thead tr th.sorting,
[data-theme="dark"] #loanrequest-table thead tr th.sorting_asc,
[data-theme="dark"] #loanrequest-table thead tr th.sorting_desc,
[data-theme="dark"] #spotcash-approval-table thead th,
[data-theme="dark"] #spotcash-approval-table thead th:nth-child(n),
[data-theme="dark"] #spotcash-approval-table thead tr th:nth-child(n),
[data-theme="dark"] #spotcash-approval-table thead tr th.sorting,
[data-theme="dark"] #spotcash-approval-table thead tr th.sorting_asc,
[data-theme="dark"] #spotcash-approval-table thead tr th.sorting_desc,
[data-theme="dark"] #fsa_commission_table thead th,
[data-theme="dark"] #fsa_commission_table thead th:nth-child(n),
[data-theme="dark"] #fsa_commission_table thead tr th:nth-child(n),
[data-theme="dark"] #fsa_commission_table thead tr th.sorting,
[data-theme="dark"] #fsa_commission_table thead tr th.sorting_asc,
[data-theme="dark"] #fsa_commission_table thead tr th.sorting_desc,
[data-theme="dark"] #processingTable thead th,
[data-theme="dark"] #processingTable thead th:nth-child(n),
[data-theme="dark"] #processingTable thead tr th:nth-child(n),
[data-theme="dark"] #processingTable thead tr th.sorting,
[data-theme="dark"] #processingTable thead tr th.sorting_asc,
[data-theme="dark"] #processingTable thead tr th.sorting_desc,
[data-theme="dark"] #modalDetailsTable thead th,
[data-theme="dark"] #modalDetailsTable thead th:nth-child(n),
[data-theme="dark"] #modalDetailsTable thead tr th:nth-child(n),
[data-theme="dark"] #modalDetailsTable thead tr th.sorting,
[data-theme="dark"] #modalDetailsTable thead tr th.sorting_asc,
[data-theme="dark"] #modalDetailsTable thead tr th.sorting_desc,
[data-theme="dark"] #firstPaymentTable thead th,
[data-theme="dark"] #firstPaymentTable thead th:nth-child(n),
[data-theme="dark"] #firstPaymentTable thead tr th:nth-child(n),
[data-theme="dark"] #firstPaymentTable thead tr th.sorting,
[data-theme="dark"] #firstPaymentTable thead tr th.sorting_asc,
[data-theme="dark"] #firstPaymentTable thead tr th.sorting_desc,
[data-theme="dark"] #verifyListTable thead th,
[data-theme="dark"] #verifyListTable thead th:nth-child(n),
[data-theme="dark"] #verifyListTable thead tr th:nth-child(n),
[data-theme="dark"] #verifyListTable thead tr th.sorting,
[data-theme="dark"] #verifyListTable thead tr th.sorting_asc,
[data-theme="dark"] #verifyListTable thead tr th.sorting_desc,
[data-theme="dark"] #linkedAccountsTable thead th,
[data-theme="dark"] #linkedAccountsTable thead th:nth-child(n),
[data-theme="dark"] #collectorTable thead th,
[data-theme="dark"] #collectorTable thead th:nth-child(n),
[data-theme="dark"] #collectorRouteTable thead th,
[data-theme="dark"] #collectorRouteTable thead th:nth-child(n),
[data-theme="dark"] #collectionsTable thead th,
[data-theme="dark"] #collectionsTable thead th:nth-child(n),
[data-theme="dark"] #remittancesTable thead th,
[data-theme="dark"] #remittancesTable thead th:nth-child(n),
[data-theme="dark"] #historyBatchesTable thead th,
[data-theme="dark"] #historyBatchesTable thead th:nth-child(n),
[data-theme="dark"] #acceptedTransactionsTable thead th,
[data-theme="dark"] #acceptedTransactionsTable thead th:nth-child(n),
[data-theme="dark"] #batchLineItemsTable thead th,
[data-theme="dark"] #batchLineItemsTable thead th:nth-child(n),
.dark table.dataTable thead th:not(.col-left):not(.text-left):not(.text-right):not(.col-right):not(.col-name),
.dark #common_dataTable thead th:not(.col-left):not(.text-left):not(.text-right):not(.col-right):not(.col-name),
.dark #loanrequest-table thead th,
.dark #spotcash-approval-table thead th,
.dark #fsa_commission_table thead th,
.dark #processingTable thead th,
.dark #modalDetailsTable thead th,
.dark #firstPaymentTable thead th,
.dark #verifyListTable thead th,
.dark #linkedAccountsTable thead th,
.dark #collectorTable thead th,
.dark #collectorRouteTable thead th,
.dark #collectionsTable thead th,
.dark #remittancesTable thead th,
.dark #historyBatchesTable thead th,
.dark #acceptedTransactionsTable thead th,
.dark #batchLineItemsTable thead th {
    background: #14262b !important;
    background-color: #14262b !important;
    color: #d1fae5 !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    padding: 0.75rem 1rem !important;
    text-align: center !important;
    vertical-align: middle !important;
    background-position: right 0.35rem center !important;
    white-space: nowrap !important;
    border-bottom: 2px solid rgba(16, 185, 129, 0.45) !important;
    border-top: none !important;
    border-left: none !important;
    border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: none !important;
}

[data-theme="dark"] table.dataTable thead th.sorting_disabled,
[data-theme="dark"] #common_dataTable thead th.sorting_disabled,
[data-theme="dark"] #loanrequest-table thead th.sorting_disabled,
[data-theme="dark"] #spotcash-approval-table thead th.sorting_disabled,
[data-theme="dark"] #linkedAccountsTable thead th.sorting_disabled,
[data-theme="dark"] #collectorTable thead th.sorting_disabled,
[data-theme="dark"] #collectorRouteTable thead th.sorting_disabled,
[data-theme="dark"] #collectionsTable thead th.sorting_disabled,
[data-theme="dark"] #remittancesTable thead th.sorting_disabled,
[data-theme="dark"] #historyBatchesTable thead th.sorting_disabled,
[data-theme="dark"] #acceptedTransactionsTable thead th.sorting_disabled,
[data-theme="dark"] #batchLineItemsTable thead th.sorting_disabled,
.dark table.dataTable thead th.sorting_disabled,
.dark #common_dataTable thead th.sorting_disabled,
.dark #loanrequest-table thead th.sorting_disabled,
.dark #spotcash-approval-table thead th.sorting_disabled,
.dark #linkedAccountsTable thead th.sorting_disabled,
.dark #collectorTable thead th.sorting_disabled,
.dark #collectorRouteTable thead th.sorting_disabled,
.dark #collectionsTable thead th.sorting_disabled,
.dark #remittancesTable thead th.sorting_disabled,
.dark #historyBatchesTable thead th.sorting_disabled,
.dark #acceptedTransactionsTable thead th.sorting_disabled,
.dark #batchLineItemsTable thead th.sorting_disabled {
    padding: 0.75rem 1rem !important;
    text-align: center !important;
}

[data-theme="dark"] table.dataTable thead th:last-child,
[data-theme="dark"] #common_dataTable thead th:last-child,
[data-theme="dark"] #loanrequest-table thead th:last-child,
[data-theme="dark"] #spotcash-approval-table thead th:last-child,
[data-theme="dark"] #linkedAccountsTable thead th:last-child,
[data-theme="dark"] #collectorTable thead th:last-child,
[data-theme="dark"] #collectorRouteTable thead th:last-child,
[data-theme="dark"] #collectionsTable thead th:last-child,
[data-theme="dark"] #remittancesTable thead th:last-child,
[data-theme="dark"] #historyBatchesTable thead th:last-child,
[data-theme="dark"] #acceptedTransactionsTable thead th:last-child,
[data-theme="dark"] #batchLineItemsTable thead th:last-child,
[data-theme="dark"] #fsa_commission_table thead th:last-child,
[data-theme="dark"] #processingTable thead th:last-child,
[data-theme="dark"] #modalDetailsTable thead th:last-child,
[data-theme="dark"] #firstPaymentTable thead th:last-child,
[data-theme="dark"] #verifyListTable thead th:last-child,
.dark table.dataTable thead th:last-child,
.dark #common_dataTable thead th:last-child,
.dark #loanrequest-table thead th:last-child,
.dark #spotcash-approval-table thead th:last-child,
.dark #linkedAccountsTable thead th:last-child,
.dark #collectorTable thead th:last-child,
.dark #collectorRouteTable thead th:last-child,
.dark #collectionsTable thead th:last-child,
.dark #remittancesTable thead th:last-child,
.dark #historyBatchesTable thead th:last-child,
.dark #acceptedTransactionsTable thead th:last-child,
.dark #batchLineItemsTable thead th:last-child,
.dark #fsa_commission_table thead th:last-child,
.dark #processingTable thead th:last-child,
.dark #modalDetailsTable thead th:last-child,
.dark #firstPaymentTable thead th:last-child,
.dark #verifyListTable thead th:last-child {
    border-right: none !important;
}

/* Adaptive Exception: Left-align headers for text/name columns with maximum specificity */
table.dataTable thead th.text-left,
table.dataTable thead th.col-left,
table.dataTable thead th.col-name,
table.dataTable thead th.col-client,
table.dataTable thead th.col-collector,
table.dataTable thead th.col-owner,
table.dataTable thead tr th.text-left,
table.dataTable thead tr th.col-left,
table.dataTable thead tr th.sorting.text-left,
table.dataTable thead tr th.sorting_asc.text-left,
table.dataTable thead tr th.sorting_desc.text-left,
table.dataTable thead tr th.sorting.col-left,
table.dataTable thead tr th.sorting_asc.col-left,
table.dataTable thead tr th.sorting_desc.col-left,
#common_dataTable thead th.text-left,
#common_dataTable thead th.col-left,
#common_dataTable thead th.col-name,
#common_dataTable thead tr th.text-left,
#common_dataTable thead tr th.col-left,
#common_dataTable thead tr th.col-name,
#common_dataTable thead tr th.sorting.text-left,
#common_dataTable thead tr th.sorting_asc.text-left,
#common_dataTable thead tr th.sorting_desc.text-left,
#common_dataTable thead tr th.sorting.col-left,
#common_dataTable thead tr th.sorting_asc.col-left,
#common_dataTable thead tr th.sorting_desc.col-left,
#collectionsTable thead th.col-client,
#collectionsTable thead tr th.col-client,
#collectionsTable thead tr th.sorting.col-client,
#collectionsTable thead tr th.sorting_asc.col-client,
#collectionsTable thead tr th.sorting_desc.col-client,
#collectorTable thead th.col-left,
#collectorTable thead tr th.col-left,
#collectorTable thead tr th.sorting.col-left,
#collectorTable thead tr th.sorting_asc.col-left,
#collectorTable thead tr th.sorting_desc.col-left,
#collectorRouteTable thead th.col-left,
#collectorRouteTable thead tr th.col-left,
#collectorRouteTable thead tr th.sorting.col-left,
#collectorRouteTable thead tr th.sorting_asc.col-left,
#collectorRouteTable thead tr th.sorting_desc.col-left,
#historyBatchesTable thead th.col-left,
#historyBatchesTable thead tr th.col-left,
#historyBatchesTable thead tr th.sorting.col-left,
#historyBatchesTable thead tr th.sorting_asc.col-left,
#historyBatchesTable thead tr th.sorting_desc.col-left,
#acceptedTransactionsTable thead th.col-left,
#acceptedTransactionsTable thead tr th.col-left,
#acceptedTransactionsTable thead tr th.sorting.col-left,
#acceptedTransactionsTable thead tr th.sorting_asc.col-left,
#acceptedTransactionsTable thead tr th.sorting_desc.col-left,
#batchLineItemsTable thead th.col-left,
#batchLineItemsTable thead tr th.col-left,
#batchLineItemsTable thead tr th.sorting.col-left,
#batchLineItemsTable thead tr th.sorting_asc.col-left,
#batchLineItemsTable thead tr th.sorting_desc.col-left,
#linkedAccountsTable thead th.col-left,
#linkedAccountsTable thead tr th.col-left,
#linkedAccountsTable thead tr th.sorting.col-left,
#linkedAccountsTable thead tr th.sorting_asc.col-left,
#linkedAccountsTable thead tr th.sorting_desc.col-left,
#remittancesTable thead th.col-left,
#remittancesTable thead tr th.col-left,
#remittancesTable thead tr th.sorting.col-left,
#remittancesTable thead tr th.sorting_asc.col-left,
#remittancesTable thead tr th.sorting_desc.col-left,
.dark table.dataTable thead th.text-left,
.dark table.dataTable thead th.col-left,
.dark table.dataTable thead tr th.text-left,
.dark table.dataTable thead tr th.col-left,
.dark table.dataTable thead tr th.sorting.text-left,
.dark table.dataTable thead tr th.sorting_asc.text-left,
.dark table.dataTable thead tr th.sorting_desc.text-left,
.dark table.dataTable thead tr th.sorting.col-left,
.dark table.dataTable thead tr th.sorting_asc.col-left,
.dark table.dataTable thead tr th.sorting_desc.col-left,
.dark #common_dataTable thead th.text-left,
.dark #common_dataTable thead th.col-left,
.dark #common_dataTable thead th.col-name,
.dark #common_dataTable thead tr th.text-left,
.dark #common_dataTable thead tr th.col-left,
.dark #common_dataTable thead tr th.col-name,
.dark #common_dataTable thead tr th.sorting.text-left,
.dark #common_dataTable thead tr th.sorting_asc.text-left,
.dark #common_dataTable thead tr th.sorting_desc.text-left,
.dark #common_dataTable thead tr th.sorting.col-left,
.dark #common_dataTable thead tr th.sorting_asc.col-left,
.dark #common_dataTable thead tr th.sorting_desc.col-left,
.dark #collectionsTable thead th.col-client,
.dark #collectionsTable thead tr th.col-client,
.dark #collectionsTable thead tr th.sorting.col-client,
.dark #collectionsTable thead tr th.sorting_asc.col-client,
.dark #collectionsTable thead tr th.sorting_desc.col-client,
.dark #collectorTable thead th.col-left,
.dark #collectorTable thead tr th.col-left,
.dark #collectorTable thead tr th.sorting.col-left,
.dark #collectorTable thead tr th.sorting_asc.col-left,
.dark #collectorTable thead tr th.sorting_desc.col-left,
.dark #collectorRouteTable thead th.col-left,
.dark #collectorRouteTable thead tr th.col-left,
.dark #collectorRouteTable thead tr th.sorting.col-left,
.dark #collectorRouteTable thead tr th.sorting_asc.col-left,
.dark #collectorRouteTable thead tr th.sorting_desc.col-left,
.dark #historyBatchesTable thead th.col-left,
.dark #historyBatchesTable thead tr th.col-left,
.dark #historyBatchesTable thead tr th.sorting.col-left,
.dark #historyBatchesTable thead tr th.sorting_asc.col-left,
.dark #historyBatchesTable thead tr th.sorting_desc.col-left,
.dark #acceptedTransactionsTable thead th.col-left,
.dark #acceptedTransactionsTable thead tr th.col-left,
.dark #acceptedTransactionsTable thead tr th.sorting.col-left,
.dark #acceptedTransactionsTable thead tr th.sorting_asc.col-left,
.dark #acceptedTransactionsTable thead tr th.sorting_desc.col-left,
.dark #batchLineItemsTable thead th.col-left,
.dark #batchLineItemsTable thead tr th.col-left,
.dark #batchLineItemsTable thead tr th.sorting.col-left,
.dark #batchLineItemsTable thead tr th.sorting_asc.col-left,
.dark #batchLineItemsTable thead tr th.sorting_desc.col-left,
.dark #linkedAccountsTable thead th.col-left,
.dark #linkedAccountsTable thead tr th.col-left,
.dark #linkedAccountsTable thead tr th.sorting.col-left,
.dark #linkedAccountsTable thead tr th.sorting_asc.col-left,
.dark #linkedAccountsTable thead tr th.sorting_desc.col-left,
.dark #remittancesTable thead th.col-left,
.dark #remittancesTable thead tr th.col-left,
.dark #remittancesTable thead tr th.sorting.col-left,
.dark #remittancesTable thead tr th.sorting_asc.col-left,
.dark #remittancesTable thead tr th.sorting_desc.col-left,
[data-theme="dark"] table.dataTable thead th.text-left,
[data-theme="dark"] table.dataTable thead th.col-left,
[data-theme="dark"] table.dataTable thead tr th.text-left,
[data-theme="dark"] table.dataTable thead tr th.col-left,
[data-theme="dark"] table.dataTable thead tr th.sorting.text-left,
[data-theme="dark"] table.dataTable thead tr th.sorting_asc.text-left,
[data-theme="dark"] table.dataTable thead tr th.sorting_desc.text-left,
[data-theme="dark"] table.dataTable thead tr th.sorting.col-left,
[data-theme="dark"] table.dataTable thead tr th.sorting_asc.col-left,
[data-theme="dark"] table.dataTable thead tr th.sorting_desc.col-left,
[data-theme="dark"] #common_dataTable thead th.text-left,
[data-theme="dark"] #common_dataTable thead th.col-left,
[data-theme="dark"] #common_dataTable thead th.col-name,
[data-theme="dark"] #common_dataTable thead tr th.text-left,
[data-theme="dark"] #common_dataTable thead tr th.col-left,
[data-theme="dark"] #common_dataTable thead tr th.col-name,
[data-theme="dark"] #common_dataTable thead tr th.sorting.text-left,
[data-theme="dark"] #common_dataTable thead tr th.sorting_asc.text-left,
[data-theme="dark"] #common_dataTable thead tr th.sorting_desc.text-left,
[data-theme="dark"] #common_dataTable thead tr th.sorting.col-left,
[data-theme="dark"] #common_dataTable thead tr th.sorting_asc.col-left,
[data-theme="dark"] #common_dataTable thead tr th.sorting_desc.col-left,
[data-theme="dark"] #collectionsTable thead th.col-client,
[data-theme="dark"] #collectionsTable thead tr th.col-client,
[data-theme="dark"] #collectionsTable thead tr th.sorting.col-client,
[data-theme="dark"] #collectionsTable thead tr th.sorting_asc.col-client,
[data-theme="dark"] #collectionsTable thead tr th.sorting_desc.col-client,
[data-theme="dark"] #collectorTable thead th.col-left,
[data-theme="dark"] #collectorTable thead tr th.col-left,
[data-theme="dark"] #collectorTable thead tr th.sorting.col-left,
[data-theme="dark"] #collectorTable thead tr th.sorting_asc.col-left,
[data-theme="dark"] #collectorTable thead tr th.sorting_desc.col-left,
[data-theme="dark"] #collectorRouteTable thead th.col-left,
[data-theme="dark"] #collectorRouteTable thead tr th.col-left,
[data-theme="dark"] #collectorRouteTable thead tr th.sorting.col-left,
[data-theme="dark"] #collectorRouteTable thead tr th.sorting_asc.col-left,
[data-theme="dark"] #collectorRouteTable thead tr th.sorting_desc.col-left,
[data-theme="dark"] #historyBatchesTable thead th.col-left,
[data-theme="dark"] #historyBatchesTable thead tr th.col-left,
[data-theme="dark"] #historyBatchesTable thead tr th.sorting.col-left,
[data-theme="dark"] #historyBatchesTable thead tr th.sorting_asc.col-left,
[data-theme="dark"] #historyBatchesTable thead tr th.sorting_desc.col-left,
[data-theme="dark"] #acceptedTransactionsTable thead th.col-left,
[data-theme="dark"] #acceptedTransactionsTable thead tr th.col-left,
[data-theme="dark"] #acceptedTransactionsTable thead tr th.sorting.col-left,
[data-theme="dark"] #acceptedTransactionsTable thead tr th.sorting_asc.col-left,
[data-theme="dark"] #acceptedTransactionsTable thead tr th.sorting_desc.col-left,
[data-theme="dark"] #batchLineItemsTable thead th.col-left,
[data-theme="dark"] #batchLineItemsTable thead tr th.col-left,
[data-theme="dark"] #batchLineItemsTable thead tr th.sorting.col-left,
[data-theme="dark"] #batchLineItemsTable thead tr th.sorting_asc.col-left,
[data-theme="dark"] #batchLineItemsTable thead tr th.sorting_desc.col-left,
[data-theme="dark"] #linkedAccountsTable thead th.col-left,
[data-theme="dark"] #linkedAccountsTable thead tr th.col-left,
[data-theme="dark"] #linkedAccountsTable thead tr th.sorting.col-left,
[data-theme="dark"] #linkedAccountsTable thead tr th.sorting_asc.col-left,
[data-theme="dark"] #linkedAccountsTable thead tr th.sorting_desc.col-left,
[data-theme="dark"] #remittancesTable thead th.col-left,
[data-theme="dark"] #remittancesTable thead tr th.col-left,
[data-theme="dark"] #remittancesTable thead tr th.sorting.col-left,
[data-theme="dark"] #remittancesTable thead tr th.sorting_asc.col-left,
[data-theme="dark"] #remittancesTable thead tr th.sorting_desc.col-left {
    text-align: left !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

.dark table.dataTable thead th.text-right,
.dark table.dataTable thead th.col-right,
.dark table.dataTable thead tr th.text-right,
.dark table.dataTable thead tr th.col-right,
.dark table.dataTable thead tr th.sorting.text-right,
.dark table.dataTable thead tr th.sorting_asc.text-right,
.dark table.dataTable thead tr th.sorting_desc.text-right,
.dark #common_dataTable thead th.text-right,
.dark #common_dataTable thead th.col-right,
.dark #common_dataTable thead tr th.text-right,
.dark #common_dataTable thead tr th.col-right,
.dark #common_dataTable thead tr th.sorting.text-right,
.dark #common_dataTable thead tr th.sorting_asc.text-right,
.dark #common_dataTable thead tr th.sorting_desc.text-right,
[data-theme="dark"] table.dataTable thead th.text-right,
[data-theme="dark"] table.dataTable thead th.col-right,
[data-theme="dark"] table.dataTable thead tr th.text-right,
[data-theme="dark"] table.dataTable thead tr th.col-right,
[data-theme="dark"] table.dataTable thead tr th.sorting.text-right,
[data-theme="dark"] table.dataTable thead tr th.sorting_asc.text-right,
[data-theme="dark"] table.dataTable thead tr th.sorting_desc.text-right,
[data-theme="dark"] #common_dataTable thead th.text-right,
[data-theme="dark"] #common_dataTable thead th.col-right,
[data-theme="dark"] #common_dataTable thead tr th.text-right,
[data-theme="dark"] #common_dataTable thead tr th.col-right,
[data-theme="dark"] #common_dataTable thead tr th.sorting.text-right,
[data-theme="dark"] #common_dataTable thead tr th.sorting_asc.text-right,
[data-theme="dark"] #common_dataTable thead tr th.sorting_desc.text-right {
    text-align: right !important;
    padding-left: 1rem !important;
    padding-right: 1.5rem !important;
}

/* Global Enterprise Card Container Border Stroke (consistent with Client Management card) */
div:has(> .inquiry-card-header),
section:has(> .inquiry-card-header) {
    border: 2px solid #86efac !important;
}
[data-theme="dark"] div:has(> .inquiry-card-header),
[data-theme="dark"] section:has(> .inquiry-card-header),
.dark div:has(> .inquiry-card-header),
.dark section:has(> .inquiry-card-header) {
    border: 2px solid rgba(4, 120, 87, 0.55) !important;
}

/* Global Inquiry-Style Card Header Banner */
.inquiry-card-header {
    background-color: #e6f4ea !important;
    border-bottom: 2px solid #22c55e !important;
    padding: 1rem 1.5rem !important;
}
.inquiry-card-header h3 {
    color: #065f46 !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    margin: 0 !important;
}
[data-theme="dark"] .inquiry-card-header,
.dark .inquiry-card-header {
    background-color: #064e3b !important;
    border-bottom: 2px solid #10b981 !important;
}
[data-theme="dark"] .inquiry-card-header h3,
.dark .inquiry-card-header h3 {
    color: #ecfdf5 !important;
}

[data-theme="dark"] table.dataTable tbody tr,
[data-theme="dark"] #common_dataTable tbody tr,
[data-theme="dark"] #loanrequest-table tbody tr,
[data-theme="dark"] #spotcash-approval-table tbody tr,
[data-theme="dark"] #linkedAccountsTable tbody tr,
[data-theme="dark"] #firstPaymentTable tbody tr,
[data-theme="dark"] #verifyListTable tbody tr,
[data-theme="dark"] #contracts_dataTable tbody tr,
[data-theme="dark"] #ors_dataTable tbody tr {
    background-color: var(--datatable-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--datatable-border) !important;
}

[data-theme="dark"] table.dataTable tbody tr:hover,
[data-theme="dark"] #common_dataTable tbody tr:hover,
[data-theme="dark"] #loanrequest-table tbody tr:hover,
[data-theme="dark"] #spotcash-approval-table tbody tr:hover,
[data-theme="dark"] #linkedAccountsTable tbody tr:hover,
[data-theme="dark"] #firstPaymentTable tbody tr:hover,
[data-theme="dark"] #verifyListTable tbody tr:hover,
[data-theme="dark"] #contracts_dataTable tbody tr:hover,
[data-theme="dark"] #ors_dataTable tbody tr:hover {
    background-color: var(--datatable-row-hover) !important;
    box-shadow: -4px 0 0 0 var(--accent-success), 0 2px 8px rgba(52, 211, 153, 0.1) !important;
}

[data-theme="dark"] table.dataTable tbody td,
[data-theme="dark"] #common_dataTable tbody td,
[data-theme="dark"] #loanrequest-table tbody td,
[data-theme="dark"] #spotcash-approval-table tbody td,
[data-theme="dark"] #linkedAccountsTable tbody td,
[data-theme="dark"] #firstPaymentTable tbody td,
[data-theme="dark"] #verifyListTable tbody td,
[data-theme="dark"] #contracts_dataTable tbody td,
[data-theme="dark"] #ors_dataTable tbody td {
    border-color: var(--datatable-border) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] table.dataTable tbody td,
[data-theme="dark"] #common_dataTable tbody td,
[data-theme="dark"] #firstPaymentTable tbody td,
[data-theme="dark"] #verifyListTable tbody td,
[data-theme="dark"] #contracts_dataTable tbody td,
[data-theme="dark"] #ors_dataTable tbody td {
    border-color: var(--datatable-border) !important;
    color: var(--text-primary) !important;
}
/* DataTables Controls - Length, Filter, Info */
[data-theme="dark"] .dataTables_wrapper .dataTables_info,
[data-theme="dark"] .dataTables_wrapper .dataTables_length {
    color: var(--text-muted) !important;
}

/* DataTables Length Label - "Show X entries" text */
[data-theme="dark"] .dataTables_wrapper .dataTables_length label,
[data-theme="dark"] .dataTables_length label,
[data-theme="dark"] #common_dataTable_length label {
    color: #e5e7eb !important;
}

/* DataTables Length Select Dropdown */
[data-theme="dark"] .dataTables_wrapper .dataTables_length select,
[data-theme="dark"] .dataTables_length select,
[data-theme="dark"] #common_dataTable_length select,
.dark .dataTables_length select {
    background-color: #1e293b !important;
    background: #1e293b !important;
    color: #f1f5f9 !important;
    border: 1px solid #475569 !important;
    border-radius: 0.5rem !important;
    padding: 0.4rem 2rem 0.4rem 0.75rem !important;
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    min-width: 60px !important;
    height: auto !important;
    cursor: pointer !important;
}

[data-theme="dark"] .dataTables_wrapper .dataTables_length select {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .dataTables_wrapper .dataTables_filter input {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
    border-color: #475569 !important;
    padding: 0.45rem 0.9rem !important;
    border-radius: 0.5rem !important;
    font-size: 0.8125rem !important;
}

/* DataTables Filter Label */
[data-theme="dark"] .dataTables_wrapper .dataTables_filter label,
[data-theme="dark"] #common_dataTable_filter label {
    color: #94a3b8 !important;
}

/* DataTables Filter Input - Ultra Specific */
[data-theme="dark"] .dataTables_filter input[type="search"],
[data-theme="dark"] .dataTables_filter input,
[data-theme="dark"] #common_dataTable_filter input[type="search"],
[data-theme="dark"] #common_dataTable_filter input,
.dark .dataTables_filter input[type="search"],
.dark .dataTables_filter input,
.dark #common_dataTable_filter input[type="search"],
.dark #common_dataTable_filter input {
    background-color: #1e293b !important;
    background: #1e293b !important;
    color: #f1f5f9 !important;
    border: 1.5px solid #475569 !important;
    border-color: #475569 !important;
    border-radius: 0.5rem !important;
    padding: 0.45rem 0.9rem !important;
    font-size: 0.8125rem !important;
}

[data-theme="dark"] .dataTables_filter input::placeholder,
[data-theme="dark"] #common_dataTable_filter input::placeholder,
.dark .dataTables_filter input::placeholder,
.dark #common_dataTable_filter input::placeholder {
    color: #94a3b8 !important;
    opacity: 1 !important;
}

[data-theme="dark"] .dataTables_length select:hover,
[data-theme="dark"] .dataTables_filter input:hover,
[data-theme="dark"] #common_dataTable_filter input:hover,
.dark .dataTables_filter input:hover,
.dark #common_dataTable_filter input:hover {
    border-color: #64748b !important;
    background: #334155 !important;
    background-color: #334155 !important;
}

[data-theme="dark"] .dataTables_length select:focus,
.dark .dataTables_length select:focus {
    border: 1.5px solid #34d399 !important;
    border-color: #34d399 !important;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.35) !important;
    outline: none !important;
}

[data-theme="dark"] .dataTables_filter input:focus,
[data-theme="dark"] .dataTables_filter input[type="search"]:focus,
[data-theme="dark"] #common_dataTable_filter input:focus,
[data-theme="dark"] #common_dataTable_filter input[type="search"]:focus,
.dark .dataTables_filter input:focus,
.dark .dataTables_filter input[type="search"]:focus,
.dark #common_dataTable_filter input:focus,
.dark #common_dataTable_filter input[type="search"]:focus {
    border: 1.5px solid #34d399 !important;
    border-color: #34d399 !important;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.35) !important;
    outline: none !important;
    background: #1e293b !important;
    background-color: #1e293b !important;
    color: #ffffff !important;
    position: relative !important;
    z-index: 10 !important;
}

/* DataTables Processing Indicator */
[data-theme="dark"] .dataTables_processing {
    background-color: var(--bg-card) !important;
    border-color: var(--border-primary) !important;
    color: var(--text-primary) !important;
}

/* DataTables Empty Message */
[data-theme="dark"] .dataTables_empty {
    color: var(--text-muted) !important;
    background-color: var(--datatable-bg) !important;
}

/* Dropdowns */
[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] [class*="dropdown"] {
    background-color: var(--bg-card) !important;
    border-color: var(--border-primary) !important;
}

[data-theme="dark"] .dropdown-menu a,
[data-theme="dark"] .dropdown-menu button {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .dropdown-menu a:hover,
[data-theme="dark"] .dropdown-menu button:hover {
    background-color: var(--bg-tertiary) !important;
}

/* Modals */
[data-theme="dark"] .modal,
[data-theme="dark"] .modal-content,
[data-theme="dark"] [role="dialog"],
.dark .modal,
.dark .modal-content,
.dark [role="dialog"] {
    background-color: var(--bg-card, #1e293b) !important;
    color: var(--text-primary, #f1f5f9) !important;
}

[data-theme="dark"] .modal-body,
.dark .modal-body {
    background-color: var(--bg-card, #1e293b) !important;
    color: var(--text-primary, #f1f5f9) !important;
}

[data-theme="dark"] .modal-footer,
.dark .modal-footer {
    background-color: #0f172a !important;
    border-top: 1px solid var(--border-primary, #334155) !important;
}

[data-theme="dark"] .modal-body p,
.dark .modal-body p {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .modal-body p strong,
[data-theme="dark"] .modal-body p b,
.dark .modal-body p strong,
.dark .modal-body p b {
    color: #f1f5f9 !important;
}

/* Navbar specific */
[data-theme="dark"] nav {
    background-color: var(--bg-card) !important;
    border-color: var(--border-primary) !important;
}

/* Footer */
[data-theme="dark"] footer {
    background-color: var(--bg-card) !important;
    border-color: var(--border-primary) !important;
}

/* Theme Toggle Button Styles */
.theme-toggle-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 50% !important;
    background-color: var(--bg-tertiary);
    border: 2px solid var(--border-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    box-sizing: border-box !important;
    line-height: 0 !important;
}

.theme-toggle-btn:hover {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: scale(1.1);
}

.theme-toggle-btn svg {
    display: block !important;
    width: 20px !important;
    height: 20px !important;
    margin: auto !important;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.theme-toggle-btn:hover svg {
    transform: rotate(15deg);
}

/* Theme indicator text */
.theme-indicator {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
    color: var(--text-muted);
}

/* Spin animation for theme change */
@keyframes themeSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.theme-spin {
    animation: themeSpin 0.5s ease-in-out;
}

/* Status Badges - Dark Mode */
[data-theme="dark"] .bg-yellow-100 {
    background-color: rgba(251, 191, 36, 0.2) !important;
    color: #fbbf24 !important;
}

[data-theme="dark"] .bg-blue-100 {
    background-color: rgba(96, 165, 250, 0.2) !important;
    color: #60a5fa !important;
}

[data-theme="dark"] .bg-green-100 {
    background-color: rgba(52, 211, 153, 0.2) !important;
    color: #34d399 !important;
}

[data-theme="dark"] .bg-red-100 {
    background-color: rgba(248, 113, 113, 0.2) !important;
    color: #f87171 !important;
}

[data-theme="dark"] .bg-purple-100 {
    background-color: rgba(167, 139, 250, 0.2) !important;
    color: #a78bfa !important;
}

[data-theme="dark"] .bg-gray-100 {
    background-color: rgba(107, 114, 128, 0.2) !important;
    color: #9ca3af !important;
}

[data-theme="dark"] .bg-orange-100 {
    background-color: rgba(249, 115, 22, 0.2) !important;
    color: #fdba74 !important;
}

[data-theme="dark"] .bg-rose-100 {
    background-color: rgba(244, 63, 94, 0.2) !important;
    color: #fda4af !important;
}

[data-theme="dark"] .bg-amber-100,
.dark .bg-amber-100 {
    background-color: rgba(245, 158, 11, 0.2) !important;
    color: #fde68a !important;
}

[data-theme="dark"] .bg-emerald-100,
.dark .bg-emerald-100 {
    background-color: rgba(16, 185, 129, 0.22) !important;
    color: #6ee7b7 !important;
}

[data-theme="dark"] .bg-teal-100,
.dark .bg-teal-100 {
    background-color: rgba(20, 184, 166, 0.22) !important;
    color: #5eead4 !important;
}

[data-theme="dark"] .bg-sky-100,
.dark .bg-sky-100 {
    background-color: rgba(14, 165, 233, 0.24) !important;
    color: #7dd3fc !important;
}

[data-theme="dark"] .bg-violet-100,
.dark .bg-violet-100 {
    background-color: rgba(139, 92, 246, 0.26) !important;
    color: #ddd6fe !important;
}

[data-theme="dark"] .bg-lime-100,
.dark .bg-lime-100 {
    background-color: rgba(132, 204, 22, 0.22) !important;
    color: #bef264 !important;
}

[data-theme="dark"] .bg-pink-100,
.dark .bg-pink-100 {
    background-color: rgba(236, 72, 153, 0.22) !important;
    color: #f9a8d4 !important;
}

[data-theme="dark"] .bg-slate-100,
.dark .bg-slate-100 {
    background-color: rgba(51, 65, 85, 0.72) !important;
    color: #e2e8f0 !important;
}

/* Text colors for badges */
[data-theme="dark"] .text-yellow-800 {
    color: #fbbf24 !important;
}

[data-theme="dark"] .text-blue-800 {
    color: #60a5fa !important;
}

[data-theme="dark"] .text-green-800 {
    color: #34d399 !important;
}

[data-theme="dark"] .text-red-800 {
    color: #f87171 !important;
}

[data-theme="dark"] .text-orange-800 {
    color: #fdba74 !important;
}

[data-theme="dark"] .text-rose-800 {
    color: #fda4af !important;
}

[data-theme="dark"] .text-amber-800 {
    color: #fde68a !important;
}

[data-theme="dark"] .text-gray-800 {
    color: var(--text-primary) !important;
}

/* Action Dropdowns in Tables */
[data-theme="dark"] .action-dropdown {
    background-color: transparent !important;
}

[data-theme="dark"] .action-dropdown-btn {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-primary) !important;
}

[data-theme="dark"] .action-dropdown-btn:hover {
    background-color: var(--accent-primary) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .action-dropdown-menu {
    background-color: var(--bg-card) !important;
    border-color: var(--border-primary) !important;
    box-shadow: var(--shadow-lg) !important;
}

[data-theme="dark"] .dropdown-item {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .dropdown-item:hover {
    background-color: var(--bg-tertiary) !important;
}

[data-theme="dark"] .dropdown-item-approve {
    color: var(--accent-success) !important;
}

[data-theme="dark"] .dropdown-item-reject {
    color: var(--accent-danger) !important;
}

/* Buttons in Tables */
[data-theme="dark"] .btn-primary {
    background-color: var(--accent-primary) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .btn-success {
    background-color: var(--accent-success) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .btn-danger {
    background-color: var(--accent-danger) !important;
    color: #ffffff !important;
}

/* Cards containing tables */
[data-theme="dark"] .card {
    background-color: var(--bg-card) !important;
    border-color: var(--border-primary) !important;
}

[data-theme="dark"] .card-body {
    background-color: var(--bg-card) !important;
}

/* Form controls in tables/filters */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background-color: var(--bg-input) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-primary) !important;
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    border-color: var(--accent-success) !important;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2) !important;
}

/* Alert boxes */
[data-theme="dark"] .alert {
    background-color: var(--bg-card) !important;
    border-color: var(--border-primary) !important;
}

[data-theme="dark"] .alert-danger {
    background-color: rgba(248, 113, 113, 0.1) !important;
    border-color: var(--accent-danger) !important;
    color: var(--accent-danger) !important;
}

[data-theme="dark"] .alert-success {
    background-color: rgba(52, 211, 153, 0.1) !important;
    border-color: var(--accent-success) !important;
    color: var(--accent-success) !important;
}

/* Table wrapper/container */
[data-theme="dark"] .table-responsive {
    background-color: var(--datatable-bg) !important;
}

/* Hover states for all clickable elements */
/* Exclude gradient action buttons - they keep white text */
[data-theme="dark"] a:hover:not(.from-blue-500):not(.from-green-500):not(.from-red-500):not(.from-purple-500):not(.from-amber-500):not(.from-orange-500):not(.from-yellow-500):not(.from-emerald-500):not(.from-indigo-500) {
    color: var(--accent-primary) !important;
}

/* Gradient action button hover states - preserve gradient + white text */
[data-theme="dark"] a.from-blue-500:hover,
[data-theme="dark"] a.from-green-500:hover,
[data-theme="dark"] a.from-red-500:hover,
[data-theme="dark"] a.from-purple-500:hover,
[data-theme="dark"] a.from-amber-500:hover,
[data-theme="dark"] a.from-orange-500:hover,
[data-theme="dark"] a.from-yellow-500:hover,
[data-theme="dark"] a.from-emerald-500:hover,
[data-theme="dark"] a.from-indigo-500:hover {
    color: #ffffff !important;
    opacity: 0.9;
}

[data-theme="dark"] button:hover {
    opacity: 0.9;
}

/* Primary color text */
[data-theme="dark"] .text-primary-600,
[data-theme="dark"] .text-primary-700 {
    color: var(--accent-primary) !important;
}

/* Green/success text */
[data-theme="dark"] .text-green-600,
[data-theme="dark"] .text-green-700 {
    color: var(--accent-success) !important;
}

/* Red/danger text */
[data-theme="dark"] .text-red-600,
[data-theme="dark"] .text-red-700 {
    color: var(--accent-danger) !important;
}

/* Blue text */
[data-theme="dark"] .text-blue-600,
[data-theme="dark"] .text-blue-700 {
    color: var(--accent-primary) !important;
}

/* Primary backgrounds */
[data-theme="dark"] .bg-primary-100 {
    background-color: rgba(96, 165, 250, 0.2) !important;
    color: var(--accent-primary) !important;
}

[data-theme="dark"] .bg-primary-600 {
    background-color: var(--accent-primary) !important;
    color: #ffffff !important;
}

/* Red backgrounds - but NOT gradient buttons (those use background shorthand above) */
[data-theme="dark"] .bg-red-500:not(.bg-gradient-to-r),
[data-theme="dark"] .bg-red-600:not(.bg-gradient-to-r) {
    background-color: var(--accent-danger) !important;
    color: #ffffff !important;
}

/* Scrollbar styling for dark mode */
[data-theme="dark"] ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--border-secondary);
    border-radius: 4px;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ========================================
   PAGE-SPECIFIC TABLE OVERRIDES
   ======================================== */

/* Loan Request Table - Dark Mode Override */
[data-theme="dark"] #loanrequest-table thead th {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%) !important;
    color: var(--text-primary) !important;
    border-bottom: 2px solid var(--datatable-border) !important;
}

[data-theme="dark"] #loanrequest-table tbody tr {
    background: var(--datatable-bg) !important;
    border-bottom: 1px solid var(--datatable-border) !important;
}

[data-theme="dark"] #loanrequest-table tbody tr:hover {
    background: var(--datatable-row-hover) !important;
    box-shadow: -4px 0 0 0 var(--accent-success), 0 2px 8px rgba(52, 211, 153, 0.1) !important;
    transform: translateX(4px) !important;
}

[data-theme="dark"] #loanrequest-table tbody td {
    color: var(--text-primary) !important;
    border-color: var(--datatable-border) !important;
}

/* Fix dropdown-open state for loan table */
[data-theme="dark"] body.dropdown-open #loanrequest-table tbody tr:hover {
    background: var(--datatable-bg) !important;
}

[data-theme="dark"] body.dropdown-open #loanrequest-table tbody tr:has(.action-dropdown.open):hover {
    background: var(--datatable-row-hover) !important;
}

/* ========================================
   NAVBAR DROPDOWN FIXES
   ======================================== */

/* FSA Rankings & other nav dropdowns - Dark Mode */
[data-theme="dark"] nav .group:hover .dropdown-menu,
[data-theme="dark"] nav .dropdown-menu {
    background-color: var(--bg-card) !important;
    border-color: var(--border-primary) !important;
}

[data-theme="dark"] nav .dropdown-menu a {
    color: var(--text-primary) !important;
}

[data-theme="dark"] nav .dropdown-menu a:hover {
    background-color: var(--bg-tertiary) !important;
    color: var(--accent-primary) !important;
}

[data-theme="dark"] nav .dropdown-menu a:hover span {
    color: var(--accent-primary) !important;
}

[data-theme="dark"] nav .dropdown-menu a:hover svg {
    stroke: var(--accent-primary) !important;
}

[data-theme="dark"] nav .dropdown-menu a.nav-item-trash,
[data-theme="dark"] nav .dropdown-menu a.text-red-600,
.dark nav .dropdown-menu a.nav-item-trash {
    color: #f87171 !important;
}
[data-theme="dark"] nav .dropdown-menu a.nav-item-trash svg,
[data-theme="dark"] nav .dropdown-menu a.text-red-600 svg,
.dark nav .dropdown-menu a.nav-item-trash svg {
    color: #f87171 !important;
    stroke: #f87171 !important;
}
[data-theme="dark"] nav .dropdown-menu a.nav-item-trash span,
[data-theme="dark"] nav .dropdown-menu a.text-red-600 span,
.dark nav .dropdown-menu a.nav-item-trash span {
    color: #f87171 !important;
}
[data-theme="dark"] nav .dropdown-menu a.nav-item-trash:hover,
.dark nav .dropdown-menu a.nav-item-trash:hover {
    background-color: rgba(225, 29, 72, 0.15) !important;
    color: #fca5a5 !important;
}
[data-theme="dark"] nav .dropdown-menu a.nav-item-trash:hover svg,
.dark nav .dropdown-menu a.nav-item-trash:hover svg {
    color: #fca5a5 !important;
    stroke: #fca5a5 !important;
}
[data-theme="dark"] nav .dropdown-menu a.nav-item-trash:hover span,
.dark nav .dropdown-menu a.nav-item-trash:hover span {
    color: #fca5a5 !important;
}

/* Nav button hover states */
[data-theme="dark"] nav button:hover {
    color: var(--accent-primary) !important;
}

[data-theme="dark"] nav .hover\:bg-primary-50:hover {
    background-color: var(--bg-tertiary) !important;
}

[data-theme="dark"] nav .hover\:text-primary-600:hover {
    color: var(--accent-primary) !important;
}

/* ========================================
   SPOTCASH APPROVAL TABLE
   ======================================== */

[data-theme="dark"] #spotcash-approval-table thead th {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%) !important;
    color: var(--text-primary) !important;
    border-bottom: 2px solid var(--datatable-border) !important;
}

[data-theme="dark"] #spotcash-approval-table tbody tr {
    background: var(--datatable-bg) !important;
}

[data-theme="dark"] #spotcash-approval-table tbody tr:hover {
    background: var(--datatable-row-hover) !important;
}

[data-theme="dark"] #spotcash-approval-table tbody td {
    color: var(--text-primary) !important;
    border-color: var(--datatable-border) !important;
}

/* ========================================
   LOAN MONITORING TABLE
   ======================================== */

[data-theme="dark"] #loanMonitoringTable thead th {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%) !important;
    color: var(--text-primary) !important;
    border-bottom: 2px solid var(--datatable-border) !important;
}

[data-theme="dark"] #loanMonitoringTable tbody tr {
    background: var(--datatable-bg) !important;
}

[data-theme="dark"] #loanMonitoringTable tbody tr:hover {
    background: var(--datatable-row-hover) !important;
}

[data-theme="dark"] #loanMonitoringTable tbody td {
    color: var(--text-primary) !important;
    border-color: var(--datatable-border) !important;
}



/* ========================================
   ALL TABLES - UNIVERSAL DARK MODE
   ======================================== */

/* Any table with custom header gradients */
[data-theme="dark"] table thead th[style*="background: linear-gradient"],
[data-theme="dark"] table thead th[style*="background:linear-gradient"] {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%) !important;
    color: var(--text-primary) !important;
}

/* Any table with white backgrounds */
[data-theme="dark"] table tbody tr[style*="background: white"],
[data-theme="dark"] table tbody tr[style*="background:white"],
[data-theme="dark"] table tbody tr[style*="background: #fff"],
[data-theme="dark"] table tbody tr[style*="background:#fff"] {
    background: var(--datatable-bg) !important;
}

/* Any table with purple hover */
[data-theme="dark"] table tbody tr[style*="background: #faf5ff"],
[data-theme="dark"] table tbody tr[style*="background:#faf5ff"],
[data-theme="dark"] table tbody tr[style*="#9333ea"] {
    box-shadow: -4px 0 0 0 var(--accent-success), 0 2px 8px rgba(52, 211, 153, 0.1) !important;
}

/* ========================================
   BLUE TEXT/BORDERS - DARK MODE
   ======================================== */

[data-theme="dark"] .text-blue-800 {
    color: var(--accent-primary) !important;
}

[data-theme="dark"] .border-blue-300 {
    border-color: var(--accent-primary) !important;
}

[data-theme="dark"] .bg-blue-300 {
    background-color: rgba(96, 165, 250, 0.3) !important;
}

/* ========================================
   ACTION DROPDOWN FIXES (client.css override)
   ======================================== */

/* Fix for action dropdown menu - override hardcoded white */
[data-theme="dark"] .action-dropdown-menu {
    background-color: var(--bg-card) !important;
    border-color: var(--border-primary) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .action-dropdown-menu.show {
    background-color: var(--bg-card) !important;
}

/* Fix dropdown items - override hardcoded white backgrounds */
[data-theme="dark"] .dropdown-item {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .dropdown-item:hover {
    background-color: var(--bg-tertiary) !important;
    color: var(--accent-primary) !important;
}

[data-theme="dark"] .dropdown-item:focus {
    background-color: var(--bg-tertiary) !important;
    color: var(--accent-primary) !important;
}

/* Disabled dropdown items in dark mode */
[data-theme="dark"] .dropdown-item.disabled {
    background-color: var(--bg-card) !important;
    color: var(--text-light) !important;
}

[data-theme="dark"] .dropdown-item.disabled:hover {
    background-color: var(--bg-card) !important;
    color: var(--text-light) !important;
}

/* Danger/Reject dropdown items */
[data-theme="dark"] .dropdown-item-danger:hover {
    background-color: rgba(248, 113, 113, 0.15) !important;
    color: var(--accent-danger) !important;
}

[data-theme="dark"] .dropdown-item-danger:focus {
    background-color: rgba(248, 113, 113, 0.15) !important;
    color: var(--accent-danger) !important;
}

/* Approve dropdown items */
[data-theme="dark"] .dropdown-item-approve:hover {
    background-color: rgba(52, 211, 153, 0.15) !important;
    color: var(--accent-success) !important;
}

/* Reject dropdown items */
[data-theme="dark"] .dropdown-item-reject:hover {
    background-color: rgba(248, 113, 113, 0.15) !important;
    color: var(--accent-danger) !important;
}

/* Ensure open dropdown row stacks on top of subsequent table rows */
tbody tr:has(.action-dropdown.open),
tbody tr.dropdown-active {
    position: relative !important;
    z-index: 50 !important;
}

tbody tr:has(.action-dropdown.open) td,
tbody tr.dropdown-active td {
    position: relative !important;
    z-index: 50 !important;
}

.action-dropdown.open {
    position: relative !important;
    z-index: 100 !important;
}

.action-dropdown.open .action-dropdown-menu,
.action-dropdown-menu.show {
    position: absolute !important;
    z-index: 110 !important;
}

/* Action Dropdown Buttons in Dark Mode */
.dark .action-dropdown-btn,
[data-theme="dark"] .action-dropdown-btn {
    background: rgba(30, 41, 59, 0.8) !important;
    border: 1.5px solid #0891b2 !important;
    border-radius: 0.5rem !important;
    color: #cbd5e1 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
    transition: all 0.2s ease !important;
}

.dark .action-dropdown-btn:hover,
[data-theme="dark"] .action-dropdown-btn:hover,
.dark .action-dropdown.open .action-dropdown-btn,
[data-theme="dark"] .action-dropdown.open .action-dropdown-btn {
    background: rgba(14, 165, 233, 0.25) !important;
    border-color: #06b6d4 !important;
    color: #ffffff !important;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.3) !important;
}

/* Fix dropdown menu for dark mode */
[data-theme="dark"] .action-dropdown-menu,
.dark .action-dropdown-menu,
[data-theme="dark"] body.dropdown-open .action-dropdown.open .action-dropdown-menu {
    background-color: #1e293b !important;
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6), 0 8px 10px -6px rgba(0, 0, 0, 0.6) !important;
    padding: 0.25rem !important;
}

[data-theme="dark"] .action-dropdown-menu .dropdown-item,
.dark .action-dropdown-menu .dropdown-item {
    background-color: transparent !important;
    background: transparent !important;
    color: #cbd5e1 !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0.375rem !important;
    padding: 0.5rem 0.75rem !important;
    margin: 0.125rem 0 !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.625rem !important;
}

[data-theme="dark"] .action-dropdown-menu .dropdown-item:hover,
.dark .action-dropdown-menu .dropdown-item:hover {
    background-color: #059669 !important;
    background: #059669 !important;
    color: #ffffff !important;
    box-shadow: none !important;
    border: none !important;
}

[data-theme="dark"] .action-dropdown-menu .dropdown-item-danger:hover,
.dark .action-dropdown-menu .dropdown-item-danger:hover {
    background-color: rgba(220, 38, 38, 0.2) !important;
    background: rgba(220, 38, 38, 0.2) !important;
    color: #f87171 !important;
    box-shadow: none !important;
    border: none !important;
}

/* Fix table row hover when dropdown is open in dark mode */
[data-theme="dark"] body.dropdown-open #common_dataTable tbody tr:hover,
[data-theme="dark"] body.dropdown-open #firstPaymentTable tbody tr:hover,
[data-theme="dark"] body.dropdown-open #verifyListTable tbody tr:hover,
[data-theme="dark"] body.dropdown-open #spotcash-approval-table tbody tr:hover,
[data-theme="dark"] body.dropdown-open #loanrequest-table tbody tr:hover {
    background-color: var(--datatable-bg) !important;
}

[data-theme="dark"] body.dropdown-open #common_dataTable tbody tr:has(.action-dropdown.open):hover,
[data-theme="dark"] body.dropdown-open #firstPaymentTable tbody tr:has(.action-dropdown.open):hover,
[data-theme="dark"] body.dropdown-open #verifyListTable tbody tr:has(.action-dropdown.open):hover,
[data-theme="dark"] body.dropdown-open #spotcash-approval-table tbody tr:has(.action-dropdown.open):hover,
[data-theme="dark"] body.dropdown-open #loanrequest-table tbody tr:has(.action-dropdown.open):hover {
    background-color: var(--datatable-row-hover) !important;
}

/* ========================================
   CLIENT HOME PAGE - INFORMATION SECTIONS
   ======================================== */

/* Client name banner - gradient background */
[data-theme="dark"] .bg-gradient-to-r.from-gray-50.to-gray-100 {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%) !important;
    border-color: var(--border-primary) !important;
}

/* Information section backgrounds - scoped to client home cards */
[data-theme="dark"] .client-info-card .bg-gray-50,
[data-theme="dark"] .client-home-info .bg-gray-50 {
    background-color: var(--bg-tertiary) !important;
}

/* Section titles */
[data-theme="dark"] .text-gray-700 {
    color: var(--text-primary) !important;
}

/* Content text */
[data-theme="dark"] .text-gray-900 {
    color: var(--text-primary) !important;
}

/* Label text */
[data-theme="dark"] .text-gray-500 {
    color: var(--text-muted) !important;
}

/* Borders between items */
[data-theme="dark"] .border-gray-200 {
    border-color: var(--border-primary) !important;
}

/* Icon & Category badges */
[data-theme="dark"] .bg-indigo-100,
.dark .bg-indigo-100 {
    background-color: rgba(96, 165, 250, 0.2) !important;
}

[data-theme="dark"] .text-indigo-600 {
    color: var(--accent-primary) !important;
}

[data-theme="dark"] .text-indigo-700 {
    color: #93c5fd !important;
}

[data-theme="dark"] .text-indigo-800,
.dark .text-indigo-800 {
    color: #e0e7ff !important;
}

[data-theme="dark"] .bg-indigo-100.text-indigo-800,
.dark .bg-indigo-100.text-indigo-800 {
    background-color: rgba(99, 102, 241, 0.32) !important;
    color: #e0e7ff !important;
    border: 1px solid rgba(129, 140, 248, 0.5) !important;
}

[data-theme="dark"] .bg-cyan-100.text-cyan-800,
.dark .bg-cyan-100.text-cyan-800 {
    background-color: rgba(6, 182, 212, 0.26) !important;
    color: #cffafe !important;
    border: 1px solid rgba(34, 211, 238, 0.45) !important;
}

[data-theme="dark"] .bg-violet-100.text-violet-800,
.dark .bg-violet-100.text-violet-800 {
    background-color: rgba(139, 92, 246, 0.3) !important;
    color: #ede9fe !important;
    border: 1px solid rgba(167, 139, 250, 0.48) !important;
}

[data-theme="dark"] .bg-sky-100.text-sky-800,
.dark .bg-sky-100.text-sky-800 {
    background-color: rgba(14, 165, 233, 0.28) !important;
    color: #e0f2fe !important;
    border: 1px solid rgba(56, 189, 248, 0.48) !important;
}

[data-theme="dark"] .bg-teal-100.text-teal-800,
.dark .bg-teal-100.text-teal-800 {
    background-color: rgba(20, 184, 166, 0.26) !important;
    color: #ccfbf1 !important;
    border: 1px solid rgba(45, 212, 191, 0.45) !important;
}

[data-theme="dark"] .bg-emerald-100.text-emerald-800,
.dark .bg-emerald-100.text-emerald-800 {
    background-color: rgba(16, 185, 129, 0.26) !important;
    color: #d1fae5 !important;
    border: 1px solid rgba(52, 211, 153, 0.45) !important;
}

[data-theme="dark"] .text-violet-800,
.dark .text-violet-800 {
    color: #ddd6fe !important;
}

[data-theme="dark"] .text-sky-800,
.dark .text-sky-800 {
    color: #bae6fd !important;
}

[data-theme="dark"] .text-teal-800,
.dark .text-teal-800 {
    color: #99f6e4 !important;
}

[data-theme="dark"] .text-emerald-800,
.dark .text-emerald-800 {
    color: #a7f3d0 !important;
}

/* Purple badges */
[data-theme="dark"] .bg-purple-100 {
    background-color: rgba(167, 139, 250, 0.2) !important;
}

[data-theme="dark"] .text-purple-700 {
    color: #c4b5fd !important;
}

/* Status badges in client info */
[data-theme="dark"] .bg-gray-200.text-gray-700 {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .bg-gray-200 .bg-gray-500 {
    background-color: var(--text-muted) !important;
}

/* ========================================
   COLOURED SECTIONS - ORANGE/YELLOW/PINK
   ======================================== */

/* Home Address - Orange theme */
[data-theme="dark"] .bg-orange-50 {
    background-color: rgba(251, 146, 60, 0.15) !important;
}

[data-theme="dark"] .border-orange-100 {
    border-color: rgba(251, 146, 60, 0.3) !important;
}

[data-theme="dark"] .text-orange-500 {
    color: #fb923c !important;
}

/* Collection Details - Yellow theme */
[data-theme="dark"] .bg-yellow-50 {
    background-color: rgba(250, 204, 21, 0.15) !important;
}

[data-theme="dark"] .border-yellow-200 {
    border-color: rgba(250, 204, 21, 0.3) !important;
}

[data-theme="dark"] .text-yellow-500 {
    color: #facc15 !important;
}

[data-theme="dark"] .text-yellow-600 {
    color: #eab308 !important;
}

/* Beneficiaries - Pink theme */
[data-theme="dark"] .bg-pink-50 {
    background-color: rgba(236, 72, 153, 0.15) !important;
}

[data-theme="dark"] .border-pink-200 {
    border-color: rgba(236, 72, 153, 0.3) !important;
}

[data-theme="dark"] .text-pink-500 {
    color: #ec4899 !important;
}

[data-theme="dark"] .text-pink-600 {
    color: #db2777 !important;
}

/* Red themed icons/text */
[data-theme="dark"] .text-red-500 {
    color: #f87171 !important;
}

/* ========================================
   LOAN REQUEST PAGE - COLORED CARDS
   ======================================== */

/* Header card - Slate theme */
[data-theme="dark"] .bg-gradient-to-br.from-slate-50.to-slate-100 {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%) !important;
}

/* Signature images - always dark black/slate ink on crisp white paper */
#waiverSignatureOverPrinted,
.loan-waiver-signature-image,
.staff-signature-preview-image {
    filter: brightness(0) saturate(100%) !important;
}

.dark #waiverSignatureOverPrinted,
[data-theme="dark"] #waiverSignatureOverPrinted,
.dark .loan-waiver-signature-image,
[data-theme="dark"] .loan-waiver-signature-image,
.dark .staff-signature-preview-image,
[data-theme="dark"] .staff-signature-preview-image {
    filter: brightness(0) saturate(100%) !important;
}

/* Loan request waiver & staff signature preview box - keep crisp white paper in dark mode */
.dark .loan-waiver-signature-box,
[data-theme="dark"] .loan-waiver-signature-box,
.dark .staff-signature-preview-box,
[data-theme="dark"] .staff-signature-preview-box {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
}

.dark #signatureModalSurface,
[data-theme="dark"] #signatureModalSurface,
.dark #policySignatureModalSurface,
[data-theme="dark"] #policySignatureModalSurface {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
}

/* Signature Pad Modal Container & Header in Dark Mode */
.dark #signaturePadModal .bg-white,
[data-theme="dark"] #signaturePadModal .bg-white,
.dark #policySignaturePadModal .bg-white,
[data-theme="dark"] #policySignaturePadModal .bg-white {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
}

.dark #signaturePadModal .border-b,
[data-theme="dark"] #signaturePadModal .border-b,
.dark #policySignaturePadModal .border-b,
[data-theme="dark"] #policySignaturePadModal .border-b {
    border-color: var(--border-primary) !important;
}

.dark #signaturePadModal h3,
[data-theme="dark"] #signaturePadModal h3,
.dark #policySignaturePadModal h3,
[data-theme="dark"] #policySignaturePadModal h3 {
    color: var(--text-primary) !important;
}

/* Explicit button styling for all Signature Pad Modals */
[data-theme="dark"] #signaturePadModal button.bg-gray-200,
[data-theme="dark"] #signaturePadModal button.bg-gray-100,
[data-theme="dark"] #policySignaturePadModal button.bg-gray-200,
[data-theme="dark"] #policySignaturePadModal button.bg-gray-100,
.dark #signaturePadModal button.bg-gray-200,
.dark #signaturePadModal button.bg-gray-100,
.dark #policySignaturePadModal button.bg-gray-200,
.dark #policySignaturePadModal button.bg-gray-100 {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-secondary) !important;
}

[data-theme="dark"] .border-slate-200 {
    border-color: var(--border-primary) !important;
}

[data-theme="dark"] .text-gray-800 {
    color: var(--text-primary) !important;
}

/* Indigo cards - Tier/Loan Term */
[data-theme="dark"] .bg-gradient-to-br.from-indigo-50.to-indigo-100 {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.15) 0%, rgba(96, 165, 250, 0.25) 100%) !important;
}

[data-theme="dark"] .border-indigo-200 {
    border-color: rgba(96, 165, 250, 0.3) !important;
}

[data-theme="dark"] .text-indigo-900 {
    color: #bfdbfe !important;
}

[data-theme="dark"] .bg-indigo-200 {
    background-color: rgba(96, 165, 250, 0.3) !important;
}

/* Blue cards - Loanable Amount */
[data-theme="dark"] .bg-gradient-to-br.from-blue-50.to-blue-100 {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0.25) 100%) !important;
}

[data-theme="dark"] .border-blue-200 {
    border-color: rgba(59, 130, 246, 0.3) !important;
}

[data-theme="dark"] .text-blue-600 {
    color: #60a5fa !important;
}

[data-theme="dark"] .text-blue-900 {
    color: #bfdbfe !important;
}

[data-theme="dark"] .bg-blue-200 {
    background-color: rgba(59, 130, 246, 0.3) !important;
}

/* Emerald cards - Net Amount */
[data-theme="dark"] .bg-gradient-to-br.from-emerald-50.to-emerald-100 {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.25) 100%) !important;
}

[data-theme="dark"] .border-emerald-200 {
    border-color: rgba(16, 185, 129, 0.3) !important;
}

[data-theme="dark"] .text-emerald-600 {
    color: #34d399 !important;
}

[data-theme="dark"] .text-emerald-900 {
    color: #a7f3d0 !important;
}

/* ========================================
/* ========================================================
   STANDARDIZED NUMBER INPUT STEPPER COMPONENT
   ======================================================== */

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

input[type="number"] {
    -moz-appearance: textfield !important;
    appearance: textfield !important;
}

/* Dedicated Stepper Wrapper */
.stepper-input-wrapper {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    width: 90px !important;
    min-width: 90px !important;
    max-width: 90px !important;
    flex-shrink: 0 !important;
}

.stepper-input-wrapper input[type="number"],
.stepper-input-wrapper input {
    width: 100% !important;
    padding-left: 8px !important;
    padding-right: 28px !important;
    text-align: center !important;
    -moz-appearance: textfield !important;
    appearance: textfield !important;
}

/* Mobile responsive stepper width & paddings */
@media (max-width: 640px) {
    .stepper-input-wrapper.client-stepper,
    .client-stepper {
        width: 74px !important;
        min-width: 74px !important;
        max-width: 74px !important;
    }
    .stepper-input-wrapper.client-stepper input,
    .client-stepper input {
        padding-left: 4px !important;
        padding-right: 20px !important;
        font-size: 13px !important;
    }
    .client-stepper .custom-stepper {
        right: 3px !important;
    }
}

/* Global Clean Transparent Custom Stepper Chevrons - STRICTLY PINNED RIGHT */
.custom-stepper {
    position: absolute !important;
    top: 0 !important;
    bottom: 0 !important;
    right: 6px !important;
    left: auto !important;
    width: 18px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 1px !important;
    pointer-events: none !important;
    z-index: 10 !important;
}

.custom-stepper.hidden {
    display: none !important;
}

.stepper-arrow {
    pointer-events: auto !important;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 2px !important;
    margin: 0 !important;
    width: 18px !important;
    height: 14px !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    color: #94a3b8 !important;
    opacity: 0.75 !important;
    transition: opacity 0.15s ease, color 0.15s ease, transform 0.1s ease !important;
}

.stepper-arrow:hover {
    opacity: 1 !important;
    color: #059669 !important;
    transform: scale(1.2) !important;
}

[data-theme="dark"] .stepper-arrow:hover,
.dark .stepper-arrow:hover {
    color: #34d399 !important;
}

.client-stepper .stepper-arrow:hover {
    color: #2563eb !important;
}

[data-theme="dark"] .client-stepper .stepper-arrow:hover,
.dark .client-stepper .stepper-arrow:hover {
    color: #60a5fa !important;
}

.stepper-arrow:active {
    transform: scale(0.9) !important;
}

.stepper-arrow svg {
    width: 11px !important;
    height: 11px !important;
    stroke-width: 2.5 !important;
    display: block !important;
}

/* Fix white background on number inputs in dark mode */
[data-theme="dark"] input[type="number"].bg-white,
[data-theme="dark"] input[type="number"][class*="bg-white"],
.dark input[type="number"].bg-white,
.dark input[type="number"][class*="bg-white"] {
    background-color: #1e293b !important;
    background: #1e293b !important;
}

[data-theme="dark"] .text-emerald-500 {
    color: #6ee7b7 !important;
}

[data-theme="dark"] .bg-emerald-200 {
    background-color: rgba(16, 185, 129, 0.3) !important;
}

/* Purple cards - Monthly Due */
[data-theme="dark"] .bg-gradient-to-br.from-purple-50.to-purple-100 {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(139, 92, 246, 0.25) 100%) !important;
}

[data-theme="dark"] .border-purple-200 {
    border-color: rgba(139, 92, 246, 0.3) !important;
}

[data-theme="dark"] .text-purple-600 {
    color: #a78bfa !important;
}

[data-theme="dark"] .text-purple-900 {
    color: #ddd6fe !important;
}

[data-theme="dark"] .text-purple-500 {
    color: #c4b5fd !important;
}

[data-theme="dark"] .bg-purple-200 {
    background-color: rgba(139, 92, 246, 0.3) !important;
}

/* Amber cards - Interest/Processing Fee */
[data-theme="dark"] .bg-gradient-to-br.from-amber-50.to-amber-100 {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.25) 100%) !important;
}

[data-theme="dark"] .border-amber-200 {
    border-color: rgba(245, 158, 11, 0.3) !important;
}

[data-theme="dark"] .text-amber-600 {
    color: #fbbf24 !important;
}

[data-theme="dark"] .text-amber-900 {
    color: #fde68a !important;
}

[data-theme="dark"] .text-amber-500 {
    color: #fcd34d !important;
}

[data-theme="dark"] .bg-amber-200 {
    background-color: rgba(245, 158, 11, 0.3) !important;
}

/* Red cards - Total Repayable */
[data-theme="dark"] .bg-gradient-to-br.from-red-50.to-red-100 {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.25) 100%) !important;
}

[data-theme="dark"] .border-red-200 {
    border-color: rgba(239, 68, 68, 0.3) !important;
}

[data-theme="dark"] .text-red-600 {
    color: #f87171 !important;
}

[data-theme="dark"] .text-red-900 {
    color: #fecaca !important;
}

[data-theme="dark"] .bg-red-200 {
    background-color: rgba(239, 68, 68, 0.3) !important;
}

/* Green cards - Status */
[data-theme="dark"] .bg-gradient-to-br.from-green-50.to-green-100 {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(34, 197, 94, 0.25) 100%) !important;
}

[data-theme="dark"] .border-green-200 {
    border-color: rgba(34, 197, 94, 0.3) !important;
}

[data-theme="dark"] .text-green-600 {
    color: #4ade80 !important;
}

[data-theme="dark"] .bg-green-200 {
    background-color: rgba(34, 197, 94, 0.3) !important;
}

/* Amber tier badge */
[data-theme="dark"] .bg-amber-100 {
    background-color: rgba(251, 191, 36, 0.2) !important;
}

[data-theme="dark"] .text-amber-800 {
    color: #fbbf24 !important;
}

/* Tier Badge Classes */
[data-theme="dark"] .tier-badge-silver,
.dark .tier-badge-silver {
    background: #374151 !important;
    color: #f9fafb !important;
    border: 1px solid #4b5563 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .tier-badge-bronze,
.dark .tier-badge-bronze {
    background: rgba(180, 83, 9, 0.25) !important;
    color: #fde68a !important;
    border: 1px solid rgba(245, 158, 11, 0.4) !important;
}

[data-theme="dark"] .tier-badge-gold,
.dark .tier-badge-gold {
    background: rgba(234, 179, 8, 0.25) !important;
    color: #fef08a !important;
    border: 1px solid rgba(234, 179, 8, 0.4) !important;
}

/* ========================================
   CLIENT-VIEW & ADDLOANPAYMENT PAGES
   ======================================== */

/* Purple to Indigo gradient header */
[data-theme="dark"] .bg-gradient-to-r.from-purple-50.to-indigo-50 {
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.15) 0%, rgba(96, 165, 250, 0.15) 100%) !important;
}

/* Indigo to Purple gradient (advance payment preview) */
[data-theme="dark"] .bg-gradient-to-r.from-indigo-50.to-purple-50 {
    background: linear-gradient(90deg, rgba(96, 165, 250, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%) !important;
}

/* Orange to Red gradient card (remaining balance) */
[data-theme="dark"] .bg-gradient-to-br.from-orange-50.to-red-100 {
    background: linear-gradient(135deg, rgba(251, 146, 60, 0.15) 0%, rgba(239, 68, 68, 0.2) 100%) !important;
}

[data-theme="dark"] .border-orange-200 {
    border-color: rgba(251, 146, 60, 0.3) !important;
}

[data-theme="dark"] .text-orange-600 {
    color: #fb923c !important;
}

[data-theme="dark"] .text-orange-900 {
    color: #fed7aa !important;
}

[data-theme="dark"] .bg-orange-200 {
    background-color: rgba(251, 146, 60, 0.3) !important;
}

/* Green themed text for headers */
[data-theme="dark"] .text-green-800 {
    color: #86efac !important;
}

/* ========================================
   FORM CONTAINERS & INPUTS
   ======================================== */

/* Form card backgrounds */
[data-theme="dark"] .bg-white.rounded-xl.shadow-lg {
    background-color: var(--bg-card) !important;
}

/* Dropdown suggestions */
[data-theme="dark"] .hover\:bg-purple-50:hover {
    background-color: rgba(139, 92, 246, 0.15) !important;
}

/* Input fields */
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] select,
.dark input[type="text"],
.dark input[type="number"],
.dark input[type="date"],
.dark select {
    background-color: var(--bg-input, #1e293b) !important;
    border-color: #475569 !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] input[type="text"]:focus,
[data-theme="dark"] input[type="number"]:focus,
[data-theme="dark"] input[type="date"]:focus,
[data-theme="dark"] select:focus,
.dark input[type="text"]:focus,
.dark input[type="number"]:focus,
.dark input[type="date"]:focus,
.dark select:focus {
    border-color: #34d399 !important;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.35) !important;
}

[data-theme="dark"] input::placeholder {
    color: var(--text-muted) !important;
}

/* Form labels */
[data-theme="dark"] .text-gray-400 {
    color: var(--text-muted) !important;
}

/* Dropdown autocomplete lists */
[data-theme="dark"] .bg-white.border.border-gray-300.rounded-lg.shadow-lg {
    background-color: var(--bg-card) !important;
    border-color: var(--border-primary) !important;
}

/* ========================================
   PAYMENT FORM SPECIFIC FIXES
   ======================================== */

/* Payment form card header */
[data-theme="dark"] .bg-gray-50.border-b {
    background-color: var(--bg-tertiary) !important;
    border-color: var(--border-primary) !important;
}

/* Payment form inner content area */
[data-theme="dark"] .bg-white.rounded-xl.shadow-lg .p-6 {
    background-color: var(--bg-card) !important;
}

/* Payment suggestions dropdown items */
[data-theme="dark"] .hover\:bg-purple-50:hover {
    background-color: rgba(139, 92, 246, 0.15) !important;
    color: var(--text-primary) !important;
}

/* ========================================
   LOAN REQUEST - REMAINING BALANCE & PAYMENT PROGRESS
   ======================================== */

/* Remaining Balance Card - Orange gradient */
[data-theme="dark"] .bg-gradient-to-br.from-orange-50.to-orange-100 {
    background: linear-gradient(to bottom right, rgba(249, 115, 22, 0.15), rgba(249, 115, 22, 0.25)) !important;
    border-color: rgba(249, 115, 22, 0.4) !important;
}

/* Orange text in Remaining Balance card */
[data-theme="dark"] .text-orange-600 {
    color: #fb923c !important;
}

[data-theme="dark"] .text-orange-900 {
    color: #fdba74 !important;
}

[data-theme="dark"] .text-orange-500 {
    color: #fb923c !important;
}

/* Orange icon background */
[data-theme="dark"] .bg-orange-200 {
    background-color: rgba(249, 115, 22, 0.3) !important;
}

/* Orange border in Payment Progress section */
[data-theme="dark"] .border-orange-200 {
    border-color: rgba(249, 115, 22, 0.3) !important;
}

/* Progress bar background */
[data-theme="dark"] .bg-orange-200.rounded-full.h-2 {
    background-color: rgba(249, 115, 22, 0.2) !important;
}

/* Progress bar fill */
[data-theme="dark"] .bg-orange-500.h-2 {
    background-color: #f97316 !important;
}

/* View Payment History button */
[data-theme="dark"] .bg-white\/60 {
    background-color: rgba(30, 41, 59, 0.6) !important;
    border-color: rgba(249, 115, 22, 0.3) !important;
    color: #fb923c !important;
}

[data-theme="dark"] .bg-white\/60:hover {
    background-color: rgba(30, 41, 59, 0.8) !important;
}

[data-theme="dark"] .text-orange-700 {
    color: #fb923c !important;
}

/* ========================================
   CLIENT-VIEW - LOAN PAYMENT HISTORY TABLE HOVER
   ======================================== */

/* Table row hover in payment history */
[data-theme="dark"] .hover\:bg-gray-50:hover {
    background-color: rgba(55, 65, 81, 0.5) !important;
}

/* Void payment row in dark mode */
[data-theme="dark"] .bg-red-50 {
    background-color: rgba(239, 68, 68, 0.1) !important;
}

/* Payment history table container */
[data-theme="dark"] .bg-white.rounded-lg.border.border-gray-200.overflow-hidden {
    background-color: var(--bg-card) !important;
    border-color: var(--border-primary) !important;
}

/* Payment history header */
[data-theme="dark"] .px-4.py-3.bg-gray-50.border-b {
    background-color: var(--bg-tertiary) !important;
    border-color: var(--border-primary) !important;
}

/* Table thead gradient */
[data-theme="dark"] .bg-gradient-to-r.from-purple-50.to-indigo-50 {
    background: linear-gradient(to right, rgba(139, 92, 246, 0.15), rgba(99, 102, 241, 0.15)) !important;
}

/* ========================================
   CLIENT-VIEW - TOTAL PAID GREEN CARD
   ======================================== */

/* Total Paid Card - Green gradient */
[data-theme="dark"] .bg-gradient-to-br.from-green-50.to-green-100 {
    background: linear-gradient(to bottom right, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.25)) !important;
    border-color: rgba(34, 197, 94, 0.4) !important;
}

/* Green text colors */
[data-theme="dark"] .text-green-600 {
    color: #4ade80 !important;
}

[data-theme="dark"] .text-green-900 {
    color: #86efac !important;
}

[data-theme="dark"] .text-green-500 {
    color: #4ade80 !important;
}

/* Green icon background */
[data-theme="dark"] .bg-green-200 {
    background-color: rgba(34, 197, 94, 0.3) !important;
}

/* Green border */
[data-theme="dark"] .border-green-200 {
    border-color: rgba(34, 197, 94, 0.3) !important;
}

/* ========================================
   CLIENT-VIEW - REMAINING BALANCE ORANGE-RED CARD
   ======================================== */

/* Remaining Balance Card - Orange to Red gradient */
[data-theme="dark"] .bg-gradient-to-br.from-orange-50.to-red-100 {
    background: linear-gradient(to bottom right, rgba(249, 115, 22, 0.15), rgba(239, 68, 68, 0.2)) !important;
    border-color: rgba(249, 115, 22, 0.4) !important;
}

/* ========================================
   CLIENT-ADDLOANPAYMENT - PAYMENT DETAILS HEADER
   ======================================== */

/* Payment Details header text */
[data-theme="dark"] .font-semibold.text-gray-700 {
    color: var(--text-primary) !important;
}

/* Payment Details header container */
[data-theme="dark"] .px-6.py-4.border-b.border-gray-200.bg-gray-50 {
    background-color: var(--bg-tertiary) !important;
    border-color: var(--border-primary) !important;
}

/* Form labels in payment form */
[data-theme="dark"] .text-sm.font-medium.text-gray-700 {
    color: var(--text-primary) !important;
}

/* Helper text under labels */
[data-theme="dark"] .text-xs.text-gray-500 {
    color: var(--text-muted) !important;
}

/* Payment Details h4 heading - more specific */
[data-theme="dark"] h4.font-semibold.text-gray-700 {
    color: var(--text-primary) !important;
}

/* All h4 elements in dark mode */
[data-theme="dark"] h4 {
    color: var(--text-primary) !important;
}

/* ========================================
   CLIENT-ADDLOANPAYMENT - BACK BUTTON & HEADER
   ======================================== */

/* Back button */
[data-theme="dark"] .inline-flex.items-center.px-4.py-2.bg-white.border.border-gray-300.rounded-lg {
    background-color: var(--bg-tertiary) !important;
    border-color: var(--border-primary) !important;
    color: var(--text-primary) !important;
}

/* Back button hover */
[data-theme="dark"] .inline-flex.items-center.px-4.py-2.bg-white.border.border-gray-300.rounded-lg:hover {
    background-color: var(--bg-secondary) !important;
}

/* Header section gradient */
[data-theme="dark"] .px-6.py-4.border-b.border-gray-200.bg-gradient-to-r.from-purple-50.to-indigo-50 {
    background: linear-gradient(to right, rgba(139, 92, 246, 0.15), rgba(99, 102, 241, 0.15)) !important;
    border-color: var(--border-primary) !important;
}

/* h3 heading in header */
[data-theme="dark"] h3.text-lg.font-semibold.text-gray-800 {
    color: var(--text-primary) !important;
}

/* All h3 elements */
[data-theme="dark"] h3 {
    color: var(--text-primary) !important;
}

/* Text gray-800 specifically */
[data-theme="dark"] .text-gray-800 {
    color: var(--text-primary) !important;
}

/* ========================================
   SECTION HEADERS - DARK MODE
   ======================================== */

/* Table Section Header - Green gradient override for dark mode */
[data-theme="dark"] .bg-white.rounded-xl.shadow-lg.overflow-hidden .px-6.py-4.border-b.border-gray-200.bg-gray-50,
.dark .bg-white.rounded-xl.shadow-lg.overflow-hidden .px-6.py-4.border-b.border-gray-200.bg-gray-50 {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.2) 0%, rgba(16, 185, 129, 0.3) 100%) !important;
    border-bottom: 2px solid var(--accent-success) !important;
}

[data-theme="dark"] .bg-white.rounded-xl.shadow-lg.overflow-hidden .px-6.py-4.border-b.border-gray-200.bg-gray-50 h3,
.dark .bg-white.rounded-xl.shadow-lg.overflow-hidden .px-6.py-4.border-b.border-gray-200.bg-gray-50 h3 {
    color: var(--accent-success) !important;
    text-shadow: none !important;
}

[data-theme="dark"] .bg-white.rounded-xl.shadow-lg.overflow-hidden .px-6.py-4.border-b.border-gray-200.bg-gray-50 p,
.dark .bg-white.rounded-xl.shadow-lg.overflow-hidden .px-6.py-4.border-b.border-gray-200.bg-gray-50 p {
    color: rgba(209, 250, 229, 0.85) !important;
}

/* Section Header - Indigo/Purple gradient (client-update.css) */
[data-theme="dark"] .section-header {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.4) 0%, rgba(79, 70, 229, 0.5) 100%) !important;
    color: var(--text-primary) !important;
    border-bottom: 1px solid var(--border-primary) !important;
}

/* Section header icons - keep visible in dark mode */
[data-theme="dark"] .section-header::before {
    filter: brightness(1.2);
}

/* Themed Client Card Section Headers in Dark Mode */
[data-theme="dark"] .section-header-contract,
.dark .section-header-contract {
    background: linear-gradient(to right, rgba(6, 78, 59, 0.5) 0%, rgba(13, 148, 136, 0.25) 45%, rgba(15, 23, 42, 0.75) 100%) !important;
    border-bottom-color: rgba(16, 185, 129, 0.3) !important;
    border-left: 4px solid #10b981 !important;
    border-left-color: #10b981 !important;
}
[data-theme="dark"] .section-header-payment,
.dark .section-header-payment {
    background: linear-gradient(to right, rgba(88, 28, 135, 0.5) 0%, rgba(99, 102, 241, 0.25) 45%, rgba(15, 23, 42, 0.75) 100%) !important;
    border-bottom-color: rgba(168, 85, 247, 0.3) !important;
    border-left: 4px solid #a855f7 !important;
    border-left-color: #a855f7 !important;
}
[data-theme="dark"] .section-header-personal,
.dark .section-header-personal {
    background: linear-gradient(to right, rgba(30, 58, 138, 0.5) 0%, rgba(79, 70, 229, 0.25) 45%, rgba(15, 23, 42, 0.75) 100%) !important;
    border-bottom-color: rgba(59, 130, 246, 0.3) !important;
    border-left: 4px solid #3b82f6 !important;
    border-left-color: #3b82f6 !important;
}
[data-theme="dark"] .section-header-address,
.dark .section-header-address {
    background: linear-gradient(to right, rgba(6, 78, 59, 0.5) 0%, rgba(16, 185, 129, 0.25) 45%, rgba(15, 23, 42, 0.75) 100%) !important;
    border-bottom-color: rgba(16, 185, 129, 0.3) !important;
    border-left: 4px solid #10b981 !important;
    border-left-color: #10b981 !important;
}
[data-theme="dark"] .section-header-home-address,
.dark .section-header-home-address {
    background: linear-gradient(to right, rgba(19, 78, 74, 0.5) 0%, rgba(20, 184, 166, 0.25) 45%, rgba(15, 23, 42, 0.75) 100%) !important;
    border-bottom-color: rgba(20, 184, 166, 0.3) !important;
    border-left: 4px solid #14b8a6 !important;
    border-left-color: #14b8a6 !important;
}
[data-theme="dark"] .section-header-contact,
.dark .section-header-contact {
    background: linear-gradient(to right, rgba(12, 74, 110, 0.5) 0%, rgba(14, 165, 233, 0.25) 45%, rgba(15, 23, 42, 0.75) 100%) !important;
    border-bottom-color: rgba(14, 165, 233, 0.3) !important;
    border-left: 4px solid #0ea5e9 !important;
    border-left-color: #0ea5e9 !important;
}
[data-theme="dark"] .section-header-verification,
.dark .section-header-verification {
    background: linear-gradient(to right, rgba(76, 29, 149, 0.5) 0%, rgba(139, 92, 246, 0.25) 45%, rgba(15, 23, 42, 0.75) 100%) !important;
    border-bottom-color: rgba(139, 92, 246, 0.3) !important;
    border-left: 4px solid #8b5cf6 !important;
    border-left-color: #8b5cf6 !important;
}
[data-theme="dark"] .section-header-beneficiaries,
.dark .section-header-beneficiaries {
    background: linear-gradient(to right, rgba(6, 78, 59, 0.5) 0%, rgba(16, 185, 129, 0.25) 45%, rgba(15, 23, 42, 0.75) 100%) !important;
    border-bottom-color: rgba(16, 185, 129, 0.3) !important;
    border-left: 4px solid #10b981 !important;
    border-left-color: #10b981 !important;
}

/* Icon Badges In Dark Mode */
[data-theme="dark"] .section-header-contract .w-9,
.dark .section-header-contract .w-9,
[data-theme="dark"] .section-header-address .w-9,
.dark .section-header-address .w-9,
[data-theme="dark"] .section-header-beneficiaries .w-9,
.dark .section-header-beneficiaries .w-9 {
    background-color: rgba(6, 78, 59, 0.75) !important;
    color: #6ee7b7 !important;
    border: 1px solid rgba(52, 211, 153, 0.35) !important;
}
[data-theme="dark"] .section-header-payment .w-9,
.dark .section-header-payment .w-9 {
    background-color: rgba(88, 28, 135, 0.75) !important;
    color: #d8b4fe !important;
    border: 1px solid rgba(192, 132, 252, 0.35) !important;
}
[data-theme="dark"] .section-header-personal .w-9,
.dark .section-header-personal .w-9 {
    background-color: rgba(30, 58, 138, 0.75) !important;
    color: #93c5fd !important;
    border: 1px solid rgba(96, 165, 250, 0.35) !important;
}
[data-theme="dark"] .section-header-home-address .w-9,
.dark .section-header-home-address .w-9 {
    background-color: rgba(19, 78, 74, 0.75) !important;
    color: #5eead4 !important;
    border: 1px solid rgba(45, 212, 191, 0.35) !important;
}
[data-theme="dark"] .section-header-contact .w-9,
.dark .section-header-contact .w-9 {
    background-color: rgba(12, 74, 110, 0.75) !important;
    color: #7dd3fc !important;
    border: 1px solid rgba(56, 189, 248, 0.35) !important;
}
[data-theme="dark"] .section-header-verification .w-9,
.dark .section-header-verification .w-9 {
    background-color: rgba(76, 29, 149, 0.75) !important;
    color: #c4b5fd !important;
    border: 1px solid rgba(167, 139, 250, 0.35) !important;
}

/* Themed Staff Section Headers in Dark Mode */
[data-theme="dark"] .section-header-staff-id,
.dark .section-header-staff-id {
    background: linear-gradient(to right, rgba(88, 28, 135, 0.5) 0%, rgba(99, 102, 241, 0.25) 45%, rgba(15, 23, 42, 0.75) 100%) !important;
    border-bottom-color: rgba(168, 85, 247, 0.3) !important;
    border-left: 4px solid #a855f7 !important;
    border-left-color: #a855f7 !important;
}
[data-theme="dark"] .section-header-staff-personal,
.dark .section-header-staff-personal {
    background: linear-gradient(to right, rgba(30, 58, 138, 0.5) 0%, rgba(79, 70, 229, 0.25) 45%, rgba(15, 23, 42, 0.75) 100%) !important;
    border-bottom-color: rgba(59, 130, 246, 0.3) !important;
    border-left: 4px solid #3b82f6 !important;
    border-left-color: #3b82f6 !important;
}
[data-theme="dark"] .section-header-staff-address,
.dark .section-header-staff-address {
    background: linear-gradient(to right, rgba(6, 78, 59, 0.5) 0%, rgba(16, 185, 129, 0.25) 45%, rgba(15, 23, 42, 0.75) 100%) !important;
    border-bottom-color: rgba(16, 185, 129, 0.3) !important;
    border-left: 4px solid #10b981 !important;
    border-left-color: #10b981 !important;
}
[data-theme="dark"] .section-header-staff-contact,
.dark .section-header-staff-contact {
    background: linear-gradient(to right, rgba(12, 74, 110, 0.5) 0%, rgba(14, 165, 233, 0.25) 45%, rgba(15, 23, 42, 0.75) 100%) !important;
    border-bottom-color: rgba(14, 165, 233, 0.3) !important;
    border-left: 4px solid #0ea5e9 !important;
    border-left-color: #0ea5e9 !important;
}
[data-theme="dark"] .section-header-staff-education,
.dark .section-header-staff-education {
    background: linear-gradient(to right, rgba(120, 53, 15, 0.5) 0%, rgba(245, 158, 11, 0.25) 45%, rgba(15, 23, 42, 0.75) 100%) !important;
    border-bottom-color: rgba(245, 158, 11, 0.3) !important;
    border-left: 4px solid #f59e0b !important;
    border-left-color: #f59e0b !important;
}
[data-theme="dark"] .section-header-staff-work,
.dark .section-header-staff-work {
    background: linear-gradient(to right, rgba(49, 46, 129, 0.5) 0%, rgba(99, 102, 241, 0.25) 45%, rgba(15, 23, 42, 0.75) 100%) !important;
    border-bottom-color: rgba(99, 102, 241, 0.3) !important;
    border-left: 4px solid #6366f1 !important;
    border-left-color: #6366f1 !important;
}
[data-theme="dark"] .section-header-staff-signature,
.dark .section-header-staff-signature {
    background: linear-gradient(to right, rgba(19, 78, 74, 0.5) 0%, rgba(20, 184, 166, 0.25) 45%, rgba(15, 23, 42, 0.75) 100%) !important;
    border-bottom-color: rgba(20, 184, 166, 0.3) !important;
    border-left: 4px solid #14b8a6 !important;
    border-left-color: #14b8a6 !important;
}

/* Staff Badges In Dark Mode */
[data-theme="dark"] .section-header-staff-id .w-9,
.dark .section-header-staff-id .w-9 {
    background-color: rgba(88, 28, 135, 0.75) !important;
    color: #d8b4fe !important;
    border: 1px solid rgba(192, 132, 252, 0.35) !important;
}
[data-theme="dark"] .section-header-staff-personal .w-9,
.dark .section-header-staff-personal .w-9 {
    background-color: rgba(30, 58, 138, 0.75) !important;
    color: #93c5fd !important;
    border: 1px solid rgba(96, 165, 250, 0.35) !important;
}
[data-theme="dark"] .section-header-staff-address .w-9,
.dark .section-header-staff-address .w-9 {
    background-color: rgba(6, 78, 59, 0.75) !important;
    color: #6ee7b7 !important;
    border: 1px solid rgba(52, 211, 153, 0.35) !important;
}
[data-theme="dark"] .section-header-staff-contact .w-9,
.dark .section-header-staff-contact .w-9 {
    background-color: rgba(12, 74, 110, 0.75) !important;
    color: #7dd3fc !important;
    border: 1px solid rgba(56, 189, 248, 0.35) !important;
}
[data-theme="dark"] .section-header-staff-education .w-9,
.dark .section-header-staff-education .w-9 {
    background-color: rgba(120, 53, 15, 0.75) !important;
    color: #fde68a !important;
    border: 1px solid rgba(245, 158, 11, 0.35) !important;
}
[data-theme="dark"] .section-header-staff-work .w-9,
.dark .section-header-staff-work .w-9 {
    background-color: rgba(49, 46, 129, 0.75) !important;
    color: #a5b4fc !important;
    border: 1px solid rgba(99, 102, 241, 0.35) !important;
}
[data-theme="dark"] .section-header-staff-signature .w-9,
.dark .section-header-staff-signature .w-9 {
    background-color: rgba(19, 78, 74, 0.75) !important;
    color: #5eead4 !important;
    border: 1px solid rgba(45, 212, 191, 0.35) !important;
}

/* Themed Operational Card Section Headers in Dark Mode */
[data-theme="dark"] .section-header-expense,
.dark .section-header-expense {
    background: linear-gradient(to right, rgba(120, 53, 15, 0.5) 0%, rgba(245, 158, 11, 0.25) 45%, rgba(15, 23, 42, 0.75) 100%) !important;
    border-bottom-color: rgba(245, 158, 11, 0.3) !important;
    border-left: 4px solid #f59e0b !important;
    border-left-color: #f59e0b !important;
}
[data-theme="dark"] .section-header-deposit,
.dark .section-header-deposit {
    background: linear-gradient(to right, rgba(22, 78, 99, 0.5) 0%, rgba(6, 182, 212, 0.25) 45%, rgba(15, 23, 42, 0.75) 100%) !important;
    border-bottom-color: rgba(6, 182, 212, 0.3) !important;
    border-left: 4px solid #06b6d4 !important;
    border-left-color: #06b6d4 !important;
}
[data-theme="dark"] .section-header-bank,
.dark .section-header-bank {
    background: linear-gradient(to right, rgba(12, 74, 110, 0.5) 0%, rgba(14, 165, 233, 0.25) 45%, rgba(15, 23, 42, 0.75) 100%) !important;
    border-bottom-color: rgba(14, 165, 233, 0.3) !important;
    border-left: 4px solid #0ea5e9 !important;
    border-left-color: #0ea5e9 !important;
}
[data-theme="dark"] .section-header-batch,
.dark .section-header-batch {
    background: linear-gradient(to right, rgba(49, 46, 129, 0.5) 0%, rgba(99, 102, 241, 0.25) 45%, rgba(15, 23, 42, 0.75) 100%) !important;
    border-bottom-color: rgba(99, 102, 241, 0.3) !important;
    border-left: 4px solid #6366f1 !important;
    border-left-color: #6366f1 !important;
}

/* Operational Badges In Dark Mode */
[data-theme="dark"] .section-header-expense .w-9,
.dark .section-header-expense .w-9 {
    background-color: rgba(120, 53, 15, 0.75) !important;
    color: #fde68a !important;
    border: 1px solid rgba(245, 158, 11, 0.35) !important;
}
[data-theme="dark"] .section-header-deposit .w-9,
.dark .section-header-deposit .w-9 {
    background-color: rgba(22, 78, 99, 0.75) !important;
    color: #67e8f9 !important;
    border: 1px solid rgba(6, 182, 212, 0.35) !important;
}
[data-theme="dark"] .section-header-bank .w-9,
.dark .section-header-bank .w-9 {
    background-color: rgba(12, 74, 110, 0.75) !important;
    color: #7dd3fc !important;
    border: 1px solid rgba(14, 165, 233, 0.35) !important;
}
[data-theme="dark"] .section-header-batch .w-9,
.dark .section-header-batch .w-9 {
    background-color: rgba(49, 46, 129, 0.75) !important;
    color: #a5b4fc !important;
    border: 1px solid rgba(99, 102, 241, 0.35) !important;
}

/* Page Header in Dark Mode - Client Update */
[data-theme="dark"] .bg-white.rounded-xl.border-2.border-blue-300,
.dark .bg-white.rounded-xl.border-2.border-blue-300 {
    background-color: #1e293b !important;
    border-color: rgba(59, 130, 246, 0.4) !important;
}
[data-theme="dark"] .bg-white.rounded-xl.border-2.border-blue-300 h1,
.dark .bg-white.rounded-xl.border-2.border-blue-300 h1 {
    color: #60a5fa !important;
}
[data-theme="dark"] .bg-white.rounded-xl.border-2.border-blue-300 p,
.dark .bg-white.rounded-xl.border-2.border-blue-300 p {
    color: #93c5fd !important;
}

/* ========================================
   NAVIGATION BUTTONS - DARK MODE
   ======================================== */

/* Font Size Toggle Button */
[data-theme="dark"] #fontSizeToggle,
[data-theme="dark"] button.bg-primary-100 {
    background-color: var(--bg-tertiary) !important;
    color: var(--accent-primary) !important;
    border-color: var(--border-primary) !important;
}

[data-theme="dark"] #fontSizeToggle:hover,
[data-theme="dark"] button.bg-primary-100:hover {
    background-color: var(--bg-secondary) !important;
}

/* Font Size Dropdown */
[data-theme="dark"] #fontSizeDropdown {
    background-color: var(--bg-card) !important;
    border-color: var(--border-primary) !important;
}

[data-theme="dark"] #fontSizeDropdown button {
    color: var(--text-primary) !important;
}

[data-theme="dark"] #fontSizeDropdown button:hover {
    background-color: var(--bg-tertiary) !important;
    color: var(--accent-primary) !important;
}

/* Theme Toggle Button */
[data-theme="dark"] #themeToggleBtn {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-primary) !important;
}

[data-theme="dark"] #themeToggleBtn:hover {
    background-color: var(--bg-secondary) !important;
}

/* User Info Section */
[data-theme="dark"] .bg-gray-100.px-3.py-2.rounded-lg {
    background-color: var(--bg-tertiary) !important;
    border-color: var(--border-primary) !important;
}

[data-theme="dark"] .bg-gray-100.px-3.py-2.rounded-lg span {
    color: var(--text-primary) !important;
}

/* Navigation Menu Container */
[data-theme="dark"] .bg-white.border-b.border-gray-200.shadow-sm.sticky {
    background-color: var(--bg-card) !important;
    border-color: var(--border-primary) !important;
}

/* Navigation Links - Main Menu */
[data-theme="dark"] nav.flex a.text-gray-700,
[data-theme="dark"] nav.flex button.text-gray-700,
[data-theme="dark"] .main-subnav a.text-gray-700,
[data-theme="dark"] .main-subnav button.text-gray-700 {
    color: var(--text-primary) !important;
}

.main-subnav a:hover,
.main-subnav button:hover,
.main-subnav .group:hover > button {
    color: #059669 !important;
    background-color: #ecfdf5 !important;
}

[data-theme="dark"] nav.flex a:hover,
[data-theme="dark"] nav.flex button:hover,
[data-theme="dark"] .main-subnav a:hover,
[data-theme="dark"] .main-subnav button:hover,
[data-theme="dark"] .main-subnav .group:hover > button,
.dark nav.flex a:hover,
.dark nav.flex button:hover,
.dark .main-subnav a:hover,
.dark .main-subnav button:hover,
.dark .main-subnav .group:hover > button {
    color: #34d399 !important;
    background-color: rgba(16, 185, 129, 0.14) !important;
}

/* Disabled Navigation Items */
[data-theme="dark"] nav.flex .text-gray-400,
[data-theme="dark"] .main-subnav .text-gray-400 {
    color: var(--text-muted) !important;
}

/* Dropdown Menu Items in Navigation */
[data-theme="dark"] nav .dropdown-menu a.text-gray-700 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] nav .dropdown-menu a:hover {
    background-color: var(--bg-tertiary) !important;
    color: var(--accent-primary) !important;
}

/* ========================================
   BACK BUTTONS - ALL VARIANTS
   ======================================== */

/* Unified .btn-back class - centralized styling */
[data-theme="dark"] .btn-back {
    background-color: #374151 !important;
    border-color: #4b5563 !important;
    color: #f9fafb !important;
}

[data-theme="dark"] .btn-back:hover {
    background-color: #1f2937 !important;
    border-color: #60a5fa !important;
    color: #60a5fa !important;
}

/* ========================================
   DASHBOARD PAGE - DARK MODE
   ======================================== */

/* Sales of the Day - Green gradient icon */
[data-theme="dark"] .bg-gradient-to-br.from-green-200.to-green-300 {
    background: linear-gradient(to bottom right, #064e3b, #065f46) !important;
}

/* Collections of the Day - Blue gradient icon */
[data-theme="dark"] .bg-gradient-to-br.from-blue-200.to-blue-300 {
    background: linear-gradient(to bottom right, #1e3a5f, #1e40af) !important;
}

/* Collections section header */
[data-theme="dark"] .bg-gradient-to-r.from-blue-100.to-blue-200 {
    background: linear-gradient(to right, rgba(30, 58, 95, 0.5), rgba(30, 64, 175, 0.3)) !important;
}

[data-theme="dark"] .bg-gradient-to-r.from-blue-100.to-blue-200 h2,
[data-theme="dark"] .bg-gradient-to-r.from-blue-100.to-blue-200 svg {
    color: #93c5fd !important;
}

/* New Sales section header */
[data-theme="dark"] .bg-gradient-to-r.from-green-100.to-green-200 {
    background: linear-gradient(to right, rgba(6, 78, 59, 0.5), rgba(6, 95, 70, 0.3)) !important;
}

[data-theme="dark"] .bg-gradient-to-r.from-green-100.to-green-200 h2,
[data-theme="dark"] .bg-gradient-to-r.from-green-100.to-green-200 svg {
    color: #6ee7b7 !important;
}

/* ========================================
   HOME PAGE (CHANGELOG) - DARK MODE
   ======================================== */

/* What's New section header - blue gradient */
[data-theme="dark"] .bg-gradient-to-r.from-blue-600.to-blue-700 {
    background: linear-gradient(to right, #1e3a5f, #1e40af) !important;
}

/* Tips section header - amber gradient */
[data-theme="dark"] .bg-gradient-to-r.from-amber-500.to-amber-600 {
    background: linear-gradient(to right, #78350f, #92400e) !important;
}

/* Changelog colored boxes */
[data-theme="dark"] .bg-blue-50 {
    background-color: rgba(30, 58, 95, 0.4) !important;
}

[data-theme="dark"] .bg-amber-50 {
    background-color: rgba(120, 53, 15, 0.3) !important;
}

[data-theme="dark"] .bg-green-50 {
    background-color: rgba(6, 78, 59, 0.3) !important;
}

[data-theme="dark"] .bg-red-50 {
    background-color: rgba(127, 29, 29, 0.3) !important;
}

/* Changelog text colors in dark mode */
[data-theme="dark"] .bg-blue-50 .text-gray-700,
[data-theme="dark"] .bg-blue-50 .text-gray-600,
[data-theme="dark"] .bg-amber-50 .text-gray-700,
[data-theme="dark"] .bg-amber-50 .text-gray-600,
[data-theme="dark"] .bg-green-50 .text-gray-700,
[data-theme="dark"] .bg-green-50 .text-gray-600,
[data-theme="dark"] .bg-red-50 .text-gray-700,
[data-theme="dark"] .bg-red-50 .text-gray-600 {
    color: #e5e7eb !important;
}

[data-theme="dark"] .bg-blue-50 .text-gray-900,
[data-theme="dark"] .bg-amber-50 .text-gray-900,
[data-theme="dark"] .bg-green-50 .text-gray-900,
[data-theme="dark"] .bg-red-50 .text-gray-900 {
    color: #f9fafb !important;
}

/* Version badges */
[data-theme="dark"] .bg-green-100.text-green-800 {
    background-color: rgba(6, 78, 59, 0.5) !important;
    color: #6ee7b7 !important;
}

/* ========================================
   LOAN REQUEST VIEW PAGE - DARK MODE
   ======================================== */

/* Computation section headers */
[data-theme="dark"] .bg-gradient-to-r.from-blue-50.to-blue-100 {
    background: linear-gradient(to right, rgba(30, 58, 95, 0.4), rgba(30, 64, 175, 0.2)) !important;
}

[data-theme="dark"] .bg-gradient-to-r.from-green-50.to-green-100 {
    background: linear-gradient(to right, rgba(6, 78, 59, 0.4), rgba(6, 95, 70, 0.2)) !important;
}

[data-theme="dark"] .bg-gradient-to-r.from-purple-50.to-purple-100 {
    background: linear-gradient(to right, rgba(88, 28, 135, 0.4), rgba(107, 33, 168, 0.2)) !important;
}

/* Header text in computation sections */
[data-theme="dark"] .bg-gradient-to-r.from-blue-50.to-blue-100 h3 {
    color: #93c5fd !important;
}

[data-theme="dark"] .bg-gradient-to-r.from-green-50.to-green-100 h3 {
    color: #6ee7b7 !important;
}

[data-theme="dark"] .bg-gradient-to-r.from-purple-50.to-purple-100 h3 {
    color: #c4b5fd !important;
}

/* Blue highlighted boxes & pills */
[data-theme="dark"] .bg-blue-50.border-blue-200,
.dark .bg-blue-50.border-blue-200 {
    background-color: rgba(30, 58, 95, 0.55) !important;
    border-color: rgba(59, 130, 246, 0.4) !important;
}

[data-theme="dark"] .bg-blue-50.border-blue-200 .text-blue-600,
[data-theme="dark"] .bg-blue-50.border-blue-200 .text-blue-800,
[data-theme="dark"] .bg-blue-50.border-blue-200.text-blue-800,
[data-theme="dark"] .bg-blue-50.text-blue-800,
.dark .bg-blue-50.border-blue-200 .text-blue-600,
.dark .bg-blue-50.border-blue-200 .text-blue-800,
.dark .bg-blue-50.border-blue-200.text-blue-800,
.dark .bg-blue-50.text-blue-800 {
    color: #bfdbfe !important;
}

/* Green highlighted boxes */
[data-theme="dark"] .bg-green-50 {
    background-color: rgba(6, 78, 59, 0.4) !important;
}

[data-theme="dark"] .bg-green-50 .text-green-800 {
    color: #6ee7b7 !important;
}

/* Purple highlighted boxes & pills (match both descendant and same-element utility classes) */
[data-theme="dark"] .bg-purple-50.border-purple-200,
.dark .bg-purple-50.border-purple-200 {
    background-color: rgba(88, 28, 135, 0.55) !important;
    border-color: rgba(192, 132, 252, 0.45) !important;
}

[data-theme="dark"] .bg-purple-50.border-purple-200 .text-purple-600,
[data-theme="dark"] .bg-purple-50.border-purple-200 .text-purple-800,
[data-theme="dark"] .bg-purple-50.border-purple-200.text-purple-800,
[data-theme="dark"] .bg-purple-50.border-purple-200.text-purple-900,
[data-theme="dark"] .bg-purple-50.text-purple-800,
[data-theme="dark"] .bg-purple-50.text-purple-900,
.dark .bg-purple-50.border-purple-200 .text-purple-600,
.dark .bg-purple-50.border-purple-200 .text-purple-800,
.dark .bg-purple-50.border-purple-200.text-purple-800,
.dark .bg-purple-50.border-purple-200.text-purple-900,
.dark .bg-purple-50.text-purple-800,
.dark .bg-purple-50.text-purple-900,
[data-theme="dark"] .orseries-assigned-pill,
.dark .orseries-assigned-pill {
    color: #f3e8ff !important;
}

/* Yellow warning boxes */
[data-theme="dark"] .bg-yellow-50 {
    background-color: rgba(146, 64, 14, 0.3) !important;
}

[data-theme="dark"] .bg-yellow-50 .text-yellow-700 {
    color: #fcd34d !important;
}

/* ========================================
   DIGITAL SIGNATURE AREA - DARK MODE
   ======================================== */

/* Signature container - keep crisp white background for black signature visibility */
[data-theme="dark"] .loan-waiver-signature-box,
[data-theme="dark"] .signature-container,
[data-theme="dark"] .signature-pad-container,
[data-theme="dark"] .border-gray-300.rounded-lg.bg-white:not(input):not(select):not(textarea):not(button):not(a),
.dark .loan-waiver-signature-box,
.dark .signature-container,
.dark .signature-pad-container,
.dark .border-gray-300.rounded-lg.bg-white:not(input):not(select):not(textarea):not(button):not(a) {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 0 0 1px rgba(203, 213, 225, 0.5), 0 2px 4px rgba(0, 0, 0, 0.25) !important;
}

/* Signature label text */
[data-theme="dark"] .text-gray-500.uppercase.tracking-wide {
    color: #9ca3af !important;
}

/* No signature placeholder text */
[data-theme="dark"] .text-gray-400.text-center {
    color: #6b7280 !important;
}

/* ========================================
   BENEFICIARIES SECTION - DARK MODE
   ======================================== */

/* Beneficiaries section header */
[data-theme="dark"] .text-purple-700.uppercase.tracking-wide {
    color: #c4b5fd !important;
}

[data-theme="dark"] .border-b-2.border-purple-200 {
    border-color: rgba(167, 139, 250, 0.3) !important;
}

/* Principal beneficiary box */
[data-theme="dark"] .bg-purple-50.rounded-lg.border-purple-100 {
    background-color: rgba(88, 28, 135, 0.3) !important;
    border-color: rgba(167, 139, 250, 0.2) !important;
}

/* Principal beneficiary header text */
[data-theme="dark"] .text-purple-800.uppercase.tracking-wider {
    color: #e9d5ff !important;
}

/* Purple icon */
[data-theme="dark"] .text-purple-600 {
    color: #a78bfa !important;
}

/* Purple bordered inputs in beneficiary section */
[data-theme="dark"] .border-purple-200.bg-white {
    background-color: #1f2937 !important;
    border-color: rgba(167, 139, 250, 0.3) !important;
    color: #f9fafb !important;
}

/* Beneficiary inputs in client pages (Primary and Secondary Beneficiaries) */
[data-theme="dark"] input[id^="beneficiary"],
[data-theme="dark"] input[id^="principalBeneficiary"],
[data-theme="dark"] select#principalBeneficiaryRelation,
.dark input[id^="beneficiary"],
.dark input[id^="principalBeneficiary"],
.dark select#principalBeneficiaryRelation {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

/* Purple action button (View ID) */
[data-theme="dark"] .border-purple-300.text-purple-700.bg-purple-100 {
    background-color: rgba(88, 28, 135, 0.4) !important;
    border-color: rgba(167, 139, 250, 0.4) !important;
    color: #c4b5fd !important;
}

[data-theme="dark"] .border-purple-300.text-purple-700.bg-purple-100:hover,
[data-theme="dark"] .hover\:bg-purple-200:hover {
    background-color: rgba(107, 33, 168, 0.5) !important;
    color: #e9d5ff !important;
}

/* ========================================
   CLIENT INFORMATION SECTION - DARK MODE
   ======================================== */

/* Client Information header gradient */
[data-theme="dark"] .bg-gradient-to-r.from-purple-50.to-indigo-50 {
    background: linear-gradient(to right, rgba(88, 28, 135, 0.3), rgba(79, 70, 229, 0.2)) !important;
}

/* Input fields in client info */
[data-theme="dark"] .border-gray-300.rounded-lg.bg-gray-50 {
    background-color: #1f2937 !important;
    border-color: #374151 !important;
    color: #f9fafb !important;
}

/* Status badges */
[data-theme="dark"] .bg-gray-200.text-gray-700 {
    background-color: #4b5563 !important;
    color: #e5e7eb !important;
}

[data-theme="dark"] .bg-blue-200.text-blue-700 {
    background-color: rgba(59, 130, 246, 0.3) !important;
    color: #93c5fd !important;
}

[data-theme="dark"] .bg-green-200.text-green-700 {
    background-color: rgba(34, 197, 94, 0.3) !important;
    color: #6ee7b7 !important;
}

[data-theme="dark"] .bg-green-300.text-green-800 {
    background-color: rgba(34, 197, 94, 0.4) !important;
    color: #86efac !important;
}

[data-theme="dark"] .bg-red-200.text-red-700 {
    background-color: rgba(239, 68, 68, 0.3) !important;
    color: #fca5a5 !important;
}

/* ========================================
   CLIENT LIST PAGE - DARK MODE
   ======================================== */

/* Client Management header box */
[data-theme="dark"] .bg-white.rounded-xl.border-2.border-green-300 {
    background-color: #1f2937 !important;
    border-color: rgba(34, 197, 94, 0.4) !important;
}

[data-theme="dark"] .text-green-800 {
    color: #86efac !important;
}

/* Create New Client button */
[data-theme="dark"] a.bg-indigo-600:not(.status-filter-link),
[data-theme="dark"] a.hover\:bg-indigo-700:not(.status-filter-link) {
    background-color: #4f46e5 !important;
}

[data-theme="dark"] a.bg-indigo-600:not(.status-filter-link):hover,
[data-theme="dark"] a.hover\:bg-indigo-700:not(.status-filter-link):hover {
    background-color: #6366f1 !important;
}

/* Filter tabs - inactive state */
[data-theme="dark"] .btn-filter-type:not(.bg-emerald-600),
[data-theme="dark"] .status-filter-link:not(.segmented-filter-btn):not(.segmented-dropdown-item):not(.bg-emerald-600):not(.bg-indigo-600):not(.bg-blue-600):not(.bg-green-600):not(.bg-red-600):not(.bg-teal-600):not(.bg-purple-600):not(.bg-amber-600),
[data-theme="dark"] .flex.flex-wrap a.bg-white:not(.client-or-alert-btn-manage),
[data-theme="dark"] .flex.flex-wrap button.bg-white,
[data-theme="dark"] .flex.flex-wrap a.text-gray-700:not(.client-or-alert-btn-manage),
[data-theme="dark"] .flex.flex-wrap button.text-gray-700,
[data-theme="dark"] .flex.flex-wrap a.border-gray-300:not(.client-or-alert-btn-manage),
[data-theme="dark"] .flex.flex-wrap button.border-gray-300,
.dark .btn-filter-type:not(.bg-emerald-600),
.dark .status-filter-link:not(.segmented-filter-btn):not(.segmented-dropdown-item):not(.bg-emerald-600):not(.bg-indigo-600):not(.bg-blue-600):not(.bg-green-600):not(.bg-red-600):not(.bg-teal-600):not(.bg-purple-600):not(.bg-amber-600),
.dark .flex.flex-wrap a.bg-white:not(.client-or-alert-btn-manage),
.dark .flex.flex-wrap button.bg-white,
.dark .flex.flex-wrap a.text-gray-700:not(.client-or-alert-btn-manage),
.dark .flex.flex-wrap button.text-gray-700,
.dark .flex.flex-wrap a.border-gray-300:not(.client-or-alert-btn-manage),
.dark .flex.flex-wrap button.border-gray-300 {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .btn-filter-type:not(.bg-emerald-600):hover,
[data-theme="dark"] .status-filter-link:not(.segmented-filter-btn):not(.segmented-dropdown-item):not(.bg-emerald-600):not(.bg-indigo-600):not(.bg-blue-600):not(.bg-green-600):not(.bg-red-600):not(.bg-teal-600):not(.bg-purple-600):not(.bg-amber-600):hover,
[data-theme="dark"] .flex.flex-wrap a.bg-white:not(.client-or-alert-btn-manage):hover,
[data-theme="dark"] .flex.flex-wrap button.bg-white:hover,
[data-theme="dark"] .flex.flex-wrap a.text-gray-700:not(.client-or-alert-btn-manage):hover,
[data-theme="dark"] .flex.flex-wrap button.text-gray-700:hover,
[data-theme="dark"] .flex.flex-wrap a.border-gray-300:not(.client-or-alert-btn-manage):hover,
[data-theme="dark"] .flex.flex-wrap button.border-gray-300:hover,
[data-theme="dark"] .flex.flex-wrap a.hover\:bg-gray-100:not(.client-or-alert-btn-manage):hover,
[data-theme="dark"] .flex.flex-wrap button.hover\:bg-gray-100:hover,
.dark .btn-filter-type:not(.bg-emerald-600):hover,
.dark .status-filter-link:not(.segmented-filter-btn):not(.segmented-dropdown-item):not(.bg-emerald-600):not(.bg-indigo-600):not(.bg-blue-600):not(.bg-green-600):not(.bg-red-600):not(.bg-teal-600):not(.bg-purple-600):not(.bg-amber-600):hover,
.dark .flex.flex-wrap a.bg-white:not(.client-or-alert-btn-manage):hover,
.dark .flex.flex-wrap button.bg-white:hover,
.dark .flex.flex-wrap a.text-gray-700:not(.client-or-alert-btn-manage):hover,
.dark .flex.flex-wrap button.text-gray-700:hover,
.dark .flex.flex-wrap a.border-gray-300:hover,
.dark .flex.flex-wrap button.border-gray-300:hover,
.dark .flex.flex-wrap a.hover\:bg-gray-100:hover,
.dark .flex.flex-wrap button.hover\:bg-gray-100:hover {
    background-color: #334155 !important;
    color: #f8fafc !important;
    border-color: #475569 !important;
}

/* Filter tabs - active states */
[data-theme="dark"] .btn-filter-type.bg-emerald-600,
[data-theme="dark"] .status-filter-link.bg-emerald-600,
[data-theme="dark"] .flex.flex-wrap a.bg-emerald-600,
[data-theme="dark"] .flex.flex-wrap button.bg-emerald-600,
.dark .btn-filter-type.bg-emerald-600,
.dark .status-filter-link.bg-emerald-600,
.dark .flex.flex-wrap a.bg-emerald-600,
.dark .flex.flex-wrap button.bg-emerald-600 {
    background-color: #059669 !important;
    color: #ffffff !important;
    border-color: #10b981 !important;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.35) !important;
}

[data-theme="dark"] .status-filter-link.bg-indigo-600,
[data-theme="dark"] .flex.flex-wrap a.bg-indigo-600,
[data-theme="dark"] .flex.flex-wrap button.bg-indigo-600,
.dark .status-filter-link.bg-indigo-600,
.dark .flex.flex-wrap a.bg-indigo-600,
.dark .flex.flex-wrap button.bg-indigo-600 {
    background-color: #4f46e5 !important;
    color: #f9fafb !important;
    border-color: #6366f1 !important;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.35) !important;
}

[data-theme="dark"] .status-filter-link.bg-blue-600,
[data-theme="dark"] .flex.flex-wrap a.bg-blue-600,
[data-theme="dark"] .flex.flex-wrap button.bg-blue-600,
.dark .status-filter-link.bg-blue-600,
.dark .flex.flex-wrap a.bg-blue-600,
.dark .flex.flex-wrap button.bg-blue-600 {
    background-color: #2563eb !important;
    color: #ffffff !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.45) !important;
}

[data-theme="dark"] .status-filter-link.bg-green-600,
[data-theme="dark"] .flex.flex-wrap a.bg-green-600,
[data-theme="dark"] .flex.flex-wrap button.bg-green-600,
.dark .status-filter-link.bg-green-600,
.dark .flex.flex-wrap a.bg-green-600,
.dark .flex.flex-wrap button.bg-green-600 {
    background-color: #16a34a !important;
    color: #f9fafb !important;
    border-color: #22c55e !important;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.35) !important;
}

[data-theme="dark"] .status-filter-link.bg-red-600,
[data-theme="dark"] .flex.flex-wrap a.bg-red-600,
[data-theme="dark"] .flex.flex-wrap button.bg-red-600,
.dark .status-filter-link.bg-red-600,
.dark .flex.flex-wrap a.bg-red-600,
.dark .flex.flex-wrap button.bg-red-600 {
    background-color: #dc2626 !important;
    color: #f9fafb !important;
    border-color: #ef4444 !important;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.35) !important;
}

[data-theme="dark"] .status-filter-link.bg-teal-600,
[data-theme="dark"] .flex.flex-wrap a.bg-teal-600,
[data-theme="dark"] .flex.flex-wrap button.bg-teal-600,
.dark .status-filter-link.bg-teal-600,
.dark .flex.flex-wrap a.bg-teal-600,
.dark .flex.flex-wrap button.bg-teal-600 {
    background-color: #0d9488 !important;
    color: #ffffff !important;
    border-color: #14b8a6 !important;
    box-shadow: 0 0 10px rgba(20, 184, 166, 0.35) !important;
}

[data-theme="dark"] .status-filter-link.bg-purple-600,
[data-theme="dark"] .flex.flex-wrap a.bg-purple-600,
[data-theme="dark"] .flex.flex-wrap button.bg-purple-600,
.dark .status-filter-link.bg-purple-600,
.dark .flex.flex-wrap a.bg-purple-600,
.dark .flex.flex-wrap button.bg-purple-600 {
    background-color: #9333ea !important;
    color: #ffffff !important;
    border-color: #a855f7 !important;
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.45) !important;
}

[data-theme="dark"] .status-filter-link.bg-amber-600,
[data-theme="dark"] .flex.flex-wrap a.bg-amber-600,
[data-theme="dark"] .flex.flex-wrap button.bg-amber-600,
.dark .status-filter-link.bg-amber-600,
.dark .flex.flex-wrap a.bg-amber-600,
.dark .flex.flex-wrap button.bg-amber-600 {
    background-color: #d97706 !important;
    color: #ffffff !important;
    border-color: #f59e0b !important;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.45) !important;
}

/* Branch & Role filter label */
[data-theme="dark"] .text-gray-700.font-semibold,
.dark .text-gray-700.font-semibold {
    color: #d1d5db !important;
}

/* Branch & Role filter dropdown */
[data-theme="dark"] select.border-gray-300.bg-white,
[data-theme="dark"] #branchFilter,
[data-theme="dark"] #staffRoleFilter,
[data-theme="dark"] #linkedRoleFilter,
.dark select.border-gray-300.bg-white,
.dark #branchFilter,
.dark #staffRoleFilter,
.dark #linkedRoleFilter {
    background-color: #1e293b !important;
    border-color: #475569 !important;
    color: #f8fafc !important;
}

[data-theme="dark"] select.border-gray-300.bg-white:focus,
[data-theme="dark"] #branchFilter:focus,
[data-theme="dark"] #staffRoleFilter:focus,
[data-theme="dark"] #linkedRoleFilter:focus,
.dark select.border-gray-300.bg-white:focus,
.dark #branchFilter:focus,
.dark #staffRoleFilter:focus,
.dark #linkedRoleFilter:focus {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3) !important;
}

/* Dropdown options */
[data-theme="dark"] select option,
[data-theme="dark"] #staffRoleFilter option,
[data-theme="dark"] #linkedRoleFilter option,
.dark select option,
.dark #staffRoleFilter option,
.dark #linkedRoleFilter option {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}

/* ========================================
   LOAN APPLICATION MODAL - DARK MODE
   ======================================== */

/* Modal container */
[data-theme="dark"] #loanApplicationModal .bg-white.rounded-lg,
[data-theme="dark"] #loanApplicationModal > div,
[data-theme="dark"] #policyAgreementModal .bg-white.rounded-lg,
[data-theme="dark"] #policyAgreementModal > div,
[data-theme="dark"] #policySignaturePadModal .bg-white.rounded-lg {
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}

/* Modal header */
[data-theme="dark"] #loanApplicationModal .bg-gray-50,
[data-theme="dark"] #policyAgreementModal .bg-gray-50,
[data-theme="dark"] #policySignaturePadModal .bg-gray-50 {
    background-color: #374151 !important;
    border-color: #4b5563 !important;
}

[data-theme="dark"] #loanApplicationModal .text-gray-900,
[data-theme="dark"] #policyAgreementModal .text-gray-900,
[data-theme="dark"] #policySignaturePadModal .text-gray-900 {
    color: #f9fafb !important;
}

/* Modal body gradient */
[data-theme="dark"] #loanApplicationModal .bg-gradient-to-b.from-slate-200.to-slate-300,
[data-theme="dark"] #policyAgreementModal .bg-gradient-to-b.from-slate-200.to-slate-300,
[data-theme="dark"] #policySignaturePadModal .bg-gradient-to-b.from-slate-200.to-slate-300 {
    background: linear-gradient(to bottom, #374151, #1f2937) !important;
}

/* Loan Details Card - blue gradient (darker, more muted for dark mode) */
[data-theme="dark"] #loanApplicationModal .bg-gradient-to-r.from-blue-500.to-blue-600 {
    background: linear-gradient(135deg, #1e3a5f 0%, #1e40af 100%) !important;
}

/* Monthly Payment Card - purple gradient (darker, more muted for dark mode) */
[data-theme="dark"] #loanApplicationModal .bg-gradient-to-r.from-purple-500.to-purple-600 {
    background: linear-gradient(135deg, #4c1d95 0%, #5b21b6 100%) !important;
}

/* Inner white cards in modal */
[data-theme="dark"] #loanApplicationModal .bg-white.rounded-xl.shadow,
[data-theme="dark"] #policyAgreementModal .bg-white.rounded-xl.shadow {
    background-color: #111827 !important;
    border: 1px solid #374151 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

/* Labels in modal cards */
[data-theme="dark"] #loanApplicationModal .text-gray-500,
[data-theme="dark"] #policyAgreementModal .text-gray-500 {
    color: #9ca3af !important;
}

/* Amount values in modal - brighter for contrast */
[data-theme="dark"] #loanApplicationModal .text-indigo-600,
[data-theme="dark"] #loanApplicationModal .text-blue-600 {
    color: #60a5fa !important;
}

[data-theme="dark"] #loanApplicationModal .text-rose-600 {
    color: #fb7185 !important;
}

[data-theme="dark"] #loanApplicationModal .text-emerald-600 {
    color: #34d399 !important;
}

[data-theme="dark"] #loanApplicationModal .text-amber-600 {
    color: #fbbf24 !important;
}

/* Signature pad modal - keep modal container dark */
[data-theme="dark"] #signaturePadModal .bg-white,
[data-theme="dark"] #policySignaturePadModal .bg-white {
    background-color: #1f2937 !important;
}

/* Exception: signature surface stays white */
[data-theme="dark"] #signaturePadModal #signatureModalSurface,
[data-theme="dark"] #policySignaturePadModal #policySignatureModalSurface {
    background-color: #ffffff !important;
}

[data-theme="dark"] #signaturePadModal .border-gray-200,
[data-theme="dark"] #policySignaturePadModal .border-gray-200 {
    border-color: #4b5563 !important;
}

/* Signature canvas surface - keep white for black signature */
[data-theme="dark"] #signatureModalSurface,
[data-theme="dark"] #policySignatureModalSurface {
    background-color: #ffffff !important;
    border-color: #6b7280 !important;
}

/* Signature canvas - white background */
[data-theme="dark"] #signatureModalCanvas,
[data-theme="dark"] #policySignatureModalCanvas {
    background-color: #ffffff !important;
}

[data-theme="dark"] #signaturePadModal .text-gray-500,
[data-theme="dark"] #policySignaturePadModal .text-gray-500 {
    color: #9ca3af !important;
}

/* Cancel button in modal */
[data-theme="dark"] #loanApplicationModal .bg-gray-200,
[data-theme="dark"] #policyAgreementModal .bg-gray-200,
[data-theme="dark"] #policySignaturePadModal .bg-gray-200 {
    background-color: #4b5563 !important;
    color: #e5e7eb !important;
}

[data-theme="dark"] #loanApplicationModal .bg-gray-200:hover,
[data-theme="dark"] #loanApplicationModal .hover\:bg-gray-300:hover,
[data-theme="dark"] #policyAgreementModal .bg-gray-200:hover,
[data-theme="dark"] #policyAgreementModal .hover\:bg-gray-300:hover,
[data-theme="dark"] #policySignaturePadModal .bg-gray-200:hover,
[data-theme="dark"] #policySignaturePadModal .hover\:bg-gray-300:hover {
    background-color: #6b7280 !important;
    color: #f9fafb !important;
}

/* Submit Loan Request Button in Modal - Dark Mode */
[data-theme="dark"] #loanApplicationModal #submitLoanBtn,
[data-theme="dark"] #loanApplicationModal button#submitLoanBtn,
[data-theme="dark"] button#submitLoanBtn.bg-green-600,
[data-theme="dark"] button#submitLoanBtn.text-white,
[data-theme="dark"] button#submitLoanBtn.px-6.py-2\.5 {
    background-color: #047857 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] #loanApplicationModal #submitLoanBtn:hover,
[data-theme="dark"] #loanApplicationModal button#submitLoanBtn:hover,
[data-theme="dark"] button#submitLoanBtn.bg-green-600:hover,
[data-theme="dark"] button#submitLoanBtn:hover {
    background-color: #059669 !important;
    color: #ffffff !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] #loanApplicationModal #submitLoanBtn:disabled,
[data-theme="dark"] #loanApplicationModal button#submitLoanBtn:disabled,
[data-theme="dark"] button#submitLoanBtn:disabled,
[data-theme="dark"] button#submitLoanBtn.disabled\:bg-gray-400 {
    background-color: #4b5563 !important;
    color: #9ca3af !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
}

/* ========================================
   ACTION BUTTONS - DARK MODE
   ======================================== */

/* Gray buttons (Return/Back buttons) - MAXIMUM SPECIFICITY */
[data-theme="dark"] a.bg-gray-500.inline-flex,
[data-theme="dark"] button.bg-gray-500.inline-flex,
[data-theme="dark"] a.inline-flex.bg-gray-500,
[data-theme="dark"] button.inline-flex.bg-gray-500,
[data-theme="dark"] a.bg-gray-500,
[data-theme="dark"] button.bg-gray-500,
[data-theme="dark"] .bg-gray-500 {
    background-color: #4b5563 !important;
}

[data-theme="dark"] a.bg-gray-500:hover,
[data-theme="dark"] button.bg-gray-500:hover,
[data-theme="dark"] a.bg-gray-500.inline-flex:hover,
[data-theme="dark"] button.bg-gray-500.inline-flex:hover,
[data-theme="dark"] a.inline-flex.bg-gray-500:hover,
[data-theme="dark"] button.inline-flex.bg-gray-500:hover,
[data-theme="dark"] .bg-gray-500:hover,
[data-theme="dark"] .hover\:bg-gray-700:hover,
[data-theme="dark"] a.hover\:bg-gray-700:hover,
[data-theme="dark"] button.hover\:bg-gray-700:hover {
    background-color: #6b7280 !important;
}

/* Blue buttons (View Client, etc.) - Matched to Theme Green */
[data-theme="dark"] a.bg-blue-500.inline-flex,
[data-theme="dark"] button.bg-blue-500.inline-flex,
[data-theme="dark"] a.inline-flex.bg-blue-500,
[data-theme="dark"] button.inline-flex.bg-blue-500,
[data-theme="dark"] a.bg-blue-500,
[data-theme="dark"] button.bg-blue-500,
[data-theme="dark"] .bg-blue-500 {
    background-color: #047857 !important;
}

[data-theme="dark"] a.bg-blue-500:hover,
[data-theme="dark"] button.bg-blue-500:hover,
[data-theme="dark"] a.bg-blue-500.inline-flex:hover,
[data-theme="dark"] button.bg-blue-500.inline-flex:hover,
[data-theme="dark"] a.inline-flex.bg-blue-500:hover,
[data-theme="dark"] button.inline-flex.bg-blue-500:hover,
[data-theme="dark"] .bg-blue-500:hover,
[data-theme="dark"] .hover\:bg-blue-700:hover,
[data-theme="dark"] a.hover\:bg-blue-700:hover,
[data-theme="dark"] button.hover\:bg-blue-700:hover {
    background-color: #059669 !important;
}

/* Green/Emerald buttons (Verify, Approve, Completed Service, etc.) - MAXIMUM SPECIFICITY */
[data-theme="dark"] a.bg-green-500.inline-flex,
[data-theme="dark"] button.bg-green-500.inline-flex,
[data-theme="dark"] a.inline-flex.bg-green-500,
[data-theme="dark"] button.inline-flex.bg-green-500,
[data-theme="dark"] a.bg-green-500,
[data-theme="dark"] button.bg-green-500,
[data-theme="dark"] .bg-green-500,
[data-theme="dark"] a.bg-green-600,
[data-theme="dark"] button.bg-green-600,
[data-theme="dark"] .bg-green-600,
[data-theme="dark"] a.bg-emerald-600,
[data-theme="dark"] button.bg-emerald-600,
[data-theme="dark"] .bg-emerald-600 {
    background-color: #047857 !important;
    color: #ffffff !important;
    border-color: #059669 !important;
}

[data-theme="dark"] a.bg-teal-600,
[data-theme="dark"] button.bg-teal-600,
[data-theme="dark"] .bg-teal-600 {
    background-color: #0d9488 !important;
    color: #ffffff !important;
    border-color: #14b8a6 !important;
}

[data-theme="dark"] a.bg-green-500:hover,
[data-theme="dark"] button.bg-green-500:hover,
[data-theme="dark"] a.bg-green-500.inline-flex:hover,
[data-theme="dark"] button.bg-green-500.inline-flex:hover,
[data-theme="dark"] a.inline-flex.bg-green-500:hover,
[data-theme="dark"] button.inline-flex.bg-green-500:hover,
[data-theme="dark"] .bg-green-500:hover,
[data-theme="dark"] .hover\:bg-green-700:hover,
[data-theme="dark"] a.hover\:bg-green-700:hover,
[data-theme="dark"] button.hover\:bg-green-700:hover,
[data-theme="dark"] a.bg-green-600:hover,
[data-theme="dark"] button.bg-green-600:hover,
[data-theme="dark"] a.bg-emerald-600:hover,
[data-theme="dark"] a.hover\:bg-emerald-500:hover,
[data-theme="dark"] a.hover\:bg-emerald-700:hover,
[data-theme="dark"] button.bg-emerald-600:hover {
    background-color: #059669 !important;
    color: #ffffff !important;
    border-color: #10b981 !important;
}

[data-theme="dark"] a.bg-teal-600:hover,
[data-theme="dark"] button.bg-teal-600:hover,
[data-theme="dark"] .bg-teal-600:hover {
    background-color: #0f766e !important;
    color: #ffffff !important;
    border-color: #2dd4bf !important;
}

/* Transfer Ownership Button - Dark Mode Specificity */
[data-theme="dark"] a[href*='transfer-client-create'] {
    background: linear-gradient(135deg, #1d4ed8 0%, #3730a3 100%) !important;
    color: #ffffff !important;
    border-color: #3b82f6 !important;
}

[data-theme="dark"] a[href*='transfer-client-create']:hover {
    background: linear-gradient(135deg, #2563eb 0%, #4338ca 100%) !important;
    color: #ffffff !important;
}

/* Red buttons - MAXIMUM SPECIFICITY */
[data-theme="dark"] a.bg-red-500.inline-flex,
[data-theme="dark"] button.bg-red-500.inline-flex,
[data-theme="dark"] a.inline-flex.bg-red-500,
[data-theme="dark"] button.inline-flex.bg-red-500,
[data-theme="dark"] a.bg-red-500,
[data-theme="dark"] button.bg-red-500,
[data-theme="dark"] .bg-red-500 {
    background-color: #b91c1c !important;
}

[data-theme="dark"] a.bg-red-500:hover,
[data-theme="dark"] button.bg-red-500:hover,
[data-theme="dark"] a.bg-red-500.inline-flex:hover,
[data-theme="dark"] button.bg-red-500.inline-flex:hover,
[data-theme="dark"] a.inline-flex.bg-red-500:hover,
[data-theme="dark"] button.inline-flex.bg-red-500:hover,
[data-theme="dark"] .bg-red-500:hover,
[data-theme="dark"] .hover\:bg-red-700:hover,
[data-theme="dark"] a.hover\:bg-red-700:hover,
[data-theme="dark"] button.hover\:bg-red-700:hover {
    background-color: #dc2626 !important;
}

/* White bordered back buttons - Force override bg-white with HIGHEST specificity */
[data-theme="dark"] a.bg-white.inline-flex,
[data-theme="dark"] button.bg-white.inline-flex,
[data-theme="dark"] a.inline-flex.bg-white,
[data-theme="dark"] button.inline-flex.bg-white,
[data-theme="dark"] .bg-white.inline-flex.items-center,
[data-theme="dark"] a.bg-white {
    background-color: #374151 !important;
    background: #374151 !important;
}

[data-theme="dark"] a.bg-white.inline-flex:hover,
[data-theme="dark"] button.bg-white.inline-flex:hover,
[data-theme="dark"] a.inline-flex.bg-white:hover,
[data-theme="dark"] button.inline-flex.bg-white:hover,
[data-theme="dark"] .bg-white.inline-flex.items-center:hover,
[data-theme="dark"] a.bg-white:hover {
    background-color: #1f2937 !important;
    background: #1f2937 !important;
}

/* Border colors for back buttons */
[data-theme="dark"] a.border-gray-300,
[data-theme="dark"] button.border-gray-300 {
    border-color: #4b5563 !important;
}

[data-theme="dark"] a.border-gray-300:hover,
[data-theme="dark"] button.border-gray-300:hover {
    border-color: #60a5fa !important;
}

/* Override hover:bg-gray-50 specifically */
[data-theme="dark"] .hover\:bg-gray-50:hover {
    background-color: #1f2937 !important;
}

/* Override text-gray-700 in back buttons */
[data-theme="dark"] a.text-gray-700,
[data-theme="dark"] button.text-gray-700 {
    color: #f9fafb !important;
}

[data-theme="dark"] a.text-gray-700:hover,
[data-theme="dark"] button.text-gray-700:hover {
    color: #60a5fa !important;
}

/* Gray back buttons (bg-gray-200) */
[data-theme="dark"] a.inline-flex.items-center.px-4.py-2.bg-gray-200,
[data-theme="dark"] a.inline-flex.items-center.px-4.py-2.hover\:bg-gray-300 {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] a.inline-flex.items-center.px-4.py-2.bg-gray-200:hover,
[data-theme="dark"] a.inline-flex.items-center.px-4.py-2.hover\:bg-gray-300:hover {
    background-color: var(--bg-secondary) !important;
    color: var(--accent-primary) !important;
}

/* Dark gray back buttons (bg-gray-600) */
[data-theme="dark"] a.inline-flex.items-center.px-4.py-2.bg-gray-600,
[data-theme="dark"] a.inline-flex.items-center.px-4.py-2.hover\:bg-gray-700 {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-primary) !important;
}

[data-theme="dark"] a.inline-flex.items-center.px-4.py-2.bg-gray-600:hover,
[data-theme="dark"] a.inline-flex.items-center.px-4.py-2.hover\:bg-gray-700:hover {
    background-color: var(--bg-secondary) !important;
    color: var(--accent-primary) !important;
}



/* Submit Loan Request button - Green button styling for dark mode */
[data-theme="dark"] button#submitLoanBtn,
[data-theme="dark"] #submitLoanBtn {
    background-color: #059669 !important;
    color: #ffffff !important;
    border-color: #059669 !important;
}

[data-theme="dark"] button#submitLoanBtn:hover,
[data-theme="dark"] #submitLoanBtn:hover {
    background-color: #10b981 !important;
    border-color: #10b981 !important;
}

[data-theme="dark"] button#submitLoanBtn:disabled,
[data-theme="dark"] #submitLoanBtn:disabled {
    background-color: #4b5563 !important;
    color: #9ca3af !important;
    border-color: #4b5563 !important;
    cursor: not-allowed !important;
}

/* Red/Danger back buttons */
[data-theme="dark"] a.inline-flex.items-center.px-4.py-2.bg-red-50,
[data-theme="dark"] a.inline-flex.items-center.px-4.py-2.hover\:bg-red-100 {
    background-color: rgba(248, 113, 113, 0.2) !important;
    color: var(--accent-danger) !important;
}

[data-theme="dark"] a.inline-flex.items-center.px-4.py-2.bg-red-50:hover,
[data-theme="dark"] a.inline-flex.items-center.px-4.py-2.hover\:bg-red-100:hover {
    background-color: rgba(248, 113, 113, 0.3) !important;
}

/* Green back buttons */
[data-theme="dark"] a.inline-flex.items-center.px-4.py-2.bg-green-600,
[data-theme="dark"] a.inline-flex.items-center.px-4.py-2.hover\:bg-green-700 {
    background-color: #047857 !important;
    color: #ffffff !important;
    border: 1px solid #059669 !important;
}

[data-theme="dark"] a.inline-flex.items-center.px-4.py-2.bg-green-600:hover,
[data-theme="dark"] a.inline-flex.items-center.px-4.py-2.hover\:bg-green-700:hover {
    background-color: #059669 !important;
    color: #ffffff !important;
    border-color: #10b981 !important;
}

/* SVG icons in back buttons */
[data-theme="dark"] a.inline-flex.items-center svg {
    stroke: currentColor !important;
}

/* ========================================
   FSA RANKINGS - MCPR DATE RANGE SELECTOR
   ======================================== */

/* MCPR Filter Section Card (do not clobber enterprise inquiry-card-header emerald borders) */
[data-theme="dark"] .bg-white.rounded-xl.shadow-lg:has(#mcprList):not(:has(> .inquiry-card-header)),
[data-theme="dark"] .bg-white.rounded-xl.shadow-lg.p-6.mb-6:has(select) {
    background-color: #1f2937 !important;
    border: 2px solid #047857 !important;
}

/* MCPR Filter Section Header */
[data-theme="dark"] .bg-white.rounded-xl.shadow-lg:has(#mcprList) h2,
[data-theme="dark"] .bg-white.rounded-xl.shadow-lg:has(#mcprList) .text-gray-800 {
    color: #e5e7eb !important;
}

/* MCPR Label */
[data-theme="dark"] label[for="mcprList"],
[data-theme="dark"] .bg-white.rounded-xl.shadow-lg:has(#mcprList) label {
    color: #d1d5db !important;
}

/* MCPR Select Dropdown (unified with Client List #1e293b / #475569 palette) */
[data-theme="dark"] #mcprList,
[data-theme="dark"] select#mcprList,
[data-theme="dark"] .bg-white.rounded-xl.shadow-lg:has(#mcprList) select,
.dark .bg-white.rounded-xl.shadow-lg:has(#mcprList) select {
    background-color: #1e293b !important;
    background: #1e293b !important;
    border-color: #475569 !important;
    color: #f1f5f9 !important;
    color-scheme: dark !important;
}

[data-theme="dark"] #mcprList:focus,
[data-theme="dark"] select#mcprList:focus,
[data-theme="dark"] .bg-white.rounded-xl.shadow-lg:has(#mcprList) select:focus,
.dark .bg-white.rounded-xl.shadow-lg:has(#mcprList) select:focus {
    border-color: #34d399 !important;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.35) !important;
}

/* MCPR Search Button - ULTRA SPECIFIC */
[data-theme="dark"] #searchMcpr,
[data-theme="dark"] button#searchMcpr,
[data-theme="dark"] button#searchMcpr.bg-green-600,
[data-theme="dark"] button.bg-green-600.hover\:bg-green-700,
[data-theme="dark"] button.bg-green-600.text-white,
[data-theme="dark"] button.px-6.py-3.bg-green-600,
[data-theme="dark"] .px-6.py-3.bg-green-600.rounded-lg,
[data-theme="dark"] button.px-6.py-3.bg-green-600.hover\:bg-green-700.text-white.font-semibold.rounded-lg {
    background-color: #047857 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] #searchMcpr:hover,
[data-theme="dark"] button#searchMcpr:hover,
[data-theme="dark"] button#searchMcpr.bg-green-600:hover,
[data-theme="dark"] button.bg-green-600.hover\:bg-green-700:hover,
[data-theme="dark"] button.bg-green-600.text-white:hover,
[data-theme="dark"] button.px-6.py-3.bg-green-600:hover,
[data-theme="dark"] .px-6.py-3.bg-green-600.rounded-lg:hover,
[data-theme="dark"] .hover\:bg-green-700:hover,
[data-theme="dark"] button.hover\:bg-green-700:hover {
    background-color: #059669 !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4) !important;
}

/* Search button focus ring in dark mode - override white offset */
[data-theme="dark"] #searchMcpr:focus,
[data-theme="dark"] button#searchMcpr:focus {
    box-shadow: 0 0 0 2px #1f2937, 0 0 0 4px #10b981 !important;
    --tw-ring-color: #10b981 !important;
    --tw-ring-offset-color: #1f2937 !important;
}

/* FSA Rankings Header Card */
[data-theme="dark"] .bg-white.rounded-xl.border-2.border-green-300 {
    background-color: #1f2937 !important;
    border-color: #065f46 !important;
}

[data-theme="dark"] .bg-white.rounded-xl.border-2.border-green-300 h1 {
    color: #34d399 !important;
}

[data-theme="dark"] .bg-white.rounded-xl.border-2.border-green-300 p {
    color: #6ee7b7 !important;
}

/* Submit Loan Request Button - Dark Mode */
[data-theme="dark"] #submitLoanBtn {
    background-color: #047857 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] #submitLoanBtn:hover {
    background-color: #059669 !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] #submitLoanBtn:disabled {
    background-color: #4b5563 !important;
    color: #9ca3af !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
}

/* FSA Rankings & Global Table Card Sections */
[data-theme="dark"] .bg-white.rounded-xl.shadow-lg.overflow-hidden,
.dark .bg-white.rounded-xl.shadow-lg.overflow-hidden {
    background-color: #1f2937 !important;
    border: 2px solid rgba(4, 120, 87, 0.55) !important;
}

[data-theme="dark"] .bg-white.rounded-xl.shadow-lg.overflow-hidden .px-6.py-4.border-b.border-gray-200.bg-gray-50 {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.2) 0%, rgba(16, 185, 129, 0.3) 100%) !important;
    border-bottom: 2px solid var(--accent-success) !important;
}

[data-theme="dark"] .bg-white.rounded-xl.shadow-lg.overflow-hidden .px-6.py-4.border-b.border-gray-200.bg-gray-50 h3 {
    color: var(--accent-success) !important;
}


/* FSA Rankings Rank Badges - Gold, Silver, Bronze */
[data-theme="dark"] .inline-flex.items-center.px-3.py-1.rounded-full.text-sm.font-bold.bg-yellow-400.text-yellow-900 {
    background-color: rgba(245, 158, 11, 0.3) !important;
    color: #fbbf24 !important;
    border: 1px solid rgba(245, 158, 11, 0.5) !important;
}

[data-theme="dark"] .inline-flex.items-center.px-3.py-1.rounded-full.text-sm.font-bold.bg-gray-300.text-gray-900 {
    background-color: rgba(107, 114, 128, 0.3) !important;
    color: #d1d5db !important;
    border: 1px solid rgba(107, 114, 128, 0.5) !important;
}

[data-theme="dark"] .inline-flex.items-center.px-3.py-1.rounded-full.text-sm.font-bold.bg-orange-400.text-orange-900 {
    background-color: rgba(251, 146, 60, 0.3) !important;
    color: #fb923c !important;
    border: 1px solid rgba(251, 146, 60, 0.5) !important;
}

[data-theme="dark"] .inline-flex.items-center.px-2\.5\.py-1.rounded-full.text-sm.font-semibold.bg-gray-100.text-gray-700 {
    background-color: rgba(55, 65, 81, 0.5) !important;
    color: #e5e7eb !important;
    border: 1px solid rgba(107, 114, 128, 0.3) !important;
}

/* FSA Rankings Sales Badges - Top 3 */
[data-theme="dark"] .inline-flex.items-center.px-4.py-2.rounded-lg.text-lg.font-bold.bg-green-100.text-green-800.border-2.border-green-400 {
    background-color: rgba(52, 211, 153, 0.2) !important;
    color: #34d399 !important;
    border-color: rgba(52, 211, 153, 0.4) !important;
}

[data-theme="dark"] .inline-flex.items-center.px-4.py-2.rounded-lg.text-lg.font-bold.bg-blue-100.text-blue-800.border-2.border-blue-400 {
    background-color: rgba(96, 165, 250, 0.2) !important;
    color: #60a5fa !important;
    border-color: rgba(96, 165, 250, 0.4) !important;
}

[data-theme="dark"] .inline-flex.items-center.px-4.py-2.rounded-lg.text-lg.font-bold.bg-purple-100.text-purple-800.border-2.border-purple-400 {
    background-color: rgba(167, 139, 250, 0.2) !important;
    color: #a78bfa !important;
    border-color: rgba(167, 139, 250, 0.4) !important;
}

[data-theme="dark"] .inline-flex.items-center.px-3\.py-1\.5.rounded-md.text-base.font-semibold.bg-gray-50.text-gray-700 {
    background-color: rgba(55, 65, 81, 0.3) !important;
    color: #e5e7eb !important;
}

/* ========================================
   NOTIFICATIONS PAGE - DARK MODE
   ======================================== */

/* Notification Header */
[data-theme="dark"] .notification-header {
    background-color: var(--bg-card) !important;
    border-color: var(--accent-primary) !important;
}

[data-theme="dark"] .notification-header h1,
[data-theme="dark"] .notification-header .text-blue-800 {
    color: var(--accent-primary) !important;
}

[data-theme="dark"] .notification-header .text-blue-600 {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .notification-header svg {
    color: var(--accent-primary) !important;
}

/* Unread count banner */
[data-theme="dark"] .notification-header .bg-blue-50 {
    background-color: rgba(59, 130, 246, 0.15) !important;
    border-color: var(--accent-primary) !important;
}

[data-theme="dark"] .notification-header .text-blue-700 {
    color: var(--accent-primary) !important;
}

/* Notification Cards */
[data-theme="dark"] .notification-card {
    background-color: var(--bg-card) !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .notification-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] .notification-card.unread {
    background-color: var(--bg-secondary) !important;
    border-left-color: var(--accent-primary) !important;
}

/* Notification text */
[data-theme="dark"] .notification-card .text-gray-900 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .notification-card .text-gray-700 {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .notification-meta {
    color: var(--text-light) !important;
}

[data-theme="dark"] .notification-meta a {
    color: var(--accent-primary) !important;
}

[data-theme="dark"] .notification-meta a:hover {
    color: var(--accent-secondary) !important;
}

/* Notification type badges */
[data-theme="dark"] .notification-type.loan_request {
    background: rgba(254, 240, 138, 0.2) !important;
    color: #fbbf24 !important;
}

[data-theme="dark"] .notification-type.spot_cash_approval,
[data-theme="dark"] .notification-type.payment {
    background: rgba(52, 211, 153, 0.2) !important;
    color: var(--accent-success) !important;
}

[data-theme="dark"] .notification-type.new_client,
[data-theme="dark"] .notification-type.system {
    background: rgba(96, 165, 250, 0.2) !important;
    color: var(--accent-primary) !important;
}

[data-theme="dark"] .notification-type.new_staff {
    background: rgba(251, 146, 60, 0.2) !important;
    color: #fb923c !important;
}

/* New badge */
[data-theme="dark"] .notification-card .bg-blue-500 {
    background-color: var(--accent-primary) !important;
}

/* Empty state */
[data-theme="dark"] .empty-state {
    color: var(--text-light) !important;
}

[data-theme="dark"] .empty-state .text-gray-900 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .empty-state .text-gray-600 {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .empty-state svg {
    color: var(--text-light) !important;
}

/* Notification Form Card (create page) */
[data-theme="dark"] .notification-form-card {
    background-color: var(--bg-card) !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] .notification-form-header {
    background-color: var(--bg-secondary) !important;
    border-color: var(--border-primary) !important;
}

[data-theme="dark"] .notification-form-header h3 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .notification-form-body .form-label {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .notification-form-body .form-control {
    background-color: var(--bg-secondary) !important;
    border-color: var(--border-primary) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .notification-form-body .form-control:focus {
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2) !important;
}

/* Success/Error alert boxes */
[data-theme="dark"] .notification-header .bg-green-50 {
    background-color: rgba(52, 211, 153, 0.15) !important;
    border-color: var(--accent-success) !important;
}

[data-theme="dark"] .notification-header .bg-green-50 svg {
    color: var(--accent-success) !important;
}

[data-theme="dark"] .notification-header .bg-green-50 p {
    color: var(--accent-success) !important;
}

[data-theme="dark"] .notification-header .bg-red-50 {
    background-color: rgba(248, 113, 113, 0.15) !important;
    border-color: var(--accent-danger) !important;
}

[data-theme="dark"] .notification-header .bg-red-50 svg {
    color: var(--accent-danger) !important;
}

[data-theme="dark"] .notification-header .bg-red-50 p {
    color: var(--accent-danger) !important;
}

/* ========================================
   SWIFT MODAL - DARK MODE (Blur Effect)
   ======================================== */

/* Modal backdrop - enhance blur visibility in dark mode */
[data-theme="dark"] #swiftModal {
    background-color: rgba(0, 0, 0, 0.6) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    backdrop-filter: blur(8px) !important;
}

/* Modal content card */
[data-theme="dark"] #swiftModal > div {
    background-color: var(--bg-card) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
}

/* Modal header */
[data-theme="dark"] #swiftModalHeader {
    background-color: transparent !important;
}

[data-theme="dark"] #swiftModalTitle {
    color: var(--text-primary) !important;
}

/* Modal body */
[data-theme="dark"] #swiftModalBody {
    background-color: transparent !important;
}

[data-theme="dark"] #swiftModalMessage {
    color: var(--text-secondary) !important;
}

/* Modal icon backgrounds */
[data-theme="dark"] #swiftModalIcon.bg-green-100 {
    background-color: rgba(52, 211, 153, 0.2) !important;
}

[data-theme="dark"] #swiftModalIcon.bg-red-100 {
    background-color: rgba(248, 113, 113, 0.2) !important;
}

[data-theme="dark"] #swiftModalIcon.bg-yellow-100 {
    background-color: rgba(251, 191, 36, 0.2) !important;
}

[data-theme="dark"] #swiftModalIcon.bg-blue-100 {
    background-color: rgba(96, 165, 250, 0.2) !important;
}

/* Modal action buttons area */
[data-theme="dark"] #swiftModalActions {
    background-color: transparent !important;
}

/* Modal buttons - default states */
[data-theme="dark"] #swiftModalActions button {
    border: 1px solid transparent !important;
}

[data-theme="dark"] #swiftModalActions button.bg-green-500 {
    background-color: var(--accent-success) !important;
}

[data-theme="dark"] #swiftModalActions button.bg-green-500:hover {
    background-color: #059669 !important;
}

[data-theme="dark"] #swiftModalActions button.bg-red-500 {
    background-color: var(--accent-danger) !important;
}

[data-theme="dark"] #swiftModalActions button.bg-red-500:hover {
    background-color: #dc2626 !important;
}

[data-theme="dark"] #swiftModalActions button.bg-yellow-500 {
    background-color: #f59e0b !important;
    color: #1f2937 !important;
}

[data-theme="dark"] #swiftModalActions button.bg-yellow-500:hover {
    background-color: #d97706 !important;
}

[data-theme="dark"] #swiftModalActions button.bg-blue-500 {
    background-color: var(--accent-primary) !important;
}

[data-theme="dark"] #swiftModalActions button.bg-blue-500:hover {
    background-color: #2563eb !important;
}

[data-theme="dark"] #swiftModalActions button.bg-gray-100,
[data-theme="dark"] #swiftModalActions button.bg-gray-200,
[data-theme="dark"] #swiftModalActions button.bg-gray-300,
[data-theme="dark"] #swiftModalActions button.bg-gray-400 {
    background-color: #374151 !important;
    color: #f9fafb !important;
    border: 1px solid #4b5563 !important;
}

[data-theme="dark"] #swiftModalActions button.bg-gray-100:hover,
[data-theme="dark"] #swiftModalActions button.bg-gray-200:hover,
[data-theme="dark"] #swiftModalActions button.bg-gray-300:hover,
[data-theme="dark"] #swiftModalActions button.bg-gray-400:hover,
[data-theme="dark"] #swiftModalActions button.hover\:bg-gray-300:hover,
[data-theme="dark"] #swiftModalActions button.hover\:bg-gray-400:hover {
    background-color: #4b5563 !important;
    color: #ffffff !important;
}

/* =====================================================
   FSA Details, Processing & Success Modals — Dark Mode Support
   ===================================================== */
[data-theme="dark"] #fsaDetailsModal .modal-content,
[data-theme="dark"] #processingModal .modal-content,
[data-theme="dark"] #successModal .modal-content {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] #fsaDetailsModal .modal-header,
[data-theme="dark"] #processingModal .modal-header {
    background: linear-gradient(135deg, #064e3b 0%, #022c22 100%) !important;
    border-bottom: 2px solid #047857 !important;
}

[data-theme="dark"] #fsaDetailsModal .modal-header h5,
[data-theme="dark"] #processingModal .modal-header h5 {
    color: #34d399 !important;
}

[data-theme="dark"] #fsaDetailsModal .modal-header .btn-close,
[data-theme="dark"] #processingModal .modal-header .btn-close {
    color: #34d399 !important;
    filter: invert(1) grayscale(100%) brightness(200%) !important;
}

[data-theme="dark"] #fsaDetailsModal .modal-body,
[data-theme="dark"] #processingModal .modal-body {
    background-color: var(--bg-secondary) !important;
}

[data-theme="dark"] .fsa-modal-info {
    background-color: var(--bg-tertiary) !important;
    border-color: var(--border-primary) !important;
}

[data-theme="dark"] .fsa-modal-info .fsa-name {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .fsa-modal-info .fsa-total {
    background: linear-gradient(135deg, #064e3b, #022c22) !important;
    color: #34d399 !important;
    border-color: #047857 !important;
}

[data-theme="dark"] .modal-table-wrapper {
    border-color: var(--border-primary) !important;
}

[data-theme="dark"] #modalDetailsTable {
    background-color: var(--bg-secondary) !important;
}

[data-theme="dark"] #modalDetailsTable thead th {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%) !important;
    color: var(--text-primary) !important;
    border-bottom: 2px solid var(--border-primary) !important;
}

[data-theme="dark"] #modalDetailsTable tbody tr {
    background-color: var(--bg-secondary) !important;
    border-bottom: 1px solid var(--border-primary) !important;
}

[data-theme="dark"] #modalDetailsTable tbody tr:nth-child(even) {
    background-color: var(--bg-primary) !important;
}

[data-theme="dark"] #modalDetailsTable tbody tr:hover {
    background-color: rgba(52, 211, 153, 0.15) !important; /* Soft emerald hover in dark mode */
}

[data-theme="dark"] #modalDetailsTable tbody td {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] #fsaDetailsModal .modal-footer,
[data-theme="dark"] #processingModal .modal-footer {
    background-color: var(--bg-secondary) !important;
    border-top: 1px solid var(--border-primary) !important;
}

[data-theme="dark"] #fsaDetailsModal .modal-footer .btn-close-modal,
[data-theme="dark"] #processingModal .modal-footer .btn-close-modal {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-primary) !important;
}

[data-theme="dark"] #fsaDetailsModal .modal-footer .btn-close-modal:hover,
[data-theme="dark"] #processingModal .modal-footer .btn-close-modal:hover {
    background-color: var(--bg-primary) !important;
}

/* ============================================================
   REPORTS PAGE & UNIVERSAL DATE MODAL - DARK & LIGHT MODE
   ============================================================ */
[data-theme="dark"] .universal-date-helper,
.dark .universal-date-helper {
    background-color: rgba(6, 78, 59, 0.85) !important;
    border-color: #059669 !important;
    color: #6ee7b7 !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] .universal-date-helper:hover,
.dark .universal-date-helper:hover {
    background-color: #047857 !important;
    border-color: #10b981 !important;
    color: #ffffff !important;
}

[data-theme="dark"] .universal-date-helper span.rounded-full,
.dark .universal-date-helper span.rounded-full {
    background-color: #10b981 !important;
    color: #ffffff !important;
}

[data-theme="dark"] #universalDateModal .bg-white,
.dark #universalDateModal .bg-white {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

[data-theme="dark"] #universalDateModal .bg-gray-50,
.dark #universalDateModal .bg-gray-50 {
    background-color: #0f172a !important;
    border-color: #334155 !important;
}

[data-theme="dark"] #universalDateModal input,
.dark #universalDateModal input {
    background-color: #1e293b !important;
    border-color: #475569 !important;
    color: #f8fafc !important;
}

[data-theme="dark"] #universalDateModal input::placeholder,
.dark #universalDateModal input::placeholder {
    color: #64748b !important;
}

[data-theme="dark"] #universalDateModal .text-gray-800,
.dark #universalDateModal .text-gray-800,
[data-theme="dark"] #universalDateModal .text-gray-900,
.dark #universalDateModal .text-gray-900 {
    color: #f8fafc !important;
}

[data-theme="dark"] #universalDateModal .text-gray-500,
.dark #universalDateModal .text-gray-500,
[data-theme="dark"] #universalDateModal .text-gray-600,
.dark #universalDateModal .text-gray-600 {
    color: #94a3b8 !important;
}

[data-theme="dark"] #universalDateModal button:hover,
.dark #universalDateModal button:hover {
    background-color: rgba(16, 185, 129, 0.15) !important;
}

[data-theme="dark"] #universalDateModal .bg-gray-100,
.dark #universalDateModal .bg-gray-100 {
    background-color: #334155 !important;
    color: #e2e8f0 !important;
}

[data-theme="dark"] #universalDateModal .border-gray-100,
.dark #universalDateModal .border-gray-100,
[data-theme="dark"] #universalDateModal .border-gray-200,
.dark #universalDateModal .border-gray-200,
[data-theme="dark"] #universalDateModal .divide-gray-100 > * + *,
.dark #universalDateModal .divide-gray-100 > * + * {
    border-color: #334155 !important;
}

/* Reports Page Dark Mode Inputs & Controls */
[data-theme="dark"] form[action*="report"] select,
.dark form[action*="report"] select,
[data-theme="dark"] form[action*="report"] input,
.dark form[action*="report"] input,
[data-theme="dark"] input[type="date"],
.dark input[type="date"],
[data-theme="dark"] input[type="month"],
.dark input[type="month"],
[data-theme="dark"] input[type="time"],
.dark input[type="time"],
[data-theme="dark"] input[type="datetime-local"],
.dark input[type="datetime-local"] {
    background-color: #1e293b !important;
    border-color: #475569 !important;
    color: #f1f5f9 !important;
    color-scheme: dark !important;
}

[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
.dark input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] input[type="month"]::-webkit-calendar-picker-indicator,
.dark input[type="month"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator,
.dark input[type="time"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] input[type="datetime-local"]::-webkit-calendar-picker-indicator,
.dark input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.2) !important;
    cursor: pointer;
}

[data-theme="dark"] form[action*="report"] label,
.dark form[action*="report"] label {
    color: #cbd5e1 !important;
}

[data-theme="dark"] form[action*="report"] .bg-gray-50,
.dark form[action*="report"] .bg-gray-50,
[data-theme="dark"] form[action*="report"] .bg-gray-100,
.dark form[action*="report"] .bg-gray-100 {
    background-color: rgba(15, 23, 42, 0.45) !important;
    border-color: rgba(75, 85, 99, 0.5) !important;
    color: #f8fafc !important;
}

/* Dashboard & Global Year Selectors / Inputs in Dark Mode */
[data-theme="dark"] #dashboard-year,
.dark #dashboard-year,
[data-theme="dark"] select#dashboard-year,
.dark select#dashboard-year,
[data-theme="dark"] #yearFilterSelect,
.dark #yearFilterSelect,
[data-theme="dark"] select#yearFilterSelect,
.dark select#yearFilterSelect,
[data-theme="dark"] select[name="year"],
.dark select[name="year"],
[data-theme="dark"] select[id*="year" i],
.dark select[id*="year" i],
[data-theme="dark"] input[name="year"],
.dark input[name="year"],
[data-theme="dark"] input[id*="year" i],
.dark input[id*="year" i] {
    background-color: #1e293b !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e") !important;
    background-position: right 0.5rem center !important;
    background-repeat: no-repeat !important;
    background-size: 1.25em 1.25em !important;
    padding-right: 2rem !important;
    border: 1px solid #475569 !important;
    color: #f8fafc !important;
    color-scheme: dark !important;
}

[data-theme="dark"] #dashboard-year option,
.dark #dashboard-year option,
[data-theme="dark"] #yearFilterSelect option,
.dark #yearFilterSelect option,
[data-theme="dark"] select[name="year"] option,
.dark select[name="year"] option,
[data-theme="dark"] select[id*="year" i] option,
.dark select[id*="year" i] option {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}

[data-theme="dark"] #dashboard-year:focus,
.dark #dashboard-year:focus,
[data-theme="dark"] #yearFilterSelect:focus,
.dark #yearFilterSelect:focus {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3) !important;
    outline: none !important;
}

/* Staff Linked Accounts Modal Dark Mode */
[data-theme="dark"] #linkedSearchInput,
.dark #linkedSearchInput,
[data-theme="dark"] #linkedAccountsModal input[type="text"],
.dark #linkedAccountsModal input[type="text"] {
    background-color: #1e293b !important;
    border: 1px solid #475569 !important;
    color: #f8fafc !important;
}

[data-theme="dark"] #linkedSearchInput::placeholder,
.dark #linkedSearchInput::placeholder,
[data-theme="dark"] #linkedAccountsModal input[type="text"]::placeholder,
.dark #linkedAccountsModal input[type="text"]::placeholder {
    color: #94a3b8 !important;
}

[data-theme="dark"] #linkedSearchInput:focus,
.dark #linkedSearchInput:focus,
[data-theme="dark"] #linkedAccountsModal input[type="text"]:focus,
.dark #linkedAccountsModal input[type="text"]:focus {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3) !important;
}

[data-theme="dark"] #linkedStaffList label,
.dark #linkedStaffList label {
    border-color: #334155 !important;
    color: #f8fafc !important;
}

[data-theme="dark"] #linkedStaffList label:hover,
.dark #linkedStaffList label:hover {
    background-color: #334155 !important;
}

#linkedAccountsModal .modal-footer,
.dark #linkedAccountsModal .modal-footer,
[data-theme="dark"] #linkedAccountsModal .modal-footer {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
}

#linkedAccountsModal #btnClearLinked,
.dark #linkedAccountsModal #btnClearLinked,
[data-theme="dark"] #linkedAccountsModal #btnClearLinked {
    margin-right: auto !important;
}

/* =====================================================
   DataTables Pagination Dark Mode & Centered Layout
   ===================================================== */
[data-theme="dark"] .dataTables_paginate,
.dark .dataTables_paginate,
[data-theme="dark"] .dataTables_wrapper .dataTables_paginate,
.dark .dataTables_wrapper .dataTables_paginate {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    float: none !important;
    width: 100% !important;
    margin: 0 auto !important;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

[data-theme="dark"] .dataTables_paginate ul,
[data-theme="dark"] .dataTables_paginate ul.pagination,
[data-theme="dark"] .dataTables_paginate li,
[data-theme="dark"] .dataTables_paginate li.page-item,
[data-theme="dark"] .dataTables_paginate li.paginate_button,
[data-theme="dark"] .dataTables_paginate li.disabled,
[data-theme="dark"] .dataTables_paginate li.previous,
[data-theme="dark"] .dataTables_paginate li.next,
[data-theme="dark"] .dataTables_wrapper .dataTables_paginate ul,
[data-theme="dark"] .dataTables_wrapper .dataTables_paginate ul.pagination,
[data-theme="dark"] .dataTables_wrapper .dataTables_paginate li,
[data-theme="dark"] .dataTables_wrapper .dataTables_paginate li.page-item,
[data-theme="dark"] .dataTables_wrapper .dataTables_paginate li.paginate_button,
[data-theme="dark"] .dataTables_wrapper .dataTables_paginate li.disabled,
[data-theme="dark"] .dataTables_wrapper .dataTables_paginate li.previous,
[data-theme="dark"] .dataTables_wrapper .dataTables_paginate li.next,
.dark .dataTables_paginate ul,
.dark .dataTables_paginate ul.pagination,
.dark .dataTables_paginate li,
.dark .dataTables_paginate li.page-item,
.dark .dataTables_paginate li.paginate_button,
.dark .dataTables_paginate li.disabled,
.dark .dataTables_paginate li.previous,
.dark .dataTables_paginate li.next,
.dark .dataTables_wrapper .dataTables_paginate ul,
.dark .dataTables_wrapper .dataTables_paginate ul.pagination,
.dark .dataTables_wrapper .dataTables_paginate li,
.dark .dataTables_wrapper .dataTables_paginate li.page-item,
.dark .dataTables_wrapper .dataTables_paginate li.paginate_button,
.dark .dataTables_wrapper .dataTables_paginate li.disabled,
.dark .dataTables_wrapper .dataTables_paginate li.previous,
.dark .dataTables_wrapper .dataTables_paginate li.next {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    float: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

[data-theme="dark"] .dataTables_paginate .page-link,
[data-theme="dark"] .dataTables_paginate a,
[data-theme="dark"] .dataTables_paginate button,
[data-theme="dark"] .dataTables_paginate .paginate_button,
[data-theme="dark"] .page-link,
.dark .dataTables_paginate .page-link,
.dark .dataTables_paginate a,
.dark .dataTables_paginate button,
.dark .dataTables_paginate .paginate_button,
.dark .page-link {
    background: #1e293b !important;
    background-color: #1e293b !important;
    background-image: none !important;
    border: 1px solid #334155 !important;
    color: #cbd5e1 !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25) !important;
    min-width: 40px !important;
    height: 40px !important;
    padding: 0 0.875rem !important;
    margin: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transform: none !important;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease !important;
}

[data-theme="dark"] .dataTables_paginate a:hover:not(.disabled):not(.current):not(.active):not([aria-disabled="true"]),
[data-theme="dark"] .dataTables_paginate button:hover:not(.disabled):not(.current):not(.active):not([aria-disabled="true"]),
[data-theme="dark"] .dataTables_paginate .page-link:hover:not(.disabled):not(.active):not([aria-disabled="true"]),
.dark .dataTables_paginate a:hover:not(.disabled):not(.current):not(.active):not([aria-disabled="true"]),
.dark .dataTables_paginate button:hover:not(.disabled):not(.current):not(.active):not([aria-disabled="true"]),
.dark .dataTables_paginate .page-link:hover:not(.disabled):not(.active):not([aria-disabled="true"]) {
    background: #334155 !important;
    background-color: #334155 !important;
    background-image: none !important;
    border-color: #10b981 !important;
    color: #34d399 !important;
    font-weight: 700 !important;
    transform: none !important;
    box-shadow: 0 0 0 1px #10b981, 0 2px 8px rgba(16, 185, 129, 0.25) !important;
    z-index: 2 !important;
}

[data-theme="dark"] .dataTables_paginate .active > .page-link,
[data-theme="dark"] .dataTables_paginate .page-item.active .page-link,
[data-theme="dark"] .dataTables_paginate a.current,
[data-theme="dark"] .dataTables_paginate a.active,
[data-theme="dark"] .dataTables_paginate button.current,
[data-theme="dark"] .dataTables_paginate button.active,
.dark .dataTables_paginate .active > .page-link,
.dark .dataTables_paginate .page-item.active .page-link,
.dark .dataTables_paginate a.current,
.dark .dataTables_paginate a.active,
.dark .dataTables_paginate button.current,
.dark .dataTables_paginate button.active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    background-color: #10b981 !important;
    border: 1px solid #059669 !important;
    border-radius: 0.5rem !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4) !important;
    transform: none !important;
    cursor: default !important;
    z-index: 1 !important;
}

[data-theme="dark"] .dataTables_paginate .disabled > .page-link,
[data-theme="dark"] .dataTables_paginate .page-item.disabled .page-link,
[data-theme="dark"] .dataTables_paginate a.disabled,
[data-theme="dark"] .dataTables_paginate button.disabled,
[data-theme="dark"] .dataTables_paginate a[aria-disabled="true"],
[data-theme="dark"] .page-item.disabled .page-link,
.dark .dataTables_paginate .disabled > .page-link,
.dark .dataTables_paginate .page-item.disabled .page-link,
.dark .dataTables_paginate a.disabled,
.dark .dataTables_paginate button.disabled,
.dark .dataTables_paginate a[aria-disabled="true"],
.dark .page-item.disabled .page-link {
    background: #1e293b !important;
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
    border-radius: 0.5rem !important;
    color: #64748b !important;
    opacity: 0.45 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    box-shadow: none !important;
    transform: none !important;
}

/* ─────────────────────────────────────────────────────────────
   Multi-Branch Access Panel - Dark Mode Support
───────────────────────────────────────────────────────────── */
[data-theme="dark"] .branch-access-panel,
.dark .branch-access-panel {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(30, 27, 75, 0.3) 100%) !important;
    border-color: #334155 !important;
}

[data-theme="dark"] #branchCheckboxList > div,
.dark #branchCheckboxList > div {
    background-color: rgba(15, 23, 42, 0.6) !important;
    border-color: #334155 !important;
}

[data-theme="dark"] #branchCheckboxList label,
.dark #branchCheckboxList label {
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

[data-theme="dark"] #branchCheckboxList label:hover,
.dark #branchCheckboxList label:hover {
    background-color: rgba(30, 41, 59, 0.8) !important;
    border-color: #6366f1 !important;
}

[data-theme="dark"] #branchCheckboxList label.is-primary,
.dark #branchCheckboxList label.is-primary,
[data-theme="dark"] #branchCheckboxList label.bg-purple-50,
.dark #branchCheckboxList label.bg-purple-50 {
    background-color: rgba(88, 28, 135, 0.3) !important;
    border-color: rgba(168, 85, 247, 0.4) !important;
}

[data-theme="dark"] #branchCheckboxList label.is-checked,
.dark #branchCheckboxList label.is-checked {
    background-color: rgba(67, 56, 202, 0.25) !important;
    border-color: rgba(99, 102, 241, 0.5) !important;
}

[data-theme="dark"] #branchCheckboxList .primary-badge,
.dark #branchCheckboxList .primary-badge,
[data-theme="dark"] #branchCheckboxList .bg-purple-200,
.dark #branchCheckboxList .bg-purple-200 {
    background-color: rgba(147, 51, 234, 0.3) !important;
    color: #d8b4fe !important;
    border-color: rgba(168, 85, 247, 0.4) !important;
}

[data-theme="dark"] #noMultiBranchMsg,
.dark #noMultiBranchMsg {
    background-color: rgba(15, 23, 42, 0.6) !important;
    border-color: #334155 !important;
    color: #94a3b8 !important;
}

/* ========================================
   CLIENT PORTAL & MODALS DARK MODE
   ======================================== */
[data-theme="dark"] #changePasswordModal,
.dark #changePasswordModal,
[data-theme="dark"] #policyAgreementModal,
.dark #policyAgreementModal,
[data-theme="dark"] #downloadPdfPaperModal,
.dark #downloadPdfPaperModal {
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    background-color: rgba(2, 6, 23, 0.65) !important;
}

/* Signature pad modals skip backdrop-filter blur so live canvas drawing has zero GPU/blur compositing lag */
[data-theme="dark"] #policySignaturePadModal,
.dark #policySignaturePadModal,
[data-theme="dark"] #signaturePadModal,
.dark #signaturePadModal {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background-color: rgba(2, 6, 23, 0.78) !important;
}

[data-theme="dark"] #changePasswordModal input,
.dark #changePasswordModal input,
[data-theme="dark"] #changePasswordForm input,
.dark #changePasswordForm input {
    background-color: #1e293b !important;
    color: #f8fafc !important;
    border-color: #475569 !important;
}

[data-theme="dark"] #changePasswordModal input::placeholder,
.dark #changePasswordModal input::placeholder,
[data-theme="dark"] #changePasswordForm input::placeholder,
.dark #changePasswordForm input::placeholder {
    color: #64748b !important;
}

[data-theme="dark"] #changePasswordModal input:focus,
.dark #changePasswordModal input:focus,
[data-theme="dark"] #changePasswordForm input:focus,
.dark #changePasswordForm input:focus {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25) !important;
}

[data-theme="dark"] #policySignatureModalSurface,
.dark #policySignatureModalSurface,
[data-theme="dark"] #signatureModalSurface,
.dark #signatureModalSurface {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
}

/* =====================================================
   Universal Form Inputs & Search Fields Dark Mode
   Applied to all text, search, select, and textarea inputs
   ===================================================== */
[data-theme="dark"] input:not([type]),
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="search"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="datetime-local"],
[data-theme="dark"] input[type="month"],
[data-theme="dark"] input[type="tel"],
[data-theme="dark"] input[type="url"],
[data-theme="dark"] textarea,
[data-theme="dark"] select,
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] .form-input,
.dark input:not([type]),
.dark input[type="text"],
.dark input[type="search"],
.dark input[type="password"],
.dark input[type="email"],
.dark input[type="number"],
.dark input[type="date"],
.dark input[type="datetime-local"],
.dark input[type="month"],
.dark input[type="tel"],
.dark input[type="url"],
.dark textarea,
.dark select,
.dark .form-control,
.dark .form-select,
.dark .form-input {
    background-color: #1e293b !important;
    border-color: #475569 !important;
    color: #f8fafc !important;
    color-scheme: dark !important;
}

[data-theme="dark"] input[type="text"]::placeholder,
[data-theme="dark"] input[type="search"]::placeholder,
[data-theme="dark"] input[type="password"]::placeholder,
[data-theme="dark"] input[type="email"]::placeholder,
[data-theme="dark"] input[type="number"]::placeholder,
[data-theme="dark"] textarea::placeholder,
.dark input[type="text"]::placeholder,
.dark input[type="search"]::placeholder,
.dark input[type="password"]::placeholder,
.dark input[type="email"]::placeholder,
.dark input[type="number"]::placeholder,
.dark textarea::placeholder {
    color: #94a3b8 !important;
    opacity: 1 !important;
}

[data-theme="dark"] input:not([type]):focus,
[data-theme="dark"] input[type="text"]:focus,
[data-theme="dark"] input[type="search"]:focus,
[data-theme="dark"] input[type="password"]:focus,
[data-theme="dark"] input[type="email"]:focus,
[data-theme="dark"] input[type="number"]:focus,
[data-theme="dark"] input[type="date"]:focus,
[data-theme="dark"] input[type="datetime-local"]:focus,
[data-theme="dark"] input[type="month"]:focus,
[data-theme="dark"] input[type="tel"]:focus,
[data-theme="dark"] input[type="url"]:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus,
.dark input:not([type]):focus,
.dark input[type="text"]:focus,
.dark input[type="search"]:focus,
.dark input[type="password"]:focus,
.dark input[type="email"]:focus,
.dark input[type="number"]:focus,
.dark input[type="date"]:focus,
.dark input[type="datetime-local"]:focus,
.dark input[type="month"]:focus,
.dark input[type="tel"]:focus,
.dark input[type="url"]:focus,
.dark textarea:focus,
.dark select:focus,
.dark .form-control:focus,
.dark .form-select:focus {
    border-color: #10b981 !important;
    background-color: #1e293b !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3) !important;
    outline: none !important;
    color: #ffffff !important;
}

[data-theme="dark"] select option,
.dark select option {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}

/* ─── Verify Collector Dark Mode Overrides ─── */
[data-theme="dark"] #verifyCollectorTable,
.dark #verifyCollectorTable {
    color: #f1f5f9 !important;
}

[data-theme="dark"] #verifyCollectorTable tbody tr,
.dark #verifyCollectorTable tbody tr {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

[data-theme="dark"] #verifyCollectorTable tbody tr:hover,
.dark #verifyCollectorTable tbody tr:hover {
    background-color: #283548 !important;
}

[data-theme="dark"] #verifyCollectorTable_wrapper .dataTables_length select,
.dark #verifyCollectorTable_wrapper .dataTables_length select,
[data-theme="dark"] #verifyCollectorTable_wrapper .dataTables_filter input,
.dark #verifyCollectorTable_wrapper .dataTables_filter input {
    background-color: #1e293b !important;
    color: #f8fafc !important;
    border: 1px solid #334155 !important;
    border-radius: 0.5rem !important;
}

[data-theme="dark"] #verifyCollectorTable_wrapper .dataTables_info,
.dark #verifyCollectorTable_wrapper .dataTables_info,
[data-theme="dark"] #verifyCollectorTable_wrapper .dataTables_length label,
.dark #verifyCollectorTable_wrapper .dataTables_length label,
[data-theme="dark"] #verifyCollectorTable_wrapper .dataTables_filter label,
.dark #verifyCollectorTable_wrapper .dataTables_filter label {
    color: #94a3b8 !important;
}

[data-theme="dark"] #verifyCollectorTable_wrapper .paginate_button,
.dark #verifyCollectorTable_wrapper .paginate_button {
    color: #94a3b8 !important;
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
}

[data-theme="dark"] #verifyCollectorTable_wrapper .paginate_button.current,
.dark #verifyCollectorTable_wrapper .paginate_button.current {
    color: #ffffff !important;
    background: #059669 !important;
    border-color: #059669 !important;
}

[data-theme="dark"] #filterDateFrom,
.dark #filterDateFrom,
[data-theme="dark"] #filterDateTo,
.dark #filterDateTo,
[data-theme="dark"] #filterCollector,
.dark #filterCollector {
    background-color: #1e293b !important;
    color: #f8fafc !important;
    border: 1px solid #475569 !important;
    color-scheme: dark !important;
}

[data-theme="dark"] #filterDateFrom::-webkit-calendar-picker-indicator,
.dark #filterDateFrom::-webkit-calendar-picker-indicator,
[data-theme="dark"] #filterDateTo::-webkit-calendar-picker-indicator,
.dark #filterDateTo::-webkit-calendar-picker-indicator {
    filter: invert(1) !important;
    cursor: pointer;
}

[data-theme="dark"] #filterCollector option,
.dark #filterCollector option {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}

/* ─── Assign Collector Dark Mode Overrides ─── */
[data-theme="dark"] #assignCollectorTable,
.dark #assignCollectorTable {
    color: #f1f5f9 !important;
}

[data-theme="dark"] #assignCollectorTable tbody tr,
.dark #assignCollectorTable tbody tr {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

[data-theme="dark"] #assignCollectorTable tbody tr:hover,
.dark #assignCollectorTable tbody tr:hover {
    background-color: #283548 !important;
}

[data-theme="dark"] #assignCollectorTable_wrapper .dataTables_length select,
.dark #assignCollectorTable_wrapper .dataTables_length select,
[data-theme="dark"] #assignCollectorTable_wrapper .dataTables_filter input,
.dark #assignCollectorTable_wrapper .dataTables_filter input {
    background-color: #1e293b !important;
    color: #f8fafc !important;
    border: 1px solid #334155 !important;
    border-radius: 0.5rem !important;
}

[data-theme="dark"] #assignCollectorTable_wrapper .dataTables_info,
.dark #assignCollectorTable_wrapper .dataTables_info,
[data-theme="dark"] #assignCollectorTable_wrapper .dataTables_length label,
.dark #assignCollectorTable_wrapper .dataTables_length label,
[data-theme="dark"] #assignCollectorTable_wrapper .dataTables_filter label,
.dark #assignCollectorTable_wrapper .dataTables_filter label {
    color: #94a3b8 !important;
}

[data-theme="dark"] #assignCollectorTable_wrapper .paginate_button,
.dark #assignCollectorTable_wrapper .paginate_button {
    color: #94a3b8 !important;
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
}

[data-theme="dark"] #assignCollectorTable_wrapper .paginate_button.current,
.dark #assignCollectorTable_wrapper .paginate_button.current {
    color: #ffffff !important;
    background: #059669 !important;
    border-color: #059669 !important;
}

[data-theme="dark"] #modalCollectorSelect,
.dark #modalCollectorSelect {
    background-color: #1e293b !important;
    color: #f8fafc !important;
    border: 1px solid #475569 !important;
}

/* Universal File Input Dark Mode Styles */
[data-theme="dark"] input[type="file"],
.dark input[type="file"] {
    background-color: #1e293b !important;
    color: #e2e8f0 !important;
    border-color: #334155 !important;
}

[data-theme="dark"] input[type="file"]::file-selector-button,
.dark input[type="file"]::file-selector-button {
    background: #3b82f6 !important;
    color: #ffffff !important;
    border: none !important;
    padding: 0.35rem 0.85rem !important;
    border-radius: 0.375rem !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    margin-right: 0.75rem !important;
    transition: background-color 0.2s ease !important;
}

[data-theme="dark"] input[type="file"]::file-selector-button:hover,
.dark input[type="file"]::file-selector-button:hover {
    background: #2563eb !important;
}

[data-theme="dark"] input[type="file"]::-webkit-file-upload-button,
.dark input[type="file"]::-webkit-file-upload-button {
    background: #3b82f6 !important;
    color: #ffffff !important;
    border: none !important;
    padding: 0.35rem 0.85rem !important;
    border-radius: 0.375rem !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    margin-right: 0.75rem !important;
    transition: background-color 0.2s ease !important;
}

[data-theme="dark"] input[type="file"]::-webkit-file-upload-button:hover,
.dark input[type="file"]::-webkit-file-upload-button:hover {
    background: #2563eb !important;
}

/* Universal DataTables Search & Filter Controls Dark Mode Overrides (Standardized to Client List #1e293b) */
html[data-theme="dark"] .dataTables_filter input,
html.dark .dataTables_filter input,
[data-theme="dark"] .dataTables_filter input,
.dark .dataTables_filter input,
[data-theme="dark"] .dataTables_wrapper .dataTables_filter input,
.dark .dataTables_wrapper .dataTables_filter input,
[data-theme="dark"] div.dataTables_filter input,
.dark div.dataTables_filter input,
[data-theme="dark"] [id$="_filter"] input,
.dark [id$="_filter"] input,
[data-theme="dark"] #firstPaymentTable_filter input,
.dark #firstPaymentTable_filter input,
[data-theme="dark"] #verifyListTable_filter input,
.dark #verifyListTable_filter input,
[data-theme="dark"] input[type="search"],
.dark input[type="search"] {
    background: #1e293b !important;
    background-color: #1e293b !important;
    border: 1px solid #475569 !important;
    border-color: #475569 !important;
    color: #f1f5f9 !important;
    color-scheme: dark !important;
    border-radius: 0.5rem !important;
}

html[data-theme="dark"] .dataTables_filter input::placeholder,
html.dark .dataTables_filter input::placeholder,
[data-theme="dark"] .dataTables_filter input::placeholder,
.dark .dataTables_filter input::placeholder,
[data-theme="dark"] .dataTables_wrapper .dataTables_filter input::placeholder,
.dark .dataTables_wrapper .dataTables_filter input::placeholder {
    color: #94a3b8 !important;
    opacity: 1 !important;
}

html[data-theme="dark"] .dataTables_filter input:focus,
html.dark .dataTables_filter input:focus,
[data-theme="dark"] .dataTables_filter input:focus,
.dark .dataTables_filter input:focus,
[data-theme="dark"] .dataTables_wrapper .dataTables_filter input:focus,
.dark .dataTables_wrapper .dataTables_filter input:focus,
[data-theme="dark"] [id$="_filter"] input:focus,
.dark [id$="_filter"] input:focus,
html.dark [id$="_filter"] input:focus {
    background: #1e293b !important;
    background-color: #1e293b !important;
    border-color: #34d399 !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.35) !important;
    outline: none !important;
    position: relative !important;
    z-index: 10 !important;
}

html[data-theme="dark"] .dataTables_length select,
html.dark .dataTables_length select,
[data-theme="dark"] .dataTables_length select,
.dark .dataTables_length select,
[data-theme="dark"] .dataTables_wrapper .dataTables_length select,
.dark .dataTables_wrapper .dataTables_length select,
[data-theme="dark"] [id$="_length"] select,
.dark [id$="_length"] select {
    background: #1e293b !important;
    background-color: #1e293b !important;
    border: 1px solid #475569 !important;
    border-color: #475569 !important;
    color: #f1f5f9 !important;
    color-scheme: dark !important;
    border-radius: 0.5rem !important;
    transition: all 0.2s ease-in-out !important;
}

html[data-theme="dark"] .dataTables_length select:focus,
html.dark .dataTables_length select:focus,
[data-theme="dark"] .dataTables_length select:focus,
.dark .dataTables_length select:focus,
[data-theme="dark"] .dataTables_wrapper .dataTables_length select:focus,
.dark .dataTables_wrapper .dataTables_length select:focus,
[data-theme="dark"] [id$="_length"] select:focus,
.dark [id$="_length"] select:focus {
    border-color: #34d399 !important;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.35) !important;
    outline: none !important;
    position: relative !important;
    z-index: 10 !important;
}

html[data-theme="dark"] select:not(.no-dark-select),
html.dark select:not(.no-dark-select),
[data-theme="dark"] select:not(.no-dark-select),
.dark select:not(.no-dark-select),
html[data-theme="dark"] select#branchFilter,
html.dark select#branchFilter,
[data-theme="dark"] select#branchFilter,
.dark select#branchFilter,
html[data-theme="dark"] select#sortFilter,
html.dark select#sortFilter,
[data-theme="dark"] select#sortFilter,
.dark select#sortFilter {
    background-color: #1e293b !important;
    background: #1e293b !important;
    border-color: #475569 !important;
    color: #f1f5f9 !important;
    color-scheme: dark !important;
    transition: all 0.2s ease-in-out !important;
}

html[data-theme="dark"] select:not(.no-dark-select):focus,
html.dark select:not(.no-dark-select):focus,
[data-theme="dark"] select:not(.no-dark-select):focus,
.dark select:not(.no-dark-select):focus,
html[data-theme="dark"] select#branchFilter:focus,
html.dark select#branchFilter:focus,
[data-theme="dark"] select#branchFilter:focus,
.dark select#branchFilter:focus,
html[data-theme="dark"] select#sortFilter:focus,
html.dark select#sortFilter:focus,
[data-theme="dark"] select#sortFilter:focus,
.dark select#sortFilter:focus,
html[data-theme="dark"] select[id$="Filter"]:focus,
html.dark select[id$="Filter"]:focus,
[data-theme="dark"] select[id$="Filter"]:focus,
.dark select[id$="Filter"]:focus {
    border-color: #34d399 !important;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.35) !important;
    outline: none !important;
    position: relative !important;
    z-index: 10 !important;
}

/* Admin Settings - System Processing & Administrative Fees Container & Header */
#system-fees-section {
    border-color: #10b981 !important;
}
[data-theme="dark"] #system-fees-section,
.dark #system-fees-section {
    border-color: #10b981 !important;
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.25) !important;
}

#system-fees-header {
    background: linear-gradient(135deg, #e6f4ea 0%, #ecfdf5 50%, #f0fdf4 100%) !important;
    border-bottom: 2px solid #22c55e !important;
}
#system-fees-header h2 {
    color: #065f46 !important;
}
#system-fees-header p {
    color: #047857 !important;
}

[data-theme="dark"] #system-fees-header,
.dark #system-fees-header {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 50%, #047857 100%) !important;
    border-bottom: 2px solid #10b981 !important;
}
[data-theme="dark"] #system-fees-header h2,
.dark #system-fees-header h2 {
    color: #ffffff !important;
}
[data-theme="dark"] #system-fees-header p,
.dark #system-fees-header p {
    color: #ecfdf5 !important;
}
[data-theme="dark"] #system-fees-header .fee-header-badge,
.dark #system-fees-header .fee-header-badge {
    background-color: rgba(6, 78, 59, 0.95) !important;
    color: #6ee7b7 !important;
    border: 1px solid #10b981 !important;
}

/* Admin Settings - Collector Date Threshold Button Amber Theme */
#btnSaveCollectorDate {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
    background-color: #d97706 !important;
    color: #ffffff !important;
    border: 1px solid #f59e0b !important;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.4) !important;
}
#btnSaveCollectorDate:hover,
#btnSaveCollectorDate:focus,
#btnSaveCollectorDate:active {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    background-color: #f59e0b !important;
    color: #ffffff !important;
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.55) !important;
}

[data-theme="dark"] #btnSaveCollectorDate,
.dark #btnSaveCollectorDate {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
    background-color: #d97706 !important;
    color: #ffffff !important;
    border: 1px solid #fbbf24 !important;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.45) !important;
}
[data-theme="dark"] #btnSaveCollectorDate:hover,
[data-theme="dark"] #btnSaveCollectorDate:focus,
[data-theme="dark"] #btnSaveCollectorDate:active,
.dark #btnSaveCollectorDate:hover,
.dark #btnSaveCollectorDate:focus,
.dark #btnSaveCollectorDate:active {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
    background-color: #f59e0b !important;
    color: #1e1b4b !important;
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.65) !important;
}

/* =========================================================
   LAPSED CLIENT REINSTATEMENT NOTE BANNER (LIGHT & DARK MODES)
   ========================================================= */
.lapse-reinstatement-banner {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%) !important;
    border: 2px solid #f59e0b !important;
    border-left: 6px solid #d97706 !important;
    color: #78350f !important;
}
.lapse-reinstatement-banner h4 {
    color: #78350f !important;
}
.lapse-reinstatement-banner p {
    color: #92400e !important;
}
.lapse-reinstatement-banner strong {
    color: #78350f !important;
    font-weight: 800 !important;
}
.lapse-reinstatement-banner .lapse-badge {
    background-color: #fde68a !important;
    color: #78350f !important;
    border: 1px solid #f59e0b !important;
}
.lapse-reinstatement-banner .lapse-icon {
    background-color: #fde68a !important;
    color: #b45309 !important;
}
.lapse-reinstatement-banner .lapse-btn {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
    color: #ffffff !important;
    border: 1px solid #f59e0b !important;
}
.lapse-reinstatement-banner .lapse-btn:hover {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: #ffffff !important;
}

/* Dark Mode Overrides */
[data-theme="dark"] .lapse-reinstatement-banner,
.dark .lapse-reinstatement-banner {
    background: linear-gradient(135deg, rgba(120, 53, 15, 0.45) 0%, rgba(69, 26, 3, 0.55) 50%, #1e293b 100%) !important;
    border: 2px solid #f59e0b !important;
    border-left: 6px solid #fbbf24 !important;
    box-shadow: 0 4px 18px rgba(245, 158, 11, 0.2) !important;
    color: #fef08a !important;
}
[data-theme="dark"] .lapse-reinstatement-banner h4,
.dark .lapse-reinstatement-banner h4 {
    color: #fef08a !important;
}
[data-theme="dark"] .lapse-reinstatement-banner p,
.dark .lapse-reinstatement-banner p {
    color: #fde68a !important;
}
[data-theme="dark"] .lapse-reinstatement-banner strong,
.dark .lapse-reinstatement-banner strong {
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
    font-weight: 800 !important;
}
[data-theme="dark"] .lapse-reinstatement-banner .lapse-badge,
.dark .lapse-reinstatement-banner .lapse-badge {
    background-color: rgba(180, 83, 9, 0.85) !important;
    color: #fef3c7 !important;
    border: 1px solid #f59e0b !important;
}
[data-theme="dark"] .lapse-reinstatement-banner .lapse-icon,
.dark .lapse-reinstatement-banner .lapse-icon {
    background-color: #b45309 !important;
    color: #ffffff !important;
}
[data-theme="dark"] .lapse-reinstatement-banner .lapse-btn,
.dark .lapse-reinstatement-banner .lapse-btn {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
    color: #1e1b4b !important;
    border: 1px solid #fef08a !important;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4) !important;
}
[data-theme="dark"] .lapse-reinstatement-banner .lapse-btn:hover,
.dark .lapse-reinstatement-banner .lapse-btn:hover {
    background: linear-gradient(135deg, #fef08a 0%, #fbbf24 100%) !important;
    color: #0f172a !important;
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.6) !important;
}

/* Lapsed Payment Type Selector styling */
[data-theme="dark"] #paymentType.border-amber-400,
.dark #paymentType.border-amber-400,
[data-theme="dark"] select[name="paymenttype"].bg-amber-50,
.dark select[name="paymenttype"].bg-amber-50 {
    background-color: #1e293b !important;
    border-color: #f59e0b !important;
    color: #fef08a !important;
}

/* =========================================================
   Executive Portfolio Health Cards Dark Mode Parity
   ========================================================= */
.dark .portfolio-card-lifetime,
[data-theme="dark"] .portfolio-card-lifetime {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%) !important;
    border: 2px solid #6366f1 !important;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.25) !important;
}
.dark .portfolio-card-lifetime .portfolio-stat-title,
[data-theme="dark"] .portfolio-card-lifetime .portfolio-stat-title { color: #c7d2fe !important; }
.dark .portfolio-card-lifetime .portfolio-stat-badge,
[data-theme="dark"] .portfolio-card-lifetime .portfolio-stat-badge {
    background: #4f46e5 !important;
    color: #ffffff !important;
    border: 1px solid #818cf8 !important;
}
.dark .portfolio-card-lifetime .portfolio-stat-value,
[data-theme="dark"] .portfolio-card-lifetime .portfolio-stat-value { color: #ffffff !important; }
.dark .portfolio-card-lifetime .portfolio-stat-desc,
[data-theme="dark"] .portfolio-card-lifetime .portfolio-stat-desc { color: #cbd5e1 !important; }

.dark .portfolio-card-goodstanding,
[data-theme="dark"] .portfolio-card-goodstanding {
    background: linear-gradient(135deg, #022c22 0%, #064e3b 100%) !important;
    border: 2px solid #10b981 !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25) !important;
}
.dark .portfolio-card-goodstanding .portfolio-stat-title,
[data-theme="dark"] .portfolio-card-goodstanding .portfolio-stat-title { color: #a7f3d0 !important; }
.dark .portfolio-card-goodstanding .portfolio-stat-badge,
[data-theme="dark"] .portfolio-card-goodstanding .portfolio-stat-badge {
    background: #059669 !important;
    color: #ffffff !important;
    border: 1px solid #34d399 !important;
}
.dark .portfolio-card-goodstanding .portfolio-stat-value,
[data-theme="dark"] .portfolio-card-goodstanding .portfolio-stat-value { color: #34d399 !important; }
.dark .portfolio-card-goodstanding .portfolio-stat-desc,
[data-theme="dark"] .portfolio-card-goodstanding .portfolio-stat-desc { color: #d1fae5 !important; }
.dark .portfolio-card-goodstanding .portfolio-stat-desc strong,
[data-theme="dark"] .portfolio-card-goodstanding .portfolio-stat-desc strong { color: #ffffff !important; }

.dark .portfolio-card-fullypaid,
[data-theme="dark"] .portfolio-card-fullypaid {
    background: linear-gradient(135deg, #083344 0%, #155e75 100%) !important;
    border: 2px solid #06b6d4 !important;
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.25) !important;
}
.dark .portfolio-card-fullypaid .portfolio-stat-title,
[data-theme="dark"] .portfolio-card-fullypaid .portfolio-stat-title { color: #a5f3fc !important; }
.dark .portfolio-card-fullypaid .portfolio-stat-badge,
[data-theme="dark"] .portfolio-card-fullypaid .portfolio-stat-badge {
    background: #0891b2 !important;
    color: #ffffff !important;
    border: 1px solid #22d3ee !important;
}
.dark .portfolio-card-fullypaid .portfolio-stat-value,
[data-theme="dark"] .portfolio-card-fullypaid .portfolio-stat-value { color: #22d3ee !important; }
.dark .portfolio-card-fullypaid .portfolio-stat-desc,
[data-theme="dark"] .portfolio-card-fullypaid .portfolio-stat-desc { color: #cffafe !important; }

.dark .portfolio-card-lapse,
[data-theme="dark"] .portfolio-card-lapse {
    background: linear-gradient(135deg, #3b0718 0%, #4c0519 100%) !important;
    border: 2px solid #f43f5e !important;
    box-shadow: 0 4px 14px rgba(244, 63, 94, 0.25) !important;
}
.dark .portfolio-card-lapse .portfolio-stat-title,
[data-theme="dark"] .portfolio-card-lapse .portfolio-stat-title { color: #fecdd3 !important; }
.dark .portfolio-card-lapse .portfolio-stat-badge,
[data-theme="dark"] .portfolio-card-lapse .portfolio-stat-badge {
    background: #e11d48 !important;
    color: #ffffff !important;
    border: 1px solid #fb7185 !important;
}
.dark .portfolio-card-lapse .portfolio-stat-value,
[data-theme="dark"] .portfolio-card-lapse .portfolio-stat-value { color: #fb7185 !important; }
.dark .portfolio-card-lapse .portfolio-stat-desc,
[data-theme="dark"] .portfolio-card-lapse .portfolio-stat-desc { color: #ffe4e6 !important; }


        /* ═════════════════════════════════════════════════════════════════════════
           CASHIER COMBOBOX DROPDOWN - LIGHT & DARK MODE THEME STYLES
        ═════════════════════════════════════════════════════════════════════════ */
        #remitCashierDropdownList,
        #claimCashierDropdownList,
        .cashier-dropdown-list {
            background-color: #ffffff !important;
            border: 1px solid #d1d5db !important;
            color: #111827 !important;
        }

        .dark #remitCashierDropdownList,
        [data-theme="dark"] #remitCashierDropdownList,
        .dark #claimCashierDropdownList,
        [data-theme="dark"] #claimCashierDropdownList,
        .dark .cashier-dropdown-list,
        [data-theme="dark"] .cashier-dropdown-list {
            background-color: #0f172a !important;
            border: 1px solid #334155 !important;
            color: #ffffff !important;
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 8px 10px -6px rgba(0, 0, 0, 0.5) !important;
        }

        /* Pinned Header: Your Branch Cashier(s) */
        .cashier-header-pinned {
            background-color: #ecfdf5 !important;
            color: #065f46 !important;
            border-bottom: 1px solid #a7f3d0 !important;
        }
        .cashier-header-pinned svg {
            color: #059669 !important;
        }
        .cashier-header-pinned .cashier-pinned-badge {
            background-color: #d1fae5 !important;
            color: #065f46 !important;
            border: 1px solid #6ee7b7 !important;
        }
        .dark .cashier-header-pinned,
        [data-theme="dark"] .cashier-header-pinned {
            background-color: #064e3b !important;
            color: #a7f3d0 !important;
            border-bottom: 1px solid #047857 !important;
        }
        .dark .cashier-header-pinned svg,
        [data-theme="dark"] .cashier-header-pinned svg {
            color: #34d399 !important;
        }
        .dark .cashier-header-pinned .cashier-pinned-badge,
        [data-theme="dark"] .cashier-header-pinned .cashier-pinned-badge {
            background-color: #047857 !important;
            color: #ffffff !important;
            border: 1px solid #10b981 !important;
        }

        /* Other Header: All Other Branch Cashiers */
        .cashier-header-other {
            background-color: #f8fafc !important;
            color: #475569 !important;
            border-bottom: 1px solid #e2e8f0 !important;
        }
        .cashier-header-other svg {
            color: #64748b !important;
        }
        .dark .cashier-header-other,
        [data-theme="dark"] .cashier-header-other {
            background-color: #1e293b !important;
            color: #94a3b8 !important;
            border-bottom: 1px solid #334155 !important;
        }
        .dark .cashier-header-other svg,
        [data-theme="dark"] .cashier-header-other svg {
            color: #94a3b8 !important;
        }

        /* Cashier Option Rows */
        .cashier-option {
            background-color: #ffffff !important;
            color: #111827 !important;
            border-bottom: 1px solid #f1f5f9 !important;
        }
        .cashier-option:hover {
            background-color: #f0fdf4 !important;
        }
        .cashier-option .cashier-name {
            color: #111827 !important;
        }
        .cashier-option .cashier-branch {
            color: #64748b !important;
        }
        .cashier-option .cashier-avatar-local {
            background-color: #d1fae5 !important;
            color: #059669 !important;
        }
        .cashier-option .cashier-avatar-other {
            background-color: #f1f5f9 !important;
            color: #64748b !important;
        }
        .cashier-option .cashier-badge-local {
            background-color: #ecfdf5 !important;
            color: #065f46 !important;
            border: 1px solid #a7f3d0 !important;
        }
        .cashier-option .cashier-check-icon {
            color: #059669 !important;
        }

        /* Dark Mode Option Rows */
        .dark .cashier-option,
        [data-theme="dark"] .cashier-option {
            background-color: #0f172a !important;
            color: #ffffff !important;
            border-bottom: 1px solid #1e293b !important;
        }
        .dark .cashier-option:hover,
        [data-theme="dark"] .cashier-option:hover {
            background-color: #1e293b !important;
        }
        .dark .cashier-option .cashier-name,
        [data-theme="dark"] .cashier-option .cashier-name {
            color: #ffffff !important;
        }
        .dark .cashier-option .cashier-branch,
        [data-theme="dark"] .cashier-option .cashier-branch {
            color: #94a3b8 !important;
        }
        .dark .cashier-option .cashier-avatar-local,
        [data-theme="dark"] .cashier-option .cashier-avatar-local {
            background-color: #064e3b !important;
            color: #34d399 !important;
        }
        .dark .cashier-option .cashier-avatar-other,
        [data-theme="dark"] .cashier-option .cashier-avatar-other {
            background-color: #1e293b !important;
            color: #94a3b8 !important;
        }
        .dark .cashier-option .cashier-badge-local,
        [data-theme="dark"] .cashier-option .cashier-badge-local {
            background-color: #064e3b !important;
            color: #6ee7b7 !important;
            border: 1px solid #047857 !important;
        }
        .dark .cashier-option .cashier-check-icon,
        [data-theme="dark"] .cashier-option .cashier-check-icon {
            color: #34d399 !important;
        }

        /* Selected State */
        .cashier-option.is-selected {
            background-color: #ecfdf5 !important;
        }
        .cashier-option.is-selected .cashier-name {
            color: #065f46 !important;
        }
        .dark .cashier-option.is-selected,
        [data-theme="dark"] .cashier-option.is-selected {
            background-color: #064e3b !important;
        }
        .dark .cashier-option.is-selected .cashier-name,
        [data-theme="dark"] .cashier-option.is-selected .cashier-name {
            color: #a7f3d0 !important;
        }

/* ==========================================================================
   Client View - O.R Error Alert Action Buttons (Dark Mode Parity)
   ========================================================================== */
.client-or-alert-btn-update,
a.client-or-alert-btn-update,
[data-theme="dark"] .client-or-alert-btn-update,
[data-theme="dark"] a.client-or-alert-btn-update,
.dark .client-or-alert-btn-update,
.dark a.client-or-alert-btn-update {
    background: #dc2626 !important;
    background-color: #dc2626 !important;
    color: #ffffff !important;
    border: 1px solid #ef4444 !important;
    box-shadow: 0 1px 3px rgba(220, 38, 38, 0.4) !important;
    text-decoration: none !important;
}
.client-or-alert-btn-update:hover,
a.client-or-alert-btn-update:hover,
[data-theme="dark"] .client-or-alert-btn-update:hover,
[data-theme="dark"] a.client-or-alert-btn-update:hover,
.dark .client-or-alert-btn-update:hover,
.dark a.client-or-alert-btn-update:hover {
    background: #b91c1c !important;
    background-color: #b91c1c !important;
    color: #ffffff !important;
    border-color: #dc2626 !important;
}
.client-or-alert-btn-update svg,
[data-theme="dark"] .client-or-alert-btn-update svg,
.dark .client-or-alert-btn-update svg {
    color: #ffffff !important;
    stroke: #ffffff !important;
}

.client-or-alert-btn-manage,
a.client-or-alert-btn-manage,
[data-theme="dark"] .client-or-alert-btn-manage,
[data-theme="dark"] a.client-or-alert-btn-manage,
.dark .client-or-alert-btn-manage,
.dark a.client-or-alert-btn-manage {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #b91c1c !important;
    border: 1px solid #fca5a5 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    text-decoration: none !important;
}
.client-or-alert-btn-manage:hover,
a.client-or-alert-btn-manage:hover,
[data-theme="dark"] .client-or-alert-btn-manage:hover,
[data-theme="dark"] a.client-or-alert-btn-manage:hover,
.dark .client-or-alert-btn-manage:hover,
.dark a.client-or-alert-btn-manage:hover {
    background: #fef2f2 !important;
    background-color: #fef2f2 !important;
    color: #991b1b !important;
    border-color: #f87171 !important;
}
.client-or-alert-btn-manage svg,
[data-theme="dark"] .client-or-alert-btn-manage svg,
.dark .client-or-alert-btn-manage svg {
    color: #b91c1c !important;
    stroke: #b91c1c !important;
}

/* Contract Number Generator & Excel Import Format Chips / Badges (Light & Dark) */
.slc-format-status-ok {
    padding: 0.625rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    background-color: #ecfdf5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}
.dark .slc-format-status-ok,
[data-theme="dark"] .slc-format-status-ok {
    background-color: rgba(6, 78, 59, 0.45) !important;
    color: #6ee7b7 !important;
    border-color: rgba(16, 185, 129, 0.5) !important;
}
.slc-format-status-warn {
    padding: 0.625rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    background-color: #fffbeb;
    color: #92400e;
    border: 1px solid #fcd34d;
}
.dark .slc-format-status-warn,
[data-theme="dark"] .slc-format-status-warn {
    background-color: rgba(120, 53, 15, 0.45) !important;
    color: #fde68a !important;
    border-color: rgba(245, 158, 11, 0.5) !important;
}
.slc-format-status-err {
    padding: 0.625rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    background-color: #fff1f2;
    color: #9f1239;
    border: 1px solid #fda4af;
}
.dark .slc-format-status-err,
[data-theme="dark"] .slc-format-status-err {
    background-color: rgba(136, 19, 55, 0.45) !important;
    color: #fecdd3 !important;
    border-color: rgba(244, 63, 94, 0.5) !important;
}
.slc-format-status-loading {
    padding: 0.5rem 0.625rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    background-color: #eef2ff;
    color: #3730a3;
    border: 1px solid #c7d2fe;
}
.dark .slc-format-status-loading,
[data-theme="dark"] .slc-format-status-loading {
    background-color: rgba(49, 46, 129, 0.45) !important;
    color: #c7d2fe !important;
    border-color: rgba(99, 102, 241, 0.45) !important;
}
.slc-format-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 700;
    background-color: #ffffff;
    color: #3730a3;
    border: 1px solid #a5b4fc;
    cursor: pointer;
    transition: all 0.15s ease;
}
.slc-format-chip:hover {
    background-color: #4f46e5;
    color: #ffffff;
    border-color: #4f46e5;
}
.dark .slc-format-chip,
[data-theme="dark"] .slc-format-chip {
    background-color: #0f172a !important;
    color: #c7d2fe !important;
    border-color: rgba(99, 102, 241, 0.55) !important;
}
.dark .slc-format-chip:hover,
[data-theme="dark"] .slc-format-chip:hover {
    background-color: #4f46e5 !important;
    color: #ffffff !important;
}
.slc-seq-pill {
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.6875rem;
    background-color: rgba(255, 255, 255, 0.85);
    color: #064e3b;
}
.dark .slc-seq-pill,
[data-theme="dark"] .slc-seq-pill {
    background-color: #0f172a !important;
    color: #a7f3d0 !important;
}
.slc-badge-autogen {
    margin-left: 0.375rem;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.625rem;
    font-weight: 700;
    background-color: #e0e7ff;
    color: #3730a3;
}
.dark .slc-badge-autogen,
[data-theme="dark"] .slc-badge-autogen {
    background-color: rgba(49, 46, 129, 0.7) !important;
    color: #c7d2fe !important;
}
.slc-badge-paper {
    margin-left: 0.375rem;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.625rem;
    font-weight: 700;
    background-color: #f1f5f9;
    color: #334155;
}
.dark .slc-badge-paper,
[data-theme="dark"] .slc-badge-paper {
    background-color: #334155 !important;
    color: #e2e8f0 !important;
}
.slc-file-dropzone {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    border: 2px dashed rgba(16, 185, 129, 0.55);
    background-color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
    user-select: none;
}
.slc-file-dropzone:hover,
.slc-file-dropzone:focus-visible,
.slc-file-dropzone.is-dragover {
    outline: none;
    border-color: #10b981;
    background-color: rgba(236, 253, 245, 0.75);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.14);
}
.slc-file-dropzone.has-file {
    border-style: solid;
    border-color: #059669;
    background-color: rgba(236, 253, 245, 0.85);
}
.slc-file-dropzone-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background-color: #d1fae5;
    color: #059669;
    border: 1px solid #a7f3d0;
    transition: transform 0.18s ease;
}
.slc-file-dropzone:hover .slc-file-dropzone-icon {
    transform: scale(1.05);
}
.slc-file-dropzone-text {
    flex: 1 1 0%;
    min-width: 0;
    text-align: left;
}
.slc-file-dropzone-title {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.slc-file-dropzone-sub {
    display: block;
    font-size: 0.6875rem;
    color: #64748b;
    margin-top: 0.125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.slc-file-dropzone-btn {
    padding: 0.425rem 0.85rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
    background-color: #d1fae5;
    color: #047857;
    border: 1px solid #6ee7b7;
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.slc-file-dropzone:hover .slc-file-dropzone-btn {
    background-color: #059669;
    color: #ffffff;
    border-color: #059669;
}
.dark .slc-file-dropzone,
[data-theme="dark"] .slc-file-dropzone {
    border-color: rgba(16, 185, 129, 0.48) !important;
    background-color: rgba(2, 6, 23, 0.78) !important;
}
.dark .slc-file-dropzone:hover,
.dark .slc-file-dropzone:focus-visible,
.dark .slc-file-dropzone.is-dragover,
[data-theme="dark"] .slc-file-dropzone:hover,
[data-theme="dark"] .slc-file-dropzone:focus-visible,
[data-theme="dark"] .slc-file-dropzone.is-dragover {
    border-color: #34d399 !important;
    background-color: rgba(15, 23, 42, 0.96) !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16) !important;
}
.dark .slc-file-dropzone.has-file,
[data-theme="dark"] .slc-file-dropzone.has-file {
    border-color: #10b981 !important;
    background-color: rgba(6, 78, 59, 0.24) !important;
}
.dark .slc-file-dropzone-icon,
[data-theme="dark"] .slc-file-dropzone-icon {
    background-color: rgba(6, 78, 59, 0.55) !important;
    color: #34d399 !important;
    border-color: rgba(16, 185, 129, 0.45) !important;
}
.dark .slc-file-dropzone-title,
[data-theme="dark"] .slc-file-dropzone-title {
    color: #f1f5f9 !important;
}
.dark .slc-file-dropzone-sub,
[data-theme="dark"] .slc-file-dropzone-sub {
    color: #94a3b8 !important;
}
.dark .slc-file-dropzone-btn,
[data-theme="dark"] .slc-file-dropzone-btn {
    background-color: rgba(6, 78, 59, 0.65) !important;
    color: #a7f3d0 !important;
    border-color: rgba(16, 185, 129, 0.5) !important;
}
.dark .slc-file-dropzone:hover .slc-file-dropzone-btn,
[data-theme="dark"] .slc-file-dropzone:hover .slc-file-dropzone-btn {
    background-color: #059669 !important;
    color: #ffffff !important;
    border-color: #10b981 !important;
}

/* Preserve directional top accent border colors when paired with .border-gray-200/.border-gray-300 in Dark Mode */
.dark .border-t-blue-500, [data-theme="dark"] .border-t-blue-500 { border-top-color: #3b82f6 !important; }
.dark .border-t-amber-500, [data-theme="dark"] .border-t-amber-500 { border-top-color: #f59e0b !important; }
.dark .border-t-purple-500, [data-theme="dark"] .border-t-purple-500 { border-top-color: #a855f7 !important; }
.dark .border-t-emerald-500, [data-theme="dark"] .border-t-emerald-500 { border-top-color: #10b981 !important; }
.dark .border-t-indigo-500, [data-theme="dark"] .border-t-indigo-500 { border-top-color: #6366f1 !important; }
.dark .border-t-teal-500, [data-theme="dark"] .border-t-teal-500 { border-top-color: #14b8a6 !important; }
.dark .border-t-cyan-500, [data-theme="dark"] .border-t-cyan-500 { border-top-color: #06b6d4 !important; }
.dark .border-t-rose-500, [data-theme="dark"] .border-t-rose-500 { border-top-color: #f43f5e !important; }

/* Add Payment O.R. Dead-End Recovery Panel & High-Contrast Pill Buttons */
.dark .bg-emerald-50.text-emerald-800,
[data-theme="dark"] .bg-emerald-50.text-emerald-800 {
    background-color: rgba(6, 78, 59, 0.72) !important;
    color: #d1fae5 !important;
    border-color: rgba(52, 211, 153, 0.5) !important;
}

.dark .bg-indigo-50.text-indigo-800,
[data-theme="dark"] .bg-indigo-50.text-indigo-800 {
    background-color: rgba(49, 46, 129, 0.72) !important;
    color: #e0e7ff !important;
    border-color: rgba(129, 140, 248, 0.5) !important;
}

.dark .or-deadend-notice,
[data-theme="dark"] .or-deadend-notice {
    background-color: rgba(69, 26, 3, 0.75) !important;
    border-color: rgba(217, 119, 6, 0.55) !important;
    color: #fde68a !important;
}

.dark .or-deadend-alt-btn,
[data-theme="dark"] .or-deadend-alt-btn {
    background-color: rgba(6, 78, 59, 0.78) !important;
    border-color: rgba(52, 211, 153, 0.55) !important;
    color: #ecfdf5 !important;
}

.dark .or-deadend-alt-btn:hover,
[data-theme="dark"] .or-deadend-alt-btn:hover {
    background-color: rgba(4, 120, 87, 0.92) !important;
    border-color: #34d399 !important;
    color: #ffffff !important;
}

.dark .or-deadend-next-btn,
[data-theme="dark"] .or-deadend-next-btn {
    background-color: rgba(49, 46, 129, 0.78) !important;
    border-color: rgba(129, 140, 248, 0.55) !important;
    color: #eef2ff !important;
}

.dark .or-deadend-next-btn:hover,
[data-theme="dark"] .or-deadend-next-btn:hover {
    background-color: rgba(67, 56, 202, 0.92) !important;
    border-color: #818cf8 !important;
    color: #ffffff !important;
}

.dark .or-deadend-create-link,
[data-theme="dark"] .or-deadend-create-link {
    background: transparent !important;
    color: #fcd34d !important;
}

.dark .or-deadend-create-link:hover,
[data-theme="dark"] .or-deadend-create-link:hover {
    color: #ffffff !important;
}

/* =====================================================
   LEGAL WHITE-PAPER SHEETS (Policy Agreement, Clauses,
   Loan Waiver, Admin Modals & Live Preview) - DARK MODE
   Always render dark legal ink on crisp #ffffff paper.
   ===================================================== */
.policy-paper-sheet,
.dark .policy-paper-sheet,
[data-theme="dark"] .policy-paper-sheet,
.dark .modal-body .policy-paper-sheet,
[data-theme="dark"] .modal-body .policy-paper-sheet,
.dark #policyAgreementModal .policy-paper-sheet,
[data-theme="dark"] #policyAgreementModal .policy-paper-sheet,
.dark #loanApplicationModal .policy-paper-sheet,
[data-theme="dark"] #loanApplicationModal .policy-paper-sheet,
.dark #waiverModal .policy-paper-sheet,
[data-theme="dark"] #waiverModal .policy-paper-sheet,
.dark #adminPolicyAgreementModal .policy-paper-sheet,
[data-theme="dark"] #adminPolicyAgreementModal .policy-paper-sheet {
    background-color: #ffffff !important;
    color: #1e293b !important;
    border-color: #cbd5e1 !important;
    color-scheme: light !important;
}

.dark .policy-paper-sheet :is(p, li, ul, ol, td, th, span, div, label, small, em, a):not([style*="color"]),
[data-theme="dark"] .policy-paper-sheet :is(p, li, ul, ol, td, th, span, div, label, small, em, a):not([style*="color"]),
.dark .modal-body .policy-paper-sheet :is(p, li, td, th, span, div):not([style*="color"]),
[data-theme="dark"] .modal-body .policy-paper-sheet :is(p, li, td, th, span, div):not([style*="color"]),
.dark #policyAgreementModal .policy-paper-sheet :is(p, li, td, th, span, div):not([style*="color"]),
[data-theme="dark"] #policyAgreementModal .policy-paper-sheet :is(p, li, td, th, span, div):not([style*="color"]),
.dark #loanApplicationModal .policy-paper-sheet :is(p, li, td, th, span, div):not([style*="color"]),
[data-theme="dark"] #loanApplicationModal .policy-paper-sheet :is(p, li, td, th, span, div):not([style*="color"]) {
    color: #1e293b !important;
}

.dark .policy-paper-sheet :is(h1, h2, h4, h5, h6, strong, b):not([style*="color"]),
[data-theme="dark"] .policy-paper-sheet :is(h1, h2, h4, h5, h6, strong, b):not([style*="color"]),
.dark .modal-body .policy-paper-sheet :is(h4, h5, h6, strong, b):not([style*="color"]),
[data-theme="dark"] .modal-body .policy-paper-sheet :is(h4, h5, h6, strong, b):not([style*="color"]),
.dark #policyAgreementModal .policy-paper-sheet :is(h4, strong, b):not([style*="color"]),
[data-theme="dark"] #policyAgreementModal .policy-paper-sheet :is(h4, strong, b):not([style*="color"]),
.dark #loanApplicationModal .policy-paper-sheet :is(h4, strong, b):not([style*="color"]),
[data-theme="dark"] #loanApplicationModal .policy-paper-sheet :is(h4, strong, b):not([style*="color"]),
.dark .policy-paper-sheet .text-gray-900:not([style*="color"]),
[data-theme="dark"] .policy-paper-sheet .text-gray-900:not([style*="color"]),
.dark #policyAgreementModal .policy-paper-sheet .text-gray-900:not([style*="color"]),
[data-theme="dark"] #policyAgreementModal .policy-paper-sheet .text-gray-900:not([style*="color"]),
.dark #loanApplicationModal .policy-paper-sheet .text-gray-900:not([style*="color"]),
[data-theme="dark"] #loanApplicationModal .policy-paper-sheet .text-gray-900:not([style*="color"]),
.dark .policy-paper-sheet .text-slate-900:not([style*="color"]),
[data-theme="dark"] .policy-paper-sheet .text-slate-900:not([style*="color"]),
.dark .policy-paper-sheet .dark\:text-white:not([style*="color"]),
[data-theme="dark"] .policy-paper-sheet .dark\:text-white:not([style*="color"]) {
    color: #0f172a !important;
}

.dark .policy-paper-sheet :is(.text-gray-800, .text-gray-700, .text-slate-800, .text-slate-700, .policy-clauses-container, .dark\:text-gray-200, .dark\:text-gray-300, .dark\:text-slate-200, .dark\:text-slate-300):not([style*="color"]),
[data-theme="dark"] .policy-paper-sheet :is(.text-gray-800, .text-gray-700, .text-slate-800, .text-slate-700, .policy-clauses-container, .dark\:text-gray-200, .dark\:text-gray-300, .dark\:text-slate-200, .dark\:text-slate-300):not([style*="color"]),
.dark #policyAgreementModal .policy-paper-sheet :is(.text-gray-800, .text-gray-700, .policy-clauses-container, .dark\:text-gray-200, .dark\:text-gray-300):not([style*="color"]),
[data-theme="dark"] #policyAgreementModal .policy-paper-sheet :is(.text-gray-800, .text-gray-700, .policy-clauses-container, .dark\:text-gray-200, .dark\:text-gray-300):not([style*="color"]),
.dark #loanApplicationModal .policy-paper-sheet :is(.text-gray-800, .text-gray-700):not([style*="color"]),
[data-theme="dark"] #loanApplicationModal .policy-paper-sheet :is(.text-gray-800, .text-gray-700):not([style*="color"]) {
    color: #1e293b !important;
}

.dark .policy-paper-sheet :is(.text-gray-600, .text-gray-500, .text-gray-400, .text-slate-600, .text-slate-500, .text-slate-400, .dark\:text-gray-400, .dark\:text-slate-400):not([style*="color"]),
[data-theme="dark"] .policy-paper-sheet :is(.text-gray-600, .text-gray-500, .text-gray-400, .text-slate-600, .text-slate-500, .text-slate-400, .dark\:text-gray-400, .dark\:text-slate-400):not([style*="color"]),
.dark #policyAgreementModal .policy-paper-sheet :is(.text-gray-500, .text-gray-600, .text-gray-400):not([style*="color"]),
[data-theme="dark"] #policyAgreementModal .policy-paper-sheet :is(.text-gray-500, .text-gray-600, .text-gray-400):not([style*="color"]),
.dark #loanApplicationModal .policy-paper-sheet :is(.text-gray-500, .text-gray-600, .text-gray-400):not([style*="color"]),
[data-theme="dark"] #loanApplicationModal .policy-paper-sheet :is(.text-gray-500, .text-gray-600, .text-gray-400):not([style*="color"]) {
    color: #475569 !important;
}

.dark .policy-paper-sheet :is(h3, .text-emerald-800, .text-emerald-700, .dark\:text-emerald-400):not([style*="color"]),
[data-theme="dark"] .policy-paper-sheet :is(h3, .text-emerald-800, .text-emerald-700, .dark\:text-emerald-400):not([style*="color"]),
.dark #policyAgreementModal .policy-paper-sheet :is(h3, .text-emerald-800, .dark\:text-emerald-400):not([style*="color"]),
[data-theme="dark"] #policyAgreementModal .policy-paper-sheet :is(h3, .text-emerald-800, .dark\:text-emerald-400):not([style*="color"]) {
    color: #065f46 !important;
}

.dark .policy-paper-sheet :is(.text-red-700, .text-red-600, .dark\:text-red-400):not([style*="color"]),
[data-theme="dark"] .policy-paper-sheet :is(.text-red-700, .text-red-600, .dark\:text-red-400):not([style*="color"]),
.dark #policyAgreementModal .policy-paper-sheet :is(.text-red-700, .dark\:text-red-400):not([style*="color"]),
[data-theme="dark"] #policyAgreementModal .policy-paper-sheet :is(.text-red-700, .dark\:text-red-400):not([style*="color"]) {
    color: #b91c1c !important;
}

.dark .policy-paper-sheet :is(.bg-gray-100, .bg-gray-50, thead, .dark\:bg-gray-700, .dark\:bg-slate-700, .dark\:bg-slate-800),
[data-theme="dark"] .policy-paper-sheet :is(.bg-gray-100, .bg-gray-50, thead, .dark\:bg-gray-700, .dark\:bg-slate-700, .dark\:bg-slate-800) {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
}

.dark .policy-paper-sheet :is(table, th, td, .border, .border-t, .border-b, .border-gray-200, .border-gray-300, .dark\:border-gray-600):not(.border-black),
[data-theme="dark"] .policy-paper-sheet :is(table, th, td, .border, .border-t, .border-b, .border-gray-200, .border-gray-300, .dark\:border-gray-600):not(.border-black) {
    border-color: #cbd5e1 !important;
}

.dark .policy-paper-sheet [style*="color: rgb(255, 255, 255)"],
.dark .policy-paper-sheet [style*="color: rgb(248, 250, 252)"],
.dark .policy-paper-sheet [style*="color: rgb(241, 245, 249)"],
.dark .policy-paper-sheet [style*="color: rgb(226, 232, 240)"],
.dark .policy-paper-sheet [style*="color: #fff"],
.dark .policy-paper-sheet [style*="color: #ffffff"],
.dark .policy-paper-sheet [style*="color: white"],
.dark .policy-paper-sheet font[color="#ffffff"],
.dark .policy-paper-sheet font[color="#fff"],
.dark .policy-paper-sheet font[color="white"],
[data-theme="dark"] .policy-paper-sheet [style*="color: rgb(255, 255, 255)"],
[data-theme="dark"] .policy-paper-sheet [style*="color: rgb(248, 250, 252)"],
[data-theme="dark"] .policy-paper-sheet [style*="color: rgb(241, 245, 249)"],
[data-theme="dark"] .policy-paper-sheet [style*="color: rgb(226, 232, 240)"],
[data-theme="dark"] .policy-paper-sheet [style*="color: #fff"],
[data-theme="dark"] .policy-paper-sheet [style*="color: #ffffff"],
[data-theme="dark"] .policy-paper-sheet [style*="color: white"],
[data-theme="dark"] .policy-paper-sheet font[color="#ffffff"],
[data-theme="dark"] .policy-paper-sheet font[color="#fff"],
[data-theme="dark"] .policy-paper-sheet font[color="white"] {
    color: #0f172a !important;
}

/* Bootstrap legacy utility readability in Dark Mode */
.dark .bg-light:not(.policy-paper-sheet),
[data-theme="dark"] .bg-light:not(.policy-paper-sheet) {
    background-color: var(--bg-secondary, #1e293b) !important;
    color: var(--text-primary, #f1f5f9) !important;
    border-color: var(--border-primary, #334155) !important;
}

.dark .text-dark:not(.badge):not(.policy-paper-sheet):not(.policy-paper-sheet *),
[data-theme="dark"] .text-dark:not(.badge):not(.policy-paper-sheet):not(.policy-paper-sheet *) {
    color: var(--text-primary, #f1f5f9) !important;
}

.dark .text-black-50:not(.policy-paper-sheet):not(.policy-paper-sheet *),
[data-theme="dark"] .text-black-50:not(.policy-paper-sheet):not(.policy-paper-sheet *) {
    color: #94a3b8 !important;
}

