/* Les deux thèmes conservent l’identité bleu royal et les repères dorés du CNLC. */
:root{color-scheme:light}
.theme-switch{display:inline-flex;align-items:center;gap:3px;padding:3px;border:1px solid #e2e8f3;border-radius:10px;background:#f3f6fb;flex-shrink:0}
.theme-switch button{display:flex;align-items:center;justify-content:center;gap:6px;padding:6px 9px;min-height:30px;border:0;border-radius:7px;background:transparent;color:#64718b;font-size:10px;font-weight:600}
.theme-switch button svg{width:14px;height:14px}
.theme-switch button[aria-pressed=true]{background:white;color:#1a3fcb;box-shadow:0 2px 7px #24396412}
.theme-switch button:hover{color:#1a3fcb;background:#e8eeff}
.theme-floating{position:fixed;top:20px;right:24px;z-index:80}
.auth-form-side{padding-top:85px}
.public-body{padding-top:80px}
html[data-theme=dark]{color-scheme:dark;--ink:#e8eefb;--muted:#aebbd1;--line:#2a3850;--bg:#101827;--shadow:0 5px 25px #00000014;--theme-surface:#192338;--theme-raised:#202d45;--theme-border:#2a3850;--theme-secondary:#b0bed4;--theme-accent:#9ab2ff}
html[data-theme=dark] body{background:var(--bg);color:var(--ink)}
html[data-theme=dark] :is(.sidebar,.topbar,.card,.stat-card,.notification-panel,.public-card,.btn-secondary,.date-chip,.info-strip.light,.danger-zone form){background:var(--theme-surface);border-color:var(--theme-border)}
html[data-theme=dark] :is(.theme-switch){background:#101a2d;border-color:#33415c}
html[data-theme=dark] .theme-switch button{color:#b0bed4}
html[data-theme=dark] .theme-switch button[aria-pressed=true]{background:#2a395b;color:#ffdd6a;box-shadow:0 2px 8px #0003}
html[data-theme=dark] .theme-switch button:hover{background:#253555;color:#f3df95}
html[data-theme=dark] :is(.workspace-label,.brand small,.institution,.nav-link,.breadcrumb,.system-status,.user-menu small,.eyebrow,.page-heading p,.date-chip,.stat-top,.stat-bottom,.section-heading p,.count-pill,th,td small,.mail-subject small,.date-cell,.card-foot,.calendar-legend,.calendar-link,.mini-cal-grid .weekday,.mini-cal-grid .day,.info-strip p,.app-footer,.list-count,.pagination,.empty-state,.step,.upload-label>span,.help-card li p,.help-note,.metadata dt,.person-block small,.timeline-item small,.role-card p,.permission-item small,.profile-banner p,.profile-banner small,.tabs a,.paper-top-label,.paper-caption,.print-paper-info,.auth-card .muted,.auth-card>.text-center .eyebrow,.auth-security,.auth-copyright,.public-metadata dt,.public-privacy p,.muted,.back-link){color:var(--theme-secondary)}
html[data-theme=dark] :is(.breadcrumb strong,.user-menu strong,.mail-subject strong,.info-strip strong,.help-card li strong,.metadata dd,.mail-content,.detail-card>h2,.public-card h2,.public-metadata dd,.empty-state h3,.review-summary p,td,label){color:#d9e3f5}
html[data-theme=dark] :is(.text-link,.text-button,.secure-note a,.card-foot>a,.attachment,.tabs a.selected,.step.active,.file-preview,.brand-dot,.greeting-dot){color:var(--theme-accent)}
html[data-theme=dark] :is(.nav-link:hover,.icon-button:hover){background:#243251;color:#b9caff}
html[data-theme=dark] .nav-link.active{background:#27395e;color:#b6c9ff}
html[data-theme=dark] .nav-link.active:before{background:#7897ff}
html[data-theme=dark] :is(.secure-note,.info-strip,.review-summary,.attachment,.public-privacy){background:#1e2c46;border-color:#304263}
html[data-theme=dark] :is(.info-icon,.help-icon,.document-icon,.step>span,.count-pill,.avatar,.mini-avatar,.public-reference){background:#25324d;border-color:#334461;color:#b2c6ff}
html[data-theme=dark] .document-icon.unread{background:#263a61;color:#adc2ff;border-color:#354e7a}
html[data-theme=dark] .step.active>span{background:#3459d5;color:white;border-color:#547aff}
html[data-theme=dark] .step.done>span{background:#243b59;color:#b1caff;border-color:#38567d}
html[data-theme=dark] .blue{background:#25365b;color:#adc2ff}
html[data-theme=dark] .purple{background:#342b50;color:#c7b2fa}
html[data-theme=dark] .amber{background:#3d3523;color:#f0d07b}
html[data-theme=dark] .green{background:#203b38;color:#88d9ba}
html[data-theme=dark] .btn-primary{background:#3155d4;color:#fff;box-shadow:0 4px 14px #0002}
html[data-theme=dark] .btn-primary:hover{background:#3c63e8}
html[data-theme=dark] .btn-secondary{color:#d4dff2}
html[data-theme=dark] .btn-secondary:hover{background:#253550;border-color:#3d5276}
html[data-theme=dark] .btn-danger{background:#ad3047;color:white}
html[data-theme=dark] :is(.danger-text,.danger-zone){color:#ffa1af}
html[data-theme=dark] :is(.topbar-divider){background:var(--theme-border)}
html[data-theme=dark] :is(.card-foot,.filter-bar,.pagination,.list-count,.wizard-steps,.help-note,.metadata,.profile-banner,.tabs,.calendar-legend,.notification-item,.public-metadata>div,.app-footer,hr){border-color:var(--theme-border)}
html[data-theme=dark] th{background:#152035;border-color:var(--theme-border);color:#bdcbe2}
html[data-theme=dark] td{border-color:#26354b}
html[data-theme=dark] tbody tr:hover{background:#1e2d45}
html[data-theme=dark] :is(.badge-nouveau,.notification-item.unread){background:#253962;color:#b2c8ff}
html[data-theme=dark] :is(.badge-lu,.verified-tag){background:#1c3d36;color:#8cddbb}
html[data-theme=dark] .badge-archived{background:#303b51;color:#c2ccdf}
html[data-theme=dark] .notification-item:hover{background:#2a3b5b}
html[data-theme=dark] #notification-badge{border-color:var(--theme-surface)}
html[data-theme=dark] :is(.mini-cal-heading button,.icon-button,.row-link){color:#adbedb}
html[data-theme=dark] .mini-cal-grid .day.other-month{color:#8c9db9}
html[data-theme=dark] .mini-cal-grid .day.has-mail{background:#403921;color:#ffe295}
html[data-theme=dark] .mini-cal-grid .day.today{background:#3e61d7;color:white}
html[data-theme=dark] :is(input:not([type=checkbox]):not([type=range]):not([type=hidden]),select,textarea){background:#121d30;color:#e2eafa;border-color:#3a4964}
html[data-theme=dark] :is(input,textarea)::placeholder{color:#95a5bf}
html[data-theme=dark] input[type=file]::file-selector-button{background:#2c3e64;color:#c1d1ff}
html[data-theme=dark] :is(input[type=checkbox],input[type=range]){accent-color:#8da7ff}
html[data-theme=dark] .upload-label{background:#152139;border-color:#485d85}
html[data-theme=dark] .permission-item{border-color:#344461}
html[data-theme=dark] .select2-container--default :is(.select2-selection--single,.select2-selection--multiple){background:#121d30;border-color:#3a4964}
html[data-theme=dark] .select2-container--default .select2-selection--single .select2-selection__rendered{color:#e2eafa}
html[data-theme=dark] .select2-container--default .select2-selection__placeholder{color:#a8b9d3}
html[data-theme=dark] .select2-container--default .select2-selection--multiple .select2-selection__choice{background:#2a3b60;border-color:#40577e;color:#d0dfff}
html[data-theme=dark] .select2-container--default .select2-selection__choice__remove{color:#cbd9f1}
html[data-theme=dark] .select2-dropdown{background:#19263b;color:#e2eafa;border-color:#435577}
html[data-theme=dark] .select2-container--default .select2-results__option[aria-selected=true]{background:#293d60}
html[data-theme=dark] .select2-container--default .select2-results__option--highlighted[aria-selected]{background:#3459cd;color:white}
html[data-theme=dark] :is(.flash-success,.alert.success){background:#183c31;border-color:#2c614b;color:#a1e2bc}
html[data-theme=dark] .alert.info{background:#233354;border-color:#3b5079;color:#c2d4ff}
html[data-theme=dark] .alert.error{background:#432334;border-color:#754051;color:#ffb3bd}
html[data-theme=dark] .swal2-popup{background:#192338;color:#e8eefb;border:1px solid #354765}
html[data-theme=dark] :is(.swal2-title,.swal2-html-container){color:#e8eefb}
html[data-theme=dark] .swal2-footer{border-color:#354765;color:#b0bed4}
html[data-theme=dark] .fc{--fc-page-bg-color:#192338;--fc-neutral-bg-color:#202e45;--fc-neutral-text-color:#b0bed4;--fc-border-color:#33425c;--fc-list-event-hover-bg-color:#263a58;--fc-today-bg-color:#393522;--fc-highlight-color:#34487566}
html[data-theme=dark] :is(.fc-theme-standard td,.fc-theme-standard th){border-color:#33425c}
html[data-theme=dark] .fc .fc-day-today{background:#393522!important}
html[data-theme=dark] .fc .fc-button-primary{background:#3155d4;border-color:#486bde}
html[data-theme=dark] .fc .fc-button-primary:not(:disabled).fc-button-active{background:#243c88;border-color:#8ba5ff}
html[data-theme=dark] .auth-form-side{background:radial-gradient(ellipse at top,#1d2b47,#101827 75%)}
html[data-theme=dark] .auth-story{background:linear-gradient(135deg,#10286e,#16338c 60%,#21429f)}
html[data-theme=dark] .public-body{background:radial-gradient(ellipse at top,#233558,#101827 70%)}
html[data-theme=dark] .paper-workspace{background:#111c2e;border-color:#31415e}
/* L’A4 et le QR conservent leurs couleurs d’impression, quel que soit le thème. */
html[data-theme=dark] #a4-paper{background:white;color:#17243d;box-shadow:0 5px 25px #0004;color-scheme:light}
html[data-theme=dark] .qr-caption{color:#17243d}
html[data-theme=dark] #page-loader{background:#101827ed}
html[data-theme=dark] #page-loader p{color:#c2d0e7}
html[data-theme=dark] .loader-emblem span{border-color:#354764;border-top-color:#ffd400}
@media(prefers-reduced-motion:no-preference){body,.sidebar,.topbar,.card,.stat-card,.public-card,.theme-switch,.theme-switch button{transition:background-color .2s ease,color .2s ease,border-color .2s ease}.sidebar{transition:transform .25s ease,background-color .2s ease,border-color .2s ease}}
@media(max-width:1250px){.theme-switch button{padding:6px 7px}.topbar-actions{gap:9px}}
@media(max-width:760px){.topbar .theme-switch button span{display:none}.topbar .theme-switch button{width:30px;padding:6px}.topbar-actions{gap:5px}.theme-floating{top:14px;right:16px}.topbar .breadcrumb{display:none}}
@media print{.theme-switch,.theme-floating{display:none!important}html[data-theme=dark]{color-scheme:light}html[data-theme=dark] body{background:white!important;color:#17243d!important}html[data-theme=dark] #a4-paper{box-shadow:none!important}}
