/* Patient portal dark mode — charcoal palette */
html[data-theme="dark"] {
    --dm-bg: #1c1c1e;
    --dm-surface: #242428;
    --dm-surface-raised: #2c2c30;
    --dm-border: #3a3a3f;
    --dm-text: #f5f5f5;
    --dm-text-secondary: #a1a1aa;
    --dm-primary: #1a6b3c;
    --dm-primary-bright: #4ade80;
    --dm-primary-hover: #1f7d45;
    --dm-primary-subtle: rgba(26, 107, 60, 0.18);
    color-scheme: dark;
}

html[data-theme="dark"],
html[data-theme="dark"] body {
    background: var(--dm-bg) !important;
}

html[data-theme="dark"] .page-content,
html[data-theme="dark"] .dashboard-section {
    background: var(--dm-bg) !important;
}

/* Navbar */
html[data-theme="dark"] .site-navbar {
    background: rgba(28, 28, 30, 0.92) !important;
    border-bottom-color: var(--dm-border) !important;
}

html[data-theme="dark"] .site-navbar.scrolled {
    background: rgba(28, 28, 30, 0.98) !important;
    border-bottom-color: var(--dm-border) !important;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.35) !important;
}

html[data-theme="dark"] .landing-nav .nav-brand,
html[data-theme="dark"] .landing-nav .nav-brand em,
html[data-theme="dark"] .site-navbar a.nav-brand,
html[data-theme="dark"] .site-navbar a.nav-brand em {
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .landing-nav .nav-brand strong,
html[data-theme="dark"] .site-navbar a.nav-brand strong {
    color: var(--dm-primary-bright) !important;
}

html[data-theme="dark"] .site-navbar .site-menu > li > a {
    color: var(--dm-text-secondary) !important;
    background: transparent !important;
}

html[data-theme="dark"] .site-navbar .site-menu > li > a:hover {
    color: var(--dm-text) !important;
    background: var(--dm-surface-raised) !important;
}

html[data-theme="dark"] .site-navbar .site-menu > li.active > a {
    color: var(--dm-text) !important;
    background: var(--dm-surface-raised) !important;
}

html[data-theme="dark"] .site-navbar .site-menu > li.active > a .fa,
html[data-theme="dark"] .site-navbar .site-menu > li.active > a svg {
    color: var(--dm-primary) !important;
}

html[data-theme="dark"] .site-navbar .site-navigation .site-menu .active > a {
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .site-navbar .site-navigation .site-menu .active > a:before {
    background: var(--dm-primary) !important;
}

html[data-theme="dark"] .icons .js-user-open {
    border-color: var(--dm-border) !important;
}

html[data-theme="dark"] .icons .js-user-open:hover {
    border-color: var(--dm-primary) !important;
}

html[data-theme="dark"] #notifBell i {
    color: var(--dm-text-secondary) !important;
}

html[data-theme="dark"] .account-nav-active,
html[data-theme="dark"] .user-dropdown .account-nav-active,
html[data-theme="dark"] .user-dropdown a.account-nav-active {
    color: #4ade80 !important;
    background: var(--dm-primary-subtle) !important;
}

html[data-theme="dark"] .user-dropdown .account-nav-active:hover,
html[data-theme="dark"] .user-dropdown .account-nav-active:focus,
html[data-theme="dark"] .user-dropdown a.account-nav-active:hover,
html[data-theme="dark"] .user-dropdown a.account-nav-active:focus {
    color: #4ade80 !important;
    background: var(--dm-primary-subtle) !important;
}

html[data-theme="dark"] .user-dropdown .dropdown-menu {
    background: var(--dm-surface) !important;
    border: 1px solid var(--dm-border) !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45) !important;
}

html[data-theme="dark"] .user-dropdown .dropdown-menu::before,
html[data-theme="dark"] .notif-dropdown .dropdown-menu::before {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border, #3a3a3f) !important;
}

