/* ========================================
   PMS Theme — Dark Mode Overrides
   Light mode = default BlazorServer look (no changes needed).
   Dark mode = override specific elements.
   ======================================== */

/* CSS variables for sidebar (both themes) */
:root {
    --sidebar-bg: #021573;
    --bg-secondary: #f7f7f7;
    --border-color: #d6d5d5;
}

/* ===== DARK MODE ===== */
.theme-dark {
    --sidebar-bg: #0d1129;
    --bg-secondary: #1a1d21;
    --border-color: #495057;
}

.theme-dark body,
.theme-dark {
    background-color: #1a1d21;
    color: #e9ecef;
}

.theme-dark .card {
    background-color: #212529;
    border: 1px solid #495057 !important;
    color: #e9ecef;
}

.theme-dark .card-header {
    background-color: #2c3034;
    border-color: #495057;
    color: #e9ecef;
}

.theme-dark .bg-light {
    background-color: #2c3034 !important;
    color: #e9ecef;
}

.theme-dark .form-control,
.theme-dark .form-select {
    background-color: #2c3034;
    border-color: #495057;
    color: #e9ecef;
}

/* Locked inputs (readonly/disabled) — greyed out in dark like Bootstrap's light disabled look. */
.theme-dark .form-control:disabled,
.theme-dark .form-control[readonly],
.theme-dark .form-select:disabled {
    background-color: #1a1d21;
    color: #adb5bd;
}

/* Date/time picker icon — light on dark (Chromium default is black). */
.theme-dark input[type="date"]::-webkit-calendar-picker-indicator,
.theme-dark input[type="datetime-local"]::-webkit-calendar-picker-indicator,
.theme-dark input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
}

.theme-dark .form-control:focus,
.theme-dark .form-select:focus {
    background-color: #343a40;
    color: #e9ecef;
}

.theme-dark .text-muted,
.theme-dark .form-text {
    color: #ced4da !important;
}

.theme-dark .modal-content {
    background-color: #212529;
    color: #e9ecef;
}

.theme-dark .modal-header {
    background-color: #2c3034;
    border-color: #495057;
}

.theme-dark .modal-footer {
    border-color: #495057;
}

.theme-dark .table {
    color: #e9ecef;
}

.theme-dark .table-striped > tbody > tr:nth-of-type(odd) {
    background-color: #2c3034;
}

.theme-dark .dropdown-menu {
    background-color: #212529;
    border-color: #495057;
}

.theme-dark .dropdown-item {
    color: #e9ecef;
}

.theme-dark .dropdown-item:hover {
    background-color: #2c3034;
}

.theme-dark .alert-info {
    background-color: rgba(13, 202, 240, 0.15);
    border-color: rgba(13, 202, 240, 0.3);
    color: #9eeaf9;
}

.theme-dark .alert-danger {
    background-color: rgba(220, 53, 69, 0.15);
    border-color: rgba(220, 53, 69, 0.3);
    color: #f5c2c7;
}

.theme-dark .list-group-item {
    background-color: #212529;
    border-color: #495057;
    color: #e9ecef;
}

.theme-dark a, .theme-dark .btn-link {
    color: #6ea8fe;
}

.theme-dark .text-primary {
    color: #6ea8fe !important;
}

.theme-dark .progress {
    background-color: #495057;
}

.theme-dark .tooltip-custom {
    background-color: #343a40;
    color: #e9ecef;
    border-color: #495057;
}

/* Home page dark mode */
.theme-dark .home-container {
    background-color: #1a1d21;
}

.theme-dark .hero-section h1,
.theme-dark .showcase-header h2,
.theme-dark .benefits-header h2,
.theme-dark .partnership-header h2,
.theme-dark .tile-content h3,
.theme-dark .benefit-card h3,
.theme-dark .partnership-card h3,
.theme-dark .info-explanation-col h3,
.theme-dark .visitor-text h2,
.theme-dark .permit-types-section h2 {
    color: #e9ecef;
}

.theme-dark .feature-tile {
    background: #212529;
    border-color: #495057;
}

.theme-dark .tile-content p,
.theme-dark .showcase-header p,
.theme-dark .benefits-header p,
.theme-dark .partnership-header p,
.theme-dark .benefit-card p,
.theme-dark .partnership-card p,
.theme-dark .info-explanation-col p,
.theme-dark .visitor-text p,
.theme-dark .permit-content p {
    color: #adb5bd;
}

.theme-dark .tile-icon i {
    color: #6ea8fe;
}

.theme-dark .benefit-card {
    background: #212529;
}

.theme-dark .partnership-card {
    background: #212529;
    border-color: #495057;
}

