/* Couche commune écran uniquement ; jamais de filtre sur PDF/images/impression. */
@media screen {
html[data-theme="dark"] {color-scheme:dark;--cab360-dark-bg:#0b1220;--cab360-dark-panel:#111d30;--cab360-dark-raised:#1e293b;--cab360-dark-text:#e8eef7;--cab360-dark-muted:#b3c1d4;--cab360-dark-border:#475569;}
html[data-theme="dark"] body{background:var(--cab360-dark-bg)!important;color:var(--cab360-dark-text)!important}
html[data-theme="dark"] :is(.content-wrapper,.cfe-page,.agri-wrap){background:var(--cab360-dark-bg)!important;color:var(--cab360-dark-text)!important}
html[data-theme="dark"] :is(.panel,.card,.table-card,.table-scroll,.matrix-scroll,.cfe-table-scroll,.agri-scroll,.scab360-role-card,.scab360-role-advanced,.scab360-collecte-help,dialog,.modal,.modal-head,.modal-body,.login-card,.login-preview,.login-preview-row,.login-stat,.login-reset-inner){background:var(--cab360-dark-panel)!important;color:var(--cab360-dark-text)!important;border-color:var(--cab360-dark-border)!important}
html[data-theme="dark"] .modal-overlay,html[data-theme="dark"] dialog::backdrop{background:rgba(2,6,23,.78)!important}
html[data-theme="dark"] :is(h1,h2,h3,h4,label,legend,caption){color:inherit}
html[data-theme="dark"] :is(.cfe-table,.agri-table,.scab360-collecte-help) :is(th,caption){background:var(--cab360-dark-raised)!important;color:#f8fafc!important;border-color:var(--cab360-dark-border)!important}
html[data-theme="dark"] :is(.cfe-table,.agri-table) td{background:var(--cab360-dark-panel)!important;color:var(--cab360-dark-text)!important;border-color:#334155!important}
html[data-theme="dark"] :is(.cfe-table,.agri-table) tr:hover td{background:#1a2b44!important}
html[data-theme="dark"] :is(.cfe-page,.agri-wrap,.scab360-role-card,.scab360-collecte-help,.login-card) :is(p,small,.cfe-origin,.agri-status,.scab360-role-settings,.scab360-role-matrix-label){color:var(--cab360-dark-muted)!important}
html[data-theme="dark"] :is(.scab360-role-card h3,.scab360-collecte-help h1,.scab360-collecte-help h2,.cfe-payment strong){color:#c5f5e2!important}
html[data-theme="dark"] :is(.scab360-roles-intro,.scab360-role-group-title,.scab360-role-tools,.agri-editbar,.login-card-intro,.login-security-note,.login-demo-caption,.login-stat span){color:var(--cab360-dark-muted)!important}
html[data-theme="dark"] :is(.content-wrapper,.agri-wrap,.cfe-page,.scab360-role-card,.scab360-collecte-help,.login-card) a:not(.btn):not(.cab360-round-btn):not(.is-delete){color:#93c5fd!important}
html[data-theme="dark"] :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=hidden]):not([type=submit]):not([type=button]),select,textarea){background:#0b1526!important;color:var(--cab360-dark-text)!important;border-color:#64748b!important;}
html[data-theme="dark"] :is(input,textarea)::placeholder{color:#a8b8ce!important;opacity:1!important}
html[data-theme="dark"] option{background:#0b1526;color:#e8eef7}
html[data-theme="dark"] input:read-only{color:#e8eef7!important}
html[data-theme="dark"] :is(button,.btn-secondary,.btn-light,.cfe-drop,.scab360-role-select-all,.scab360-role-run,.login-button.secondary){background:#1e293b!important;color:#e8eef7!important;border-color:#64748b!important}
html[data-theme="dark"] :is(button,.btn-secondary,.btn-light):hover:not(:disabled){background:#334155!important;color:#fff!important}
html[data-theme="dark"] :is(.cfe-start,.login-button.primary,.agri-editbar button[aria-pressed=true]){background:#16665d!important;color:#fff!important;border-color:#5eead4!important}
html[data-theme="dark"] :is(.cfe-stop,.is-delete,.agri-error,.cfe-payment[data-mode=inconnu] strong,.cfe-payment[data-mode=non_analyse] strong){color:#fda4af!important}
html[data-theme="dark"] :is(.agri-note,.agri-settings[open],#cfe-agent-status,.scab360-collecte-help aside,.scab360-role-tag){background:#17352d!important;color:#d1fae5!important;border-color:#4c8c79!important}
html[data-theme="dark"] :is(.cfe-page,.agri-wrap,.login-card) :is(button,input,select,textarea,a):focus-visible{outline:3px solid #7dd3fc!important;outline-offset:3px!important}
html[data-theme="dark"] :is(button,select,input):disabled{opacity:.8}
/* Rattrapage des surfaces neutres écrites en inline, sans changer les couleurs métier. */
html[data-theme="dark"] :is([style*="background:#fff;"],[style*="background: #fff;"],[style*="background:#ffffff;"],[style*="background: #ffffff;"],[style*="background:#f8fafc;"],[style*="background: #f8fafc;"],[style*="background-color: #fff;"]){background:var(--cab360-dark-panel)!important;color:var(--cab360-dark-text)!important;border-color:var(--cab360-dark-border)!important}
html[data-theme="dark"] :is([style*="color:#111827"],[style*="color: #111827"],[style*="color:#0f172a"],[style*="color: #0f172a"],[style*="color:#334155"],[style*="color: #334155"]){color:var(--cab360-dark-text)!important}
html[data-theme="dark"] :is([style*="color:#64748b"],[style*="color: #64748b"],[style*="color:#475569"],[style*="color: #475569"],[style*="color:#6b7280"],[style*="color: #6b7280"]){color:var(--cab360-dark-muted)!important}
html[data-theme="dark"] body.cab360-login-page{background:radial-gradient(ellipse at top left,#123c43,#0b1220 65%)!important}
html[data-theme="dark"] :is(.login-card-header,.login-title,.login-card h1,.login-stat strong,.login-preview strong,.login-preview-row strong,.login-field label){color:#f1f5f9!important}
html[data-theme="dark"] .login-hero{color:#e8eef7!important}
html[data-theme="dark"] :is(.login-preview-top,.login-preview-head,.login-kicker,.login-brand,.login-preview-title){color:#dbeafe!important}
.cab360-login-theme-toggle{position:fixed;right:16px;top:12px;z-index:10;padding:7px 12px;border:1px solid #94a3b8;border-radius:20px;background:#fff;color:#1e293b;cursor:pointer}
html[data-theme="dark"] .login-card .login-alert.error{background:#451a25!important;color:#fecdd3!important;border-color:#fb7185!important}
html[data-theme="dark"] .cab360-standalone-page :is(main,aside,.box,.path,.scroll,#status){background:var(--cab360-dark-panel)!important;color:var(--cab360-dark-text)!important;border-color:var(--cab360-dark-border)!important}
html[data-theme="dark"] .cab360-standalone-page :is(th,td){background:#16243b!important;color:#e8eef7!important;border-color:#475569!important}
html[data-theme="dark"] .cab360-standalone-page :is(.muted,.hint,header p){color:var(--cab360-dark-muted)!important}
html[data-theme="dark"] .cab360-standalone-page a{color:#93c5fd!important}
html[data-theme="dark"] .cab360-standalone-page :is(.warn,.err,#status.error){background:#451a25!important;color:#fecdd3!important}
html[data-theme="dark"] .cab360-standalone-page :is(.ok,#status.success){background:#17352d!important;color:#d1fae5!important}
html[data-theme="dark"] .cab360-standalone-page button.danger{background:#7f1d1d!important;color:#fff!important}
html[data-theme="dark"] :is([style*="background:#fef3c7"],[style*="background:#fffbeb"],[style*="background:#fff7ed"],[style*="background: #fef3c7"],[style*="background: #fffbeb"],[style*="background: #fff7ed"]){background:#493415!important;color:#fef3c7!important;border-color:#c29440!important}
html[data-theme="dark"] :is([style*="background:#fee2e2"],[style*="background:#fef2f2"],[style*="background: #fee2e2"],[style*="background: #fef2f2"]){background:#451a25!important;color:#fecdd3!important;border-color:#fb7185!important}
html[data-theme="dark"] :is([style*="background:#dcfce7"],[style*="background:#f0fdf4"],[style*="background: #dcfce7"],[style*="background: #f0fdf4"]){background:#17352d!important;color:#d1fae5!important;border-color:#4c8c79!important}
html[data-theme="dark"] :is([style*="background:#eff6ff"],[style*="background:#e0f2fe"],[style*="background: #eff6ff"],[style*="background: #e0f2fe"]){background:#18334e!important;color:#dbeafe!important;border-color:#60a5fa!important}
}