html[data-theme="dark"] .user-dropdown .dropdown-item {
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .user-dropdown .dropdown-item:hover,
html[data-theme="dark"] .user-dropdown .dropdown-item:focus {
    background: var(--dm-surface-raised) !important;
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .user-dropdown .dropdown-item:hover i,
html[data-theme="dark"] .user-dropdown .dropdown-item:focus i {
    color: inherit !important;
}

html[data-theme="dark"] .user-dropdown span.dropdown-item strong {
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .user-dropdown .dropdown-divider {
    border-color: var(--dm-border) !important;
}

html[data-theme="dark"] .user-dropdown .dropdown-item-theme,
html[data-theme="dark"] .user-dropdown .dropdown-item-theme i {
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .user-dropdown .dropdown-item-theme:hover,
html[data-theme="dark"] .user-dropdown .dropdown-item-theme:focus {
    background: var(--dm-surface-raised) !important;
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .user-dropdown .dropdown-item-theme:hover i,
html[data-theme="dark"] .user-dropdown .dropdown-item-theme:focus i {
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .search-wrap .form-control {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .search-wrap .form-control::placeholder {
    color: var(--dm-text-secondary) !important;
}

/* Dropdowns */
html[data-theme="dark"] .dropdown-menu {
    background: var(--dm-surface) !important;
    border: 1px solid var(--dm-border) !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45) !important;
}

html[data-theme="dark"] .dropdown-item {
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .dropdown-item:hover,
html[data-theme="dark"] .dropdown-item:focus {
    background: var(--dm-surface-raised) !important;
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .dropdown-divider {
    border-color: var(--dm-border) !important;
}

html[data-theme="dark"] .user-dropdown .dropdown-item-account,
html[data-theme="dark"] .user-dropdown .dropdown-item-account i {
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .user-dropdown .dropdown-item-account:hover,
html[data-theme="dark"] .user-dropdown .dropdown-item-account:focus {
    background: var(--dm-surface-raised) !important;
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .user-dropdown .dropdown-item-account:hover i,
html[data-theme="dark"] .user-dropdown .dropdown-item-account:focus i {
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .user-dropdown .dropdown-item-logout,
html[data-theme="dark"] .user-dropdown .dropdown-item-logout i {
    color: #f87171 !important;
}

html[data-theme="dark"] .user-dropdown .dropdown-item-logout:hover,
html[data-theme="dark"] .user-dropdown .dropdown-item-logout:focus {
    background: rgba(220, 38, 38, 0.15) !important;
    color: #f87171 !important;
}

html[data-theme="dark"] .user-dropdown .dropdown-item-logout:hover i,
html[data-theme="dark"] .user-dropdown .dropdown-item-logout:focus i {
    color: #f87171 !important;
}

html[data-theme="dark"] .notif-header {
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .notif-divider {
    background: var(--dm-border) !important;
}

html[data-theme="dark"] .notif-item {
    border-bottom-color: var(--dm-border) !important;
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .notif-item:hover,
html[data-theme="dark"] .notif-item:focus {
    background: var(--dm-surface-raised) !important;
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .notif-item-title {
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .notif-item-detail,
html[data-theme="dark"] .notif-item-time,
html[data-theme="dark"] .notif-menu .text-muted {
    color: var(--dm-text-secondary) !important;
}

html[data-theme="dark"] .notif-menu .js-mark-notifications-read {
    color: #4ade80 !important;
}

html[data-theme="dark"] .notif-icon {
    background: var(--dm-primary-subtle) !important;
    color: var(--dm-primary) !important;
}

html[data-theme="dark"] .text-muted {
    color: var(--dm-text-secondary) !important;
}

/* Cards */
html[data-theme="dark"] .card,
html[data-theme="dark"] .card-dash,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .quick-action-card {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
}

html[data-theme="dark"] .card-dash .card-header,
html[data-theme="dark"] .stat-card .card-body {
    border-color: var(--dm-border) !important;
}

html[data-theme="dark"] .section-title,
html[data-theme="dark"] .site-section-heading,
html[data-theme="dark"] .order-timeline .timeline-order-ref,
html[data-theme="dark"] .order-timeline .timeline-step.active .step-label {
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .stat-card h4.fw-bold,
html[data-theme="dark"] .stat-card .stat-value-real,
html[data-theme="dark"] .order-table td.fw-semibold,
html[data-theme="dark"] .order-table td.fw-semibold.small {
    color: var(--dm-text) !important;
}

html[data-theme="dark"] body.patient-homepage #statsCardsWrap .stat-card .stat-label {
    color: var(--dm-text-secondary) !important;
}

html[data-theme="dark"] body.patient-homepage #statsCardsWrap .stat-card .stat-subtitle {
    color: #71717a !important;
}

html[data-theme="dark"] .shadow-sm {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3) !important;
}

/* Tables */
html[data-theme="dark"] .order-table th {
    color: var(--dm-text-secondary) !important;
    border-top-color: var(--dm-border) !important;
    border-bottom-color: var(--dm-border) !important;
}

html[data-theme="dark"] .order-table td {
    border-top-color: var(--dm-border) !important;
    border-bottom-color: var(--dm-border) !important;
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .recent-dashboard-card .order-table tbody td {
    border-top-color: var(--dm-border) !important;
    border-bottom-color: var(--dm-border) !important;
}

html[data-theme="dark"] .order-table tbody tr.clickable-row:hover td {
    background: var(--dm-surface-raised) !important;
}

/* Mobile order tables — card layout (patient_responsive_styles.php) */
@media (max-width: 767.98px) {
    html[data-theme="dark"] .order-table tr {
        background: var(--dm-surface-raised) !important;
        border-color: var(--dm-border) !important;
    }

    html[data-theme="dark"] .order-table tbody td {
        color: var(--dm-text) !important;
        background: transparent !important;
        border: none !important;
        border-top: none !important;
        border-bottom: 1px solid var(--dm-border) !important;
    }

    html[data-theme="dark"] .order-table tbody td:last-child,
    html[data-theme="dark"] .order-table tbody td[data-label="Action"] {
        border-bottom: none !important;
    }

    html[data-theme="dark"] .order-table td::before {
        color: var(--dm-text-secondary) !important;
    }

    html[data-theme="dark"] .order-table td .text-muted,
    html[data-theme="dark"] .order-table td small.text-muted {
        color: var(--dm-text-secondary) !important;
    }

    html[data-theme="dark"] .order-table td.fw-semibold,
    html[data-theme="dark"] .order-table td.fw-semibold.small,
    html[data-theme="dark"] .order-table td[style*="color:#1a1a2e"],
    html[data-theme="dark"] .order-table td[style*="color: #1a1a2e"] {
        color: var(--dm-text) !important;
    }

    html[data-theme="dark"] .order-table tbody tr:not(.blank-row):not(.table-row-skeleton):hover td {
        background: transparent !important;
    }
}

/* Timeline */
html[data-theme="dark"] .order-timeline .timeline-step .step-label {
    color: var(--dm-text-secondary) !important;
}

html[data-theme="dark"] .order-timeline .timeline-step.done .step-label {
    color: var(--dm-primary) !important;
}

html[data-theme="dark"] .order-timeline .timeline-step.active .step-label {
    color: var(--dm-text) !important;
    font-weight: 600;
}

/* Pending steps: dark dot, muted icon (override inline #e2e8f0) */
html[data-theme="dark"] .order-timeline .timeline-step:not(.done) .step-dot {
    background: var(--dm-border) !important;
    border: 1px solid #4a4a50;
}

html[data-theme="dark"] .order-timeline .timeline-step:not(.done) .step-dot i {
    color: var(--dm-text-secondary) !important;
}

/* Completed / active steps: brand green dot, white icon */
html[data-theme="dark"] .order-timeline .timeline-step.done .step-dot,
html[data-theme="dark"] .order-timeline .timeline-step.active .step-dot {
    background: var(--dm-primary) !important;
    border-color: transparent;
}

html[data-theme="dark"] .order-timeline .timeline-step.done .step-dot i,
html[data-theme="dark"] .order-timeline .timeline-step.active .step-dot i {
    color: #fff !important;
}

html[data-theme="dark"] .order-timeline .timeline-step.active .step-dot {
    box-shadow: 0 0 0 3px rgba(26, 107, 60, 0.35) !important;
}

/* Connector lines: default muted, completed segments green */
html[data-theme="dark"] .order-timeline .timeline-step:not(:first-child)::before {
    background: var(--dm-border) !important;
}

html[data-theme="dark"] .order-timeline .timeline-step.done:not(:first-child)::before {
    background: var(--dm-primary) !important;
}

html[data-theme="dark"] .order-timeline .timeline-divider {
    background: linear-gradient(to right, transparent, var(--dm-border), transparent) !important;
}

html[data-theme="dark"] .tl-nav-btn {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text-secondary) !important;
}

html[data-theme="dark"] .tl-nav-btn:hover:not(:disabled) {
    border-color: var(--dm-primary) !important;
    color: var(--dm-primary) !important;
    background: var(--dm-surface-raised) !important;
}

html[data-theme="dark"] .tl-dot {
    background: var(--dm-border) !important;
}

html[data-theme="dark"] .tl-dot.active {
    background: var(--dm-primary) !important;
}

/* Empty states & skeletons */
html[data-theme="dark"] .empty-state-icon {
    color: var(--dm-border) !important;
}

html[data-theme="dark"] .skeleton-box {
    background: linear-gradient(90deg, var(--dm-border) 25%, var(--dm-surface-raised) 50%, var(--dm-border) 75%) !important;
    background-size: 200px 100% !important;
}

html[data-theme="dark"] .skeleton-row {
    border-bottom-color: var(--dm-border) !important;
}

/* View all link */
html[data-theme="dark"] .view-all-link {
    color: var(--dm-primary) !important;
}

html[data-theme="dark"] .view-all-link:hover,
html[data-theme="dark"] .view-all-link:focus {
    color: var(--dm-primary-hover) !important;
}

/* Watermark */
html[data-theme="dark"] .watermark span {
    color: rgba(245, 245, 245, 0.35) !important;
}

/* Mobile drawer */
@media (max-width: 991.98px) {
    html[data-theme="dark"] .patient-mobile-drawer {
        background: var(--dm-surface) !important;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.45) !important;
    }

    html[data-theme="dark"] .patient-mobile-drawer-header {
        border-bottom-color: var(--dm-border) !important;
    }

    html[data-theme="dark"] .patient-mobile-drawer-logo,
    html[data-theme="dark"] .patient-mobile-drawer-logo:hover,
    html[data-theme="dark"] .patient-mobile-drawer-logo:focus {
        color: var(--dm-text) !important;
    }

    html[data-theme="dark"] .patient-mobile-drawer-logo .patient-brand-rx {
        color: var(--dm-primary-bright) !important;
    }

    html[data-theme="dark"] .patient-mobile-drawer-logo .patient-brand-md {
        color: #F0C040 !important;
    }

    html[data-theme="dark"] .patient-hamburger span {
        background: var(--dm-text) !important;
    }

    html[data-theme="dark"] .patient-hamburger:hover,
    html[data-theme="dark"] .patient-hamburger.is-open,
    html[data-theme="dark"] .patient-hamburger-drawer-slot .patient-hamburger {
        background: var(--dm-surface-raised) !important;
    }

    html[data-theme="dark"] .patient-mobile-nav li a {
        color: var(--dm-text-secondary) !important;
    }

}

/* Modals */
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .modal-contentout,
html[data-theme="dark"] #myModalcle .modal-contentout,
html[data-theme="dark"] #deleteConfirmModal .modal-contentout,
html[data-theme="dark"] .modalcon-content,
html[data-theme="dark"] .order-info-modal-content,
html[data-theme="dark"] .pharma-cancel-confirm-content {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .order-info-modal-header {
    color: var(--dm-text) !important;
    border-bottom-color: var(--dm-border) !important;
}

html[data-theme="dark"] .modal-header h2,
html[data-theme="dark"] .order-info-modal-header h2 {
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .modal-footer {
    border-top-color: var(--dm-border) !important;
}

html[data-theme="dark"] .modal-body,
html[data-theme="dark"] .modal-bodyout {
    color: var(--dm-text-secondary) !important;
}

html[data-theme="dark"] #myModalcle .btn-signout-cancel,
html[data-theme="dark"] #deleteConfirmModal .btn-signout-cancel {
    background: var(--dm-surface-raised) !important;
    color: var(--dm-text) !important;
    border-color: var(--dm-border) !important;
}

html[data-theme="dark"] #myModalcle .btn-signout-cancel:hover,
html[data-theme="dark"] #deleteConfirmModal .btn-signout-cancel:hover {
    background: var(--dm-border) !important;
    border-color: var(--dm-border) !important;
}

/* Cart / upload modal */
html[data-theme="dark"] .modal-custom .modal-content-custom {
    background: var(--dm-surface) !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45) !important;
}

html[data-theme="dark"] .modal-custom .modal-header {
    border-bottom-color: var(--dm-border) !important;
    background: var(--dm-surface) !important;
}

html[data-theme="dark"] .modal-custom .modal-header h3 {
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .modal-custom .modal-body {
    background: var(--dm-surface) !important;
}

html[data-theme="dark"] .modal-custom .label {
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .modal-custom .instruction {
    color: var(--dm-text-secondary) !important;
}

html[data-theme="dark"] .modal-custom .drop-zone {
    background: var(--dm-bg) !important;
    border-color: var(--dm-border) !important;
}

html[data-theme="dark"] .modal-custom .drop-zone:hover,
html[data-theme="dark"] .modal-custom .drop-zone.drag-over {
    border-color: var(--dm-primary) !important;
    background: var(--dm-primary-subtle) !important;
}

html[data-theme="dark"] .modal-custom .custom-dropdown-trigger,
html[data-theme="dark"] .modal-custom .custom-dropdown-trigger-input {
    background: var(--dm-bg) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .modal-custom .custom-dropdown-trigger.is-placeholder:not(.open),
html[data-theme="dark"] .modal-custom .custom-dropdown-trigger-input.is-placeholder:not(.open) {
    background: var(--dm-surface-raised) !important;
    color: var(--dm-text-secondary) !important;
}

html[data-theme="dark"] .modal-custom .custom-dropdown-trigger.open,
html[data-theme="dark"] .modal-custom .custom-dropdown-trigger-input.open,
html[data-theme="dark"] .modal-custom .custom-dropdown-trigger-input:focus:not(.is-placeholder) {
    border-color: var(--dm-primary) !important;
    background: var(--dm-bg) !important;
    box-shadow: 0 0 0 3px rgba(26, 107, 60, 0.25) !important;
}

html[data-theme="dark"] .modal-custom .custom-dropdown-list {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border) !important;
}

html[data-theme="dark"] .modal-custom .custom-dropdown-option {
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .modal-custom .custom-dropdown-option:hover,
html[data-theme="dark"] .modal-custom .custom-dropdown-option.is-selected {
    background: var(--dm-primary-subtle) !important;
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .modal-custom .form-control,
html[data-theme="dark"] .modal-custom select,
html[data-theme="dark"] .modal-custom textarea,
html[data-theme="dark"] .modal-custom input[type="text"],
html[data-theme="dark"] .modal-custom input[type="email"],
html[data-theme="dark"] .modal-custom input[type="tel"] {
    background: var(--dm-bg) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .modal-custom .form-control:focus,
html[data-theme="dark"] .modal-custom select:focus,
html[data-theme="dark"] .modal-custom textarea:focus,
html[data-theme="dark"] .modal-custom input:focus {
    border-color: var(--dm-primary) !important;
    box-shadow: 0 0 0 3px rgba(26, 107, 60, 0.25) !important;
}

html[data-theme="dark"] .modal-custom .form-control::placeholder,
html[data-theme="dark"] .modal-custom textarea::placeholder {
    color: var(--dm-text-secondary) !important;
}

html[data-theme="dark"] .modal-custom .file-preview,
html[data-theme="dark"] .modal-custom .info-box {
    background: var(--dm-primary-subtle) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text-secondary) !important;
}

html[data-theme="dark"] .modal-custom .file-preview-thumb {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border) !important;
}

html[data-theme="dark"] .modal-custom .cart-upload-modal {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border) !important;
}

html[data-theme="dark"] .modal-custom .cart-upload-option {
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .modal-custom .cart-upload-option:hover {
    background: var(--dm-surface-raised) !important;
}

html[data-theme="dark"] .modal-custom .modal-footer {
    border-top-color: var(--dm-border) !important;
    background: var(--dm-surface) !important;
}

html[data-theme="dark"] .addr-add-btn {
    border-color: var(--dm-border) !important;
    color: var(--dm-text-secondary) !important;
}

html[data-theme="dark"] .addr-add-btn:hover {
    border-color: var(--dm-primary) !important;
    color: var(--dm-primary) !important;
    background: var(--dm-primary-subtle) !important;
}

/* Chatbot */
html[data-theme="dark"] .patient-chatbot-popup-panel {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45) !important;
}

html[data-theme="dark"] .patient-chatbot-popup-header {
    background: var(--dm-surface) !important;
    border-bottom-color: var(--dm-border) !important;
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .patient-chatbot-popup-header h2 {
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .patient-chatbot-popup-messages {
    background: var(--dm-bg) !important;
}

html[data-theme="dark"] .patient-chatbot-popup-footer {
    background: var(--dm-surface) !important;
    border-top-color: var(--dm-border) !important;
}

html[data-theme="dark"] .patient-chatbot-popup-loading,
html[data-theme="dark"] .patient-chatbot-popup-empty {
    color: var(--dm-text-secondary) !important;
}

html[data-theme="dark"] .patient-chatbot-bubble.is-bot {
    background: var(--dm-surface-raised) !important;
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .patient-chatbot-bubble.is-user {
    background: var(--dm-primary) !important;
    color: #fff !important;
}

html[data-theme="dark"] .patient-chatbot-quick {
    background: var(--dm-surface-raised) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .patient-chatbot-quick:hover {
    border-color: var(--dm-primary) !important;
    color: var(--dm-primary) !important;
}

html[data-theme="dark"] .patient-chatbot-popup-compose input {
    background: var(--dm-bg) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .patient-chatbot-popup-compose input:focus {
    border-color: var(--dm-primary) !important;
    box-shadow: 0 0 0 3px rgba(26, 107, 60, 0.25) !important;
}

html[data-theme="dark"] .patient-chatbot-popup-foot {
    color: var(--dm-text-secondary) !important;
}

/* Theme toggle (avatar dropdown) */
.user-dropdown .theme-toggle-btn {
    width: 100%;
    border: none;
    background: transparent;
    font-family: inherit;
    line-height: inherit;
    text-align: left;
}

.user-dropdown .theme-toggle-btn .theme-icon-light {
    display: none;
}

html[data-theme="dark"] .user-dropdown .theme-toggle-btn .theme-icon-dark {
    display: none;
}

html[data-theme="dark"] .user-dropdown .theme-toggle-btn .theme-icon-light {
    display: inline-block;
}

/* ===== Prescriptions page ===== */
html[data-theme="dark"] .summary-subtitle {
    color: var(--dm-text-secondary) !important;
}

html[data-theme="dark"] .prescription-summary-card {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border) !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25) !important;
}

html[data-theme="dark"] .summary-table-wrapper {
    background: var(--dm-bg) !important;
    border-color: var(--dm-border) !important;
}

html[data-theme="dark"] .filter-input,
html[data-theme="dark"] .filter-select,
html[data-theme="dark"] .prescription-filters-trigger,
html[data-theme="dark"] .prescription-filters-clear,
html[data-theme="dark"] .prescription-filters-row {
    background: var(--dm-bg) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .prescription-filters-trigger:hover,
html[data-theme="dark"] .prescription-filters-clear:hover {
    background: var(--dm-surface-raised) !important;
    color: var(--dm-text) !important;
    border-color: var(--dm-border) !important;
}

html[data-theme="dark"] .prescription-filters-trigger:focus,
html[data-theme="dark"] .prescription-filters-trigger:active,
html[data-theme="dark"] .prescription-filters-trigger:focus-visible,
html[data-theme="dark"] .prescription-filters-clear:focus,
html[data-theme="dark"] .prescription-filters-clear:focus-visible {
    border-color: var(--dm-border) !important;
    box-shadow: none !important;
    outline: none !important;
}

html[data-theme="dark"] .search-group .search-icon,
html[data-theme="dark"] .search-clear,
html[data-theme="dark"] .prescription-filters-chevron,
html[data-theme="dark"] .custom-date-separator {
    color: var(--dm-text-secondary) !important;
}

html[data-theme="dark"] .search-clear:hover {
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .filter-input:focus,
html[data-theme="dark"] .filter-select:focus {
    border-color: var(--dm-primary) !important;
    box-shadow: 0 0 0 3px rgba(26, 107, 60, 0.25) !important;
}

html[data-theme="dark"] .filter-input::placeholder {
    color: var(--dm-text-secondary) !important;
}

html[data-theme="dark"] .filter-select:disabled {
    background: var(--dm-surface-raised) !important;
    color: var(--dm-text-secondary) !important;
}

html[data-theme="dark"] .prescription-filters-row .custom-dropdown-trigger:not(.is-placeholder),
html[data-theme="dark"] .prescription-filters-row .custom-dropdown-trigger-input:not(.is-placeholder) {
    background: var(--dm-bg) !important;
    color: var(--dm-text) !important;
    border-color: var(--dm-border) !important;
}

html[data-theme="dark"] .prescription-filters-row .custom-dropdown-trigger.is-placeholder:not(.open),
html[data-theme="dark"] .prescription-filters-row .custom-dropdown-trigger-input.is-placeholder:not(.open) {
    background: var(--dm-surface-raised) !important;
    color: var(--dm-text-secondary) !important;
}

html[data-theme="dark"] .prescription-filters-row .custom-dropdown-trigger.open,
html[data-theme="dark"] .prescription-filters-row .custom-dropdown-trigger:hover:not(.is-placeholder),
html[data-theme="dark"] .prescription-filters-row .custom-dropdown-trigger-input.open,
html[data-theme="dark"] .prescription-filters-row .custom-dropdown-trigger-input:focus:not(.is-placeholder) {
    border-color: var(--dm-primary) !important;
    background: var(--dm-bg) !important;
    box-shadow: 0 0 0 3px rgba(26, 107, 60, 0.25) !important;
}

html[data-theme="dark"] .prescription-filters-row .custom-dropdown-list {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border) !important;
}

html[data-theme="dark"] .prescription-filters-row .custom-dropdown-option {
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .prescription-filters-row .custom-dropdown-option:hover,
html[data-theme="dark"] .prescription-filters-row .custom-dropdown-option.is-selected {
    background: var(--dm-primary-subtle) !important;
}

html[data-theme="dark"] #customDateFromGroup .filter-date-input.is-placeholder,
html[data-theme="dark"] #customDateToGroup .filter-date-input.is-placeholder {
    background: var(--dm-surface-raised) !important;
}

html[data-theme="dark"] #customDateFromGroup .filter-date-input:not(.is-placeholder),
html[data-theme="dark"] #customDateToGroup .filter-date-input:not(.is-placeholder) {
    background: var(--dm-bg) !important;
}

html[data-theme="dark"] #customDateFromGroup .filter-date-input.is-placeholder + .custom-date-display,
html[data-theme="dark"] #customDateToGroup .filter-date-input.is-placeholder + .custom-date-display {
    color: var(--dm-text-secondary) !important;
}

html[data-theme="dark"] #customDateFromGroup .filter-date-input:not(.is-placeholder) + .custom-date-display,
html[data-theme="dark"] #customDateToGroup .filter-date-input:not(.is-placeholder) + .custom-date-display {
    color: var(--dm-text) !important;
}

html[data-theme="dark"] #customDateFromGroup .filter-date-input:not(.is-placeholder):hover,
html[data-theme="dark"] #customDateFromGroup .filter-date-input:focus,
html[data-theme="dark"] #customDateToGroup .filter-date-input:not(.is-placeholder):hover,
html[data-theme="dark"] #customDateToGroup .filter-date-input:focus {
    border-color: var(--dm-primary) !important;
    background: var(--dm-bg) !important;
}

html[data-theme="dark"] .table-page-info,
html[data-theme="dark"] .pagination-page-select,
html[data-theme="dark"] .page-of {
    color: var(--dm-text-secondary) !important;
}

html[data-theme="dark"] .table-pagination button {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .table-pagination button:hover:not(:disabled) {
    background: var(--dm-surface-raised) !important;
    border-color: var(--dm-border) !important;
}

html[data-theme="dark"] .table-pagination button:disabled {
    background: var(--dm-bg) !important;
}

html[data-theme="dark"] .pagination-page-select select {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .pagination-page-select select:focus {
    border-color: var(--dm-primary) !important;
}

html[data-theme="dark"] .table-empty-state,
html[data-theme="dark"] .verification-empty-state {
    color: var(--dm-text-secondary) !important;
}

html[data-theme="dark"] .table-empty-state i,
html[data-theme="dark"] .verification-empty-state i {
    color: var(--dm-border) !important;
}

html[data-theme="dark"] #skeletonPrescriptionTable td {
    border-bottom-color: var(--dm-border) !important;
}

html[data-theme="dark"] .order-table tbody tr:not(.blank-row):not(.table-row-skeleton):hover td {
    background: var(--dm-surface-raised) !important;
}

/* Table action buttons (View, etc.) */
html[data-theme="dark"] .btn-sm-outline,
html[data-theme="dark"] .btn-table-view {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text-secondary) !important;
}

html[data-theme="dark"] .btn-sm-outline:hover,
html[data-theme="dark"] .btn-table-view:hover {
    border-color: var(--dm-primary) !important;
    color: var(--dm-primary) !important;
    background: var(--dm-primary-subtle) !important;
}

html[data-theme="dark"] .btn-sm-outline:focus,
html[data-theme="dark"] .btn-sm-outline:focus-visible,
html[data-theme="dark"] .btn-sm-outline:active,
html[data-theme="dark"] .btn-table-view:focus,
html[data-theme="dark"] .btn-table-view:focus-visible,
html[data-theme="dark"] .btn-table-view:active {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text-secondary) !important;
}

html[data-theme="dark"] .btn-sm-outline:hover:focus,
html[data-theme="dark"] .btn-sm-outline:hover:active,
html[data-theme="dark"] .btn-table-view:hover:focus,
html[data-theme="dark"] .btn-table-view:hover:active {
    border-color: var(--dm-primary) !important;
    color: var(--dm-primary) !important;
    background: var(--dm-primary-subtle) !important;
}

html[data-theme="dark"] .btn-sm-outline.danger,
html[data-theme="dark"] .btn-table-view.danger {
    border-color: rgba(248, 113, 113, 0.45) !important;
    color: #f87171 !important;
}

html[data-theme="dark"] .btn-sm-outline.danger:hover,
html[data-theme="dark"] .btn-table-view.danger:hover {
    border-color: #ef4444 !important;
    color: #fca5a5 !important;
    background: rgba(220, 38, 38, 0.15) !important;
}

html[data-theme="dark"] .btn-upload-prescription {
    background: var(--dm-primary) !important;
    color: #fff !important;
}

html[data-theme="dark"] .btn-upload-prescription:hover,
html[data-theme="dark"] .btn-upload-prescription:focus {
    background: var(--dm-primary-hover) !important;
    color: #fff !important;
}

html[data-theme="dark"] .summary-title {
    color: var(--dm-primary-bright) !important;
}

html[data-theme="dark"] .prescription-filters-trigger.has-active-filters > .fa-filter {
    color: var(--dm-primary) !important;
}

html[data-theme="dark"] .prescription-filters-badge {
    background: var(--dm-primary) !important;
    color: #fff !important;
}

/* ===== Prescription viewer (view_prescription.php) ===== */
html[data-theme="dark"] .rx-view-page,
html[data-theme="dark"] .rx-view-page .page-content {
    background: var(--dm-bg) !important;
}

html[data-theme="dark"] .rx-view-page .verification-back-btn {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text-secondary) !important;
}

html[data-theme="dark"] .rx-view-page .verification-back-btn:hover,
html[data-theme="dark"] .rx-view-page .verification-back-btn:focus {
    background: var(--dm-surface-raised) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .rx-view-page .rx-info-card,
html[data-theme="dark"] .rx-view-page .rx-container,
html[data-theme="dark"] .rx-view-page .rx-meds-card {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border) !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25) !important;
}

html[data-theme="dark"] .rx-view-page .rx-meds-table th {
    background: var(--dm-bg) !important;
    color: var(--dm-text-secondary) !important;
    border-bottom-color: var(--dm-border) !important;
}

html[data-theme="dark"] .rx-view-page .rx-meds-table td {
    color: var(--dm-text) !important;
    border-bottom-color: var(--dm-border) !important;
}

html[data-theme="dark"] .rx-view-page .rx-meds-table-wrap.is-empty .rx-meds-table tbody tr.blank-row td {
    border-bottom-color: transparent !important;
}

html[data-theme="dark"] .rx-view-page .rx-meds-empty-state {
    color: var(--dm-text-secondary) !important;
}

html[data-theme="dark"] .rx-view-page .rx-info-card-title,
html[data-theme="dark"] .rx-view-page .rx-header,
html[data-theme="dark"] .rx-view-page .rx-header h1,
html[data-theme="dark"] .rx-view-page .rx-detail-card h4,
html[data-theme="dark"] .rx-view-page .rx-detail-subtitle {
    color: var(--dm-text) !important;
    border-bottom-color: var(--dm-border) !important;
}

html[data-theme="dark"] .rx-view-page .rx-vitals-section--bordered {
    border-top-color: var(--dm-border) !important;
}

html[data-theme="dark"] .rx-view-page .rx-header .order-badge {
    background: var(--dm-surface-raised) !important;
    color: var(--dm-text-secondary) !important;
}

html[data-theme="dark"] .rx-view-page .rx-controls {
    background: var(--dm-bg) !important;
    border-bottom-color: var(--dm-border) !important;
}

html[data-theme="dark"] .rx-view-page .rx-controls .ctrl-btn {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text-secondary) !important;
}

html[data-theme="dark"] .rx-view-page .rx-controls .ctrl-btn:hover {
    background: var(--dm-surface-raised) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .rx-view-page .rx-controls .zoom-level,
html[data-theme="dark"] .rx-view-page .rx-controls .sep {
    color: var(--dm-text-secondary) !important;
    background: var(--dm-border) !important;
}

html[data-theme="dark"] .rx-view-page .rx-image-page-arrow {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text-secondary) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25) !important;
}

html[data-theme="dark"] .rx-view-page .rx-image-page-arrow:hover:not(:disabled):not(.is-disabled) {
    background: var(--dm-surface-raised) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .rx-view-page .rx-image-page-arrow:disabled,
html[data-theme="dark"] .rx-view-page .rx-image-page-arrow.is-disabled {
    opacity: 0.4;
    background: var(--dm-surface) !important;
    color: var(--dm-text-secondary) !important;
}

html[data-theme="dark"] .rx-view-page .rx-detail-card,
html[data-theme="dark"] .rx-view-page .rx-history-item,
html[data-theme="dark"] .rx-view-page .rx-history-pdf-thumb {
    background: var(--dm-bg) !important;
    border-color: var(--dm-border) !important;
}

html[data-theme="dark"] .rx-view-page .rx-field-label,
html[data-theme="dark"] .rx-view-page .rx-detail-card label {
    color: var(--dm-text-secondary) !important;
}

html[data-theme="dark"] .rx-view-page .rx-field-value,
html[data-theme="dark"] .rx-view-page .rx-detail-card label + span,
html[data-theme="dark"] .rx-view-page .rx-complaint-body {
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .rx-view-page .rx-image-wrap iframe {
    background: var(--dm-bg) !important;
}

html[data-theme="dark"] .rx-view-page .rx-alert-banner {
    background: rgba(220, 38, 38, 0.12) !important;
    border-color: rgba(248, 113, 113, 0.35) !important;
}

html[data-theme="dark"] .rx-view-page .rx-alert-banner-title {
    color: #fca5a5 !important;
}

html[data-theme="dark"] .rx-view-page .rx-alert-banner-text {
    color: #fecaca !important;
}

html[data-theme="dark"] .rx-view-page #myModalcle .modal-contentout {
    background: var(--dm-surface) !important;
}

html[data-theme="dark"] .rx-view-page #myModalcle .btn-signout-cancel {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text-secondary) !important;
}

html[data-theme="dark"] .rx-view-page #myModalcle .btn-signout-cancel:hover {
    background: var(--dm-surface-raised) !important;
    border-color: var(--dm-border) !important;
}

html[data-theme="dark"] .rx-view-page .erx-page-select:not(.is-dark) .erx-page-select-btn {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text-secondary) !important;
}

html[data-theme="dark"] .rx-view-page .erx-page-select:not(.is-dark) .erx-page-select-btn:hover:not(:disabled) {
    background: var(--dm-surface-raised) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .rx-view-page .erx-page-select:not(.is-dark) .erx-page-select-menu {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border) !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45) !important;
}

html[data-theme="dark"] .rx-view-page .erx-page-select:not(.is-dark) .erx-page-select-item {
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .rx-view-page .erx-page-select:not(.is-dark) .erx-page-select-item:hover {
    background: var(--dm-surface-raised) !important;
}

html[data-theme="dark"] .rx-view-page .erx-page-select:not(.is-dark) .erx-page-select-item.is-active {
    background: var(--dm-primary-subtle) !important;
    color: #4ade80 !important;
}

/* ===== Patient orders page ===== */
html[data-theme="dark"] .orders-card {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border) !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25) !important;
}

html[data-theme="dark"] .custom-tabs {
    border-bottom-color: var(--dm-border) !important;
}

html[data-theme="dark"] .custom-tabs > li > a {
    color: var(--dm-text-secondary) !important;
}

html[data-theme="dark"] .custom-tabs > li > a:hover,
html[data-theme="dark"] .custom-tabs > li.active > a,
html[data-theme="dark"] .custom-tabs > li.active > a:hover,
html[data-theme="dark"] .custom-tabs > li.active > a:focus,
html[data-theme="dark"] .custom-tabs > li.active > a:active {
    color: #4ade80 !important;
}

html[data-theme="dark"] .custom-tabs > li.active > a::after {
    background: var(--dm-primary) !important;
}

html[data-theme="dark"] .order-table-shell .table-responsive {
    background: var(--dm-bg) !important;
    border-color: var(--dm-border) !important;
}

html[data-theme="dark"] #customDateFromGroup .filter-date-input.is-placeholder,
html[data-theme="dark"] #customDateToGroup .filter-date-input.is-placeholder,
html[data-theme="dark"] #customDateFromGroupCurrent .filter-date-input.is-placeholder,
html[data-theme="dark"] #customDateToGroupCurrent .filter-date-input.is-placeholder,
html[data-theme="dark"] #customDateFromGroupHistory .filter-date-input.is-placeholder,
html[data-theme="dark"] #customDateToGroupHistory .filter-date-input.is-placeholder {
    background: var(--dm-surface-raised) !important;
}

html[data-theme="dark"] #customDateFromGroup .filter-date-input:not(.is-placeholder),
html[data-theme="dark"] #customDateToGroup .filter-date-input:not(.is-placeholder),
html[data-theme="dark"] #customDateFromGroupCurrent .filter-date-input:not(.is-placeholder),
html[data-theme="dark"] #customDateToGroupCurrent .filter-date-input:not(.is-placeholder),
html[data-theme="dark"] #customDateFromGroupHistory .filter-date-input:not(.is-placeholder),
html[data-theme="dark"] #customDateToGroupHistory .filter-date-input:not(.is-placeholder) {
    background: var(--dm-bg) !important;
}

html[data-theme="dark"] #customDateFromGroup .filter-date-input.is-placeholder + .custom-date-display,
html[data-theme="dark"] #customDateToGroup .filter-date-input.is-placeholder + .custom-date-display,
html[data-theme="dark"] #customDateFromGroupCurrent .filter-date-input.is-placeholder + .custom-date-display,
html[data-theme="dark"] #customDateToGroupCurrent .filter-date-input.is-placeholder + .custom-date-display,
html[data-theme="dark"] #customDateFromGroupHistory .filter-date-input.is-placeholder + .custom-date-display,
html[data-theme="dark"] #customDateToGroupHistory .filter-date-input.is-placeholder + .custom-date-display {
    color: var(--dm-text-secondary) !important;
}

html[data-theme="dark"] #customDateFromGroup .filter-date-input:not(.is-placeholder) + .custom-date-display,
html[data-theme="dark"] #customDateToGroup .filter-date-input:not(.is-placeholder) + .custom-date-display,
html[data-theme="dark"] #customDateFromGroupCurrent .filter-date-input:not(.is-placeholder) + .custom-date-display,
html[data-theme="dark"] #customDateToGroupCurrent .filter-date-input:not(.is-placeholder) + .custom-date-display,
html[data-theme="dark"] #customDateFromGroupHistory .filter-date-input:not(.is-placeholder) + .custom-date-display,
html[data-theme="dark"] #customDateToGroupHistory .filter-date-input:not(.is-placeholder) + .custom-date-display {
    color: var(--dm-text) !important;
}

