/* GENERATED by a one-off script from the light-theme rules of style.css, qvora-tabler.css, qvora-clinical.css and
   specialty-modules.css: hard-coded near-white backgrounds become dark surfaces and hard-coded dark-grey text becomes
   readable text in dark mode. Saturated colours (errors, success, warnings) are untouched. Regenerate if those files change. */
@media screen {
html[data-theme="dark"] .data-table tbody tr:hover { background: var(--surface-sunken) !important; color: var(--text) !important; }
html[data-theme="dark"] .data-table tbody tr:hover td:first-child { background: var(--surface-sunken) !important; color: var(--text) !important; }
html[data-theme="dark"] .insurance-metric,
html[data-theme="dark"] .inventory-stat { background: var(--surface) !important; color: var(--text) !important; border-color: var(--border) !important; }
html[data-theme="dark"] .insurance-flow-nav button { background: var(--surface-sunken) !important; border-color: var(--border) !important; }
html[data-theme="dark"] .inventory-form { background: var(--surface-sunken) !important; color: var(--text) !important; border-color: var(--border) !important; }
html[data-theme="dark"] .inventory-form input,
html[data-theme="dark"] .inventory-form select { background: var(--surface) !important; color: var(--text) !important; border-color: var(--border) !important; }
html[data-theme="dark"] .wh-val-card { background: var(--surface-sunken) !important; color: var(--text) !important; border-color: var(--border) !important; }
html[data-theme="dark"] .wh-val-card .wh-name { color: var(--text) !important; }
html[data-theme="dark"] .wh-val-card .wh-meta { color: var(--text-muted) !important; }
html[data-theme="dark"] .main-topbar { background: var(--surface) !important; color: var(--text) !important; }
html[data-theme="dark"] .icon-red { background: var(--surface-sunken) !important; }
html[data-theme="dark"] .table-wrap { background: var(--surface) !important; color: var(--text) !important; }
html[data-theme="dark"] .data-table thead th,
html[data-theme="dark"] table.table thead th { background: var(--surface-sunken) !important; color: var(--text) !important; }
html[data-theme="dark"] .claims-table-wrap { background: var(--surface) !important; color: var(--text) !important; border-color: var(--border) !important; }
html[data-theme="dark"] .claims-table-wrap::-webkit-scrollbar-track { background: var(--surface-sunken) !important; color: var(--text) !important; }
html[data-theme="dark"] #claimsToSendTable thead th { background: var(--surface-sunken) !important; color: var(--text) !important; }
html[data-theme="dark"] .invoices-table-wrap { background: var(--surface) !important; color: var(--text) !important; border-color: var(--border) !important; }
html[data-theme="dark"] .invoices-table-wrap::-webkit-scrollbar-track { background: var(--surface-sunken) !important; color: var(--text) !important; }
html[data-theme="dark"] #invoicesTable thead th { background: var(--surface-sunken) !important; color: var(--text) !important; }
html[data-theme="dark"] .user-action-menu { background: var(--surface) !important; color: var(--text) !important; border-color: var(--border) !important; }
html[data-theme="dark"] .btn-outline,
html[data-theme="dark"] .btn-outline-secondary { background: var(--surface) !important; color: var(--text) !important; }
html[data-theme="dark"] .btn-outline:hover,
html[data-theme="dark"] .btn-outline-secondary:hover { background: var(--surface-sunken) !important; color: var(--text) !important; border-color: var(--border) !important; }
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] input[type="tel"],
html[data-theme="dark"] select,
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select { background: var(--surface) !important; color: var(--text) !important; border-color: var(--border) !important; }
html[data-theme="dark"] textarea,
html[data-theme="dark"] textarea.form-control { background: var(--surface) !important; color: var(--text) !important; border-color: var(--border) !important; }
html[data-theme="dark"] label,
html[data-theme="dark"] .form-label { color: var(--text) !important; }
html[data-theme="dark"] .info-item .value .empty,
html[data-theme="dark"] .info-item .value.empty,
html[data-theme="dark"] .info-item .value-empty,
html[data-theme="dark"] .info-item span.empty,
html[data-theme="dark"] .info-item .empty,
html[data-theme="dark"] .info-item.empty-item .value { color: var(--text-muted) !important; }
html[data-theme="dark"] .folder-content { background: var(--surface) !important; color: var(--text) !important; }
html[data-theme="dark"] .modal-overlay > .modal,
html[data-theme="dark"] .modal-overlay .modal { background: var(--surface) !important; color: var(--text) !important; }
html[data-theme="dark"] #invoiceViewModalOverlay .modal-body { background: var(--surface-sunken) !important; color: var(--text) !important; }
html[data-theme="dark"] #encounterModalOverlay > .modal,
html[data-theme="dark"] #encounterModalOverlay .modal.modal-workspace { background: var(--surface) !important; color: var(--text) !important; }
html[data-theme="dark"] #encounterFooterActions,
html[data-theme="dark"] .encounter-footer { background: var(--surface-sunken) !important; color: var(--text) !important; }
html[data-theme="dark"] .modal-header { background: var(--surface) !important; color: var(--text) !important; }
html[data-theme="dark"] .modal-actions { background: var(--surface-sunken) !important; color: var(--text) !important; }
html[data-theme="dark"] .modal-body > form > .modal-actions,
html[data-theme="dark"] .modal-body .modal-actions { background: var(--surface-sunken) !important; color: var(--text) !important; }
html[data-theme="dark"] .auth-screen { background: var(--surface-sunken) !important; color: var(--text) !important; }
html[data-theme="dark"] .auth-card { background: var(--surface) !important; color: var(--text) !important; }
html[data-theme="dark"] .quick-action-tile { background: var(--surface) !important; color: var(--text) !important; }
html[data-theme="dark"] .appointments-toolbar-card { background: var(--surface) !important; color: var(--text) !important; }
html[data-theme="dark"] .appointments-toolbar-card .calendar-view-toggle { background: var(--surface) !important; color: var(--text) !important; }
html[data-theme="dark"] .appointments-toolbar-card .cal-toggle-btn:hover { background: var(--surface-sunken) !important; color: var(--text) !important; }
html[data-theme="dark"] .layout > .sidebar { background: var(--surface) !important; color: var(--text) !important; }
html[data-theme="dark"] .layout > .main { background: var(--surface) !important; color: var(--text) !important; }
html[data-theme="dark"] .patient-card:hover { background: var(--surface-sunken) !important; color: var(--text) !important; }
html[data-theme="dark"] .patient-header { background: var(--surface) !important; color: var(--text) !important; }
html[data-theme="dark"] .folder-tabs .tab { color: var(--text-muted) !important; }
html[data-theme="dark"] .table-action-menu { background: var(--surface) !important; color: var(--text) !important; }
html[data-theme="dark"] .table-action-menu .dropdown-item:hover { background: var(--surface-sunken) !important; color: var(--text) !important; }
html[data-theme="dark"] .table-action-menu .dropdown-item.text-danger:hover { background: var(--surface-sunken) !important; color: var(--text) !important; }
html[data-theme="dark"] .data-table .row-actions button,
html[data-theme="dark"] .row-actions button { background: var(--surface) !important; color: var(--text) !important; border-color: var(--border) !important; }
html[data-theme="dark"] .data-table .row-actions button:hover,
html[data-theme="dark"] .row-actions button:hover { background: var(--surface-sunken) !important; color: var(--text) !important; border-color: var(--border) !important; }
html[data-theme="dark"] .data-table .row-actions button.danger:hover,
html[data-theme="dark"] .row-actions button.danger:hover { background: var(--surface-sunken) !important; color: var(--text) !important; }
html[data-theme="dark"] .full-view:has(> #adminTabs) { background: var(--surface) !important; color: var(--text) !important; }
html[data-theme="dark"] #adminTabs { background: var(--surface) !important; color: var(--text) !important; }
html[data-theme="dark"] #adminTabs .settings-nav-group-label { color: var(--text-muted) !important; }
html[data-theme="dark"] #adminTabs .tab { color: var(--text-muted) !important; }
html[data-theme="dark"] .bulk-upload-dropzone { background: var(--surface-sunken) !important; color: var(--text) !important; border-color: var(--border) !important; }
html[data-theme="dark"] .reports-toolbar-card { background: var(--surface) !important; color: var(--text) !important; }
html[data-theme="dark"] .rx-print-header h3 { color: var(--text) !important; }
html[data-theme="dark"] .rx-print-meta { color: var(--text) !important; }
html[data-theme="dark"] .info-item { background: var(--surface) !important; color: var(--text) !important; }
html[data-theme="dark"] .info-item .label { color: var(--text-muted) !important; }
html[data-theme="dark"] .info-item .value { color: var(--text) !important; }
html[data-theme="dark"] .data-table th,
html[data-theme="dark"] .data-table td { color: var(--text) !important; }
html[data-theme="dark"] .data-table thead th { background: var(--surface-sunken) !important; color: var(--text) !important; }
html[data-theme="dark"] #doctorPrintTemplateModalOverlay .template-editor-mobile-tabs { background: var(--surface-sunken) !important; color: var(--text) !important; }
html[data-theme="dark"] #doctorPrintTemplateModalOverlay .a4-sheet-sim { background: var(--surface) !important; color: var(--text) !important; }
html[data-theme="dark"] #doctorPrintTemplateModalOverlay .template-preview-iframe { background: var(--surface) !important; color: var(--text) !important; }
html[data-theme="dark"] .doctor-logo-upload-wrap { background: var(--surface-sunken) !important; color: var(--text) !important; border-color: var(--border) !important; }
html[data-theme="dark"] .doctor-logo-thumb-container { background: var(--surface) !important; color: var(--text) !important; border-color: var(--border) !important; }
html[data-theme="dark"] .dx-tools.is-planned .dx-tool.is-active { background: var(--surface-sunken) !important; }
html[data-theme="dark"] .dx-tooth:hover { background: var(--surface) !important; color: var(--text) !important; }
html[data-theme="dark"] .dx-tooth.is-selected { background: var(--surface) !important; color: var(--text) !important; }
html[data-theme="dark"] .dx-status.is-declined { background: var(--surface-sunken) !important; color: var(--text) !important; }
html[data-theme="dark"] .dx-perio-in.is-ok { background: var(--surface-sunken) !important; border-color: var(--border) !important; }
html[data-theme="dark"] .dx-perio-in.is-deep { background: var(--surface-sunken) !important; border-color: var(--border) !important; }
html[data-theme="dark"] .dx-bop { background: var(--surface) !important; color: var(--text) !important; border-color: var(--border) !important; }
html[data-theme="dark"] .dx-perio-table .dx-perio-sel { background: var(--surface) !important; color: var(--text) !important; }
html[data-theme="dark"] .px-redflag { background: var(--surface-sunken) !important; border-color: var(--border) !important; }
html[data-theme="dark"] .px-bar { background: var(--surface-sunken) !important; color: var(--text) !important; }
html[data-theme="dark"] .qv-viewer-count { color: var(--text-muted) !important; }
html[data-theme="dark"] .qv-viewer-pdf { background: var(--surface) !important; color: var(--text) !important; }
html[data-theme="dark"] .dx-workspace.is-readonly input:disabled,
html[data-theme="dark"] .dx-workspace.is-readonly select:disabled,
html[data-theme="dark"] .dx-workspace.is-readonly textarea:disabled { background: var(--surface-sunken) !important; color: var(--text) !important; }
html[data-theme="dark"] .dp-table .dp-cat td { background: var(--surface-sunken) !important; color: var(--text) !important; }
html[data-theme="dark"] .dp-table .dp-code { color: var(--text-muted) !important; }
html[data-theme="dark"] .odontogram-container { background: var(--surface) !important; color: var(--text) !important; border-color: var(--border) !important; }
html[data-theme="dark"] .tooth-modal-tab-btn { color: var(--text-muted) !important; }
html[data-theme="dark"] .tooth-modal-tab-btn:hover { color: var(--text) !important; }
html[data-theme="dark"] .tooth-history-item { background: var(--surface-sunken) !important; color: var(--text) !important; }
html[data-theme="dark"] .tooth-history-date { color: var(--text-muted) !important; }
html[data-theme="dark"] .tooth-history-action { color: var(--text) !important; }
html[data-theme="dark"] .tooth-history-meta { color: var(--text-muted) !important; }
html[data-theme="dark"] .tooth-cell.is-missing .tooth-svg { background: var(--surface-sunken) !important; color: var(--text) !important; }
html[data-theme="dark"] .body-view-btn { color: var(--text-muted) !important; }
html[data-theme="dark"] .body-view-btn.active { color: var(--text) !important; }
html[data-theme="dark"] .rehab-progress-bar { background: var(--surface-sunken) !important; color: var(--text) !important; }
html[data-theme="dark"] .dental-section-heading { color: var(--text) !important; }
html[data-theme="dark"] .dental-plans-table-wrap { background: var(--surface) !important; color: var(--text) !important; border-color: var(--border) !important; }
html[data-theme="dark"] .dental-plans-table th { background: var(--surface-sunken) !important; color: var(--text) !important; }
html[data-theme="dark"] #patientStatementTableWrap,
html[data-theme="dark"] div[data-panel="financial"] .table-wrap { background: var(--surface) !important; color: var(--text) !important; border-color: var(--border) !important; }
html[data-theme="dark"] #patientStatementTable th { background: var(--surface-sunken) !important; color: var(--text) !important; }
html[data-theme="dark"] .invoices-table-wrap::-webkit-scrollbar-track,
html[data-theme="dark"] #invoicesTableWrap::-webkit-scrollbar-track,
html[data-theme="dark"] .claims-table-wrap::-webkit-scrollbar-track,
html[data-theme="dark"] #claimsTableWrap::-webkit-scrollbar-track,
html[data-theme="dark"] .expenses-table-wrap::-webkit-scrollbar-track,
html[data-theme="dark"] #clinicExpensesPanel .table-wrap::-webkit-scrollbar-track,
html[data-theme="dark"] #patientStatementTableWrap::-webkit-scrollbar-track,
html[data-theme="dark"] .physio-table-wrap::-webkit-scrollbar-track { background: var(--surface-sunken) !important; color: var(--text) !important; }
html[data-theme="dark"] #invoicesTable th,
html[data-theme="dark"] #claimsToSendTable th,
html[data-theme="dark"] #expensesTable th { background: var(--surface-sunken) !important; color: var(--text) !important; }
}

