/* Mode sombre : surcharges des couleurs écrites en dur dans les autres feuilles. Chargé en dernier. */
:root[data-theme="dark"] body{background:var(--bg)}
:root[data-theme="dark"] input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),:root[data-theme="dark"] select,:root[data-theme="dark"] textarea{background-color:var(--surface);color:var(--ink);border-color:var(--control-line)}
:root[data-theme="dark"] ::placeholder{color:#7d91a1}
/* style.css */
:root[data-theme="dark"] .badge.red{background:#3d2220;color:#f0a596}
:root[data-theme="dark"] .badge.blue{background:#1d2c40;color:#9fbbe0}
:root[data-theme="dark"] .topbar{background:#15212be6}
:root[data-theme="dark"] .calendar-col{background:var(--surface)}
:root[data-theme="dark"] .notice.green{border-color:#2d4a35}
:root[data-theme="dark"] .notice.red{background:#3a221d;color:#f0a596;border-color:#5a3329}
:root[data-theme="dark"] .accent:hover{background:#f0d27a;border-color:#f0d27a}
:root[data-theme="dark"] :where(button:not(.ghost):not(.primary):not(.accent):not(.clinic-day-row):not(.calendar-event):not(.agenda-event)){border-color:var(--control-line)}
:root[data-theme="dark"] button:not(.primary):not(.accent):not(.clinic-day-row):not(.calendar-event):not(.agenda-event):hover{background:#1d3444;border-color:#3f6d8c}
:root[data-theme="dark"] .card-head{color:#a9d1ec}
:root[data-theme="dark"] .topbar .search-btn{background:var(--surface-subtle)}
:root[data-theme="dark"] .topbar-brand{color:#7cc0ea}
:root[data-theme="dark"] .sidebar .workspace{background:var(--surface-subtle)}
:root[data-theme="dark"] .sidebar .nav button.active{background:#173b54;color:#9fd3f3}
:root[data-theme="dark"] th{background:#1a2a36;color:#a6bccc}
:root[data-theme="dark"] .contact-pill[aria-pressed="true"]{background:#173b54;color:#b6dcf4}
:root[data-theme="dark"] .correspondent-autocomplete{color:var(--ink);border-color:var(--control-line)}
:root[data-theme="dark"] .correspondent-autocomplete [aria-selected=true],:root[data-theme="dark"] .correspondent-autocomplete [role=option]:hover{background:#173b54}
/* clinical.css : mélanges de couleurs de rendez-vous faits sur fond blanc */
:root[data-theme="dark"] .calendar-event,:root[data-theme="dark"] .clinic-day-row{background:color-mix(in srgb,var(--appointment-color,var(--line)) 14%,var(--surface))}
:root[data-theme="dark"] .calendar-event:hover,:root[data-theme="dark"] .clinic-day-row.selected{background:color-mix(in srgb,var(--appointment-color,var(--line)) 26%,var(--surface))}
:root[data-theme="dark"] .appointment-banner{background:color-mix(in srgb,var(--appointment-color) 18%,var(--surface))}
:root[data-theme="dark"] .appointment-entry{background:color-mix(in srgb,var(--appointment-color) 10%,var(--surface))}
:root[data-theme="dark"] button.clinic-day-row:hover{background:color-mix(in srgb,var(--appointment-color) 26%,var(--surface))}
:root[data-theme="dark"] .calendar-event,:root[data-theme="dark"] button.clinic-day-row{background:color-mix(in srgb,var(--appointment-color) 24%,var(--surface))}
:root[data-theme="dark"] .appointment-dossier .patient-banner .avatar{background:color-mix(in srgb,var(--appointment-color) 35%,var(--surface))}
:root[data-theme="dark"] .inline-patient .patient-banner{border-top-color:color-mix(in srgb,var(--appointment-color) 40%,var(--surface))}
:root[data-theme="dark"] .planning-dock>.card-head{background:var(--nav-surface)}
:root[data-theme="dark"] .planning-dock .clinic-filters{background:var(--section-surface)}
:root[data-theme="dark"] .planning-dock .clinic-filters label,:root[data-theme="dark"] .inline-patient .form-summary .form-grid b{color:#a6bccc}
:root[data-theme="dark"] .planning-dock button.clinic-day-row{border-bottom-color:var(--bg)}
:root[data-theme="dark"] .inline-patient .clinic-appointment-actions button{color:#b6d4ea}
:root[data-theme="dark"] .inline-patient .quote>h3,:root[data-theme="dark"] .inline-patient .clinical-plan h3{color:#7cc0ea}
:root[data-theme="dark"] .inline-patient .form-summary .form-grid>div{border-top-color:var(--line)}
:root[data-theme="dark"] .management-timeline{background:var(--surface-subtle);color:var(--ink);border-bottom-color:var(--line)}
:root[data-theme="dark"] .appointment-dossier .management-period,:root[data-theme="dark"] .appointment-dossier .management-period:nth-child(odd){border-right-color:var(--surface-subtle)}
:root[data-theme="dark"] .management-axis,:root[data-theme="dark"] .appointment-dossier .management-axis{background:#7d93ad}
:root[data-theme="dark"] .management-dot:not(.absent),:root[data-theme="dark"] .appointment-dossier .management-dot:not(.absent){border-color:#8fb2da!important;box-shadow:0 0 0 2px var(--surface-subtle)}
:root[data-theme="dark"] .management-dot.past:not(.absent),:root[data-theme="dark"] .appointment-dossier .management-dot.past:not(.absent){background:#8fb2da!important}
:root[data-theme="dark"] .allergy-alert{background:#3d1b1b;color:#ffb4b4}
:root[data-theme="dark"] .appointment-dossier .session-today button:hover,:root[data-theme="dark"] .session-today button:hover{background:#19321f}
/* agenda-display.css, similar-cases.css, age-statistics.css */
:root[data-theme="dark"] .agenda-holiday-tag{color:#8fd3a6}
:root[data-theme="dark"] .case-filter-row,:root[data-theme="dark"] .case-edit-row,:root[data-theme="dark"] .case-entry,:root[data-theme="dark"] .case-section,:root[data-theme="dark"] .case-fact{border-color:var(--line)}
:root[data-theme="dark"] .case-result blockquote{border-left-color:#4f6f8f;color:var(--muted)}
/* Styles en ligne générés par app.js (alertes rouges) */
:root[data-theme="dark"] [style*="background:#fff0f1"]{background:#3d1b1f!important;color:#ffb4bc!important}
:root[data-theme="dark"] [style*="color:#a51d2d"]{color:#ff9aa6!important}
/* Les pages CERFA et aperçus de documents restent sur papier blanc */
:root[data-theme="dark"] .cerfa-sheet{color-scheme:light}
/* Réglage d'affichage */
.theme-setting select{width:100%}
