/* Dark Mode Global Styles */
body.dark-mode {
    background: #0f172a !important;
    color: #e2e8f0 !important;
}

body.dark-mode .dashboard-nav {
    background: #1e293b !important;
    border-bottom-color: #334155 !important;
}

body.dark-mode .brand-logo {
    color: #22c55e !important;
}

body.dark-mode .brand-logo .text-dark {
    color: #e2e8f0 !important;
}

body.dark-mode .user-profile {
    color: #cbd5e1 !important;
}

body.dark-mode .theme-toggle {
    background: #334155 !important;
    color: #fbbf24 !important;
}

body.dark-mode .theme-toggle:hover {
    background: #475569 !important;
}

body.dark-mode .glass-card {
    background: #1e293b !important;
    border-color: #334155 !important;
}

body.dark-mode .action-card {
    background: #1e293b !important;
    border-color: #334155 !important;
}

body.dark-mode .action-card:hover {
    background: #334155 !important;
}

body.dark-mode .card-variant-success {
    background: linear-gradient(145deg, #14532d 0%, #1e293b 100%) !important;
    border-color: #166534 !important;
}

body.dark-mode .card-variant-primary {
    background: linear-gradient(145deg, #1e3a8a 0%, #1e293b 100%) !important;
    border-color: #1d4ed8 !important;
}

body.dark-mode .card-variant-danger {
    background: linear-gradient(145deg, #7f1d1d 0%, #1e293b 100%) !important;
    border-color: #991b1b !important;
}

body.dark-mode .card-variant-warning {
    background: linear-gradient(145deg, #78350f 0%, #1e293b 100%) !important;
    border-color: #92400e !important;
}

body.dark-mode .card-variant-info {
    background: linear-gradient(145deg, #0c4a6e 0%, #1e293b 100%) !important;
    border-color: #0369a1 !important;
}

body.dark-mode .card-variant-surface {
    background: linear-gradient(145deg, #334155 0%, #1e293b 100%) !important;
    border-color: #475569 !important;
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6 {
    color: #f1f5f9 !important;
}

body.dark-mode .text-dark {
    color: #e2e8f0 !important;
}

body.dark-mode .text-muted {
    color: #94a3b8 !important;
}

body.dark-mode .text-primary {
    color: #60a5fa !important;
}

body.dark-mode .table {
    color: #e2e8f0 !important;
    --bs-table-bg: transparent !important;
    --bs-table-border-color: #334155 !important;
}

body.dark-mode .table thead {
    background: #334155 !important;
    border-color: #475569 !important;
}

body.dark-mode .table thead th {
    border-color: #475569 !important;
    color: #f1f5f9 !important;
}

body.dark-mode .table tbody td {
    border-color: #334155 !important;
}

body.dark-mode .table-hover tbody tr:hover {
    background: #334155 !important;
    --bs-table-hover-bg: #334155 !important;
}

body.dark-mode .form-control,
body.dark-mode .form-select {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus {
    background: #1e293b !important;
    border-color: #22c55e !important;
    color: #e2e8f0 !important;
}

body.dark-mode .input-group-text {
    background: #334155 !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

body.dark-mode .btn-primary {
    background: linear-gradient(135deg, #16a34a, #14532d) !important;
    border-color: #16a34a !important;
}

body.dark-mode .btn-outline-primary {
    color: #22c55e !important;
    border-color: #16a34a !important;
}

body.dark-mode .btn-outline-primary:hover {
    background: #16a34a !important;
    border-color: #16a34a !important;
}

body.dark-mode .btn-outline-secondary {
    color: #cbd5e1 !important;
    border-color: #475569 !important;
}

body.dark-mode .btn-outline-secondary:hover {
    background: #475569 !important;
    border-color: #475569 !important;
    color: #fff !important;
}

body.dark-mode .btn-outline-danger {
    color: #fca5a5 !important;
    border-color: #991b1b !important;
}

body.dark-mode .btn-outline-danger:hover {
    background: #991b1b !important;
    border-color: #991b1b !important;
    color: #fff !important;
}

body.dark-mode .btn-warning {
    background: #92400e !important;
    border-color: #92400e !important;
    color: #fff !important;
}

body.dark-mode .btn-warning:hover {
    background: #78350f !important;
    border-color: #78350f !important;
}

body.dark-mode .alert-danger {
    background: #7f1d1d !important;
    border-color: #991b1b !important;
    color: #fca5a5 !important;
}

body.dark-mode .alert-success {
    background: #14532d !important;
    border-color: #166534 !important;
    color: #86efac !important;
}

body.dark-mode .alert-info {
    background: #0c4a6e !important;
    border-color: #0369a1 !important;
    color: #7dd3fc !important;
}

body.dark-mode .badge {
    background: #334155 !important;
    color: #e2e8f0 !important;
}

body.dark-mode .badge.bg-success {
    background: #166534 !important;
}

body.dark-mode .badge.bg-danger {
    background: #991b1b !important;
}

body.dark-mode .badge.bg-secondary {
    background: #475569 !important;
}

body.dark-mode .modal-content {
    background: #1e293b !important;
    border-color: #334155 !important;
}

body.dark-mode .modal-header {
    border-bottom-color: #334155 !important;
}

body.dark-mode .modal-footer {
    border-top-color: #334155 !important;
}

body.dark-mode .border-start {
    border-left-color: inherit !important;
}

body.dark-mode .border-4 {
    border-width: 4px !important;
}

/* Additional Text Color Rules */
body.dark-mode h5,
body.dark-mode h6 {
    color: #f1f5f9 !important;
}

body.dark-mode p {
    color: #e2e8f0 !important;
}

body.dark-mode label {
    color: #e2e8f0 !important;
}

body.dark-mode .form-label {
    color: #e2e8f0 !important;
}

body.dark-mode small {
    color: #94a3b8 !important;
}

body.dark-mode strong {
    color: #f1f5f9 !important;
}

body.dark-mode .card-body,
body.dark-mode .card-header,
body.dark-mode .card-footer {
    color: #e2e8f0 !important;
}

body.dark-mode .glass-card p,
body.dark-mode .glass-card label,
body.dark-mode .glass-card h5,
body.dark-mode .glass-card h6 {
    color: #e2e8f0 !important;
}

body.dark-mode .dropdown-menu {
    background: #1e293b !important;
    border-color: #334155 !important;
}

body.dark-mode .dropdown-item {
    color: #e2e8f0 !important;
}

body.dark-mode .dropdown-item:hover {
    background: #334155 !important;
    color: #fff !important;
}

body.dark-mode .text-success {
    color: #86efac !important;
}

body.dark-mode .text-danger {
    color: #fca5a5 !important;
}

body.dark-mode .text-warning {
    color: #fcd34d !important;
}

body.dark-mode .text-info {
    color: #7dd3fc !important;
}

body.dark-mode .fw-bold,
body.dark-mode .fw-semibold {
    color: #f1f5f9 !important;
}

body.dark-mode a:not(.btn) {
    color: #60a5fa !important;
}

body.dark-mode .btn {
    color: #fff !important;
}

/* Billing Page Specific Dark Mode Fixes */
body.dark-mode .alert {
    color: #e2e8f0 !important;
}

body.dark-mode .alert-info {
    background: #0c4a6e !important;
    border-color: #0369a1 !important;
    color: #e2e8f0 !important;
}

body.dark-mode .alert-info span {
    color: #e2e8f0 !important;
}

body.dark-mode .small,
body.dark-mode small {
    color: #cbd5e1 !important;
}

/* Fix for invisible table headers in dark mode */
body.dark-mode .table thead,
body.dark-mode .table-light,
body.dark-mode .table thead th,
body.dark-mode .table-light th {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #f1f5f9 !important;
    --bs-table-color: #f1f5f9 !important;
    --bs-table-bg: #334155 !important;
}

body.dark-mode .fw-bold {
    color: #f1f5f9 !important;
}

body.dark-mode .text-white {
    color: #ffffff !important;
}



body.dark-mode .bg-green-gradient label {
    color: #ffffff !important;
}

/* Update placeholder colors for better visibility */
body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder,
body.dark-mode select::placeholder {
    color: #94a3b8 !important;
    opacity: 1 !important;
}

/* Force placeholder colors with higher specificity */
body.dark-mode input.form-control::placeholder,
body.dark-mode textarea.form-control::placeholder {
    color: #cbd5e1 !important;
    opacity: 1 !important;
}

/* Ensure all table text is light in dark mode */
body.dark-mode table,
body.dark-mode table th,
body.dark-mode table td,
body.dark-mode table tfoot,
body.dark-mode table tfoot th,
body.dark-mode table tfoot td {
    color: #e2e8f0 !important;
}

/* Specific rules for invoice/billing tables */
body.dark-mode .invoice-table,
body.dark-mode .invoice-table th,
body.dark-mode .invoice-table td {
    color: #e2e8f0 !important;
}

/* Text in table footers and summary sections */
body.dark-mode tfoot,
body.dark-mode tfoot th,
body.dark-mode tfoot td,
body.dark-mode tfoot span,
body.dark-mode tfoot strong {
    color: #e2e8f0 !important;
}

/* Final Robust Fixes for Billing Page */
body.dark-mode .invoice-summary-row th,
body.dark-mode .invoice-summary-row td,
body.dark-mode .invoice-summary-row span,
body.dark-mode .invoice-summary-row strong {
    color: #f1f5f9 !important;
}

body.dark-mode .bg-light {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: #f1f5f9 !important;
}

body.dark-mode input.form-control::placeholder,
body.dark-mode .form-control::placeholder {
    color: #94a3b8 !important;
    opacity: 1 !important;
}

/* Ensure text inside color-tinted card variants is always light in dark mode */
body.dark-mode [class*="card-variant-"],
body.dark-mode [class*="card-variant-"] th,
body.dark-mode [class*="card-variant-"] td,
body.dark-mode [class*="card-variant-"] h5,
body.dark-mode [class*="card-variant-"] p,
body.dark-mode [class*="card-variant-"] span,
body.dark-mode [class*="card-variant-"] small,
body.dark-mode [class*="card-variant-"] strong {
    color: #f1f5f9 !important;
}

body.dark-mode [class*="card-variant-"] .text-muted {
    color: #cbd5e1 !important;
}
/* Held bills hover dropdown dark mode */
body.dark-mode .held-bills-dropdown div[style*='background:white'] {
    background: #1e293b !important;
}
body.dark-mode .held-bills-dropdown .bg-light {
    background: #334155 !important;
    color: #f1f5f9 !important;
}
body.dark-mode .held-bills-dropdown .table {
    color: #e2e8f0 !important;
}