html[data-theme="dark"] #customDateFromGroup .filter-date-input:not(.is-placeholder):hover,
html[data-theme="dark"] #customDateFromGroup .filter-date-input:focus,
html[data-theme="dark"] #customDateToGroup .filter-date-input:not(.is-placeholder):hover,
html[data-theme="dark"] #customDateToGroup .filter-date-input:focus,
html[data-theme="dark"] #customDateFromGroupCurrent .filter-date-input.is-placeholder:hover,
html[data-theme="dark"] #customDateToGroupCurrent .filter-date-input.is-placeholder:hover,
html[data-theme="dark"] #customDateFromGroupHistory .filter-date-input.is-placeholder:hover,
html[data-theme="dark"] #customDateToGroupHistory .filter-date-input.is-placeholder:hover {
    border-color: var(--dm-border) !important;
    background: var(--dm-surface-raised) !important;
}

html[data-theme="dark"] #customDateFromGroupCurrent .filter-date-input:not(.is-placeholder):hover,
html[data-theme="dark"] #customDateFromGroupCurrent .filter-date-input:focus,
html[data-theme="dark"] #customDateToGroupCurrent .filter-date-input:not(.is-placeholder):hover,
html[data-theme="dark"] #customDateToGroupCurrent .filter-date-input:focus,
html[data-theme="dark"] #customDateFromGroupHistory .filter-date-input:not(.is-placeholder):hover,
html[data-theme="dark"] #customDateFromGroupHistory .filter-date-input:focus,
html[data-theme="dark"] #customDateToGroupHistory .filter-date-input:not(.is-placeholder):hover,
html[data-theme="dark"] #customDateToGroupHistory .filter-date-input:focus {
    border-color: var(--dm-primary) !important;
    background: var(--dm-bg) !important;
}

