/* GAIA claire et guidée — palette et composants issus des maquettes validées.
   Chargé après app.css ; les règles de parcours et de responsive existantes restent actives. */
:root {
  color-scheme: light;
  --color-bg: #f3f6fa;
  --color-bg-alt: #eaf0f7;
  --color-surface: #fff;
  --color-input-bg: #fff;
  --color-text: #1f2937;
  --color-text-light: #526174;
  --color-text-muted: #526174;
  --color-border: #cbd5e1;
  --color-border-light: #dce3ed;
  --color-primary: #285e93;
  --color-primary-dark: #214e7d;
  --color-primary-light: #528cc9;
  --color-primary-50: #eaf2fb;
  --color-primary-100: #d6e5f5;
  --color-accent: #9a480b;
  --color-accent-dark: #803b09;
  --color-accent-light: #e2781d;
  --color-accent-50: #fff3e6;
  --color-accent-100: #f6dfc7;
  --color-info: #285e93;
  --color-info-bg: #eaf2fb;
  --color-success: #166534;
  --color-success-bg: #edf8f0;
  --color-warning: #9a480b;
  --color-warning-bg: #fff3e6;
  --color-danger: #b91c1c;
  --color-danger-bg: #fef0f0;
  --color-neutral-bg: #eef1f5;
  --color-on-primary: #fff;
  --color-on-semantic: #fff;
  --font-size-xs: .8125rem;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --sidebar-width: 240px;
  --shadow-primary: 0 2px 5px #233b5710;
  --shadow-accent: 0 2px 5px #233b5710;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --color-bg: #111827;
  --color-bg-alt: #273449;
  --color-surface: #1f2937;
  --color-input-bg: #1f2937;
  --color-text: #f3f4f6;
  --color-text-light: #b8c4d4;
  --color-text-muted: #b8c4d4;
  --color-border: #475569;
  --color-border-light: #3a485b;
  --color-primary: #93c5fd;
  --color-primary-dark: #bfdbfe;
  --color-primary-light: #93c5fd;
  --color-primary-50: #213b56;
  --color-primary-100: #314e6c;
  --color-accent: #fdba74;
  --color-accent-dark: #fed7aa;
  --color-accent-light: #fdba74;
  --color-accent-50: #443022;
  --color-accent-100: #66462c;
  --color-info: #93c5fd;
  --color-info-bg: #213b56;
  --color-success: #86efac;
  --color-success-bg: #203d32;
  --color-warning: #fdba74;
  --color-warning-bg: #443022;
  --color-danger: #fca5a5;
  --color-danger-bg: #452a32;
  --color-neutral-bg: #303b4c;
  --color-on-primary: #142437;
  --color-on-semantic: #142437;
  --shadow-sm: 0 2px 5px #00000018;
  --shadow-md: 0 8px 28px #00000018;
}
/* Sans JavaScript, suivre l'appareil. Un choix explicite reste prioritaire. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --color-bg: #111827; --color-bg-alt: #273449; --color-surface: #1f2937; --color-input-bg: #1f2937;
    --color-text: #f3f4f6; --color-text-light: #b8c4d4; --color-text-muted: #b8c4d4;
    --color-border: #475569; --color-border-light: #3a485b;
    --color-primary: #93c5fd; --color-primary-dark: #bfdbfe; --color-primary-light: #93c5fd;
    --color-primary-50: #213b56; --color-primary-100: #314e6c;
    --color-accent: #fdba74; --color-accent-dark: #fed7aa; --color-accent-light: #fdba74;
    --color-accent-50: #443022; --color-accent-100: #66462c;
    --color-info: #93c5fd; --color-info-bg: #213b56;
    --color-success: #86efac; --color-success-bg: #203d32;
    --color-warning: #fdba74; --color-warning-bg: #443022;
    --color-danger: #fca5a5; --color-danger-bg: #452a32;
    --color-neutral-bg: #303b4c; --color-on-primary: #142437; --color-on-semantic: #142437;
  }
}

body { overflow-wrap: anywhere; color: var(--color-text); background: var(--color-bg); }
.company-monogram { display: inline-grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; border-radius: 10px; background: var(--color-primary); color: white; font-size: 1rem; font-weight: 800; }
.app-header, .app-sidebar, .sidebar-footer { background: var(--color-surface); border-color: var(--color-border); }
.app-sidebar { box-shadow: none; }
button, input, select, textarea { font-family: inherit; }
.btn { min-height: 44px; white-space: normal; border-width: 1px; border-radius: 8px; }
.btn--primary, .btn--primary:hover { color: var(--color-on-primary); box-shadow: var(--shadow-xs); transform: none; }
.btn--accent, .btn--accent:hover, .btn--warning, .btn--warning:hover { color: var(--color-on-semantic); background: var(--color-warning); box-shadow: none; transform: none; }
.btn--success, .btn--success:hover { color: var(--color-on-semantic); background: var(--color-success); transform: none; }
.btn--danger, .btn--danger:hover { color: var(--color-on-semantic); background: var(--color-danger); transform: none; }
.btn--action, .btn--action:hover { color: var(--color-warning); background: var(--color-warning-bg); border-color: var(--color-warning); }
.btn--outline { background: var(--color-surface); }
.btn:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 3px; }
.form-input, .form-select, .form-textarea { border-color: var(--color-border); background: var(--color-input-bg); color: var(--color-text); }
.form-input::placeholder, .form-textarea::placeholder { color: var(--color-text-light); opacity: 1; }
.form-label, .form-help, .form-hint { font-size: .875rem; }
.form-input:hover, .form-select:hover { border-color: var(--color-primary); }
.form-errors a, .form-field-error { color: var(--color-danger); }
.page-title, .dashboard-welcome__title { font-size: 1.875rem; letter-spacing: -.035em; }
.page-header { margin-bottom: 1.75rem; }
.page-subtitle { margin-top: .5rem; }
.app-header__logo { background: transparent; padding: 0; border-radius: 0; }
.app-header__title { color: var(--color-text); }
.app-header__avatar, .profil-avatar, .collaborateur-card__avatar, .admin-account-card__avatar { background: var(--color-primary-50); color: var(--color-primary); box-shadow: none; }
.app-header__locations { background: transparent; }
.location-dot { animation: none; }
.sidebar-nav { padding: 1.5rem .75rem; }
.sidebar-section__title { color: var(--color-text-light); font-size: .6875rem; letter-spacing: .12em; padding: 0 .75rem; }
.sidebar-link { margin: .25rem 0; padding: .75rem; border-left: 0; border-radius: 9px; }
.sidebar-link.is-active { background: var(--color-primary-50); }
.sidebar-link--danger { background: transparent; width: 100%; border: 0; text-align: left; font: inherit; color: var(--color-text-light); cursor: pointer; }
.role-badge { color: var(--color-info); background: var(--color-info-bg); }
.skip-link { background: var(--color-surface); }
.appearance-control { min-width: 0; max-width: 100%; margin: 0; padding: 0; border: 0; font-size: .875rem; color: var(--color-text-light); }
.appearance-control legend { margin-bottom: .4rem; font-weight: 500; }
.appearance-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .125rem; padding: .25rem; background: var(--color-bg); border: 1px solid var(--color-border-light); border-radius: 999px; }
.appearance-choice { display: block; position: relative; min-width: 0; }
.appearance-choice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.appearance-option { display: flex; align-items: center; justify-content: center; gap: .375rem; min-height: 44px; min-width: 44px; padding: .25rem .5rem; border-radius: 999px; color: var(--color-text-light); }
.appearance-symbol { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; border: 1px solid transparent; border-radius: 50%; }
.appearance-symbol .icon { stroke-width: 1.7; }
.appearance-option-text { font-size: .8125rem; font-weight: 500; }
.appearance-choice:hover .appearance-symbol { background: var(--color-bg-alt); }
.appearance-choice input:checked + .appearance-option { color: var(--color-primary); }
.appearance-choice input:checked + .appearance-option .appearance-symbol { background: var(--color-surface); border-color: var(--color-primary-100); box-shadow: var(--shadow-xs); }
.appearance-choice input:checked + .appearance-option .appearance-option-text { font-weight: 650; }
.appearance-choice input:focus-visible + .appearance-option { outline: 3px solid var(--color-primary); outline-offset: 2px; }
.appearance-choice input:disabled { cursor: default; }
.appearance-choice input:disabled + .appearance-option { opacity: .6; }
.appearance-hint { margin-top: .4rem; font-size: .75rem; color: var(--color-text-light); }
.appearance-control--compact .appearance-options { width: max-content; }
.appearance-control--compact .appearance-option { padding: 0; }
.appearance-control--compact .appearance-option-text, .appearance-control--compact .appearance-hint { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; }
.appearance-settings { flex-direction: row; justify-content: space-between; flex-wrap: wrap; }
.appearance-settings > div { flex: 1 1 320px; }
.appearance-settings .profil-card__title { border: 0; padding: 0; }
.profil-card, .profil-grid, .profil-stat, .info-list__item > div { min-width: 0; }
.profil-page .info-list__icon { display: grid; place-items: center; width: 40px; height: 40px; background: var(--color-primary-50); color: var(--color-primary); border: 1px solid var(--color-primary-100); border-radius: 10px; }
.profil-page .info-list__icon .icon { stroke-width: 1.7; }
.profil-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.app-footer { background: var(--color-bg); }

/* Statut du dossier (bleu/vert/rouge/gris) et action du lecteur (orange). */
.status-badge { border-radius: 7px; font-size: .875rem; padding: .35rem .6rem; white-space: normal; }
.status-badge--info { color: var(--color-info); background: var(--color-info-bg); border: 1px solid transparent; }
.status-badge--success { color: var(--color-success); background: var(--color-success-bg); border-color: transparent; }
.status-badge--danger { color: var(--color-danger); background: var(--color-danger-bg); border-color: transparent; }
.status-badge--warning { color: var(--color-warning); background: var(--color-warning-bg); border-color: transparent; }
.status-badge--neutral { color: var(--color-text-light); background: var(--color-neutral-bg); border: 1px solid transparent; }
.request-badges { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .5rem; }
.request-next { margin-top: .65rem; color: var(--color-text-light); font-size: .875rem; line-height: 1.5; }
.request-next--action { color: var(--color-warning); font-weight: 600; }
.request-guidance { padding: 1rem 1.25rem; border: 1px solid var(--color-border); border-left: 4px solid var(--color-info); border-radius: 9px; background: var(--color-info-bg); font-size: .875rem; }
.request-guidance p { margin-top: .35rem; color: var(--color-text-light); }
.request-guidance .btn { margin-top: .75rem; }
#supplemental-documents-title { scroll-margin-top: calc(var(--header-height) + 1rem); }
.request-guidance--action { border-left-color: var(--color-warning); background: var(--color-warning-bg); }
.request-guidance--action strong { color: var(--color-warning); }
.request-amount { color: var(--color-text); font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.request-cell--amount { text-align: right; font-variant-numeric: tabular-nums; }
.demande-card { border-left: 4px solid var(--color-info); padding: 1.5rem; box-shadow: none; }
.demande-card:hover { transform: none; color: var(--color-text); border-color: var(--color-border); }
.demande-card--action, .demande-card--action:hover { border-left-color: var(--color-warning); }
.demande-card--success, .demande-card--success:hover { border-left-color: var(--color-success); }
.demande-card--danger, .demande-card--danger:hover { border-left-color: var(--color-danger); }
.demande-card--neutral, .demande-card--neutral:hover { border-left-color: var(--color-text-light); }
.demande-card--deleted { opacity: 1; }
.demande-card__header { justify-content: flex-start; }
.demande-card__title { font-size: 1.125rem; }
.demande-detail strong { font-size: 1.125rem; }
.demande-detail strong.request-amount { font-size: 1.5rem; }
.demande-detail__label { color: var(--color-text-light); }
.demande-card__footer { flex-wrap: wrap; gap: .75rem; }
.demandes-overview { grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: .75rem; }
.demandes-overview__item { padding: 1.1rem; min-height: 100px; flex-direction: column; align-items: flex-start; position: relative; }
.demandes-overview__item strong { font-size: 1.75rem; }
.demandes-overview__item small { margin-top: .5rem; font-size: .875rem; }
.demandes-overview__icon { position: absolute; top: 1rem; right: 1rem; width: 28px; height: 28px; background: transparent; }
.demandes-overview__item--info .demandes-overview__icon { color: var(--color-info); }
.demandes-overview__item--success .demandes-overview__icon { color: var(--color-success); background: transparent; }
.demandes-overview__item--action { border-top: 3px solid var(--color-warning); }
.demandes-overview__item--action strong, .demandes-overview__item--action .demandes-overview__icon { color: var(--color-warning); }
.demandes-overview__item.is-selected { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.filter-chip { min-height: 44px; font-size: .875rem; }
.filter-chip.is-active { color: var(--color-on-primary); }
.filter-chip--warning.is-active, .filter-chip--success.is-active, .filter-chip--danger.is-active { color: var(--color-on-semantic); }
.gestion-table th { font-size: .6875rem; padding: 1rem; }
.gestion-table td { padding: 1.25rem 1rem; border-color: var(--color-border); }
.gestion-table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--color-bg-alt) 30%, var(--color-surface)); }
.gestion-table tbody tr:hover td { background: var(--color-bg-alt); }
.gestion-table .request-row--action td:first-child { box-shadow: inset 3px 0 var(--color-warning); }
.gestion-table .request-next { max-width: 24rem; }
.gestion-table .type-tag { background: transparent; color: var(--color-text-light); padding-left: 0; }
.page-gestion-demandes .gestion-table { table-layout: fixed; }
.page-gestion-demandes .gestion-table th:first-child { width: 22%; }
.page-gestion-demandes .gestion-table th:nth-child(2) { width: 9%; }
.page-gestion-demandes .gestion-table th:nth-child(3) { width: 24%; }
.page-gestion-demandes .gestion-table th:nth-child(4) { width: 31%; }
.page-gestion-demandes .gestion-table th:last-child { width: 14%; }
.page-gestion-demandes .gestion-table td:last-child .btn { white-space: nowrap; }
.page-gestion-demandes .gestion-table .type-tag { white-space: nowrap; font-weight: 500; padding-right: 0; }
.request-reference { display: block; margin-top: .4rem; color: var(--color-text-light); font-size: .8125rem; }
.profil-stat--info .profil-stat__value { color: var(--color-info); }
.profil-stat--neutral .profil-stat__value { color: var(--color-text-light); }