.theme-dark .property-benefits-section {
    background: linear-gradient(135deg, #212529 0%, #1a1d21 100%);
}

.theme-dark .visitor-registration-section {
    background: linear-gradient(135deg, #212529 0%, #1a1d21 100%);
}

.theme-dark .highlight-item {
    background: #2c3034;
}

.theme-dark .highlight-item span,
.theme-dark .info-benefit span {
    color: #e9ecef;
}

.theme-dark .info-benefit {
    background: rgba(110, 168, 254, 0.1);
}

.theme-dark .site-footer {
    border-color: #495057;
}

.theme-dark .social-icons a {
    background: #2c3034;
    color: #adb5bd;
}

/* Navigation dashboard buttons dark mode */
.theme-dark .nav-dashboard-btn {
    background-color: #2c3034;
    border-color: #495057;
    color: #e9ecef;
}

.theme-dark .nav-dashboard-btn:hover {
    background-color: #495057;
}

/* ===== SIDEBAR / NAV MENU DARK MODE ===== */
.theme-dark .sidebar {
    background-color: #1a1d21 !important;
    border-right-color: #495057;
    box-shadow: 2px 0 4px rgba(0,0,0,.2);
}

.theme-dark .top-row {
    background-color: #212529 !important;
}

.theme-dark .nav-scrollable {
    background-color: #1a1d21 !important;
}

.theme-dark .user-info-section {
    background-color: #2c3034;
    border-bottom-color: #495057;
}

.theme-dark .welcome-message {
    color: #e9ecef;
}

.theme-dark .info-label {
    color: #adb5bd;
}

.theme-dark .info-value,
.theme-dark .info-line {
    color: #9ca3af;
}

.theme-dark .nav-section {
    background-color: #1a1d21 !important;
}

.theme-dark .nav-section-header {
    background-color: #1a1d21 !important;
    color: #6c757d;
}

.theme-dark .nav-item {
    background-color: #1a1d21 !important;
    color: #adb5bd;
}

.theme-dark .nav-item:hover {
    background-color: #2c3034 !important;
    color: #e9ecef;
}

.theme-dark .nav-item.active {
    background-color: #2c3034 !important;
    color: #6ea8fe;
    border-right-color: #6ea8fe;
}

.theme-dark .nav-footer {
    background-color: #1a1d21 !important;
    border-top-color: #495057;
}

.theme-dark .logout-button {
    color: #adb5bd;
    background-color: #1a1d21 !important;
}

.theme-dark .logout-button:hover {
    background-color: #dc3545 !important;
    color: white;
}

.theme-dark .theme-toggle-btn {
    color: #adb5bd;
}

.theme-dark .theme-toggle-btn:hover {
    color: #e9ecef;
    background-color: #2c3034;
}

/* Login page dark mode */
.theme-dark .login-container {
    background-color: #1a1d21;
}

.theme-dark .login-card {
    background-color: #212529;
    border-color: #495057;
}

/* Alert variants — warning & success (info/danger already covered above) */
.theme-dark .alert-warning {
    background-color: rgba(255, 193, 7, 0.15);
    border-color: rgba(255, 193, 7, 0.3);
    color: #ffda6a;
}

.theme-dark .alert-success {
    background-color: rgba(25, 135, 84, 0.15);
    border-color: rgba(25, 135, 84, 0.3);
    color: #75b798;
}

/* Form validation states */
.theme-dark .form-control.is-invalid,
.theme-dark .form-select.is-invalid {
    border-color: #dc3545;
}

.theme-dark .validation-message,
.theme-dark .text-danger {
    color: #f5c2c7 !important;
}

/* Modal overlay dark mode */
.theme-dark .modal-dialog {
    background-color: #212529;
}

.theme-dark .modal-header.bg-warning {
    background-color: rgba(255, 193, 7, 0.2) !important;
    color: #ffda6a;
}

/* Btn outline variants */
.theme-dark .btn-outline-secondary {
    color: #dee2e6;
    border-color: #6c757d;
}

.theme-dark .btn-outline-secondary:hover {
    background-color: #495057;
    color: #e9ecef;
}

.theme-dark .btn-outline-primary {
    color: #6ea8fe;
    border-color: #6ea8fe;
}

.theme-dark .btn-outline-primary:hover {
    background-color: rgba(110, 168, 254, 0.15);
    color: #6ea8fe;
}

/* Remaining outline variants: dark-only light tints (text + border). Filled states
   (hover / active / .btn-check:checked) keep Bootstrap's background with its normal text colour */
.theme-dark .btn-outline-success { color: #75b798; border-color: #75b798; }
.theme-dark .btn-outline-success:hover, .theme-dark .btn-outline-success:active, .theme-dark .btn-outline-success.active, .theme-dark .btn-check:checked + .btn-outline-success { color: #fff; }
.theme-dark .btn-outline-danger { color: #ea868f; border-color: #ea868f; }
.theme-dark .btn-outline-danger:hover, .theme-dark .btn-outline-danger:active, .theme-dark .btn-outline-danger.active, .theme-dark .btn-check:checked + .btn-outline-danger { color: #fff; }
.theme-dark .btn-outline-warning { color: #ffda6a; border-color: #ffda6a; }
.theme-dark .btn-outline-warning:hover, .theme-dark .btn-outline-warning:active, .theme-dark .btn-outline-warning.active, .theme-dark .btn-check:checked + .btn-outline-warning { color: #000; }
.theme-dark .btn-outline-info { color: #6edff6; border-color: #6edff6; }
.theme-dark .btn-outline-info:hover, .theme-dark .btn-outline-info:active, .theme-dark .btn-outline-info.active, .theme-dark .btn-check:checked + .btn-outline-info { color: #000; }
.theme-dark .btn-outline-dark { color: #dee2e6; border-color: #adb5bd; }
.theme-dark .btn-outline-dark:hover, .theme-dark .btn-outline-dark:active, .theme-dark .btn-outline-dark.active, .theme-dark .btn-check:checked + .btn-outline-dark { color: #fff; background-color: #495057; border-color: #adb5bd; }

/* ===== PERMIT HISTORY & AUDIT TRAIL DARK MODE ===== */

.theme-dark .table thead th {
    background-color: #2c3034;
    border-bottom-color: #495057;
    color: #adb5bd;
}

.theme-dark .table > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(255, 255, 255, 0.03);
}

.theme-dark .table-hover > tbody > tr:hover > * {
    background-color: rgba(255, 255, 255, 0.06);
}

.theme-dark .table-responsive {
    border-color: #495057;
}

.theme-dark .table > :not(caption) > * > * {
    border-bottom-color: #495057;
}

.theme-dark .mobile-history-card {
    background: #212529;
    border-color: #495057;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.theme-dark .current-card {
    border-color: #198754;
    background-color: rgba(25, 135, 84, 0.1);
}

.theme-dark .current-badge {
    background: #198754;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.theme-dark .change-details {
    color: #adb5bd;
}

.theme-dark .change-field {
    color: #adb5bd;
}

.theme-dark .change-item {
    border-bottom-color: #495057;
}

.theme-dark .no-changes {
    color: #adb5bd;
}

.theme-dark .current-permit {
    background-color: rgba(25, 135, 84, 0.08);
}

/* ===== RECENT PERMIT HISTORY DARK MODE ===== */

.theme-dark .mobile-permit-card {
    background: #212529;
    border-color: #495057;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.theme-dark .mobile-permit-card .info-value {
    color: #e9ecef;
}

.theme-dark .mobile-permit-card .info-row {
    border-bottom-color: #495057;
}

.theme-dark .mobile-permit-card .card-footer {
    border-top-color: #495057;
}

.theme-dark .license-plate {
    background: #2c3034;
    border-color: #495057;
    color: #e9ecef;
}

.theme-dark .status-badge.active {
    background-color: rgba(25, 135, 84, 0.2);
    color: #75b798;
}

.theme-dark .status-badge.expired {
    background-color: rgba(220, 53, 69, 0.2);
    color: #f5c2c7;
}

.theme-dark .status-badge.pending {
    background-color: rgba(255, 193, 7, 0.2);
    color: #ffda6a;
}

/* Permit type row colors - dark mode variants */
.theme-dark .resident {
    background-color: rgba(224, 247, 250, 0.08);
}

.theme-dark .reserved {
    background-color: rgba(255, 235, 238, 0.08);
}

.theme-dark .carport {
    background-color: rgba(240, 244, 195, 0.08);
}

.theme-dark .garage {
    background-color: rgba(197, 202, 233, 0.08);
}

.theme-dark .visitor {
    background-color: rgba(232, 245, 233, 0.08);
}

.theme-dark .temp-pass {
    background-color: rgba(255, 243, 224, 0.08);
}

.theme-dark .handicap {
    background-color: rgba(224, 224, 224, 0.08);
}

.theme-dark .vip {
    background-color: rgba(209, 196, 233, 0.08);
}

.theme-dark .corporate {
    background-color: rgba(187, 222, 251, 0.08);
}

/* Pagination dark mode */
.theme-dark .page-link {
    background-color: #212529;
    border-color: #495057;
    color: #6ea8fe;
}

.theme-dark .page-link:hover {
    background-color: #2c3034;
    border-color: #495057;
    color: #6ea8fe;
}

.theme-dark .page-item.active .page-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

.theme-dark .page-item.disabled .page-link {
    background-color: #1a1d21;
    border-color: #495057;
    color: #6c757d;
}

.theme-dark .border-top {
    border-top-color: #495057 !important;
}

/* ===== EXPIRING PERMITS DASHBOARD DARK MODE ===== */

.theme-dark .card-header.bg-white {
    background-color: #2c3034 !important;
}

.theme-dark .permit-card {
    background-color: #212529;
    border-color: #495057;
}

.theme-dark .permit-header {
    background-color: #2c3034;
    border-bottom-color: #495057;
}

.theme-dark .permit-id {
    color: #e9ecef;
}

.theme-dark .permit-status {
    background-color: #495057;
    color: #e9ecef;
}

.theme-dark .permit-type-badge {
    background-color: rgba(110, 168, 254, 0.15);
    color: #6ea8fe;
}

.theme-dark .plate-badge {
    background-color: #2c3034;
    border-color: #495057;
    color: #e9ecef;
}

.theme-dark .permit-meta {
    border-top-color: #495057;
}

.theme-dark .permit-space {
    color: #adb5bd;
}

.theme-dark .vehicle-info {
    color: #e9ecef;
}

.theme-dark .table-light th {
    background-color: #2c3034 !important;
    color: #adb5bd;
}

.theme-dark .status-indicator.warning {
    background-color: #ffc107;
}

.theme-dark .status-indicator.danger {
    background-color: #dc3545;
}

.theme-dark .status-indicator.success {
    background-color: #198754;
}

.theme-dark .bg-light.bg-opacity-50 {
    background-color: #2c3034 !important;
}

.theme-dark .alert-secondary {
    background-color: rgba(108, 117, 125, 0.15);
    border-color: rgba(108, 117, 125, 0.3);
    color: #adb5bd;
}

.theme-dark .card.bg-light {
    background-color: #2c3034 !important;
    border-color: #495057;
}

.theme-dark .card.bg-light .card-body {
    color: #e9ecef;
}

.theme-dark .table-responsive::-webkit-scrollbar-track {
    background: #2c3034;
}

.theme-dark .table-responsive::-webkit-scrollbar-thumb {
    background: #495057;
}

.theme-dark .table-responsive::-webkit-scrollbar-thumb:hover {
    background: #6c757d;
}

/* ===== RESIDENT DASHBOARD DARK MODE ===== */

.theme-dark .profile-card {
    background-color: #212529;
}

.theme-dark .profile-info-card {
    background: #2c3034;
}

.theme-dark .profile-info-card:hover {
    background: #343a40;
}

.theme-dark .info-icon {
    background: #495057;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.theme-dark .info-label {
    color: #adb5bd;
}

.theme-dark .info-value {
    color: #e9ecef;
}

.theme-dark .vehicle-permit-card {
    background: #212529;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.theme-dark .vehicle-permit-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.theme-dark .permit-header {
    border-bottom-color: #495057;
}

.theme-dark .permit-type {
    color: #e9ecef;
}

.theme-dark .permit-id {
    background: #495057;
    color: #e9ecef;
}

.theme-dark .space-badge {
    background: rgba(110, 168, 254, 0.15);
    color: #6ea8fe;
}

.theme-dark .detail-row {
    color: #adb5bd;
}

.theme-dark .license-plate .state {
    color: #adb5bd;
}

.theme-dark .license-plate .number {
    color: #e9ecef;
}

.theme-dark .expiry-info {
    color: #adb5bd;
}

.theme-dark .vehicle-info-mobile {
    color: #adb5bd;
}

.theme-dark .space-info {
    color: #adb5bd;
    background: rgba(110, 168, 254, 0.15);
}

.theme-dark .date-info {
    color: #adb5bd;
}

.theme-dark .plate-info {
    background: #2c3034;
    border-color: #495057;
}

.theme-dark .plate-info span {
    color: #adb5bd;
}

.theme-dark .plate-info strong {
    color: #e9ecef;
}

.theme-dark .empty-permit i {
    color: #adb5bd;
}

.theme-dark .empty-permit p {
    color: #adb5bd;
}

.theme-dark .empty-permit-instruction {
    color: #adb5bd;
}

.theme-dark .pulsate-text {
    color: #f5c2c7;
}

.theme-dark .property-badge {
    background: #2c3034;
    color: #e9ecef;
}

.theme-dark .active-visitor-permits-card {
    background-color: #212529;
}

.theme-dark .mobile-visitor-permits {
    background: #1a1d21;
}

.theme-dark .mobile-visitor-card {
    background: #212529;
    border-color: #495057;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.theme-dark .visitor-header {
    border-bottom-color: #495057;
}

.theme-dark .visitor-name {
    color: #e9ecef;
}

.theme-dark .permit-id-badge {
    color: #adb5bd;
    background: #495057;
}

.theme-dark .visitor-details .detail-row {
    color: #adb5bd;
}

.theme-dark .visitor-details .detail-row i {
    color: #adb5bd;
}

.theme-dark .permit-history-card {
    background-color: #212529;
}

.theme-dark .mobile-permit-history {
    background: #1a1d21;
}

.theme-dark .permit-id-label {
    color: #e9ecef;
}

.theme-dark .registration-card {
    background-color: #212529;
}

.theme-dark .info-badge {
    color: #adb5bd;
    background: #495057;
}

.theme-dark .property-group {
    background: #1a1d21;
}

.theme-dark .property-header {
    background: #2c3034;
    color: #6ea8fe;
    border-bottom-color: #495057;
}

.theme-dark .code-card {
    background: #212529;
    border-color: #495057;
}

.theme-dark .code-card:hover {
    border-color: #6c757d;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.theme-dark .permit-type-label {
    color: #e9ecef;
}

.theme-dark .registration-code {
    color: #adb5bd;
}

.theme-dark .unit-code-card {
    background: linear-gradient(135deg, #2c3034 0%, #343a40 100%);
    border-color: #495057;
}

.theme-dark .unit-code-card:hover {
    background: linear-gradient(135deg, #343a40 0%, #495057 100%);
    border-color: #6c757d;
}

.theme-dark .unit-details {
    border-top-color: #495057;
}

.theme-dark .unit-registration-section {
    border-bottom-color: #495057;
}

.theme-dark .empty-state {
    color: #adb5bd;
}

.theme-dark .empty-icon {
    color: #6c757d;
}

.theme-dark .header-icon-wrapper {
    background: rgba(110, 168, 254, 0.15);
}

.theme-dark .permit-header .border-bottom {
    border-bottom-color: #495057;
}

/* ===== GENERAL BOOTSTRAP UTILITY DARK MODE ===== */

.theme-dark .input-group-text {
    background-color: #2c3034;
    border-color: #495057;
    color: #adb5bd;
}

.theme-dark .table-danger {
    --bs-table-bg: rgba(220, 53, 69, 0.15);
    --bs-table-border-color: rgba(220, 53, 69, 0.3);
    color: #f5c2c7;
}

.theme-dark .table-danger > td,
.theme-dark .table-danger > th {
    background-color: rgba(220, 53, 69, 0.15);
}

.theme-dark .table-success {
    --bs-table-bg: rgba(25, 135, 84, 0.15);
    --bs-table-border-color: rgba(25, 135, 84, 0.3);
    color: #75b798;
}

.theme-dark .table-success > td,
.theme-dark .table-success > th {
    background-color: rgba(25, 135, 84, 0.15);
}

.theme-dark .table-warning {
    --bs-table-bg: rgba(255, 193, 7, 0.15);
    --bs-table-border-color: rgba(255, 193, 7, 0.3);
    color: #ffda6a;
}

.theme-dark .table-warning > td,
.theme-dark .table-warning > th {
    background-color: rgba(255, 193, 7, 0.15);
}

.theme-dark .card-footer.bg-white,
.theme-dark .card-footer.bg-transparent {
    background-color: #2c3034 !important;
    border-color: #495057;
}

/* ===== DYNAMIC MESSAGE PAGES ===== */

.content-preview {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #212529;
}

.theme-dark .content-preview {
    background-color: #2c3034;
    border-color: #495057 !important;
    color: #e9ecef;
}

.theme-dark .content-preview pre {
    color: #e9ecef;
}

/* Form switch / checkbox dark mode */
.theme-dark .form-check-input {
    background-color: #495057;
    border-color: #6c757d;
}

.theme-dark .form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.theme-dark .form-check-label {
    color: #e9ecef;
}

/* Form switch container dark mode (PropertyManager toggle rows) */
.theme-dark .form-check.form-switch {
    background-color: #2c3034;
    border-color: #495057;
}

/* ===== MASTER SEARCH DARK MODE ===== */

.theme-dark .property-dropdown {
    background: #212529;
    border-color: #495057;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.theme-dark .property-dropdown .dropdown-item {
    color: #e9ecef;
}

.theme-dark .property-dropdown .dropdown-item:hover {
    background-color: #2c3034;
}

.theme-dark .property-dropdown .dropdown-item .text-muted {
    color: #adb5bd !important;
}

/* ===== METRICS DASHBOARD DARK MODE ===== */

.theme-dark .metric-box {
    background: #2c3034;
    border-color: #495057;
}

.theme-dark .city-summary-card {
    background: #2c3034;
    border-color: #495057;
}

.theme-dark .city-summary-card h6 {
    color: #e9ecef;
}

.theme-dark .city-summary-card .fw-semibold {
    color: #e9ecef;
}

.theme-dark .repeat-visitor-card {
    background: #2c3034;
    border-color: #495057;
}

.theme-dark .city-selection {
    background: #2c3034;
    border-color: #495057;
}

.theme-dark .manager-list .fw-semibold {
    color: #e9ecef;
}

/* ===== HELP PAGE DARK MODE ===== */

.theme-dark .help-container {
    background-color: #1a1d21;
}

.theme-dark .featured-section {
    background: #1a1d21;
}

.theme-dark .notice-generator-section {
    background: #212529;
}

.theme-dark .tutorials-section {
    background: #1a1d21;
}

.theme-dark .applications-section {
    background: #212529;
}

.theme-dark .property-setup-section {
    background: linear-gradient(135deg, #1a1d21 0%, #212529 100%);
}

.theme-dark .faq-section {
    background: #1a1d21;
}

.theme-dark .support-section {
    background: #212529;
}

.theme-dark .section-title {
    color: #e9ecef;
}

.theme-dark .section-subtitle {
    color: #ced4da;
}

.theme-dark .featured-content .section-title,
.theme-dark .notice-content .section-title,
.theme-dark .support-content .section-title {
    color: #e9ecef;
}

.theme-dark .featured-videos h4,
.theme-dark .tutorials-section h4 {
    color: #e9ecef;
}

/* Help page - Video cards */
.theme-dark .video-card {
    background: #212529;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.theme-dark .video-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.theme-dark .video-info h5,
.theme-dark .video-info h6 {
    color: #e9ecef;
}

.theme-dark .video-info p {
    color: #adb5bd;
}

/* Help page - Application cards */
.theme-dark .application-card {
    background: #212529;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.theme-dark .card-header-custom {
    background: linear-gradient(135deg, #2c3034, #212529);
    border-bottom-color: #495057;
}

.theme-dark .header-content h3 {
    color: #e9ecef;
}

.theme-dark .header-content p {
    color: #adb5bd;
}

.theme-dark .section-label {
    color: #e9ecef;
}

.theme-dark .pain-point {
    background: rgba(239, 68, 68, 0.15);
}

.theme-dark .pain-point span {
    color: #e9ecef;
}

.theme-dark .digital-benefit {
    background: rgba(16, 185, 129, 0.15);
}

.theme-dark .digital-benefit span {
    color: #e9ecef;
}

.theme-dark .efficiency-stats {
    background: #2c3034;
}

.theme-dark .stat-highlight .stat-label {
    color: #adb5bd;
}

/* Help page - Setup cards */
.theme-dark .setup-info-card {
    background: #212529;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.theme-dark .setup-forms-card {
    background: #212529;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.theme-dark .benefit-card {
    background: #2c3034;
}

.theme-dark .benefit-card .benefit-content h5 {
    color: #e9ecef;
}

.theme-dark .benefit-card .benefit-content p {
    color: #adb5bd;
}

.theme-dark .setup-process {
    background: #2c3034;
    border-color: #495057;
}

.theme-dark .setup-process h5 {
    color: #e9ecef;
}

.theme-dark .process-step .step-content strong {
    color: #e9ecef;
}

.theme-dark .process-step .step-content p {
    color: #adb5bd;
}

.theme-dark .form-instructions {
    background: #2c3034;
}

.theme-dark .form-instructions h6 {
    color: #e9ecef;
}

.theme-dark .instruction-list li {
    color: #adb5bd;
}

/* Help page - Benefit items (Notice Generator section) */
.theme-dark .benefit-content h5 {
    color: #e9ecef;
}

.theme-dark .benefit-content p {
    color: #adb5bd;
}

/* Help page - Mockup preview */
.theme-dark .preview-mockup {
    background: #212529;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.theme-dark .mockup-header {
    background: #2c3034;
    border-bottom-color: #495057;
}

.theme-dark .mockup-title {
    color: #adb5bd;
}

.theme-dark .form-preview-mock {
    background: #1a1d21;
}

.theme-dark .mockup-form-section {
    background: #495057;
}

.theme-dark .preview-panel {
    background: #212529;
}

.theme-dark .preview-header-bar {
    background: #2c3034;
    border-bottom-color: #495057;
}

.theme-dark .preview-content-area {
    background: #212529;
}

.theme-dark .preview-content-area::before {
    background: #495057;
}

.theme-dark .preview-content-area::after {
    background: #2c3034;
}

/* Help page - FAQ */
.theme-dark .search-box {
    background: #212529;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.theme-dark .search-box input {
    color: #e9ecef;
}

.theme-dark .search-box i {
    color: #adb5bd;
}

.theme-dark .faq-container {
    background: #212529;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.theme-dark .faq-card {
    background: #2c3034;
}

.theme-dark .faq-card.expanded {
    background: #343a40;
}

.theme-dark .faq-header h5 {
    color: #e9ecef;
}

.theme-dark .faq-content p {
    color: #adb5bd;
}

.theme-dark .page-info {
    color: #adb5bd;
}

/* Help page - Support section */
.theme-dark .support-feature strong {
    color: #e9ecef;
}

.theme-dark .support-feature p {
    color: #adb5bd;
}

/* Help page - Contact cards */
.theme-dark .contact-card {
    background: #212529;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.theme-dark .contact-card:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.theme-dark .contact-info h4 {
    color: #e9ecef;
}

.theme-dark .contact-info p {
    color: #adb5bd;
}

.theme-dark .contact-link {
    color: #6ea8fe;
}

.theme-dark .contact-link:hover {
    color: #93bbfe;
}

/* Help page - Video modal */
.theme-dark .video-modal-content {
    background: #212529;
}

.theme-dark .modal-header-custom {
    border-bottom-color: #495057;
}

.theme-dark .modal-header-custom h4 {
    color: #e9ecef;
}

.theme-dark .close-btn {
    background: #2c3034;
    color: #e9ecef;
}

.theme-dark .close-btn:hover {
    background: #495057;
}

.theme-dark .modal-footer-custom {
    border-top-color: #495057;
    background: #2c3034;
}

.theme-dark .modal-footer-custom p {
    color: #adb5bd;
}

/* ===== NAV-TABS DARK MODE ===== */

.theme-dark .nav-tabs {
    border-bottom-color: #495057;
}

.theme-dark .nav-tabs .nav-link {
    color: #adb5bd;
    border-color: transparent;
}

.theme-dark .nav-tabs .nav-link:hover,
.theme-dark .nav-tabs .nav-link:focus {
    color: #e9ecef;
    border-color: #495057 #495057 transparent;
    background-color: #2c3034;
}

.theme-dark .nav-tabs .nav-link.active {
    color: #e9ecef;
    background-color: #212529;
    border-color: #495057 #495057 #212529;
}

.theme-dark .nav-pills .nav-link {
    color: #adb5bd;
}

.theme-dark .nav-pills .nav-link:hover {
    color: #e9ecef;
    background-color: #2c3034;
}

.theme-dark .nav-pills .nav-link.active {
    background-color: #0d6efd;
    color: #fff;
}

/* Commercial hub tab bar (page-local navy active text) — readable in dark mode. */
.theme-dark .commercial-hub-tabs { border-bottom-color: #495057; }
.theme-dark .commercial-hub-tabs .nav-link { color: #adb5bd; }
.theme-dark .commercial-hub-tabs .nav-link:hover,
.theme-dark .commercial-hub-tabs .nav-link.active { color: #e9ecef; }

/* Shared pager (Previous / Page X of Y / Next) — disabled buttons readable in dark, still clearly disabled. */
.theme-dark .pms-pager button:disabled {
    color: #adb5bd;
    background-color: #2c3034;
    border: 1px solid #495057;
    cursor: not-allowed;
}

.theme-dark .tab-content {
    background-color: #212529;
}

/* ===== FILE UPLOAD ZONES DARK MODE (GLOBAL) ===== */

.theme-dark .upload-area {
    background-color: #2c3034;
    border-color: #495057;
    color: #adb5bd;
}

.theme-dark .upload-area.dragging {
    background-color: rgba(13, 110, 253, 0.1);
    border-color: #6ea8fe;
}

.theme-dark .upload-area .bi-cloud-upload {
    color: #6c757d;
}

/* ===== ACCORDION DARK MODE ===== */

.theme-dark .accordion-item {
    background-color: #212529;
    border-color: #495057;
}

.theme-dark .accordion-button {
    background-color: #2c3034;
    color: #e9ecef;
    box-shadow: none;
}

.theme-dark .accordion-button:not(.collapsed) {
    background-color: #343a40;
    color: #e9ecef;
}

.theme-dark .accordion-button::after {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.theme-dark .accordion-body {
    background-color: #212529;
    color: #e9ecef;
}

/* ===== OFFCANVAS DARK MODE ===== */

.theme-dark .offcanvas {
    background-color: #212529;
    color: #e9ecef;
}

.theme-dark .offcanvas-header {
    border-bottom-color: #495057;
}

.theme-dark .offcanvas .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* ===== BREADCRUMB DARK MODE ===== */

.theme-dark .breadcrumb {
    background-color: transparent;
}

.theme-dark .breadcrumb-item a {
    color: #6ea8fe;
}

.theme-dark .breadcrumb-item.active {
    color: #adb5bd;
}

.theme-dark .breadcrumb-item + .breadcrumb-item::before {
    color: #6c757d;
}

/* ===== FORM FLOATING LABELS DARK MODE ===== */

.theme-dark .form-floating > label {
    color: #adb5bd;
}

.theme-dark .form-floating > .form-control:focus ~ label,
.theme-dark .form-floating > .form-control:not(:placeholder-shown) ~ label,
.theme-dark .form-floating > .form-select ~ label {
    color: #adb5bd;
}

/* ===== BADGE DARK MODE ===== */

.theme-dark .badge.bg-light {
    background-color: #343a40 !important;
    color: #e9ecef !important;
}

.theme-dark .badge.bg-secondary {
    background-color: #495057 !important;
}

/* ===== POPOVER / TOOLTIP DARK MODE ===== */

.theme-dark .popover {
    background-color: #212529;
    border-color: #495057;
}

.theme-dark .popover-header {
    background-color: #2c3034;
    border-bottom-color: #495057;
    color: #e9ecef;
}

.theme-dark .popover-body {
    color: #e9ecef;
}

/* ===== AD DASHBOARD DARK MODE ===== */

.theme-dark .ad-dashboard-nav .btn-outline-secondary {
    color: #adb5bd;
    border-color: #495057;
}

.theme-dark .ad-dashboard-nav .btn-outline-secondary:hover {
    background-color: #2c3034;
    color: #e9ecef;
    border-color: #6c757d;
}

/* Preview controls panel */
.theme-dark .preview-controls {
    background: #212529;
    border-color: #495057;
}

.theme-dark .preview-frame {
    border-color: #495057;
    background: #1a1d21;
}

.theme-dark .preview-frame-body {
    background: #212529;
}

/* ===== CARD BG-WHITE OVERRIDES ===== */

.theme-dark .card-header.bg-white,
.theme-dark .card .bg-white {
    background-color: #2c3034 !important;
    color: #e9ecef;
}

.theme-dark .bg-white {
    background-color: #212529 !important;
}

/* ===== TABLE-LIGHT DARK MODE ===== */

.theme-dark .table-light {
    --bs-table-bg: #2c3034;
    --bs-table-border-color: #495057;
    color: #adb5bd;
}

.theme-dark .table-light th,
.theme-dark .table-light td {
    background-color: #2c3034;
    color: #adb5bd;
}

/* ===== MISC BOOTSTRAP UTILITIES DARK MODE ===== */

.theme-dark .border {
    border-color: #495057 !important;
}

.theme-dark .border-bottom {
    border-bottom-color: #495057 !important;
}

.theme-dark .border-end {
    border-right-color: #495057 !important;
}

.theme-dark hr {
    border-color: #495057;
    opacity: 0.5;
}

.theme-dark .text-dark {
    color: #e9ecef !important;
}

.theme-dark .bg-body-tertiary {
    background-color: #2c3034 !important;
}

/* Card border-primary in dark mode */
.theme-dark .card.border-primary {
    border-color: #6ea8fe !important;
}

/* ===== NOTICE GENERATOR DARK MODE ===== */

.theme-dark .notice-preview-panel {
    background: #212529;
    border-color: #495057;
}

.theme-dark .notice-form-card {
    background: #212529;
    border-color: #495057;
}

/* ===== PERMIT CODE ENTRY DARK MODE ===== */

.theme-dark .content-wrapper {
    background: #212529 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,.2) !important;
    color: #e9ecef;
}

.theme-dark .code-entry-section {
    background: #2c3034 !important;
}

.theme-dark .permit-types-section {
    background: #2c3034 !important;
}

.theme-dark .property-snap-card {
    background: linear-gradient(135deg, #1b3a1b, #1f3320) !important;
    border-color: #2e7d32 !important;
}

.theme-dark .snap-label {
    color: #adb5bd !important;
}

.theme-dark .snap-property-name {
    color: #90caf9 !important;
}

.theme-dark .snap-unit {
    color: #64b5f6 !important;
}

.theme-dark .snap-property-badge {
    background: #1565c0 !important;
    color: #e3f2fd !important;
}

.theme-dark .permit-item {
    background: #212529 !important;
    border-color: #495057 !important;
    color: #e9ecef;
}

.theme-dark .permit-item:hover {
    box-shadow: 0 4px 6px rgba(0,0,0,.2);
}

.theme-dark .permit-item-disabled {
    background-color: #1a1d21 !important;
    border-color: #495057 !important;
}

.theme-dark .maintenance-message {
    background-color: #212529 !important;
    border-color: #495057 !important;
    color: #e9ecef;
}

.theme-dark .maintenance-message .email-content {
    background-color: #2c3034 !important;
}

.theme-dark .code-entry-section .form-control,
.theme-dark .code-entry-section .form-select {
    background-color: #2c3034;
    border-color: #495057;
    color: #e9ecef;
}

.theme-dark .code-entry-section .form-label {
    color: #e9ecef;
}

.theme-dark .code-entry-section .form-control::placeholder {
    color: #6c757d;
}

/* ===== GRID / TABLE TEXT VISIBILITY IN DARK MODE ===== */

.theme-dark .table td,
.theme-dark .table th {
    color: #e9ecef;
}

.theme-dark .table td code {
    color: #e685b5;
    background-color: rgba(255, 255, 255, 0.05);
}

.theme-dark .table .fw-semibold {
    color: #f8f9fa;
}

.theme-dark .table td a {
    color: #6ea8fe;
}

.theme-dark .table .text-muted {
    color: #9e9e9e !important;
}

/* Ensure table cell backgrounds don't hide text */
.theme-dark .table > tbody > tr > td {
    background-color: transparent;
    color: #e9ecef;
}

.theme-dark .table > thead > tr > th {
    background-color: #2c3034;
    color: #adb5bd;
}

/* ===== INPUT GROUP DARK MODE (search bars in admin tools) ===== */

.theme-dark .input-group-text {
    background-color: #2c3034 !important;
    border-color: #495057;
    color: #adb5bd;
}

.theme-dark .input-group .form-control {
    background-color: #2c3034;
    border-color: #495057;
    color: #e9ecef;
}

.theme-dark .input-group .form-control::placeholder {
    color: #6c757d;
}

/* ===== BULK IMPORT UPLOAD ZONE DARK MODE ===== */

.theme-dark .upload-zone,
.theme-dark .dropzone,
.theme-dark [class*="drop-zone"],
.theme-dark [class*="upload-area"] {
    background-color: #2c3034 !important;
    border-color: #495057 !important;
    color: #adb5bd;
}

/* ===== CARD FOOTER IN DARK MODE ===== */

.theme-dark .card-footer {
    background-color: #1e2226;
    border-top-color: #495057;
    color: #adb5bd;
}

/* ===== PAGINATION DARK MODE REINFORCEMENT ===== */

.theme-dark .pagination .page-link {
    background-color: #212529;
    border-color: #495057;
    color: #adb5bd;
}

.theme-dark .pagination .page-link:hover {
    background-color: #2c3034;
    border-color: #6c757d;
    color: #e9ecef;
}

.theme-dark .pagination .page-item.active .page-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

.theme-dark .pagination .page-item.disabled .page-link {
    background-color: #1a1d21;
    border-color: #495057;
    color: #495057;
}

/* ===== SELECT DROPDOWN DARK MODE ===== */

.theme-dark select.form-select,
.theme-dark .form-select {
    background-color: #2c3034;
    border-color: #495057;
    color: #e9ecef;
}

/* Select caret — light chevron on dark (Bootstrap's default is dark grey, near-invisible). Leaves valid/invalid and multi-row selects alone. */
.theme-dark .form-select:not([multiple]):not([size]):not(.is-invalid):not(.is-valid) {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23dee2e6' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

.theme-dark select.form-select option {
    background-color: #212529;
    color: #e9ecef;
}

/* ===== PAID PARKING DASHBOARD DARK MODE ===== */

.theme-dark .pp-header h3 {
    color: #90caf9;
}

.theme-dark .pp-summary-card {
    background: #212529 !important;
    border-color: #495057 !important;
}

.theme-dark .pp-card-revenue .pp-card-value { color: #90caf9; }
.theme-dark .pp-card-property .pp-card-value { color: #ffb74d; }
.theme-dark .pp-card-ppoa .pp-card-value { color: #81c784; }

.theme-dark .pp-card-label { color: #adb5bd; }
.theme-dark .pp-card-sub { color: #6c757d; }

.theme-dark .pp-record-card {
    background: #212529 !important;
    border-color: #495057 !important;
    color: #e9ecef;
}

.theme-dark .pp-record-card:hover {
    border-color: #1565c0 !important;
}

.theme-dark .pp-record-gross { color: #90caf9; }
.theme-dark .pp-record-detail { color: #adb5bd; }

.theme-dark .pp-month-tag {
    background: #1a237e;
    color: #bbdefb;
}

.theme-dark .pp-client { color: #ffb74d; }
.theme-dark .pp-vendor { color: #81c784; }
.theme-dark .pp-towing { color: #64b5f6; }
.theme-dark .pp-tax { color: #9e9e9e; }

.theme-dark .pp-empty-card {
    background: #332b00 !important;
    border-color: #665500 !important;
}

.theme-dark .pp-empty-name { color: #e9ecef; }

/* Global form-label and card-title dark mode overrides */
.theme-dark .form-label { color: #e9ecef; }
.theme-dark .card-title { color: #e9ecef; }
.theme-dark .card-body h1,
.theme-dark .card-body h2,
.theme-dark .card-body h3,
.theme-dark .card-body h4,
.theme-dark .card-body h5,
.theme-dark .card-body h6 { color: #e9ecef; }
.theme-dark .card-header h4,
.theme-dark .card-header h5,
.theme-dark .card-header h6 { color: #e9ecef; }

/* Phase E (#835): ResidentPicker dark-mode overrides */
.theme-dark .resident-picker-list {
    background-color: #2c3034;
    border-color: #495057;
}
.theme-dark .resident-picker-row {
    border-bottom-color: #3b4046;
    color: #e9ecef;
}
.theme-dark .resident-picker-row:hover {
    background-color: #3b4046;
}
.theme-dark .resident-picker-row.selected {
    background-color: rgba(110, 168, 254, 0.18);
    border-left-color: #6ea8fe;
}

/* Phase G.3: SlotPickerForReservation dark-mode overrides */
.theme-dark .slot-picker-list {
    background-color: #2c3034;
    border-color: #495057;
}
.theme-dark .slot-picker-row {
    border-bottom-color: #3b4046;
    color: #e9ecef;
}
.theme-dark .slot-picker-row:hover {
    background-color: #3b4046;
}
.theme-dark .slot-picker-row.selected,
.theme-dark .slot-picker-row.linked {
    background-color: rgba(110, 168, 254, 0.18);
    border-left-color: #6ea8fe;
}

/* ========================================================================
   Disabled-button & toggle-switch polish — DARK-MODE brand parity
   Mirrors the light-mode rules appended to app.css. Higher specificity so
   these win over the light rules whenever the .theme-dark class is present.
   Brand palette: navy #0A1B3D · sky-cyan #5BB5DC · silver #7A8A9E
   ======================================================================== */

/* Disabled buttons — dark, muted, readable (not light-silver on a dark bg) */
.theme-dark .btn:disabled:not(.btn-link),
.theme-dark .btn.disabled:not(.btn-link),
.theme-dark .btn[disabled]:not(.btn-link),
.theme-dark .btn:disabled:not(.btn-link):hover,
.theme-dark .btn.disabled:not(.btn-link):hover,
.theme-dark .btn[disabled]:not(.btn-link):hover,
.theme-dark .btn:disabled:not(.btn-link):focus,
.theme-dark .btn.disabled:not(.btn-link):focus,
.theme-dark .btn[disabled]:not(.btn-link):focus {
    background-color: #2c3034;
    border-color: #495057;
    color: #8b97a5;
    opacity: 1;
    box-shadow: none;
    transform: none;
    cursor: not-allowed;
}

/* Toggle switches — keep the existing dark off-track, brand-cyan on-state */
.theme-dark .form-switch .form-check-input {
    background-color: #495057;
    border-color: #6c757d;
}

.theme-dark .form-switch .form-check-input:checked {
    background-color: #5BB5DC;
    border-color: #5BB5DC;
}


/* Dark only: cyan (bg-info) card headers keep white-on-cyan in light mode like 2.0, but get black text in dark for contrast (Citations dashboard "Citation Overview"). Global so it can't miss like the page-level rule did. */
html.theme-dark .card .card-header.bg-info,
html.theme-dark .card .card-header.bg-info h6,
html.theme-dark .card .card-header.bg-info i {
    color: #000 !important;
}

/* Light only: 2.0 sidebar has no right border and no shadow (also removes the faint shadow under the phone top bar). Dark keeps its border/shadow above. */
html:not(.theme-dark) .sidebar {
    border-right-width: 0;
    box-shadow: none;
}

/* Dark only: yellow (bg-warning) modal headers use the tinted dark style above; make the close X visible on it too. */
.theme-dark .modal-header.bg-warning .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Dark-mode green text: Bootstrap #198754 is ~2.9:1 on dark cards; lift to Bootstrap's dark-mode success text */
.theme-dark .text-success,
.theme-dark .card .text-success,
.theme-dark .badge.text-success,
.theme-dark .table .text-success {
    color: #75b798 !important;
}

/* Dark review (breaker-3 pass 21) — dark-only readability fixes; light mode untouched */
/* 1. Master scope bar: search box + Reset were leftover light panels on the dark bar */
.theme-dark .master-scope-bar .msb-input {
    background: #2b3035;
    color: #f8f9fa;
    border-color: #6c757d;
}
.theme-dark .master-scope-bar .msb-input::placeholder { color: #adb5bd; }
.theme-dark .master-scope-bar .msb-reset {
    background: #495057;
    color: #f8f9fa;
}
.theme-dark .master-scope-bar .msb-reset:hover { background: #5c636a; color: #ffffff; }
/* 2. Info badges (e.g. Voice Search property tag): dark text on the bright cyan */
.theme-dark .badge.bg-info { color: #000000 !important; }
/* 3. Disabled primary buttons (e.g. Commercial Tenants "Invite Tenant"): still grey/not-allowed, but legible */
.theme-dark .btn.btn-primary:disabled,
.theme-dark .btn.btn-primary.disabled {
    background-color: #343a40 !important;
    border-color: #495057 !important;
    color: #ced4da !important;
    opacity: 1 !important;
}
/* 4. Blocked Vehicles "Blacklisted" status tag */
.theme-dark .status-badge.blacklisted { color: #f1aeb5 !important; }
/* 5. Inline code inside info alerts (e.g. Paid Resident Slots "?propertyId={id}") */
.theme-dark .alert-info code { color: #f7c1dc; }
/* 6. Dark link color must not override button text or partner-page links on white (reset-password, /dfwtows, /mustang) */
.theme-dark a.btn-primary:not(.disabled), .theme-dark a.btn-primary:not(.disabled):hover { color: #fff; }
/* Link badges on solid fills (e.g. resident-edit permit # "badge bg-primary") — the generic .theme-dark a link blue made them ~1.9:1. */
.theme-dark a.badge.bg-primary, .theme-dark a.badge.bg-success, .theme-dark a.badge.bg-danger, .theme-dark a.badge.bg-secondary, .theme-dark a.badge.bg-dark { color: #fff; }
.theme-dark a.dfw-pill-light { color: var(--dfw-ink); }
.theme-dark a.dfw-pill-light:hover { color: var(--dfw-red); }
.theme-dark a.mus-header-phone { color: var(--mus-navy); }
/* 7. Dark link color must not repaint solid Bootstrap link-buttons (LPR showcase, Help, Resident dashboard) */
.theme-dark a:is(.btn-success, .btn-secondary, .btn-info, .btn-danger):not(.disabled),
.theme-dark a:is(.btn-success, .btn-secondary, .btn-info, .btn-danger):not(.disabled):hover { color: #fff; }
/* 8. .keep-light: a section that is white in the page design keeps its light-mode look in dark mode
      (used on /patriot-lpr content sections; dark hero/CTA sections are not tagged) */
.theme-dark .keep-light { color: #212529; color-scheme: light; }
.theme-dark .keep-light :is(h1, h2, h3, h4, h5, h6, .card-title) { color: #1f2937; }
.theme-dark .keep-light .text-muted { color: #6c757d !important; }
.theme-dark .keep-light .card { background-color: #fff; color: #212529; border-color: #dee2e6 !important; }
.theme-dark .keep-light a:not(.btn):not([class*="badge"]) { color: #0d6efd; }
.theme-dark .keep-light .btn-outline-primary, .theme-dark .keep-light .pricing-card .btn:not(.btn-primary):not(.btn-success):not(.btn-danger) { color: #0d6efd; }
.theme-dark .keep-light p:not([class*="btn"]):not([class*="badge"]) { color: #4b5563; }
.theme-dark .keep-light .benefit-card { background: #fff !important; border-color: #e5e7eb !important; color: #212529; }
.theme-dark .keep-light .benefit-card :is(h3, h4, h5) { color: #1f2937 !important; }
.theme-dark .keep-light .benefit-card p { color: #6b7280 !important; }
/* AustinLoomis business card (classes unique to that page): light chips keep dark text */
.theme-dark :is(.contact-item, .expertise-item) { color: #212529; }
.theme-dark .expertise-item :is(h4, h5, h6) { color: #1f2937; }
.theme-dark .expertise-item p { color: #4b5563; }
/* 9. Dark only: yellow (bg-warning) badges/card headers and cyan (bg-info) badges stay bright in dark, so their
      "text-dark" must stay dark; the generic `.theme-dark .text-dark { #e9ecef !important }` made it light-on-yellow.
      Modal headers are excluded (they use the tinted dark style at rule ~358). */
.theme-dark :is(.badge, .card-header).bg-warning.text-dark,
.theme-dark .card-header.bg-warning.text-dark :is(h1, h2, h3, h4, h5, h6, i, small, span:not(.badge)),
.theme-dark .badge.bg-info.text-dark { color: #212529 !important; }

/* Dark only: grey stat numbers on cards (e.g. /metrics-dashboard "Regional" managers, h3.text-secondary) were #6c757d on #2c3034 (~2.8:1). */
.theme-dark .card-body h3.text-secondary { color: #adb5bd !important; }
