/* Chaque règle de couleur s'applique exclusivement au mode sombre.
   Les couleurs et le placement existants du mode clair restent intacts. */
html.appearance-changing *,html.appearance-changing *::before,html.appearance-changing *::after{transition:none!important}
html[data-theme="dark"]{color-scheme:dark;color:#e8edea;background:#23272b;--navy:#e8edea;--blue:#477c65;--line:#434b50;--muted:#b5beb8;--danger:#ffaea4;--dark-card:#2d3338;--dark-field:#343c40}
html[data-theme="dark"] :is(aside,.col,.rich-tabs){background:#292f33;border-color:var(--line);color:#e8edea}
html[data-theme="dark"] :is(.panel,.card,.user,.authcard,dialog,.editorwrap,.org-company-options){background:var(--dark-card);border-color:var(--line);color:#e8edea}
html[data-theme="dark"] :is(.brand span,.authlogo span,.home-more,.org-filters summary,.accountbtn:hover){color:#b0d4be}
html[data-theme="dark"] :is(.brand,.authlogo,.card>b,dialog,label,.notification-row,.org-company-field,.org-filters .org-company-options label){color:#e8edea}
html[data-theme="dark"] :is(.caption,.foot,.accountbtn,.nav button,.col>b,.badge,.empty,.notice,.authstatus,.authhelp,.meta,.commenthead,.attachmentmeta,.uploadhint,.richpreview,.org-help,.home-eyebrow,.home-count small,.home-task-meta,.home-empty){color:var(--muted)}
html[data-theme="dark"] :is(.nav button.active,.nav button:hover,.rich-tabs button.active){background:#3b4942;color:#d2eddd;border-color:#596c60}
html[data-theme="dark"] :is(input,select,textarea,.filters select,.filters input,.toolbar,.toolbar button){background:var(--dark-field);border-color:var(--line);color:#e8edea}
html[data-theme="dark"] :is(input,textarea)::placeholder{color:#b1bbb5}
html[data-theme="dark"] :is(.quick,.day){background:#292f33;border-color:var(--line);color:#e8edea}
html[data-theme="dark"] .quick input{background:transparent;border:0}
html[data-theme="dark"] .btn{background:#477c65;color:#fff}
html[data-theme="dark"] .btn:hover{background:#538e74}
html[data-theme="dark"] :is(.btn.ghost,.actions button,.subitem button){background:#3a4740;color:#d0e6d7}
html[data-theme="dark"] :is(.btn.ghost:hover,.toolbar button:hover,.home-task:hover){background:#45554b;color:#e6f4eb}
html[data-theme="dark"] .btn.danger{background:#563a39;color:#ffc0b7}
html[data-theme="dark"] :is(.stat,.noticebox,.task-focus,.org-progress,.badge){background:#303d35;border-color:#485b4d;color:#d7e8dc}
html[data-theme="dark"] .stat b{color:#e8edea}
html[data-theme="dark"] :is(.stat span,.rich-tabs button){color:var(--muted)}
html[data-theme="dark"] :is(.tasktitle,.repartition-name){color:#e8edea}
html[data-theme="dark"] .tasktitle:hover{color:#b0d4be}
html[data-theme="dark"] .late{color:#ffb1a7}
html[data-theme="dark"] :is(.urgent,.familyhero){background:#48392b;color:#ffe0bd;border-color:#796043}
html[data-theme="dark"] .stat:nth-child(2){background:#2d3b48}
html[data-theme="dark"] .stat:nth-child(3){background:#403b30}
html[data-theme="dark"] .stat:nth-child(4){background:#483333}
html[data-theme="dark"] .stat:nth-child(4) b{color:#ffb1a7}
html[data-theme="dark"] .stat:nth-child(5){background:#2e413a}
html[data-theme="dark"] :is(.task,.settingsrow,.commentitem,.attachmentrow,.home-task,.org-setting-row,.profilecard,.authhelp,.accountbtn){border-color:var(--line)}
html[data-theme="dark"] :is(.home-count,.home-focus .home-count){color:#c0d9ca}
html[data-theme="dark"] .pill{background:#3e484c;color:#d9e1e2}
html[data-theme="dark"] .owner-nanou{--person:#b1d5ff;--bubble:#2d415a}
html[data-theme="dark"] .owner-guillaume{--person:#dcc2ff;--bubble:#423653}
html[data-theme="dark"] .owner-both{--person:#b8e2c4;--bubble:#2e473a}
html[data-theme="dark"] .owner-other{--person:#d3dbd6;--bubble:#3b4540}
html[data-theme="dark"] .message{background:var(--bubble);color:#e8edea}
html[data-theme="dark"] .message-quote{background:#22282a80;color:#e8edea}
html[data-theme="dark"] .priority-urgent{background:#5c333b;color:#ffc0c7}
html[data-theme="dark"] .priority-high{background:#533c2b;color:#ffcd9e}
html[data-theme="dark"] .priority-normal{background:#484329;color:#f3e5a1}
html[data-theme="dark"] .priority-low{background:#2d4735;color:#bce5c5}
html[data-theme="dark"] .priority-unknown{background:#3b4540;color:#d3dbd6}
html[data-theme="dark"] :is(.notification-row.unread,.event){background:#34493b;color:#d2eddd}
html[data-theme="dark"] .event:hover{background:#415d49;border-color:#799985}
html[data-theme="dark"] :is(.org-sub,.profilecard){border-color:var(--line)}
html[data-theme="dark"] :is(.org-review,#syncConflict){background:#48392b!important;border-color:#796043;color:#ffe0bd}
html[data-theme="dark"] .org-filters .org-company-picker summary{background:var(--dark-field);color:#e8edea}
html[data-theme="dark"] .org-company-options label:hover{background:#415048}
html[data-theme="dark"] :is(.richeditor,.richpreview,.message-body) :is(p,span,div,b,strong,i,em,font,h2,h3,li,a){background-color:transparent!important;color:inherit!important}
html[data-theme="dark"] :is(.richeditor,.richpreview,.message-body) a{color:#b1d5ff!important}
html[data-theme="dark"] :is(table,thead,tbody,tr,td,th){background:#30383d;color:#e8edea;border-color:#596369}
html[data-theme="dark"] .formactions{background:#2d3338f5}
html[data-theme="dark"] .syncbadge{background:#2d3338ed;color:#c7d0ca;border-color:var(--line)}
html[data-theme="dark"] .syncbadge.ok{color:#b8e2c4}
html[data-theme="dark"] .syncbadge.err{background:#483333;color:#ffb1a7}
html[data-theme="dark"] .authgate{background:radial-gradient(ellipse at 25% 20%,#34443b 0%,transparent 55%),#23272b}
html[data-theme="dark"] dialog::backdrop{background:#12181bb3}
html[data-theme="dark"] :is(.avatar,.profilephoto){background:#3a4740;color:#d0e6d7}
html[data-theme="dark"] .miniavatar{border-color:#37413b}
html[data-theme="dark"] .tabcount{background:#465449;color:#e8edea}