/* Accueil : essentiels visibles, retours à gauche, raccourcis à droite. */
.dashboard { gap: 1.75rem; }
.dashboard-welcome { background: transparent; border: 0; padding: 0; box-shadow: none; display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; flex-wrap: wrap; }
.dashboard-welcome__content { flex: 1; min-width: 0; }
.dashboard-welcome__date { display: none; }
.dashboard-welcome::after { display: none; }
.dashboard-welcome__action { margin: 0; }
.dashboard-highlights { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.dashboard-highlight { display: flex; flex-direction: column; min-width: 0; gap: .75rem; padding: 1.25rem; color: var(--color-text); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px; box-shadow: var(--shadow-sm); }
.dashboard-highlight:hover { color: var(--color-text); border-color: var(--color-primary); }
.dashboard-highlight > span { display: flex; align-items: center; justify-content: space-between; gap: .5rem; color: var(--color-text-light); font-size: .875rem; }
.dashboard-highlight > strong { font-size: 2.125rem; line-height: 1.2; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.dashboard-highlight > small { font-size: .8125rem; color: var(--color-text-light); }
.dashboard-highlight--action { border-top: 3px solid var(--color-warning); }
.dashboard-highlight--action > span, .dashboard-highlight--action > strong { color: var(--color-warning); }
.dashboard-highlight--success > span { color: var(--color-success); }
.dashboard-main-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; gap: 1.5rem; }
.dashboard-main-column { min-width: 0; display: grid; gap: 1.25rem; }
.dashboard-shortcuts, .dashboard-notifications { min-width: 0; margin: 0; padding: 1.5rem; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px; }
.dashboard .section-title { color: var(--color-text); }
.dashboard-shortcuts .navigation-actions { grid-template-columns: minmax(0, 1fr); gap: 0; margin-bottom: 0; }
.dashboard-shortcuts .navigation-action { border: 0; border-bottom: 1px solid var(--color-border); border-radius: 0; padding: 1rem 0; background: transparent; color: var(--color-text); }
.dashboard-shortcuts .navigation-action:last-child { border-bottom: 0; }
.dashboard-shortcuts .navigation-action > .icon:first-child { color: var(--color-primary); }
.dashboard-shortcuts .navigation-action--priority strong { color: var(--color-warning); }
.dashboard-shortcuts .navigation-action--priority > .icon:first-child { color: var(--color-warning); }
.dashboard-next-action { padding: 1.25rem; background: var(--color-warning-bg); border: 1px solid var(--color-warning); border-left-width: 4px; border-radius: 9px; }
.dashboard-next-action .section-kicker { color: var(--color-warning); }
.dashboard-next-action h2 { margin: .5rem 0; font-size: 1.125rem; }
.dashboard-next-action p { color: var(--color-text-light); font-size: .875rem; margin-bottom: 1rem; }
.dashboard-overview { background: var(--color-surface); margin: 0; }
.navigation-action { background: var(--color-surface); }
.navigation-action--priority { background: var(--color-warning-bg); border-color: var(--color-warning); }
.notification-kpi, .notification-kpi:hover { background: var(--color-surface); color: var(--color-text); border: 0; border-bottom: 1px solid var(--color-border); border-radius: 0; box-shadow: none; transform: none; padding: 1rem 0; }
.notification-kpi__content strong { color: var(--color-text); }
.notification-kpi__content small, .notification-kpi__content time { color: var(--color-text-light); }
.notification-kpi__icon, .notification-kpi__arrow { color: var(--color-info); background: var(--color-info-bg); }
.notification-kpi__arrow { background: transparent; }
.notification-kpi--warning .notification-kpi__icon { color: var(--color-warning); background: var(--color-warning-bg); }
.notification-kpi--danger .notification-kpi__icon { color: var(--color-danger); background: var(--color-danger-bg); }
.notification-kpi--success .notification-kpi__icon { color: var(--color-success); background: var(--color-success-bg); }
.notification-empty, .dashboard-payment-card__icon, .dashboard-payment-card small,
.kpi-card--green .kpi-card__icon { color: var(--color-success); }
.dashboard .kpi-card--warning .kpi-card__icon, .dashboard .kpi-card--warning .kpi-card__link,
.dashboard .kpi-card--warning .kpi-card__link:hover, .kpi-card--violet .kpi-card__icon { color: var(--color-info); background: var(--color-info-bg); }
.dashboard .kpi-card--warning .kpi-card__link, .dashboard .kpi-card--warning .kpi-card__link:hover { background: transparent; }
.kpi-card--danger .kpi-card__link:hover { color: var(--color-danger); }

/* Surfaces communes : les anciens fonds blancs fixes suivent désormais le thème. */
.agency-card, .agency-card__color input[type="color"], #requestRecap, .annual-archive-card,
.archive-demand-summary article, .archive-process-grid article, .payment-notice-upload,
.decision-card__motif, .archive-config-card__icon, .privacy-contact-card__icon { background: var(--color-surface); }
.agency-card--inactive, .agency-record--inactive, .admin-account-card--disabled, .admin-account-card--disabled:hover,
.archive-state, .export-filter-feedback, .document-preview-modal__body { background: var(--color-bg-alt); }
.admin-account-card:hover, .agency-record:hover, .collaborateur-card:hover { background: var(--color-bg-alt); }
.annual-archive-card.is-invalid { background: var(--color-danger-bg); }
.expense-total, .dashboard-info-card, .collaborateurs-summary { background: var(--color-info-bg); border-color: var(--color-border); }
.page-gestion-deplacements .deplacement-disclosure__summary { background: var(--color-surface); }
.privacy-contact-card { color: var(--color-info); background: var(--color-info-bg); border-color: var(--color-border); }
.privacy-contact-card a, .privacy-contact-card__icon, .privacy-panel-icon { color: var(--color-info); }
.privacy-panel-icon { background: var(--color-info-bg); }
.privacy-contact-card small { color: var(--color-text-light); }
.deplacement-info-update-banner { color: var(--color-warning); background: var(--color-warning-bg); border-color: var(--color-warning); box-shadow: none; }
.deplacement-info-update-banner__icon { color: var(--color-warning); background: var(--color-warning-bg); }
.flash-message--error, .alert--danger, .decision-card--refuse { color: var(--color-danger); background: var(--color-danger-bg); border-color: var(--color-danger); }
.flash-message--success, .alert--success, .decision-card--valide, .archive-config-card.is-ready { color: var(--color-success); background: var(--color-success-bg); border-color: var(--color-success); }
.flash-message--warning, .alert--warning, .privacy-admin-warning, .archive-config-card.is-blocked, .archive-current-year { color: var(--color-warning); background: var(--color-warning-bg); border-color: var(--color-warning); }
.alert--info { color: var(--color-info); background: var(--color-info-bg); border-color: var(--color-info); }
.decision-card--neutral { color: var(--color-text-light); background: var(--color-neutral-bg); border-color: var(--color-border); }
.payment-notice-link, .payment-notice-link:hover { color: var(--color-success); background: var(--color-surface); border-color: var(--color-success); }
.payment-notice-upload .form-help { color: var(--color-text-light); }
.meta-box--paid .meta-box__value, .file-upload-control.is-selected .file-picker-status,
.collaborateur-card__footer span, .export-panel__icon--euro, .agency-kpi--success .agency-kpi__icon { color: var(--color-success); }
.file-upload-control.has-error .file-picker-status, .archive-finalize-form > label { color: var(--color-danger); }
.export-item__notice, .export-item__history { color: var(--color-success) !important; }
.archive-state.is-done, .absence-summary-card--today .absence-summary-card__icon { color: var(--color-success); background: var(--color-success-bg); }
.deplacement-count--pending { color: var(--color-info); background: var(--color-info-bg); border-color: var(--color-border); }
.deplacement-count--paid { color: var(--color-success); background: var(--color-success-bg); border-color: var(--color-border); }
.export-panel__icon--travel { color: var(--color-info); background: var(--color-info-bg); }
.agency-kpi--muted .agency-kpi__icon, .agency-record--inactive .agency-record__icon { color: var(--color-text-light); background: var(--color-neutral-bg); }
.storage-test-result.is-success > header > span { color: var(--color-success); background: var(--color-success-bg); }
.storage-test-result.is-error > header > span { color: var(--color-danger); background: var(--color-danger-bg); }
.archived-page-banner--danger { color: var(--color-text-light); background: var(--color-neutral-bg); border-color: var(--color-border); }
.role-badge--rh, .role-badge--cabinet_comptable { color: var(--color-info); background: var(--color-info-bg); }
.historical-count, .absence-agenda-item mark { color: var(--color-text-light); background: var(--color-neutral-bg); }
.absence-calendar__day.is-weekend, .absence-calendar__day.is-outside { background: var(--color-bg); }
.absence-calendar__day.is-today { background: var(--color-info-bg); }
.absence-calendar__day.is-today .absence-calendar__date { color: var(--color-on-primary); }
.absence-agenda-item__heading em { color: var(--color-text); background: var(--color-bg-alt); }
.demande-timeline__step.is-complete .demande-timeline__dot { color: var(--color-on-semantic); }
.demande-timeline__step.is-current .demande-timeline__dot { color: var(--color-info); background: var(--color-info-bg); border-color: var(--color-info); box-shadow: none; }
.demande-timeline__step--refuse .demande-timeline__dot { color: var(--color-on-semantic) !important; }
.form-progress__step.is-active span { color: var(--color-on-primary); }
.deplacement-item--paid, .deplacement-badge--paid { color: var(--color-success); background: var(--color-success-bg); border-color: var(--color-success); }
.deplacement-item--alert, .deplacement-badge--alert, .badge-tag--warning { color: var(--color-warning); background: var(--color-warning-bg); border-color: var(--color-warning); }
.deplacement-badge--problem, .deplacement-problem { color: var(--color-danger); background: var(--color-danger-bg); }
.notification-item--warning .notification-item__icon { color: var(--color-warning); }
.login-hero__logo { background: #fff; padding: .35rem; }

/* Repères sémantiques visibles sur les compteurs, pas seulement sur l'icône. */
.status-legend { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: 1.5rem; }
.status-legend__label { color: var(--color-text-light); font-size: .8125rem; margin-right: .25rem; }
.status-legend .status-badge { font-size: .8125rem; }
.demandes-overview { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.demandes-overview__item--all, .demandes-overview__item--info { border-top: 3px solid var(--color-info); background: var(--color-info-bg); }
.demandes-overview__item--all strong, .demandes-overview__item--info strong { color: var(--color-info); }
.demandes-overview__item--success { border-top: 3px solid var(--color-success); background: var(--color-success-bg); }
.demandes-overview__item--success strong { color: var(--color-success); }
.demandes-overview__item--action { background: var(--color-warning-bg); }
.demandes-overview__item--danger { border-top: 3px solid var(--color-danger); background: var(--color-danger-bg); }
.demandes-overview__item--danger strong, .demandes-overview__item--danger .demandes-overview__icon { color: var(--color-danger); }
.demandes-overview__item.is-empty { border-top-color: var(--color-border); background: var(--color-surface); }
.demandes-overview__item.is-empty strong, .demandes-overview__item.is-empty .demandes-overview__icon { color: var(--color-text-light); }
.dashboard-highlight:not(.dashboard-highlight--action):not(.dashboard-highlight--success) { border-top: 3px solid var(--color-info); }
.dashboard-highlight--success { border-top: 3px solid var(--color-success); background: var(--color-success-bg); }
.dashboard-highlight--action { background: var(--color-warning-bg); }
.kpi-card--blue, .kpi-card--violet, .kpi-card--warning { border-top-color: var(--color-info); background: var(--color-info-bg); }
.dashboard .kpi-card.kpi-card--warning { border-top-color: var(--color-info); }
.kpi-card--orange { background: var(--color-warning-bg); }
.kpi-card--green { background: var(--color-success-bg); }
.kpi-card--danger { background: var(--color-danger-bg); }
.kpi-card--orange .kpi-card__value, .kpi-card--orange .kpi-card__link { color: var(--color-warning); }
.kpi-card--green .kpi-card__value, .kpi-card--green .kpi-card__link { color: var(--color-success); }
.kpi-card--danger .kpi-card__value { color: var(--color-danger); }
.notification-empty[hidden] { display: none; }

/* Comptes : six colonnes propres, indépendantes des cinq colonnes des demandes. */
.admin-users-page .gestion-table { table-layout: fixed; min-width: 0; }
.admin-users-page .gestion-table th:first-child { width: 24%; }
.admin-users-page .gestion-table th:nth-child(2) { width: 14%; }
.admin-users-page .gestion-table th:nth-child(3) { width: 10%; }
.admin-users-page .gestion-table th:nth-child(4) { width: 20%; }
.admin-users-page .gestion-table th:nth-child(5) { width: 12%; }
.admin-users-page .gestion-table th:last-child { width: 20%; }
.admin-users-page .gestion-table td { vertical-align: top; min-width: 0; }
.admin-users-page .gestion-table td small { display: block; margin-top: .35rem; }
.admin-users-page .gestion-table td > br { display: none; }
.admin-users-page .gestion-table td[data-label="Contact"] a { display: flex; align-items: flex-start; gap: .35rem; overflow-wrap: anywhere; }
.admin-users-page .role-badge { max-width: 100%; border-radius: 7px; font-size: .8125rem; }
.admin-users-page .table-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: .35rem; }
.admin-users-page .table-actions > *, .admin-users-page .table-actions .btn { width: 100%; min-width: 0; }
.admin-users-page .table-actions .btn { justify-content: flex-start; padding: .5rem .65rem; }
.admin-users-page .admin-search-form { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: center; gap: 1rem; width: 100%; }
.admin-users-page .admin-search-form .search-input-wrapper { width: 100%; min-width: 0; }
.admin-users-page .admin-search-form .filter-group { display: flex; flex-direction: row; flex-wrap: wrap; gap: .65rem; min-width: 0; }
.admin-users-page .admin-search-form select { flex: 1 1 150px; min-width: 0; width: auto; }

/* Stockage : candidat, précontrôles, résultat et étapes suivent tous le thème. */
.storage-test-card, .storage-test-result { background: var(--color-surface); }
.storage-test-safety, .storage-check.is-passed { color: var(--color-success); background: var(--color-success-bg); border-color: var(--color-success); }
.storage-check.is-failed { color: var(--color-danger); background: var(--color-danger-bg); border-color: var(--color-danger); }
.storage-test-notice.is-ready { color: var(--color-info); background: var(--color-info-bg); border: 1px solid var(--color-info); }
.storage-test-notice.is-blocked { color: var(--color-warning); background: var(--color-warning-bg); border: 1px solid var(--color-warning); }
.storage-test-steps li.is-passed > span { color: var(--color-on-semantic); background: var(--color-success); }
.storage-test-steps li.is-failed > span { color: var(--color-on-semantic); background: var(--color-danger); }

/* 404 : climatisation air-air split en mode froid, air et fluide distincts. */
.cvc-error-page { display: flex; flex-direction: column; align-items: center; gap: 1.25rem; max-width: 800px; margin: 0 auto; padding: 3rem 1.5rem 4rem; text-align: center; }
.cvc-error-page__eyebrow { color: var(--color-danger); font-size: .8125rem; font-weight: 700; letter-spacing: .12em; }
.cvc-error-page h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); line-height: 1.2; letter-spacing: -.035em; max-width: 650px; }
.cvc-error-page__message { color: var(--color-text-light); max-width: 580px; line-height: 1.7; }
.cvc-error-scene { width: 100%; max-width: 640px; }
.cvc-error-illustration { width: 100%; height: auto; display: block; }
.cvc-halo { fill: var(--color-info-bg); }
.cvc-wall { fill: none; stroke: var(--color-border); stroke-width: 5; }
.cvc-refrigerant { fill: none; stroke: var(--color-warning); stroke-linejoin: round; }
.cvc-refrigerant--liquid { stroke-width: 4; }
.cvc-refrigerant--gas { stroke-width: 8; }
.cvc-flow { fill: none; stroke-width: 3; stroke-dasharray: 9 12; stroke-linecap: round; }
.cvc-flow--cool { stroke: var(--color-info); }
.cvc-unit { fill: var(--color-surface); stroke: var(--color-border); stroke-width: 2; }
.cvc-unit-inset { fill: var(--color-bg-alt); }
.cvc-fan-ring { fill: var(--color-surface); stroke: var(--color-info); stroke-width: 2; }
.cvc-fan { fill: var(--color-info); transform-box: fill-box; transform-origin: center; }
.cvc-fan-hub { fill: var(--color-surface); stroke: var(--color-info); stroke-width: 2; }
.cvc-unit-detail, .cvc-ground { fill: none; stroke: var(--color-border); stroke-width: 3; stroke-linecap: round; }
.cvc-indoor-panel, .cvc-louvers { fill: none; stroke: var(--color-text-light); stroke-width: 2; stroke-linecap: round; }
.cvc-operation-light { fill: var(--color-success); }
.cvc-missing-link rect { fill: var(--color-warning-bg); stroke: var(--color-warning); stroke-width: 2; }
.cvc-missing-link path { fill: none; stroke: var(--color-warning); stroke-width: 4; stroke-linecap: round; }
.cvc-missing-link circle { fill: var(--color-warning); }
.cvc-404-number { fill: var(--color-info); font: 800 60px var(--font-family); letter-spacing: 6px; }
.cvc-motion-control { margin-top: .5rem; font-size: .8125rem; }
.cvc-motion-control[hidden] { display: none; }
.cvc-error-scene[data-motion] .cvc-fan { animation: cvc-fan-turn 12s linear infinite; }
.cvc-error-scene[data-motion] .cvc-flow { animation: cvc-air-flow 6s linear infinite; }
.cvc-error-scene[data-motion="paused"] .cvc-fan, .cvc-error-scene[data-motion="paused"] .cvc-flow { animation-play-state: paused; }
@keyframes cvc-fan-turn { to { transform: rotate(360deg); } }
@keyframes cvc-air-flow { to { stroke-dashoffset: -84; } }
@media (prefers-reduced-motion: reduce) {
  .cvc-error-scene .cvc-fan, .cvc-error-scene .cvc-flow { animation: none !important; }
}
@media (max-width: 600px) {
  .cvc-error-page { padding: 2rem 1rem 3rem; }
  .cvc-error-page > .btn { width: 100%; }
}