html[data-theme="dark"] .order-info-modal-body {
    background: var(--dm-surface) !important;
    color: var(--dm-text-secondary) !important;
}

html[data-theme="dark"] .order-info-modal-body .order-gcash-pay-btn:hover,
html[data-theme="dark"] .order-info-modal-body .order-gcash-pay-btn:focus,
html[data-theme="dark"] .order-info-modal-body .order-gcash-pay-btn:focus-visible,
html[data-theme="dark"] .order-info-modal-body .order-gcash-pay-btn:active {
    outline: none !important;
    box-shadow: none !important;
    border-color: #fdba74 !important;
    background: rgba(234, 88, 12, 0.12) !important;
}

html[data-theme="dark"] .order-detail-card,
html[data-theme="dark"] .order-staff-patient-card.order-detail-card,
html[data-theme="dark"] .order-logistics-delivery-section.order-detail-card,
html[data-theme="dark"] .warehouse-shipping-label-panel.order-detail-card,
html[data-theme="dark"] .logistics-complete-delivery-card.order-detail-card {
    background: var(--dm-bg) !important;
    border-color: var(--dm-border) !important;
    box-shadow: none !important;
}

html[data-theme="dark"] .order-detail-card-title {
    color: var(--dm-text) !important;
    border-bottom-color: var(--dm-border) !important;
}