/* Inline styles written by the screens (js/*.js, index.html) */
html[data-theme="dark"] [style*="color:#64748b"], html[data-theme="dark"] [style*="color: #64748b"],
html[data-theme="dark"] [style*="color:#475569"], html[data-theme="dark"] [style*="color: #475569"] { color: var(--text-muted) !important; }
html[data-theme="dark"] [style*="color:#1e293b"], html[data-theme="dark"] [style*="color: #1e293b"],
html[data-theme="dark"] [style*="color:#0f172a"], html[data-theme="dark"] [style*="color: #0f172a"],
html[data-theme="dark"] [style*="color:#334155"], html[data-theme="dark"] [style*="color: #334155"] { color: var(--text) !important; }
html[data-theme="dark"] [style*="background:#fff"], html[data-theme="dark"] [style*="background: #fff"],
html[data-theme="dark"] [style*="background:#ffffff"], html[data-theme="dark"] [style*="background: #ffffff"] { background: var(--surface) !important; }
html[data-theme="dark"] [style*="background:#f8fafc"], html[data-theme="dark"] [style*="background: #f8fafc"],
html[data-theme="dark"] [style*="background:#f1f5f9"], html[data-theme="dark"] [style*="background: #f1f5f9"] { background: var(--surface-sunken) !important; }
html[data-theme="dark"] [style*="background:#fef3c7"], html[data-theme="dark"] [style*="background:#e0f2fe"], html[data-theme="dark"] [style*="background:#dcfce7"] { color: #111827 !important; }