@media (max-width: 1200px) {
  .dashboard-main-grid { grid-template-columns: minmax(0, 1fr); }
  .page-gestion-demandes .gestion-table-card { background: transparent; border: 0; box-shadow: none; overflow: visible; }
  .page-gestion-demandes .gestion-table, .page-gestion-demandes .gestion-table tbody { display: block; width: 100%; }
  .page-gestion-demandes .gestion-table tbody { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
  .page-gestion-demandes .gestion-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .page-gestion-demandes .gestion-table tr { display: flex; flex-direction: column; min-width: 0; padding: 1.25rem; border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-surface); margin: 0; }
  .page-gestion-demandes .gestion-table .request-row--action { border-left: 4px solid var(--color-warning); }
  .page-gestion-demandes .gestion-table td { display: block; min-height: 0; padding: .5rem 0; border: 0; text-align: left; background: transparent; }
  .page-gestion-demandes .gestion-table td::before { content: attr(data-label); display: block; color: var(--color-text-light); font-size: .8125rem; margin-bottom: .35rem; }
  .page-gestion-demandes .gestion-table td:first-child, .page-gestion-demandes .gestion-table td:last-child { padding-left: 0; padding-right: 0; box-shadow: none; }
  .page-gestion-demandes .gestion-table td:last-child { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--color-border); }
  .page-gestion-demandes .gestion-table td > br { display: none; }
  .page-gestion-demandes .gestion-table td > small { display: block; }
  .page-gestion-demandes .gestion-table tbody tr:nth-child(even) td, .page-gestion-demandes .gestion-table tbody tr:hover td { background: transparent; }
}
@media (max-width: 1300px) {
  .admin-users-page .gestion-table-card { background: transparent; border: 0; box-shadow: none; overflow: visible; }
  .admin-users-page .gestion-table, .admin-users-page .gestion-table tbody { display: block; width: 100%; }
  .admin-users-page .gestion-table tbody { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
  .admin-users-page .gestion-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .admin-users-page .gestion-table tr { display: flex; flex-direction: column; min-width: 0; margin: 0; padding: 1.25rem; border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-surface); }
  .admin-users-page .gestion-table td { display: block; padding: .5rem 0; border: 0; min-height: 0; text-align: left; }
  .admin-users-page .gestion-table td::before { content: attr(data-label); display: block; margin-bottom: .35rem; color: var(--color-text-light); font-size: .8125rem; }
  .admin-users-page .gestion-table td:first-child, .admin-users-page .gestion-table td:last-child { padding-left: 0; padding-right: 0; }
  .admin-users-page .gestion-table td:last-child { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--color-border); }
  .admin-users-page .gestion-table tbody tr:nth-child(even) td, .admin-users-page .gestion-table tbody tr:hover td { background: transparent; }
}
@media (max-width: 768px) {
  .dashboard, .demandes-page, .gestion-demandes-page { padding: 1.5rem 1rem; }
  .dashboard-welcome { align-items: stretch; }
  .dashboard-welcome__action { width: 100%; }
  .dashboard-welcome__action .btn { width: 100%; }
  .dashboard-highlights { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
  .dashboard-highlight { padding: 1rem; }
  .dashboard-highlight:first-child { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .dashboard-highlight:first-child > strong { grid-column: 2; grid-row: 1 / 3; align-self: center; }
  .dashboard-highlight:first-child > span, .dashboard-highlight:first-child > small { grid-column: 1; }
  .dashboard-highlight .icon { display: none; }
  .dashboard-highlight > strong { font-size: 1.75rem; }
  .dashboard-shortcuts, .dashboard-notifications { padding: 1.25rem 1rem; }
  .demandes-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .demandes-overview__item { padding: 1rem; }
  .demande-card { padding: 1.25rem 1rem; }
  .demandes-list { grid-template-columns: minmax(0, 1fr); }
  .request-cell--amount { text-align: left; }
  .gestion-table .request-row--action { border-left: 4px solid var(--color-warning); }
  .gestion-table .request-row--action td:first-child { box-shadow: none; }
  .page-gestion-demandes .gestion-table tbody, .admin-users-page .gestion-table tbody { grid-template-columns: minmax(0, 1fr); }
  .gestion-table td { padding: .5rem 0; }
  .gestion-table tr { background: var(--color-surface); }
  .page-gestion-demandes .gestion-table td { display: block; text-align: left; min-height: 0; }
  .page-gestion-demandes .gestion-table td::before { display: block; margin-bottom: .35rem; }
  .page-gestion-demandes .gestion-table td > br { display: none; }
  .page-gestion-demandes .gestion-table td > small { display: block; }
  .gestion-table td:first-child, .gestion-table td:last-child { padding-left: 0; padding-right: 0; }
  .gestion-table tbody tr:nth-child(even) td, .gestion-table tbody tr:hover td { background: transparent; }
  .appearance-settings { flex-direction: column; }
  .admin-users-page .admin-search-form { grid-template-columns: minmax(0, 1fr); }
  .profil-grid { grid-template-columns: minmax(0, 1fr); }
  .profil-card { padding: 1.25rem; }
  .appearance-settings > div { flex-basis: auto; }
  .appearance-control { max-width: 100%; }
  .mobile-bottom-nav { background: var(--color-surface); }
  .appearance-settings .appearance-control { align-items: stretch; flex-direction: column; }
  .appearance-settings .appearance-option { flex-direction: column; gap: .125rem; padding: .25rem .375rem; }
}
@media print {
  :root, :root[data-theme="dark"], :root:not([data-theme]) {
    color-scheme: light;
    --color-bg: #fff; --color-bg-alt: #f3f6fa; --color-surface: #fff; --color-input-bg: #fff;
    --color-text: #1f2937; --color-text-light: #526174; --color-text-muted: #526174;
    --color-border: #cbd5e1; --color-border-light: #dce3ed;
    --color-primary: #285e93; --color-primary-dark: #214e7d; --color-primary-50: #eaf2fb;
    --color-info: #285e93; --color-info-bg: #eaf2fb; --color-success: #166534; --color-success-bg: #edf8f0;
    --color-warning: #9a480b; --color-warning-bg: #fff3e6; --color-danger: #b91c1c; --color-danger-bg: #fef0f0;
    --color-neutral-bg: #eef1f5; --color-on-primary: #fff; --color-on-semantic: #fff;
  }
  .appearance-control, .appearance-settings { display: none; }
  .cvc-motion-control { display: none; }
  .cvc-error-scene .cvc-fan, .cvc-error-scene .cvc-flow { animation: none !important; }
}
/* Retours d'envoi : même palette et mêmes surfaces dans les deux thèmes. */
.flash-message.transfer-notice { display:block; margin-bottom:1rem; overflow-wrap:anywhere; scroll-margin-top:6rem; }
.transfer-notice[hidden], .transfer-notice a[hidden] { display:none!important; }
.transfer-notice p { margin:0 0 .75rem; }
.transfer-notice:focus { outline:3px solid var(--color-primary); outline-offset:3px; }
.workflow-audit { margin:1.5rem 0; padding:1rem; border:1px solid var(--color-border); border-radius:var(--radius-lg); background:var(--color-surface); overflow-wrap:anywhere; }
.workflow-audit h2 { font-size:var(--font-size-lg); margin-bottom:.75rem; }
.workflow-audit ul { padding-left:1.25rem; }
.workflow-audit li { padding:.6rem 0; color:var(--color-text); }
.workflow-audit li p { margin:.35rem 0 0; color:var(--color-text-light); }
[data-auto-dismiss][hidden] { display:none!important; }
.welcome-notice { margin:1rem; }