html[data-theme="dark"] #paymentProofModal .pm2-box {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border) !important;
}

html[data-theme="dark"] #paymentProofModal .pm2-left,
html[data-theme="dark"] #paymentProofModal .pm2-right {
    background: var(--dm-bg) !important;
    border-color: var(--dm-border) !important;
    box-shadow: none !important;
}

html[data-theme="dark"] #paymentProofModal .pm2-title,
html[data-theme="dark"] #paymentProofModal .pm2-amt2 {
    color: var(--dm-text) !important;
}

html[data-theme="dark"] #paymentProofModal .pm2-left-note,
html[data-theme="dark"] #paymentProofModal .pm2-field-label,
html[data-theme="dark"] #paymentProofModal .pm2-footer,
html[data-theme="dark"] #paymentProofModal .payment-proof-loading {
    color: var(--dm-text-secondary) !important;
}

html[data-theme="dark"] #paymentProofModal .pm2-field-value,
html[data-theme="dark"] #paymentProofModal .pm2-total2 {
    color: var(--dm-text) !important;
}

html[data-theme="dark"] #paymentProofModal .payment-proof-close {
    background: var(--dm-surface-raised) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text) !important;
}

html[data-theme="dark"] #paymentProofModal .pm2-input {
    background: var(--dm-bg) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text) !important;
}

html[data-theme="dark"] #paymentProofModal .pm2-qr {
    background: var(--dm-surface-raised) !important;
    border-color: var(--dm-border) !important;
}

html[data-theme="dark"] #paymentProofModal .pm2-field,
html[data-theme="dark"] #paymentProofModal .pm2-totalrow2,
html[data-theme="dark"] #paymentProofModal .pm2-vdiv {
    border-color: var(--dm-border) !important;
}

/* Autofill paints a white/yellow fill that background cannot override */
html[data-theme="dark"] input:-webkit-autofill,
html[data-theme="dark"] input:-webkit-autofill:hover,
html[data-theme="dark"] input:-webkit-autofill:focus,
html[data-theme="dark"] input:-webkit-autofill:active,
html[data-theme="dark"] textarea:-webkit-autofill,
html[data-theme="dark"] select:-webkit-autofill {
    -webkit-text-fill-color: var(--dm-text, #f5f5f5) !important;
    caret-color: var(--dm-text, #f5f5f5);
    box-shadow: 0 0 0 1000px var(--dm-surface-raised, #2c2c30) inset !important;
    -webkit-box-shadow: 0 0 0 1000px var(--dm-surface-raised, #2c2c30) inset !important;
    transition: background-color 99999s ease-out 0s;
}
