/* Construit et imaginé par Jean-François Avart */
/* Variables de base */
:root {
  --color-primary: #1fb8cd;
  --color-primary-light: #3cc8da;
  --color-primary-dark: #199aad;
  --color-secondary: #5d878f;
  --color-secondary-light: #78a2aa;
  --color-secondary-dark: #436972;
  --color-success: #32c086;
  --color-success-light: #4fd29a;
  --color-success-dark: #27a06d;
  --color-warning: #ffc185;
  --color-warning-light: #ffd1a6;
  --color-warning-dark: #db9f61;
  --color-danger: #db4545;
  --color-danger-light: #e26969;
  --color-danger-dark: #bb3030;
  --color-info: #5d878f;
  --color-info-light: #78a2aa;
  --color-info-dark: #436972;

  --color-background: #f8f9fa;
  --color-surface: #ffffff;
  --color-surface-secondary: #f2f3f5;
  /* FIX-AUDIT-CSS : alias des tokens historiquement utilisés par le module Analyse de
     risques (--color-bg / --color-bg-secondary n'ont JAMAIS existé → var() invalide,
     backgrounds transparents). Alias sur les tokens réels : les thèmes suivent. */
  --color-bg: var(--color-surface);
  --color-bg-secondary: var(--color-surface-secondary);
  --color-text: #2d3e4a;
  --color-text-light: #5a6a77;
  --color-text-secondary: #758592;
  --color-border: #e9ecef;

  /* Navigation category colors */
  --color-nav-fondations: #4682B4;
  --color-nav-gouvernance: #2E8B57;
  --color-nav-controles: #7B68EE;
  --color-nav-risques: #D4880F;
  --color-nav-nis2: #4B0082;

  /* Accent nouveauté V3 (mauve) — signe la version sur tous les thèmes */
  --color-v3-accent: #7F77DD;
  --color-v3-accent-on: #ffffff;

  /* Mode banner */
  --color-mode-local-start: #fdf6e3;
  --color-mode-local-end: #f4e9cf;
  --color-mode-edit-start: #e6f7f1;
  --color-mode-edit-end: #d4f2e8;
  --color-mode-locked-start: #fff4e0;
  --color-mode-locked-end: #ffe2b8;

  /* Domain colors */
  --color-domain-org: #3b82f6;
  --color-domain-human: #8b5cf6;
  --color-domain-physical: #f97316;
  --color-domain-tech: #06b6d4;

  /* History tags */
  --color-tag-manual: #0e7490;
  --color-tag-auto: #7c3aed;

  --border-radius-sm: 0.25rem;
  --border-radius: 0.5rem;
  --border-radius-lg: 0.75rem;
  --border-radius-xl: 1rem;
  --border-radius-full: 9999px;

  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;

  /* Typography - Using Inter for Light/Dark themes */
  --font-family: 'Inter', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-md: 1rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: 1.5rem;
  --font-size-xxl: 2rem;

  /* Typography refinements */
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.625;
  --letter-spacing-tight: -0.025em;
  --letter-spacing-normal: 0;
  --letter-spacing-wide: 0.025em;

  /* Enhanced shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.08), 0 4px 6px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1), 0 8px 10px rgba(0, 0, 0, 0.04);

  /* Transitions */
  --transition-duration: 0.2s;
  --transition-timing: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark mode auto-detection — only when no explicit theme class is set */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-background: #1a202c;
    --color-surface: #2d3748;
    --color-surface-secondary: #38465a;
    --color-text: #f7fafc;
    --color-text-light: #cbd5e0;
    --color-border: #4a5568;
  }
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  /* Smooth scrolling */
  scroll-behavior: smooth;
  /* Prevent font size inflation on mobile */
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  font-size: var(--font-size-md);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-background);

  /* Font rendering optimization */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
}

/* Selection styling */
::selection {
  background-color: var(--color-primary);
  color: var(--color-surface);
}

/* Focus visible: see enhanced version in UX Improvements section (~line 9429) */

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.header {
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: var(--spacing-md);
  box-shadow: var(--shadow-sm);
  position: relative;
  z-index: 30;
}

.header__content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-lg);
  max-width: 1400px;
  margin: 0 auto;
}

/* Refonte header 2026-07 — 3 zones : marque (souple), statut (largeur réservée), actions */
.header__brand {
  flex: 1 1 auto;
  min-width: 0;
}

/* Zone statut : largeur réservée même quand la présence est masquée — rien ne saute. */
.header__status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--spacing-sm);
  flex: 0 0 220px;
  min-width: 0;
}

.header__right {
  display: flex;
  justify-content: flex-end;
  min-width: 0;
  flex: 0 0 auto;
}

.header__title {
  font-size: var(--font-size-xl);
  margin: 0;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}
/* Pastille de version (V3) — mauve plein pour signer la nouveauté et
   décrocher du titre ; couleur d'accent partagée sur tous les thèmes. */
.header__version-badge {
  align-self: center;
  font-size: 0.55em;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  padding: 0.3em 0.6em;
  border-radius: 999px;
  border: 1px solid var(--color-v3-accent);
  background-color: var(--color-v3-accent);
  color: var(--color-v3-accent-on);
  transform: translateY(0.05em);
  user-select: none;
}
.header__subtitle {
  font-size: var(--font-size-sm);
  margin: 0;
  color: var(--color-secondary-dark);
  /* Align subtitle text with the title text, offsetting the icon width */
  padding-left: calc(1em + var(--spacing-sm));
}
.header__copyright {
  font-size: var(--font-size-xs);
  margin: 0;
  color: var(--color-text-light);
}

.footer {
  text-align: center;
  font-size: var(--font-size-xs);
  color: var(--color-text-light);
  margin: var(--spacing-md) 0;
}
.footer a {
  color: var(--color-primary);
  text-decoration: none;
  margin-left: var(--spacing-sm);
}
.footer a:hover {
  text-decoration: underline;
}
.footer__license {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
}
.footer__license-icons {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
}
.footer__version {
  color: var(--color-text-lighter, var(--color-text-light));
  margin-left: var(--spacing-xs);
  font-size: var(--font-size-sm);
  opacity: 0.7;
}

.header__actions {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  justify-content: flex-end;
  min-width: 0;
  gap: var(--spacing-sm);
}
.header__actions > * { flex-shrink: 0; }
.header__actions .btn { white-space: nowrap; }

/* Fix AA (refonte header 2026-07) : en thème clair (et avant pose de la classe thème),
   le vert de base ne contraste pas assez avec le texte blanc du bouton édition. */
body.theme-light #editModeBtn.btn--success,
body:not(.theme-dark):not(.theme-poudre):not(.theme-bleu) #editModeBtn.btn--success {
  background-color: var(--color-success-dark);
  border-color: var(--color-success-dark);
}

/* FALLBACK vieux markup (pas de .header__brand) : slot flottant historique du
   sélecteur de périmètre, entre la marque et les actions. Le markup 3 zones
   utilise désormais .csi-scope-breadcrumb (fil d'Ariane sous le titre). */
.csi-header-scope {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex: 0 1 230px;
  min-width: 160px;
  max-width: 240px;
}
/* Le trigger fil d'Ariane ajoute libellé + « › » : masqués dans la pastille
   fallback pour préserver son gabarit compact (icône + nom + caret). */
.csi-header-scope .csi-scope__label,
.csi-header-scope .csi-scope__chevron { display: none; }

/* Palier intermédiaire : nom du user masqué, zone statut resserrée */
@media (max-width: 1239px) {
  .csi-usermenu__name {
    display: none;
  }

  .header__status {
    flex-basis: 130px;
  }

  /* Libellé sync court : « HH:MM » tient, « Synchronisé » est tronqué proprement */
  .csi-sync-dot__text {
    max-width: 64px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 1120px) {
  /* Contrôles compacts (icônes + avatar) : tout tient sur UNE ligne,
     plus d'empilement — les zones gardent leur place, rien ne saute. */
  .header__brand {
    flex: 1 1 auto;
    min-width: 0;
  }

  .csi-header-scope {
    flex: 1 1 220px;
    max-width: 320px;
  }

  /* Pastilles seules : le texte de la pastille sync disparaît, le point reste */
  .header__status {
    flex-basis: 84px;
  }

  .csi-sync-dot__text {
    display: none;
  }

  /* Bouton édition icône seule (title/aria posés par updateEditModeButtonUi) */
  #editModeBtn span {
    display: none;
  }
}

/* Global search */
.global-search {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: var(--spacing-sm) var(--spacing-lg);
  box-shadow: var(--shadow-sm);
}
.global-search__inner {
  display: flex;
  gap: var(--spacing-sm);
  align-items: center;
  max-width: 900px;
  margin: 0 auto;
  position: relative;
}
/* V3 : champ affiné en pilule avec loupe intégrée — moins massif, plus fluide. */
.global-search__icon {
  position: absolute;
  left: var(--spacing-md);
  color: var(--color-text-light);
  font-size: var(--font-size-sm);
  pointer-events: none;
}
/* Spécificité 0-3-0 : doit gagner sur les overrides de thème (body.theme-* .form-control). */
.global-search .global-search__inner .form-control {
  padding: 0.45rem var(--spacing-md) 0.45rem 2.4rem;
  font-size: var(--font-size-sm);
  border-radius: 999px;
}
.global-search .global-search__inner .btn {
  border-radius: 999px;
  white-space: nowrap;
}
.global-search__results {
  max-width: 900px;
  margin: var(--spacing-sm) auto 0;
  display: grid;
  gap: var(--spacing-xs);
}
.global-search__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  background: var(--color-surface-secondary);
  cursor: pointer;
  text-align: left;
}
.global-search__item:hover {
  border-color: var(--color-primary);
}
.global-search__label {
  flex: 1;
  color: var(--color-text);
  font-weight: 600;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  min-width: 0;
}
.global-search__label mark {
  background-color: rgba(255, 213, 0, 0.35);
  color: inherit;
  border-radius: var(--border-radius-sm);
  padding: 0 1px;
}
.global-search__context {
  font-size: var(--font-size-xs);
  font-weight: 400;
  color: var(--color-text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.global-search__type {
  font-size: var(--font-size-xs);
  color: var(--color-text-light);
  text-transform: uppercase;
  white-space: nowrap;
}
.global-search__module {
  font-size: var(--font-size-sm);
  color: var(--color-primary);
  white-space: nowrap;
}

body.mode-readonly #serverSyncBtn {
  display: none;
}

/* Read-only banner */
/* Refonte header 2026-07 : bandeau resserré — une seule barre discrète
   (états lecture seule / édition / verrouillé+takeover inchangés). */
.mode-banner {
  background: linear-gradient(90deg, var(--color-mode-local-start), var(--color-mode-local-end));
  border-bottom: 1px solid var(--color-border);
  padding: var(--spacing-xs) var(--spacing-lg);
  min-height: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-md);
  box-shadow: var(--shadow-sm);
}

.mode-banner--edit {
  background: linear-gradient(90deg, var(--color-mode-edit-start), var(--color-mode-edit-end));
}

.mode-banner--locked-by-other {
  background: linear-gradient(90deg, var(--color-mode-locked-start), var(--color-mode-locked-end));
  border-bottom-color: #f0a500;
}

.mode-banner__info {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--spacing-xs) var(--spacing-md);
  min-width: 0;
}

.mode-banner__status {
  font-weight: 700;
  font-size: var(--font-size-sm);
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  color: var(--color-text);
}

.mode-banner__subtitle {
  font-size: var(--font-size-xs);
  color: var(--color-text-light);
}

.mode-banner__actions {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.mode-banner__countdown {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

body.mode-readonly [data-readonly-lock] {
  opacity: 0.6;
  cursor: not-allowed;
}

body.mode-readonly .form-control[disabled] {
  background-color: var(--color-surface-secondary);
  color: var(--color-text-light);
}

body.theme-dark .mode-banner {
  background: linear-gradient(90deg, #1f2937, #111827);
}


.history-list {
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: var(--spacing-sm);
  max-height: 260px;
  overflow-y: auto;
  background: var(--color-surface-secondary);
}
.history-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: var(--spacing-xs) 0;
  border-bottom: 1px solid var(--color-border);
}
.history-item:last-child {
  border-bottom: none;
}
.history-item__info {
  display: grid;
  gap: var(--spacing-xs);
}
.history-item__headline {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  flex-wrap: wrap;
}
.history-item__title {
  font-size: var(--font-size-sm);
  color: var(--color-text);
}
.history-item__meta {
  font-size: var(--font-size-xs);
  color: var(--color-text-light);
}
.history-item__tag {
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--border-radius-full);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-light);
}
.history-item__tag--manuel {
  border-color: rgba(14, 116, 144, 0.2);
  color: var(--color-tag-manual);
}
.history-item__tag--auto {
  border-color: rgba(124, 58, 237, 0.2);
  color: var(--color-tag-auto);
}
.history-item__actions {
  display: flex;
  gap: var(--spacing-xs);
}

/* Explicit theme classes to override prefers-color-scheme */
body.theme-light {
  --color-background: #f8f9fa;
  --color-surface: #ffffff;
  --color-surface-secondary: #f2f3f5;
  --color-text: #2d3e4a;
  --color-text-light: #5a6a77;
  --color-border: #e9ecef;
}

body.theme-dark {
  --color-background: #0f172a;
  --color-surface: #1e293b;
  --color-surface-secondary: #334155;
  --color-text: #f1f5f9;
  --color-text-light: #cbd5e1;
  --color-text-secondary: #94a3b8;
  --color-border: #334155;

  /* Enhanced dark mode colors */
  --color-primary: #38bdf8;
  --color-primary-light: #7dd3fc;
  --color-primary-dark: #0ea5e9;
  --color-success: #4ade80;
  --color-success-light: #86efac;
  --color-warning: #fbbf24;
  --color-warning-light: #fcd34d;
  --color-danger: #f87171;
  --color-danger-light: #fca5a5;

  /* Dark mode shadows with blue tint */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4), 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.45), 0 4px 8px rgba(0, 0, 0, 0.25);

  /* Navigation category colors — lighter for dark bg */
  --color-nav-fondations: #7db8e0;
  --color-nav-gouvernance: #5ccf8d;
  --color-nav-controles: #aa9af7;
  --color-nav-risques: #f0b84e;
  --color-nav-nis2: #9e63d4;

  /* Mode banner — dark-adapted gradients */
  --color-mode-local-start: #1f2937;
  --color-mode-local-end: #111827;
  --color-mode-edit-start: #14342a;
  --color-mode-edit-end: #0f2920;
  --color-mode-locked-start: #3a2710;
  --color-mode-locked-end: #2c1d08;

  /* Domain colors — lighter for dark bg */
  --color-domain-org: #60a5fa;
  --color-domain-human: #a78bfa;
  --color-domain-physical: #fb923c;
  --color-domain-tech: #22d3ee;

  /* History tags — lighter for dark bg */
  --color-tag-manual: #22d3ee;
  --color-tag-auto: #a78bfa;
}

body.theme-poudre {
  /* Couleurs principales - Tons poudrés modernisés */
  --color-primary: #c2706f;
  --color-primary-light: #e8c4c3;
  --color-primary-dark: #a25a59;
  --color-secondary: #8fa8b5;
  --color-secondary-light: #d4e4ea;
  --color-secondary-dark: #5f7a8a;
  --color-success: #6db28c;
  --color-success-light: #c8e6d5;
  --color-success-dark: #4d8a68;
  --color-warning: #dba66a;
  --color-warning-light: #f5dfc0;
  --color-warning-dark: #b8854a;
  --color-danger: #d46b6b;
  --color-danger-light: #f0c0c0;
  --color-danger-dark: #b04a4a;
  --color-info: #7aa8c2;
  --color-info-light: #c8dfe9;
  --color-info-dark: #5a88a2;

  /* Backgrounds - Plus lumineux et aérés */
  --color-background: #f8f4ef;
  --color-surface: #ffffff;
  --color-surface-secondary: #faf5f2;

  /* Textes - Contraste optimisé */
  --color-text: #4a4340;
  --color-text-light: #6b6360;
  --color-text-secondary: #8a8280;
  --color-border: #e8dcd6;

  /* Border-radius généreux et modernes */
  --border-radius-sm: 0.625rem;
  --border-radius: 1rem;
  --border-radius-lg: 1.5rem;

  /* Ombres douces et modernes */
  --shadow-sm: 0 2px 8px rgba(74, 67, 64, 0.06);
  --shadow-md: 0 4px 20px rgba(74, 67, 64, 0.08), 0 2px 8px rgba(74, 67, 64, 0.04);
  --shadow-lg: 0 12px 40px rgba(74, 67, 64, 0.10), 0 4px 12px rgba(74, 67, 64, 0.05);
  --shadow-xl: 0 24px 60px rgba(74, 67, 64, 0.12), 0 8px 20px rgba(74, 67, 64, 0.06);

  /* Typography - DM Sans moderne et arrondie */
  --font-family: "DM Sans", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;

  /* Typographie fluide */
  --line-height-tight: 1.25;
  --line-height-normal: 1.6;
  --line-height-relaxed: 1.75;
  --letter-spacing-tight: -0.015em;
}

body.theme-poudre .header__subtitle {
  color: var(--color-secondary);
}

body.theme-poudre {
  background-image:
    radial-gradient(circle at 12% 18%, rgba(225, 194, 194, 0.4), transparent 55%),
    radial-gradient(circle at 88% -8%, rgba(226, 240, 243, 0.6), transparent 60%),
    radial-gradient(circle at 92% 88%, rgba(203, 207, 215, 0.35), transparent 55%),
    linear-gradient(180deg, #fffaf6 0%, #f2ebdf 58%, #fce8dd 100%);
  background-attachment: fixed;
}

/* Animations et micro-interactions */
@keyframes moderne-fade-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes moderne-scale-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes moderne-glow {
  0%, 100% { box-shadow: 0 0 8px rgba(192, 108, 109, 0.2); }
  50% { box-shadow: 0 0 20px rgba(192, 108, 109, 0.35); }
}

/* =============================================================================
   THEME BLEU - Palette professionnelle bleue et or
   ============================================================================= */

body.theme-bleu {
  /* Couleurs principales */
  --color-primary: #0000B3;
  --color-primary-light: #3333CC;
  --color-primary-dark: #000080;

  /* Accent - Or */
  --color-accent: #FBBD00;
  --color-accent-light: #FFF2CC;
  --color-accent-dark: #D9A300;

  /* Secondaire - Gris */
  --color-secondary: #44546A;
  --color-secondary-light: #5D6E84;
  --color-secondary-dark: #2D3A4A;

  /* Couleurs sémantiques */
  --color-success: #70AD47;
  --color-success-light: #C2D888;
  --color-success-dark: #5A8B39;
  --color-warning: #FBBD00;
  --color-warning-light: #FFF2CC;
  --color-warning-dark: #D9A300;
  --color-danger: #C00000;
  --color-danger-light: #F6D9DF;
  --color-danger-dark: #8B0000;
  --color-info: #0563C1;
  --color-info-light: #B4D7F0;
  --color-info-dark: #044A8C;

  /* Backgrounds */
  --color-background: #F5F7FA;
  --color-surface: #FFFFFF;
  --color-surface-secondary: #EEF2F7;

  /* Textes */
  --color-text: #2C3E50;
  --color-text-light: #44546A;
  --color-text-secondary: #6C757D;
  --color-border: #DEE2E6;

  /* Border radius */
  --border-radius-sm: 0.375rem;
  --border-radius: 0.75rem;
  --border-radius-lg: 1rem;

  /* Ombres avec teinte bleue */
  --shadow-sm: 0 1px 3px rgba(0, 0, 179, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 179, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 8px 24px rgba(0, 0, 179, 0.10), 0 4px 8px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 16px 40px rgba(0, 0, 179, 0.12), 0 8px 16px rgba(0, 0, 0, 0.06);
  --shadow-glow: 0 0 20px rgba(0, 0, 179, 0.15);

  /* Typography */
  --font-family: "Verdana", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;

  /* Typographie */
  --line-height-tight: 1.25;
  --line-height-normal: 1.6;
  --line-height-relaxed: 1.75;
  --letter-spacing-tight: -0.01em;
  --letter-spacing-normal: 0;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #0000B3 0%, #000080 100%);
  --gradient-accent: linear-gradient(135deg, #FBBD00 0%, #D9A300 100%);
  --gradient-surface: linear-gradient(180deg, #FFFFFF 0%, #F5F7FA 100%);
}

/* Background avec touches de bleu subtiles */
body.theme-bleu {
  background:
    radial-gradient(ellipse at 10% 20%, rgba(0, 0, 179, 0.03), transparent 50%),
    radial-gradient(ellipse at 90% 80%, rgba(251, 189, 0, 0.04), transparent 50%),
    linear-gradient(180deg, #FFFFFF 0%, #F5F7FA 100%);
  background-attachment: fixed;
}

/* Header */
body.theme-bleu .header {
  background: var(--gradient-surface);
  border-bottom: 2px solid var(--color-primary);
}

body.theme-bleu .header__title {
  color: var(--color-primary);
  font-weight: 700;
}

body.theme-bleu .header__title i {
  color: var(--color-accent);
}

body.theme-bleu .header__subtitle {
  color: var(--color-secondary);
}

/* Boutons */
body.theme-bleu .btn-primary,
body.theme-bleu .btn--primary {
  background: var(--gradient-primary);
  border: none;
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

body.theme-bleu .btn-primary:hover,
body.theme-bleu .btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

body.theme-bleu .btn-secondary,
body.theme-bleu .btn--secondary {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

body.theme-bleu .btn-secondary:hover,
body.theme-bleu .btn--secondary:hover {
  border-color: var(--color-primary-light);
  color: var(--color-primary);
}

/* Navigation */
body.theme-bleu .nav__item--active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

body.theme-bleu .nav__item--active::after {
  background: var(--color-primary);
}

body.theme-bleu .nav__item:hover {
  color: var(--color-primary);
}

/* Cards et surfaces */
body.theme-bleu .card,
body.theme-bleu .panel,
body.theme-bleu .chart-card,
body.theme-bleu .kpi-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

body.theme-bleu .card:hover,
body.theme-bleu .panel:hover,
body.theme-bleu .chart-card:hover,
body.theme-bleu .kpi-card:hover {
  border-color: var(--color-primary-light);
  box-shadow: var(--shadow-md);
}

/* Formulaires */
body.theme-bleu .form-control:focus,
body.theme-bleu input:focus,
body.theme-bleu select:focus,
body.theme-bleu textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 0, 179, 0.1);
}

/* Tables -- see consolidated rules below (line ~1297) */

/* Badges */
body.theme-bleu .badge-primary {
  background: rgba(0, 0, 179, 0.1);
  color: var(--color-primary);
}

body.theme-bleu .badge-success {
  background: rgba(112, 173, 71, 0.12);
  color: var(--color-success-dark);
}

body.theme-bleu .badge-warning {
  background: rgba(251, 189, 0, 0.15);
  color: #8B6914;
}

body.theme-bleu .badge-danger {
  background: rgba(192, 0, 0, 0.1);
  color: var(--color-danger);
}

/* Progress bars */
body.theme-bleu .progress-bar,
body.theme-bleu .progress__fill {
  background: var(--gradient-primary);
}

/* KPI cards spécifiques */
body.theme-bleu .kpi-card--primary {
  border-left: 4px solid var(--color-primary);
}

body.theme-bleu .kpi-card--success {
  border-left: 4px solid var(--color-success);
}

body.theme-bleu .kpi-card--warning {
  border-left: 4px solid var(--color-accent);
}

body.theme-bleu .kpi-card--danger {
  border-left: 4px solid var(--color-danger);
}

/* Modal */
body.theme-bleu .modal__header {
  border-bottom-color: var(--color-primary);
}

/* Scrollbar */
body.theme-bleu ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

body.theme-bleu ::-webkit-scrollbar-track {
  background: var(--color-surface-secondary);
}

body.theme-bleu ::-webkit-scrollbar-thumb {
  background: var(--color-secondary);
  border-radius: var(--border-radius-sm);
}

body.theme-bleu ::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* Focus visible */
body.theme-bleu :focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Selection */
body.theme-bleu ::selection {
  background-color: rgba(0, 0, 179, 0.2);
  color: var(--color-text);
}

/* App container */
body.theme-bleu .app {
  background: transparent;
}

/* Header et navigation complets */
body.theme-bleu .header,
body.theme-bleu .nav,
body.theme-bleu .nav--tertiary,
body.theme-bleu .nav-ribbon,
body.theme-bleu .global-search {
  background-color: rgba(245, 247, 250, 0.95);
  border-bottom-color: rgba(0, 0, 179, 0.15);
  box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

body.theme-bleu .nav--secondary {
  background-color: rgba(238, 242, 247, 0.9);
  border-bottom-color: rgba(0, 0, 179, 0.1);
}

body.theme-bleu .header__title,
body.theme-bleu .module__title,
body.theme-bleu .chart-card__title,
body.theme-bleu .modal__title {
  color: var(--color-primary);
  font-weight: 700;
  letter-spacing: -0.01em;
}

body.theme-bleu .header__title {
  font-family: var(--font-family);
}

body.theme-bleu .module__subtitle,
body.theme-bleu .chart-card__subtitle {
  color: var(--color-text-secondary);
}

body.theme-bleu .nav__content {
  gap: var(--spacing-xs);
  padding: var(--spacing-sm) 0;
}

body.theme-bleu .nav__item {
  border-radius: var(--border-radius);
  padding: var(--spacing-sm) var(--spacing-md);
  font-weight: 500;
  color: var(--color-text-light);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body.theme-bleu .nav__item:hover {
  background-color: rgba(0, 0, 179, 0.08);
  color: var(--color-primary);
}

body.theme-bleu .nav__item--active {
  background-color: rgba(0, 0, 179, 0.12);
  color: var(--color-primary);
  font-weight: 600;
}

body.theme-bleu .nav__item--active::after {
  display: none;
}

/* Global search */
body.theme-bleu .global-search__item {
  background: var(--color-surface);
  border-radius: var(--border-radius-xl);
  border-color: rgba(203, 207, 215, 0.75);
}

body.theme-bleu .global-search__item:hover {
  border-color: rgba(0, 0, 179, 0.5);
  box-shadow: 0 8px 16px rgba(0, 0, 179, 0.12);
}

body.theme-bleu .global-search__type {
  letter-spacing: 0.08em;
}

/* Mode banner */
body.theme-bleu .mode-banner {
  background: linear-gradient(90deg, #EEF2F7, #F5F7FA);
  border-bottom-color: rgba(0, 0, 179, 0.15);
}

body.theme-bleu .mode-banner--edit {
  background: linear-gradient(90deg, #E8F4E8, #F5F7FA);
}

body.theme-bleu .mode-banner--locked-by-other {
  background: linear-gradient(90deg, #FBE8C8, #F5F7FA);
  border-bottom-color: rgba(240, 165, 0, 0.5);
}

/* Boutons complets */
body.theme-bleu .btn {
  background-color: var(--color-surface);
  border-color: var(--color-border);
  border-radius: var(--border-radius-lg);
  color: var(--color-text);
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body.theme-bleu .btn:hover {
  background-color: var(--color-surface-secondary);
  transform: translateY(-1px);
}

body.theme-bleu .btn--primary {
  background: var(--gradient-primary);
  border: none;
  border-radius: var(--border-radius-lg);
  box-shadow: 0 4px 14px rgba(0, 0, 179, 0.25);
  color: #fff;
  font-weight: 600;
}

body.theme-bleu .btn--primary:hover {
  background: linear-gradient(135deg, #3333CC 0%, #0000B3 100%);
  box-shadow: 0 6px 20px rgba(0, 0, 179, 0.35);
  transform: translateY(-2px);
}

body.theme-bleu .btn--secondary {
  background: linear-gradient(135deg, #5D6E84 0%, #44546A 100%);
  border: none;
  border-radius: var(--border-radius-lg);
  box-shadow: 0 4px 14px rgba(68, 84, 106, 0.25);
  color: #fff;
  font-weight: 600;
}

body.theme-bleu .btn--secondary:hover {
  background: linear-gradient(135deg, #44546A 0%, #2D3A4A 100%);
  box-shadow: 0 6px 20px rgba(68, 84, 106, 0.35);
  transform: translateY(-2px);
}

body.theme-bleu .btn--outline {
  background-color: transparent;
  border: 1.5px solid var(--color-primary-light);
  border-radius: var(--border-radius-lg);
  color: var(--color-primary);
}

body.theme-bleu .btn--outline:hover {
  background-color: rgba(0, 0, 179, 0.08);
  border-color: var(--color-primary);
}

body.theme-bleu .btn--danger {
  background: linear-gradient(135deg, #D42020 0%, #C00000 100%);
  border: none;
  border-radius: var(--border-radius-lg);
  box-shadow: 0 4px 14px rgba(192, 0, 0, 0.25);
  color: #fff;
}

body.theme-bleu .btn--danger:hover {
  background: linear-gradient(135deg, #C00000 0%, #8B0000 100%);
  box-shadow: 0 6px 20px rgba(192, 0, 0, 0.35);
  transform: translateY(-2px);
}
body.theme-bleu .btn--success {
  background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
  border: none;
  border-radius: var(--border-radius-lg);
  box-shadow: 0 4px 14px rgba(30, 126, 52, 0.25);
  color: #fff;
}
body.theme-bleu .btn--success:hover {
  background: linear-gradient(135deg, #1e7e34 0%, #155724 100%);
  box-shadow: 0 6px 20px rgba(30, 126, 52, 0.35);
  transform: translateY(-2px);
}

/* Formulaires complets */
body.theme-bleu .form-control {
  background-color: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: 0.625rem var(--spacing-md);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body.theme-bleu .form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 0, 179, 0.12);
  outline: none;
}

body.theme-bleu .form-control[readonly] {
  background-color: var(--color-surface-secondary);
}

/* Tables complets */
body.theme-bleu .table-container {
  border: 1px solid rgba(0, 0, 179, 0.15);
  box-shadow: var(--shadow-md);
  background: linear-gradient(180deg, #FFFFFF 0%, #F5F7FA 100%);
}

body.theme-bleu .table th {
  background-color: rgba(0, 0, 179, 0.06);
  color: var(--color-secondary-dark);
  border-bottom: 2px solid var(--color-primary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body.theme-bleu .table tbody tr:nth-child(even) {
  background-color: rgba(0, 0, 179, 0.02);
}

body.theme-bleu .table tbody tr:hover {
  background-color: rgba(0, 0, 179, 0.06);
}

/* Info box */
body.theme-bleu .info-box {
  background-color: rgba(5, 99, 193, 0.08);
  border-left-color: var(--color-info);
  box-shadow: var(--shadow-sm);
}

body.theme-bleu .info-box__icon {
  color: var(--color-info);
}

/* Chart cards */
body.theme-bleu .chart-card {
  background: linear-gradient(145deg, #ffffff 0%, #F5F7FA 100%);
  border: 1px solid rgba(0, 0, 179, 0.1);
  border-radius: var(--border-radius-xl);
  box-shadow: 0 4px 20px rgba(0, 0, 179, 0.06);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body.theme-bleu .chart-card:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 179, 0.12);
}

body.theme-bleu .chart-legend {
  border-color: rgba(0, 0, 179, 0.1);
  border-radius: var(--border-radius-lg);
  background: rgba(255, 255, 255, 0.8);
}

/* KPI cards complets */
body.theme-bleu .kpi-card {
  background: linear-gradient(145deg, #ffffff 0%, #F5F7FA 100%);
  border: 1px solid rgba(0, 0, 179, 0.1);
  border-radius: var(--border-radius-xl);
  box-shadow: 0 4px 20px rgba(0, 0, 179, 0.06);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body.theme-bleu .kpi-card:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 179, 0.12);
  transform: translateY(-2px);
}

body.theme-bleu .kpi-card--primary {
  --kpi-accent: #0000B3;
  --kpi-accent-soft: rgba(0, 0, 179, 0.12);
  --kpi-border: rgba(0, 0, 179, 0.25);
}

body.theme-bleu .kpi-card--success {
  --kpi-accent: #70AD47;
  --kpi-accent-soft: rgba(112, 173, 71, 0.12);
  --kpi-border: rgba(112, 173, 71, 0.25);
}

body.theme-bleu .kpi-card--warning {
  --kpi-accent: #FBBD00;
  --kpi-accent-soft: rgba(251, 189, 0, 0.12);
  --kpi-border: rgba(251, 189, 0, 0.25);
}

body.theme-bleu .kpi-card--danger {
  --kpi-accent: #C00000;
  --kpi-accent-soft: rgba(192, 0, 0, 0.12);
  --kpi-border: rgba(192, 0, 0, 0.25);
}

body.theme-bleu .kpi-card--info {
  --kpi-accent: #0563C1;
  --kpi-accent-soft: rgba(5, 99, 193, 0.12);
  --kpi-border: rgba(5, 99, 193, 0.25);
}

/* KPI cards couleurs secondaires */
body.theme-bleu .kpi-card--purple {
  --kpi-accent: #7030A0;
  --kpi-accent-soft: rgba(112, 48, 160, 0.12);
  --kpi-border: rgba(112, 48, 160, 0.25);
}

body.theme-bleu .kpi-card--cyan {
  --kpi-accent: #00B0F0;
  --kpi-accent-soft: rgba(0, 176, 240, 0.12);
  --kpi-border: rgba(0, 176, 240, 0.25);
}

body.theme-bleu .kpi-card--orange {
  --kpi-accent: #ED7D31;
  --kpi-accent-soft: rgba(237, 125, 49, 0.12);
  --kpi-border: rgba(237, 125, 49, 0.25);
}

body.theme-bleu .kpi-card--blue {
  --kpi-accent: #0563C1;
  --kpi-accent-soft: rgba(5, 99, 193, 0.12);
  --kpi-border: rgba(5, 99, 193, 0.25);
}

body.theme-bleu .kpi-card--teal {
  --kpi-accent: #00B050;
  --kpi-accent-soft: rgba(0, 176, 80, 0.12);
  --kpi-border: rgba(0, 176, 80, 0.25);
}

body.theme-bleu .kpi-card--amber {
  --kpi-accent: #FFC000;
  --kpi-accent-soft: rgba(255, 192, 0, 0.12);
  --kpi-border: rgba(255, 192, 0, 0.25);
}

/* Dashboard Hero */
body.theme-bleu .score-global {
  background: linear-gradient(145deg, #ffffff 0%, #F5F7FA 100%);
  border: 1px solid rgba(0, 0, 179, 0.15);
}

body.theme-bleu .score-global__track {
  stroke: rgba(0, 0, 179, 0.15);
  stroke-dasharray: 8 4;
}

body.theme-bleu .score-global__value {
  fill: var(--color-text);
}

body.theme-bleu .score-global__label {
  fill: var(--color-text-secondary);
}

body.theme-bleu .score-global__dot--iso { background: linear-gradient(135deg, #0000B3, #70AD47); }
body.theme-bleu .score-global__dot--nis2 { background: linear-gradient(135deg, #0563C1, #7030A0); }
body.theme-bleu .score-global__dot--risk { background: linear-gradient(135deg, #FBBD00, #C00000); }

/* Dashboard alerts */
body.theme-bleu .dashboard-alerts {
  background: linear-gradient(145deg, #ffffff 0%, #F5F7FA 100%);
  border: 1px solid rgba(192, 0, 0, 0.15);
}

body.theme-bleu .dashboard-alerts__header {
  color: var(--color-primary);
}
body.theme-bleu .dashboard-activity {
  background: linear-gradient(145deg, #ffffff 0%, #F5F7FA 100%);
  border: 1px solid rgba(0, 0, 179, 0.12);
}
body.theme-bleu .dashboard-activity__header { color: var(--color-primary); }

body.theme-bleu .alert-item {
  background: #F5F7FA;
  border: 1px solid rgba(0, 0, 179, 0.08);
}

body.theme-bleu .alert-item:hover {
  background: #EEF2F7;
  box-shadow: 0 2px 8px rgba(0, 0, 179, 0.08);
}

body.theme-bleu .alert-item__icon--critical {
  background: rgba(192, 0, 0, 0.12);
  color: #8B0000;
}

body.theme-bleu .alert-item__icon--warning {
  background: rgba(251, 189, 0, 0.15);
  color: #8B6914;
}

body.theme-bleu .alert-item__icon--info {
  background: rgba(5, 99, 193, 0.15);
  color: #044A8C;
}

body.theme-bleu .alert-item__icon--purple {
  background: rgba(112, 48, 160, 0.15);
  color: #5A2080;
}

/* Chart mini legend */
body.theme-bleu .chart-mini-legend__value {
  color: var(--color-text);
}

/* Activity items */
body.theme-bleu .activity-item {
  border-bottom-color: rgba(0, 0, 179, 0.08);
}

body.theme-bleu .activity-item__icon--control { background: rgba(112, 173, 71, 0.15); color: #5A8B39; }
body.theme-bleu .activity-item__icon--action { background: rgba(251, 189, 0, 0.15); color: #8B6914; }
body.theme-bleu .activity-item__icon--risk { background: rgba(192, 0, 0, 0.15); color: #8B0000; }
body.theme-bleu .activity-item__icon--audit { background: rgba(5, 99, 193, 0.15); color: #044A8C; }
body.theme-bleu .activity-item__icon--doc { background: rgba(112, 48, 160, 0.15); color: #5A2080; }
body.theme-bleu .activity-item__icon--nc { background: rgba(0, 0, 179, 0.15); color: #000080; }

/* Chart filters */
body.theme-bleu .chart-filters {
  background: rgba(0, 0, 179, 0.06);
}

body.theme-bleu .chart-filter {
  color: var(--color-text-secondary);
}

body.theme-bleu .chart-filter--active {
  background: var(--color-primary);
  color: #fff;
}

/* Dashboard footer */
body.theme-bleu .dashboard-footer {
  border-top-color: rgba(0, 0, 179, 0.1);
}

/* KPI trends */
body.theme-bleu .kpi-card__trend--up {
  color: var(--color-success);
  background: rgba(112, 173, 71, 0.1);
}

body.theme-bleu .kpi-card__trend--down {
  color: var(--color-danger);
  background: rgba(192, 0, 0, 0.1);
}

/* Progress bars */
body.theme-bleu .progress-bar {
  background: var(--color-surface-secondary);
}

body.theme-bleu .progress-bar__fill {
  background: var(--gradient-primary);
}

/* Status badges */
body.theme-bleu .status-badge--non_implemente {
  background: rgba(192, 0, 0, 0.1);
  color: #8B0000;
}

body.theme-bleu .status-badge--en_cours {
  background: rgba(251, 189, 0, 0.15);
  color: #8B6914;
}

body.theme-bleu .status-badge--implemente {
  background: rgba(112, 173, 71, 0.12);
  color: #5A8B39;
}

body.theme-bleu .status-badge--verifie {
  background: rgba(0, 0, 179, 0.1);
  color: #000080;
}

body.theme-bleu .status-badge--insignifiant {
  background: rgba(180, 197, 211, 0.25);
  color: #44546A;
}

body.theme-bleu .status-badge--significatif {
  background: rgba(251, 189, 0, 0.15);
  color: #8B6914;
}

body.theme-bleu .status-badge--grave {
  background: rgba(237, 125, 49, 0.15);
  color: #B85F20;
}

body.theme-bleu .status-badge--critique {
  background: rgba(192, 0, 0, 0.12);
  color: #8B0000;
}

body.theme-bleu .status-badge--non-applicable {
  background: rgba(68, 84, 106, 0.1);
  color: #44546A;
}

/* SOA styles */
body.theme-bleu .soa-link {
  color: var(--color-primary);
}

body.theme-bleu .soa-link:hover {
  color: var(--color-primary-dark);
}

body.theme-bleu .soa-alert--warning {
  background: rgba(251, 189, 0, 0.1);
  border-color: rgba(251, 189, 0, 0.3);
}

body.theme-bleu .soa-alert__icon {
  color: #8B6914;
}

body.theme-bleu .soa-alert__content strong {
  color: var(--color-text);
}

body.theme-bleu .highlight-row {
  background: rgba(251, 189, 0, 0.08);
}

/* SOA risk badges */
body.theme-bleu .soa-risks__badge--critique {
  background: rgba(192, 0, 0, 0.12);
  color: #8B0000;
}

body.theme-bleu .soa-risks__badge--grave {
  background: rgba(237, 125, 49, 0.15);
  color: #B85F20;
}

body.theme-bleu .soa-risks__badge--significatif {
  background: rgba(251, 189, 0, 0.15);
  color: #8B6914;
}

body.theme-bleu .soa-risks__badge--mineur {
  background: rgba(0, 176, 80, 0.12);
  color: #008040;
}

body.theme-bleu .soa-risks__badge--insignifiant {
  background: rgba(180, 197, 211, 0.2);
  color: #44546A;
}

body.theme-bleu .soa-risks__empty {
  color: var(--color-text-secondary);
}

/* SOA row styles */
body.theme-bleu .soa-row--applicable {
  background: rgba(112, 173, 71, 0.04);
}

body.theme-bleu .soa-row--applicable:hover {
  background: rgba(112, 173, 71, 0.08);
}

body.theme-bleu .soa-row--not-applicable {
  background: rgba(68, 84, 106, 0.04);
}

body.theme-bleu .soa-row--not-applicable:hover {
  background: rgba(68, 84, 106, 0.08);
}

body.theme-bleu .soa-row--not-applicable td:first-child,
body.theme-bleu .soa-row--not-applicable td:nth-child(2) {
  opacity: 0.7;
}

/* SOA justification */
body.theme-bleu .soa-justification,
body.theme-bleu .doc-review-justification,
body.theme-bleu .doc-review-tool {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
}

body.theme-bleu .soa-justification:focus,
body.theme-bleu .doc-review-justification:focus,
body.theme-bleu .doc-review-tool:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 0, 179, 0.1);
}

body.theme-bleu .table textarea.form-control:valid:not(:placeholder-shown) {
  border-color: var(--color-success);
}

/* Priority badges */
body.theme-bleu .priority--low {
  background: rgba(112, 173, 71, 0.12);
  color: #5A8B39;
}

body.theme-bleu .priority--medium {
  background: rgba(251, 189, 0, 0.15);
  color: #8B6914;
}

body.theme-bleu .priority--high {
  background: rgba(237, 125, 49, 0.15);
  color: #B85F20;
}

body.theme-bleu .priority--critical {
  background: rgba(192, 0, 0, 0.12);
  color: #8B0000;
}

/* Matrix cells */
body.theme-bleu .matrix-cell--insignifiant { background-color: rgba(180, 197, 211, 0.2); }
body.theme-bleu .matrix-cell--mineur { background-color: rgba(0, 176, 80, 0.15); }
body.theme-bleu .matrix-cell--significatif { background-color: rgba(251, 189, 0, 0.18); }
body.theme-bleu .matrix-cell--grave { background-color: rgba(237, 125, 49, 0.18); }
body.theme-bleu .matrix-cell--critique { background-color: rgba(192, 0, 0, 0.18); }

/* Chips */
body.theme-bleu .chip--phase {
  background: rgba(0, 0, 179, 0.08);
  color: var(--color-primary);
}

body.theme-bleu .chip-btn.is-active {
  background: var(--color-primary);
  color: #fff;
}
body.theme-bleu .sort-chip--active {
  background: var(--color-primary);
}

/* NIS2 plan cards */
body.theme-bleu .nis2-plan-card--pillar1 {
  --pillar-color: #0000B3;
  --pillar-bg: rgba(0, 0, 179, 0.08);
}

body.theme-bleu .nis2-plan-card--pillar2 {
  --pillar-color: #70AD47;
  --pillar-bg: rgba(112, 173, 71, 0.08);
}

body.theme-bleu .nis2-plan-card--pillar3 {
  --pillar-color: #0563C1;
  --pillar-bg: rgba(5, 99, 193, 0.08);
}

body.theme-bleu .nis2-plan-card--pillar4 {
  --pillar-color: #FBBD00;
  --pillar-bg: rgba(251, 189, 0, 0.1);
}

body.theme-bleu .nis2-plan-card--pillar5 {
  --pillar-color: #7030A0;
  --pillar-bg: rgba(112, 48, 160, 0.08);
}

/* Socle cards */
body.theme-bleu .socle-card--pillar1 {
  --socle-accent: #0000B3;
  --socle-bg: rgba(0, 0, 179, 0.06);
  --socle-border: rgba(0, 0, 179, 0.2);
}

body.theme-bleu .socle-card--pillar2 {
  --socle-accent: #70AD47;
  --socle-bg: rgba(112, 173, 71, 0.06);
  --socle-border: rgba(112, 173, 71, 0.2);
}

body.theme-bleu .socle-card--pillar3 {
  --socle-accent: #0563C1;
  --socle-bg: rgba(5, 99, 193, 0.06);
  --socle-border: rgba(5, 99, 193, 0.2);
}

body.theme-bleu .socle-card--pillar4 {
  --socle-accent: #FBBD00;
  --socle-bg: rgba(251, 189, 0, 0.08);
  --socle-border: rgba(251, 189, 0, 0.25);
}

body.theme-bleu .socle-card--pillar5 {
  --socle-accent: #7030A0;
  --socle-bg: rgba(112, 48, 160, 0.06);
  --socle-border: rgba(112, 48, 160, 0.2);
}

/* Modal */
body.theme-bleu .modal {
  background: var(--color-surface);
}

body.theme-bleu .modal__header {
  border-bottom-color: var(--color-primary);
}

body.theme-bleu .modal-overlay {
  background: rgba(0, 0, 40, 0.5);
}

/* NIS2 custom cards */
body.theme-bleu .nis2-custom-card .kpi-card__value,
body.theme-bleu .nis2-custom-card .kpi-card__eyebrow,
body.theme-bleu .nis2-custom-card .kpi-card__label {
  color: var(--color-text);
}

body.theme-bleu .nis2-status-text,
body.theme-bleu .nis2-action-text,
body.theme-bleu .nis2-phase-group td {
  color: var(--color-text);
}

body.theme-bleu .nis2-status-chip__label,
body.theme-bleu .stat-chip {
  color: var(--color-text-secondary);
}


/* Navigation */
.nav {
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0 var(--spacing-md);
}

.nav--secondary {
  background-color: var(--color-surface-secondary);
  border-bottom: 1px solid var(--color-border);
}

.nav--tertiary {
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.nav__content {
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  overflow-x: auto;
  gap: 0;
}

.nav__separator {
  display: inline-block;
  width: 1px;
  height: 24px;
  background-color: var(--color-border);
  margin: auto var(--spacing-sm);
  flex-shrink: 0;
}

.nav__item {
  padding: var(--spacing-md);
  background: none;
  border: none;
  color: var(--color-text-light);
  cursor: pointer;
  font-weight: 500;
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  white-space: nowrap;
}

.nav__item:hover {
  color: var(--color-primary);
}

.nav__item--active {
  color: var(--color-primary);
}

.nav__item--active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background-color: var(--color-primary);
}

/* ============================================================
   RIBBON NAVIGATION - Compact 2-line layout
   ============================================================ */

.nav-ribbon {
  width: 100%;
  max-width: 1400px;
  min-width: 0;
  margin: 0 auto;
  border-bottom: 1px solid var(--color-border);
  padding: 0 var(--spacing-md);
  overflow: hidden;
}

/* --- Line 1: Category pills --- */

.nav-ribbon__categories {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-sm) 0 var(--spacing-xs);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.nav-ribbon__categories::-webkit-scrollbar {
  display: none;
}

.nav-ribbon__cat {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: var(--spacing-xs);
  min-height: 36px;
  padding: var(--spacing-xs) 14px;
  border: none;
  border-left: 3px solid transparent;
  border-radius: var(--border-radius-xl);
  background: transparent;
  font-size: var(--font-size-sm);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-light);
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-ribbon__cat:hover {
  background-color: rgba(128, 128, 128, 0.08);
}

.nav-ribbon__cat i {
  font-size: var(--font-size-sm);
}

/* Category colors — border-left + selected bg */

.nav-ribbon__cat--fondations { border-left-color: var(--color-nav-fondations); }
.nav-ribbon__cat--fondations.nav-ribbon__cat--selected { background-color: rgba(70, 130, 180, 0.12); color: var(--color-nav-fondations); filter: brightness(0.85); }
.nav-ribbon__cat--fondations:hover { color: var(--color-nav-fondations); filter: brightness(0.85); }

.nav-ribbon__cat--gouvernance { border-left-color: var(--color-nav-gouvernance); }
.nav-ribbon__cat--gouvernance.nav-ribbon__cat--selected { background-color: rgba(46, 139, 87, 0.12); color: var(--color-nav-gouvernance); filter: brightness(0.85); }
.nav-ribbon__cat--gouvernance:hover { color: var(--color-nav-gouvernance); filter: brightness(0.85); }

.nav-ribbon__cat--controles { border-left-color: var(--color-nav-controles); }
.nav-ribbon__cat--controles.nav-ribbon__cat--selected { background-color: rgba(123, 104, 238, 0.12); color: var(--color-nav-controles); filter: brightness(0.85); }
.nav-ribbon__cat--controles:hover { color: var(--color-nav-controles); filter: brightness(0.85); }

.nav-ribbon__cat--risques { border-left-color: var(--color-nav-risques); }
.nav-ribbon__cat--risques.nav-ribbon__cat--selected { background-color: rgba(212, 136, 15, 0.12); color: var(--color-nav-risques); filter: brightness(0.85); }
.nav-ribbon__cat--risques:hover { color: var(--color-nav-risques); filter: brightness(0.85); }

.nav-ribbon__cat--nis2 { border-left-color: var(--color-nav-nis2); }
.nav-ribbon__cat--nis2.nav-ribbon__cat--selected { background-color: rgba(75, 0, 130, 0.12); color: var(--color-nav-nis2); filter: brightness(0.85); }
.nav-ribbon__cat--nis2:hover { color: var(--color-nav-nis2); filter: brightness(0.85); }

/* Selected state */

.nav-ribbon__cat--selected {
  font-weight: 600;
}

/* Active-module dot indicator */

.nav-ribbon__cat--has-active::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border-radius: var(--border-radius-full);
  background-color: currentColor;
}

/* --- Line 2: Item panels --- */

.nav-ribbon__panels {
  overflow: hidden;
  position: relative;
  min-height: 34px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.nav-ribbon__panel {
  display: none;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs) 0 var(--spacing-xs);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.nav-ribbon__panel::-webkit-scrollbar {
  display: none;
}

.nav-ribbon__panel--active {
  display: flex;
  animation: ribbonFadeIn 0.2s ease;
}

@keyframes ribbonFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Items inside ribbon — compact reuse of .nav__item */

.nav-ribbon__panel .nav__item {
  flex: 0 0 auto;
  min-height: 34px;
  padding: var(--spacing-xs) 10px;
  font-size: var(--font-size-sm);
  border-radius: var(--border-radius);
}

.nav-ribbon__panel .nav__item--active::after {
  display: none;
}

/* Item colors per category panel (high specificity to beat theme overrides) */

.nav-ribbon__panel[data-panel="fondations"] .nav__item--active { background-color: rgba(70, 130, 180, 0.15); color: #3a7197; font-weight: 600; }
.nav-ribbon__panel[data-panel="fondations"] .nav__item:hover   { background-color: rgba(70, 130, 180, 0.10); color: #3a7197; }

.nav-ribbon__panel[data-panel="gouvernance"] .nav__item--active { background-color: rgba(46, 139, 87, 0.15); color: #267349; font-weight: 600; }
.nav-ribbon__panel[data-panel="gouvernance"] .nav__item:hover   { background-color: rgba(46, 139, 87, 0.10); color: #267349; }

.nav-ribbon__panel[data-panel="controles"] .nav__item--active { background-color: rgba(123, 104, 238, 0.15); color: #6858cc; font-weight: 600; }
.nav-ribbon__panel[data-panel="controles"] .nav__item:hover   { background-color: rgba(123, 104, 238, 0.10); color: #6858cc; }

.nav-ribbon__panel[data-panel="risques"] .nav__item--active { background-color: rgba(212, 136, 15, 0.15); color: #b5740d; font-weight: 600; }
.nav-ribbon__panel[data-panel="risques"] .nav__item:hover   { background-color: rgba(212, 136, 15, 0.10); color: #b5740d; }

.nav-ribbon__panel[data-panel="nis2"] .nav__item--active { background-color: rgba(75, 0, 130, 0.15); color: #3a0066; font-weight: 600; }
.nav-ribbon__panel[data-panel="nis2"] .nav__item:hover   { background-color: rgba(75, 0, 130, 0.10); color: #3a0066; }

/* --- Responsive --- */

@media (max-width: 768px) {
  .nav-ribbon__categories {
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) 0 var(--spacing-xs);
  }
  .nav-ribbon__categories::-webkit-scrollbar { display: none; }

  .nav-ribbon__cat span { display: none; }
  .nav-ribbon__cat { padding: var(--spacing-xs) 10px; border-left-width: 2px; }

  .nav-ribbon__panel .nav__item {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: var(--font-size-sm);
  }

  .nav-ribbon__panel .nav__item span { display: none; }
}

/* ============================================================
   RIBBON NAVIGATION - Theme Adaptations
   ============================================================ */

/* --- Dark Theme --- */

body.theme-dark .nav-ribbon {
  border-bottom-color: rgba(51, 65, 85, 0.6);
}

body.theme-dark .nav-ribbon__cat {
  color: var(--color-text-light);
}

body.theme-dark .nav-ribbon__cat:hover {
  background-color: rgba(255, 255, 255, 0.06);
}

body.theme-dark .nav-ribbon__cat--fondations.nav-ribbon__cat--selected { background-color: rgba(70, 130, 180, 0.18); color: #7db8e0; }
body.theme-dark .nav-ribbon__cat--gouvernance.nav-ribbon__cat--selected { background-color: rgba(46, 139, 87, 0.18); color: #5ccf8d; }
body.theme-dark .nav-ribbon__cat--controles.nav-ribbon__cat--selected { background-color: rgba(123, 104, 238, 0.18); color: #aa9af7; }
body.theme-dark .nav-ribbon__cat--risques.nav-ribbon__cat--selected { background-color: rgba(212, 136, 15, 0.18); color: #f0b84e; }
body.theme-dark .nav-ribbon__cat--nis2.nav-ribbon__cat--selected { background-color: rgba(75, 0, 130, 0.22); color: #9e63d4; }

body.theme-dark .nav-ribbon__panel[data-panel="fondations"] .nav__item--active { background-color: rgba(70, 130, 180, 0.22); color: #7db8e0; }
body.theme-dark .nav-ribbon__panel[data-panel="fondations"] .nav__item:hover   { background-color: rgba(70, 130, 180, 0.12); color: #7db8e0; }

body.theme-dark .nav-ribbon__panel[data-panel="gouvernance"] .nav__item--active { background-color: rgba(46, 139, 87, 0.22); color: #5ccf8d; }
body.theme-dark .nav-ribbon__panel[data-panel="gouvernance"] .nav__item:hover   { background-color: rgba(46, 139, 87, 0.12); color: #5ccf8d; }

body.theme-dark .nav-ribbon__panel[data-panel="controles"] .nav__item--active { background-color: rgba(123, 104, 238, 0.22); color: #aa9af7; }
body.theme-dark .nav-ribbon__panel[data-panel="controles"] .nav__item:hover   { background-color: rgba(123, 104, 238, 0.12); color: #aa9af7; }

body.theme-dark .nav-ribbon__panel[data-panel="risques"] .nav__item--active { background-color: rgba(212, 136, 15, 0.22); color: #f0b84e; }
body.theme-dark .nav-ribbon__panel[data-panel="risques"] .nav__item:hover   { background-color: rgba(212, 136, 15, 0.12); color: #f0b84e; }

body.theme-dark .nav-ribbon__panel[data-panel="nis2"] .nav__item--active { background-color: rgba(75, 0, 130, 0.25); color: #9e63d4; }
body.theme-dark .nav-ribbon__panel[data-panel="nis2"] .nav__item:hover   { background-color: rgba(75, 0, 130, 0.14); color: #9e63d4; }

/* --- Poudre Theme --- */

body.theme-poudre .nav-ribbon {
  border-bottom-color: rgba(225, 194, 194, 0.5);
}

body.theme-poudre .nav-ribbon__cat:hover {
  background-color: rgba(74, 67, 64, 0.06);
}

body.theme-poudre .nav-ribbon__panel .nav__item {
  border-radius: var(--border-radius);
}

body.theme-poudre .nav-ribbon__panel[data-panel="fondations"] .nav__item--active { background-color: rgba(70, 130, 180, 0.14); color: #4a7a9e; }
body.theme-poudre .nav-ribbon__panel[data-panel="gouvernance"] .nav__item--active { background-color: rgba(46, 139, 87, 0.14); color: #2d7e51; }
body.theme-poudre .nav-ribbon__panel[data-panel="controles"] .nav__item--active { background-color: rgba(123, 104, 238, 0.14); color: #6d5cca; }
body.theme-poudre .nav-ribbon__panel[data-panel="risques"] .nav__item--active { background-color: rgba(212, 136, 15, 0.14); color: #b87b10; }
body.theme-poudre .nav-ribbon__panel[data-panel="nis2"] .nav__item--active { background-color: rgba(75, 0, 130, 0.12); color: #5c1a8a; }

/* --- Bleu Theme --- */

body.theme-bleu .nav-ribbon {
  border-bottom-color: rgba(0, 0, 179, 0.15);
  background-color: rgba(245, 247, 250, 0.95);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

body.theme-bleu .nav-ribbon__cat:hover {
  background-color: rgba(0, 0, 179, 0.06);
}

body.theme-bleu .nav-ribbon__panel .nav__item {
  border-radius: var(--border-radius);
}

body.theme-bleu .nav-ribbon__panel[data-panel="fondations"] .nav__item--active { background-color: rgba(70, 130, 180, 0.15); color: #3a6d96; }
body.theme-bleu .nav-ribbon__panel[data-panel="gouvernance"] .nav__item--active { background-color: rgba(46, 139, 87, 0.14); color: #267a4a; }
body.theme-bleu .nav-ribbon__panel[data-panel="controles"] .nav__item--active { background-color: rgba(123, 104, 238, 0.14); color: #5f52c0; }
body.theme-bleu .nav-ribbon__panel[data-panel="risques"] .nav__item--active { background-color: rgba(212, 136, 15, 0.14); color: #b07510; }
body.theme-bleu .nav-ribbon__panel[data-panel="nis2"] .nav__item--active { background-color: rgba(75, 0, 130, 0.14); color: #3d006b; }

/* --- Light Theme --- */

body.theme-light .nav-ribbon {
  border-bottom-color: rgba(233, 236, 239, 0.8);
}

/* --- Print: hide ribbon nav --- */

@media print {
  .nav-ribbon {
    display: none !important;
  }
}

/* Main Content */
.main {
  flex: 1;
  padding: var(--spacing-lg);
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  overflow-x: hidden;
}

/* Module */
.module {
  display: none;
  opacity: 0;
  transition: opacity var(--transition-duration) ease;
}

.module--active {
  display: block;
  opacity: 1;
}

.module__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.module__title {
  font-size: var(--font-size-xl);
  margin: 0 0 var(--spacing-sm);
}

.module__subtitle {
  color: var(--color-text-light);
  margin: 0;
}

.module__actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin-top: 0;
  flex-wrap: wrap;
}

/* Dashboard */

/* Header Dashboard avec bouton export */
.module__header--dashboard {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--spacing-md);
}

.module__header-left {
  flex: 1;
  min-width: 200px;
}

/* ========================================
   DASHBOARD HERO (Score Global + Alertes)
   ======================================== */
.dashboard-hero {
  display: grid;
  grid-template-columns: auto 1fr 260px;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
  align-items: stretch;
}

/* Score Global SMSI - Jauge circulaire */
.score-global {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  background: linear-gradient(135deg, rgba(15, 155, 122, 0.08), rgba(34, 197, 94, 0.05));
  border: 1px solid rgba(15, 155, 122, 0.2);
  border-radius: var(--border-radius-xl);
  padding: var(--spacing-md);
  min-width: 0;
}

.score-global__gauge {
  flex-shrink: 0;
}

.score-global__svg {
  width: 120px;
  height: 120px;
  transform: rotate(-90deg);
}

.score-global__track {
  fill: none;
  stroke: rgba(0, 0, 0, 0.1);
  stroke-width: 10;
  stroke-dasharray: 8 4;
}

.score-global__progress {
  fill: none;
  stroke: var(--color-success);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 339.292;
  stroke-dashoffset: 339.292;
  transition: stroke-dashoffset 1s ease-out, stroke 0.3s ease;
}

.score-global__value {
  transform: rotate(90deg);
  fill: var(--color-text);
  font-size: var(--font-size-xxl);
  font-weight: 800;
  text-anchor: middle;
  dominant-baseline: middle;
}

.score-global__label {
  transform: rotate(90deg);
  fill: var(--color-text-light);
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-anchor: middle;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.score-global__details {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.score-global__item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: var(--font-size-sm);
  color: var(--color-text);
}

.score-global__item strong {
  margin-left: auto;
  font-weight: 700;
  min-width: 45px;
  text-align: right;
}

.score-global__dot {
  width: 10px;
  height: 10px;
  border-radius: var(--border-radius-full);
  flex-shrink: 0;
}

.score-global__dot--iso { background: linear-gradient(135deg, #0f9b7a, #22c55e); }
.score-global__dot--nis2 { background: linear-gradient(135deg, #3b82f6, #8b5cf6); }
.score-global__dot--risk { background: linear-gradient(135deg, #f59e0b, #ef4444); }

/* Hover subtil sur la jauge */
.score-global__gauge {
  transition: transform 0.3s ease;
}

.score-global__gauge:hover {
  transform: scale(1.02);
}

/* Alertes & Priorités */
.dashboard-alerts {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.04), rgba(245, 158, 11, 0.04));
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: var(--border-radius-xl);
  padding: var(--spacing-md);
  display: flex;
  flex-direction: column;
  min-height: 140px;
}

.dashboard-alerts__header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-danger);
  margin-bottom: var(--spacing-sm);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.dashboard-alerts__header i {
  font-size: var(--font-size-sm);
}

.dashboard-alerts__list {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  flex: 1;
  align-content: flex-start;
}

.dashboard-alerts__empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  color: var(--color-text-light);
  font-size: var(--font-size-sm);
  opacity: 0.7;
}

.alert-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: 0.375rem 0.625rem;
  background: var(--color-surface);
  border-radius: var(--border-radius);
  font-size: var(--font-size-xs);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  border: 1px solid transparent;
  flex: 0 0 auto;
}

.alert-item:hover {
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.alert-item__icon {
  width: 20px;
  height: 20px;
  border-radius: var(--border-radius);
  display: grid;
  place-items: center;
  font-size: 0.625rem;
  flex-shrink: 0;
}

.alert-item__icon--critical {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-danger);
}

.alert-item__icon--warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--color-warning-dark);
}

.alert-item__icon--info {
  background: rgba(59, 130, 246, 0.15);
  color: var(--color-info);
}

.alert-item__icon--purple {
  background: rgba(139, 92, 246, 0.15);
  color: var(--color-info-dark, #7c3aed);
}

.alert-item__text {
  flex: 1;
  color: var(--color-text);
}

.alert-item__badge {
  font-size: var(--font-size-xs);
  font-weight: 600;
  padding: 0.125rem var(--spacing-sm);
  border-radius: var(--border-radius-lg);
  background: rgba(0, 0, 0, 0.06);
  color: var(--color-text-light);
}

/* ========================================
   DASHBOARD ACTIVITY WIDGET
   ======================================== */
.dashboard-activity {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.04), rgba(139, 92, 246, 0.04));
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: var(--border-radius-xl);
  padding: var(--spacing-md);
  display: flex;
  flex-direction: column;
  min-height: 140px;
  max-height: 280px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.dashboard-activity:hover {
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}
.dashboard-activity__header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-primary);
  margin-bottom: var(--spacing-sm);
  flex-shrink: 0;
}
.dashboard-activity__header i { font-size: var(--font-size-sm); }
.dashboard-activity__list {
  flex: 1;
  overflow: hidden;
  position: relative;
  -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
}
.activity-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: var(--spacing-xs) 0;
  font-size: 0.6875rem;
  line-height: 1.3;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.activity-item:last-child { border-bottom: none; }
.activity-item__time {
  flex-shrink: 0;
  font-size: 0.625rem;
  color: var(--color-text-light);
  font-variant-numeric: tabular-nums;
  min-width: 2.5rem;
}
.activity-item__icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: var(--border-radius-sm);
  display: grid;
  place-items: center;
  font-size: 0.5rem;
}
.activity-item__icon--add { background: rgba(50, 192, 134, 0.15); color: var(--color-success-dark); }
.activity-item__icon--edit { background: rgba(31, 184, 205, 0.15); color: var(--color-primary-dark); }
.activity-item__icon--delete { background: rgba(219, 69, 69, 0.15); color: var(--color-danger); }
.activity-item__icon--import { background: rgba(255, 193, 133, 0.15); color: var(--color-warning-dark); }
.activity-item__icon--export { background: rgba(255, 193, 133, 0.15); color: var(--color-warning-dark); }
.activity-item__icon--config { background: rgba(93, 135, 143, 0.15); color: var(--color-secondary); }
.activity-item__text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-text);
}
.activity-item__user {
  flex-shrink: 0;
  font-size: 0.5625rem;
  color: var(--color-text-light);
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dashboard-activity__empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  color: var(--color-text-light);
  font-size: var(--font-size-sm);
  opacity: 0.7;
}

/* ========================================
   AUDIT LOG PAGE
   ======================================== */
.audit-page { padding: var(--spacing-md); }
.audit-page__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-md);
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}
.audit-page__title {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--color-text);
}
.audit-page__title i { color: var(--color-primary); }
/* Toolbar v2 : la barre de filtres du journal réutilise .section-toolbar
   (markup généré dans renderAuditLogModule) — l'ancienne .audit-filters a été retirée. */
.table--audit {
  width: 100%;
  border-collapse: collapse;
}
.table--audit th {
  padding: var(--spacing-sm) var(--spacing-md);
  text-align: left;
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-light);
  border-bottom: 2px solid var(--color-border);
}
.table--audit td {
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: var(--font-size-sm);
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
.table--audit tr:hover { background: var(--color-surface-secondary); }
.audit-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: 0.125rem var(--spacing-sm);
  border-radius: var(--border-radius-lg);
  font-size: var(--font-size-xs);
  font-weight: 600;
  white-space: nowrap;
}
.audit-badge--add { background: rgba(50, 192, 134, 0.12); color: var(--color-success-dark); }
.audit-badge--edit { background: rgba(31, 184, 205, 0.12); color: var(--color-primary-dark); }
.audit-badge--delete { background: rgba(219, 69, 69, 0.12); color: var(--color-danger); }
.audit-badge--import { background: rgba(255, 193, 133, 0.12); color: var(--color-warning-dark); }
.audit-badge--export { background: rgba(255, 193, 133, 0.12); color: var(--color-warning-dark); }
.audit-badge--config { background: rgba(93, 135, 143, 0.12); color: var(--color-secondary); }
.audit-cat-badge {
  display: inline-block;
  padding: 0.125rem 0.375rem;
  border-radius: var(--border-radius);
  font-size: var(--font-size-xs);
  background: rgba(0,0,0,0.05);
  color: var(--color-text-light);
}
.audit-empty {
  text-align: center;
  padding: var(--spacing-xl);
  color: var(--color-text-light);
  font-size: var(--font-size-sm);
}
.audit-target { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Lot 1b : badge catégorie réduit (fusionné dans la colonne Cible) */
.audit-target .audit-cat-badge { font-size: 0.68rem; padding: 0.06rem 0.3rem; }
/* Lot 1b : détails en ligne extensible (clic sur la ligne) */
.audit-row--expandable { cursor: pointer; }
.audit-details-row td.audit-details {
  max-width: none;
  white-space: normal;
  color: var(--color-text-light);
  font-size: var(--font-size-xs);
  background: var(--color-surface-secondary);
}
.audit-details { color: var(--color-text-light); font-size: var(--font-size-xs); }

/* ========================================
   KPI GRID & CARDS
   ======================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.kpi-grid--secondary {
  margin-bottom: var(--spacing-xl);
}

/* KPI Grid responsive */
@media (max-width: 1400px) {
  .kpi-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .kpi-grid--secondary {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .kpi-grid--secondary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .kpi-grid--secondary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .kpi-grid,
  .kpi-grid--secondary {
    grid-template-columns: 1fr;
  }
}

.kpi-card {
  position: relative;
  background: linear-gradient(135deg, var(--kpi-accent-soft, rgba(13, 148, 136, 0.12)), #ffffff);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-md);
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--kpi-border, var(--color-border));
  overflow: hidden;
  transition: transform var(--transition-duration) ease, box-shadow var(--transition-duration) ease, border-color var(--transition-duration) ease;
}

.kpi-card[data-nav-target] {
  cursor: pointer;
}
.kpi-card[data-nav-target]:focus-visible {
  outline: 2px solid var(--kpi-accent, var(--color-primary));
  outline-offset: 2px;
}

.kpi-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, var(--kpi-accent-soft, transparent), transparent 55%);
  pointer-events: none;
}

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.08);
  border-color: var(--kpi-accent, var(--color-primary));
}

.kpi-card--primary {
  --kpi-accent: #0f9b7a;
  --kpi-accent-soft: rgba(15, 155, 122, 0.16);
  --kpi-border: rgba(15, 155, 122, 0.35);
}
.kpi-card--success {
  --kpi-accent: #22c55e;
  --kpi-accent-soft: rgba(34, 197, 94, 0.16);
  --kpi-border: rgba(34, 197, 94, 0.3);
}
.kpi-card--warning {
  --kpi-accent: #f59e0b;
  --kpi-accent-soft: rgba(245, 158, 11, 0.18);
  --kpi-border: rgba(245, 158, 11, 0.35);
}
.kpi-card--danger {
  --kpi-accent: #ef4444;
  --kpi-accent-soft: rgba(239, 68, 68, 0.18);
  --kpi-border: rgba(239, 68, 68, 0.35);
}
.kpi-card--info {
  --kpi-accent: #2563eb;
  --kpi-accent-soft: rgba(37, 99, 235, 0.16);
  --kpi-border: rgba(37, 99, 235, 0.35);
}

/* Nouvelles couleurs pour KPI secondaires */
.kpi-card--purple {
  --kpi-accent: #8b5cf6;
  --kpi-accent-soft: rgba(139, 92, 246, 0.16);
  --kpi-border: rgba(139, 92, 246, 0.35);
}
.kpi-card--cyan {
  --kpi-accent: #06b6d4;
  --kpi-accent-soft: rgba(6, 182, 212, 0.16);
  --kpi-border: rgba(6, 182, 212, 0.35);
}
.kpi-card--orange {
  --kpi-accent: #f97316;
  --kpi-accent-soft: rgba(249, 115, 22, 0.16);
  --kpi-border: rgba(249, 115, 22, 0.35);
}
.kpi-card--blue {
  --kpi-accent: #3b82f6;
  --kpi-accent-soft: rgba(59, 130, 246, 0.16);
  --kpi-border: rgba(59, 130, 246, 0.35);
}
.kpi-card--teal {
  --kpi-accent: #14b8a6;
  --kpi-accent-soft: rgba(20, 184, 166, 0.16);
  --kpi-border: rgba(20, 184, 166, 0.35);
}
.kpi-card--amber {
  --kpi-accent: #f59e0b;
  --kpi-accent-soft: rgba(245, 158, 11, 0.14);
  --kpi-border: rgba(245, 158, 11, 0.3);
}

.kpi-card__icon {
  width: 56px;
  height: 56px;
  border-radius: var(--border-radius-lg);
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--kpi-accent, var(--color-primary)), rgba(0, 0, 0, 0.15));
  color: var(--color-surface);
  font-size: var(--font-size-lg);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}
.kpi-card__icon i {
  display: block;
  opacity: 0.95;
}

.kpi-card__eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: var(--font-size-xs);
  color: var(--color-text);
  font-weight: 700;
}

.kpi-card__value {
  font-size: var(--font-size-xxl);
  font-weight: 800;
  line-height: 1.1;
  margin: var(--spacing-xs) 0 0;
}

.kpi-card__label {
  color: var(--color-text-light);
  font-size: var(--font-size-sm);
  margin-top: var(--spacing-xs);
}

/* KPI Value avec Sparkline */
.kpi-card__value-row {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.kpi-sparkline {
  flex-shrink: 0;
  opacity: 0.8;
}

/* KPI Detail (sous-texte) */
.kpi-card__detail {
  font-size: var(--font-size-xs);
  color: var(--color-text-light);
  margin-top: var(--spacing-xs);
  opacity: 0.85;
}

/* Dark theme tweaks */
body.theme-dark .kpi-card {
  background: linear-gradient(135deg, var(--kpi-accent-soft, rgba(13, 148, 136, 0.18)), #1f2937);
  border-color: var(--kpi-border, var(--color-border));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}
body.theme-dark .kpi-card__value {
  color: #f8fafc;
}
body.theme-dark .kpi-card__label,
body.theme-dark .kpi-card__eyebrow {
  color: #cbd5e0;
}
body.theme-dark .kpi-card__icon {
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* Dark theme - Dashboard Hero */
body.theme-dark .score-global {
  background: linear-gradient(135deg, rgba(15, 155, 122, 0.12), rgba(34, 197, 94, 0.08));
  border-color: rgba(15, 155, 122, 0.25);
}

body.theme-dark .score-global__track {
  stroke: rgba(255, 255, 255, 0.15);
  stroke-dasharray: 8 4;
}

body.theme-dark .score-global__value {
  fill: #f8fafc;
}

body.theme-dark .score-global__label {
  fill: #94a3b8;
}

body.theme-dark .score-global__item {
  color: #e2e8f0;
}

body.theme-dark .dashboard-alerts {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(245, 158, 11, 0.06));
  border-color: rgba(239, 68, 68, 0.2);
}
body.theme-dark .dashboard-activity {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.06));
  border-color: rgba(59, 130, 246, 0.2);
}
body.theme-dark .activity-item { border-bottom-color: rgba(255,255,255,0.06); }

body.theme-dark .alert-item {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

body.theme-dark .alert-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

body.theme-dark .alert-item__text {
  color: #e2e8f0;
}

body.theme-dark .alert-item__badge {
  background: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
}

/* Dark theme - Nouvelles fonctionnalités dashboard */
body.theme-dark .chart-mini-legend__item {
  color: #94a3b8;
}

body.theme-dark .chart-mini-legend__value {
  color: #f1f5f9;
}

body.theme-dark .activity-item {
  border-bottom-color: rgba(51, 65, 85, 0.5);
}

body.theme-dark .activity-item__title {
  color: #e2e8f0;
}

body.theme-dark .activity-item__meta {
  color: #94a3b8;
}

body.theme-dark .activity-empty {
  color: #64748b;
}

body.theme-dark .chart-filters {
  background: rgba(51, 65, 85, 0.5);
}

body.theme-dark .chart-filter {
  color: #94a3b8;
}

body.theme-dark .chart-filter:hover {
  color: #e2e8f0;
}

body.theme-dark .dashboard-footer {
  border-top-color: rgba(51, 65, 85, 0.6);
}

body.theme-dark .kpi-card__trend--up {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

body.theme-dark .kpi-card__trend--down {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(350px, 100%), 1fr));
  gap: var(--spacing-lg);
}

/* Grille compacte 6 colonnes */
.charts-grid--compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.chart-card--compact {
  min-height: auto;
}

.chart-card--compact .chart-card__header {
  padding: var(--spacing-md) var(--spacing-md) var(--spacing-sm);
}

.chart-card--compact .chart-card__title {
  font-size: var(--font-size-sm);
}

.chart-card--compact .chart-card__content {
  padding: var(--spacing-sm) var(--spacing-md) var(--spacing-md);
  height: 180px;
}

.chart-card--compact .chart-card__subtitle {
  display: none;
}

.chart-card--compact canvas {
  max-height: 160px;
}

.chart-card--compact .risk-matrix {
  transform: scale(0.85);
  transform-origin: center center;
}

@media (max-width: 1200px) {
  .charts-grid--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chart-row--radars {
    gap: var(--spacing-md);
  }

  .chart-card--radar .chart-card__content {
    height: 300px;
  }
}

@media (max-width: 900px) {
  .charts-grid--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chart-card--compact .chart-card__content {
    height: 180px;
  }

  .dashboard-row {
    grid-template-columns: 1fr;
  }
}

/* Mini-légendes pour graphiques compacts */
.chart-mini-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md) var(--spacing-md);
  font-size: var(--font-size-xs);
}

.chart-mini-legend__item {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  color: var(--color-text-light);
}

.chart-mini-legend__dot {
  width: 8px;
  height: 8px;
  border-radius: var(--border-radius-sm);
  flex-shrink: 0;
}

.chart-mini-legend__value {
  font-weight: 700;
  color: var(--color-text);
}

/* Indicateurs de tendance dans KPI */
.kpi-card__trend {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: var(--font-size-xs);
  font-weight: 600;
  padding: 0.125rem 0.375rem;
  border-radius: var(--border-radius-sm);
  margin-left: var(--spacing-sm);
}

.kpi-card__trend--up {
  background: rgba(34, 197, 94, 0.15);
  color: var(--color-success-dark);
}

.kpi-card__trend--down {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-danger);
}

.kpi-card__trend--neutral {
  background: rgba(148, 163, 184, 0.15);
  color: #64748b;
}

.kpi-card__trend i {
  font-size: 0.55rem;
}

/* Section Activité Récente */
.dashboard-row {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

.chart-card--activity {
  display: flex;
  flex-direction: column;
}

.chart-card--activity .chart-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chart-card--activity .chart-card__title i {
  margin-right: var(--spacing-sm);
  opacity: 0.7;
}

.activity-timeline {
  flex: 1;
  padding: 0 var(--spacing-md) var(--spacing-md);
  overflow-y: auto;
  max-height: 280px;
}

.activity-item {
  display: flex;
  gap: var(--spacing-md);
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--font-size-xs);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-item__icon {
  width: 28px;
  height: 28px;
  border-radius: var(--border-radius-full);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: var(--font-size-xs);
}

.activity-item__icon--control { background: rgba(50, 192, 134, 0.15); color: var(--color-success-dark); }
.activity-item__icon--action { background: rgba(255, 193, 133, 0.15); color: var(--color-warning-dark); }
.activity-item__icon--risk { background: rgba(219, 69, 69, 0.15); color: var(--color-danger); }
.activity-item__icon--audit { background: rgba(31, 184, 205, 0.15); color: var(--color-primary); }
.activity-item__icon--doc { background: rgba(139, 92, 246, 0.15); color: var(--color-tag-auto); }
.activity-item__icon--nc { background: rgba(219, 69, 69, 0.15); color: var(--color-danger-dark); }

.activity-item__content {
  flex: 1;
  min-width: 0;
}

.activity-item__title {
  color: var(--color-text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-item__meta {
  color: var(--color-text-light);
  margin-top: 0.125rem;
}

.activity-item__time {
  color: var(--color-text-secondary);
  font-size: 0.625rem;
  flex-shrink: 0;
}

.activity-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl);
  color: var(--color-text-light);
  text-align: center;
}

.activity-empty i {
  font-size: var(--font-size-xxl);
  opacity: 0.3;
  margin-bottom: var(--spacing-sm);
}

/* État vide du graphique d'évolution des actions (historique < 2 mois) */
.chart-empty-note {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  padding: var(--spacing-xl);
  color: var(--color-text-light);
  text-align: center;
  font-size: var(--font-size-sm);
  line-height: 1.5;
}

/* Filtres temporels */
.chart-card__actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.chart-filters {
  display: flex;
  background: var(--color-surface-secondary);
  border-radius: var(--border-radius);
  padding: var(--spacing-xs);
}

.chart-filter {
  padding: var(--spacing-xs) 0.625rem;
  font-size: var(--font-size-xs);
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--color-text-light);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.chart-filter:hover {
  color: var(--color-text);
}

.chart-filter--active {
  background: var(--color-primary);
  color: #fff;
}

/* Footer Dashboard avec export */
.dashboard-footer {
  display: flex;
  justify-content: center;
  padding: var(--spacing-lg) 0;
  border-top: 1px solid var(--color-border);
  margin-top: var(--spacing-lg);
}

.dashboard-footer .btn {
  gap: var(--spacing-sm);
}

/* Responsive */
@media (max-width: 900px) {
  .dashboard-row {
    grid-template-columns: 1fr;
  }

  .activity-timeline {
    max-height: 200px;
  }
}

.charts-grid.nis2-top-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  grid-auto-rows: 1fr;
}

/* Réduction de la hauteur des blocs NIS2 (radar, statuts, actions) */
.charts-grid.nis2-top-grid .chart-card {
  max-height: 600px;
  overflow: auto;
  display: flex;
  flex-direction: column;
}

.charts-grid.nis2-top-grid .chart-card__content {
  max-height: 450px;
  flex: 1;
}

.charts-grid.nis2-top-grid #nis2StatusList {
  max-height: 430px;
  overflow-y: auto;
  padding-right: var(--spacing-xs);
}

.chart-card--nis2-status {
  max-height: 640px;
}

.chart-card--nis2-status .chart-card__content {
  max-height: 520px;
}

.chart-card--nis2-status #nis2StatusList {
  max-height: 520px;
}

.chart-card--actions-nis2 .chart-card__content,
.chart-card--actions-domain .chart-card__content {
  max-height: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chart-card--actions-nis2 canvas,
.chart-card--actions-domain canvas {
  max-width: 70%;
  max-height: 70%;
}

.actions-legend {
  display: none;
}

.actions-legend__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-sm) 10px;
  border-radius: var(--border-radius-lg);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.actions-legend__left {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.actions-legend__dot {
  width: 12px;
  height: 12px;
  border-radius: var(--border-radius-full);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.06);
}

.actions-legend__label {
  font-weight: 700;
  font-size: var(--font-size-sm);
}

.actions-legend__value {
  font-size: var(--font-size-xs);
  color: var(--color-text-light);
}

.socle-grid--inline {
  margin: var(--spacing-lg) 0;
}

@media (max-width: 1200px) {
  .charts-grid.nis2-top-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .charts-grid.nis2-top-grid {
    grid-template-columns: 1fr;
  }
}

.chart-row {
  display: grid;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}

.chart-row--radars {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

@media (max-width: 900px) {
  .chart-row--radars {
    grid-template-columns: 1fr;
  }
}

.chart-legend {
  margin-top: var(--spacing-sm);
  padding: var(--spacing-sm);
  background: var(--color-surface-secondary);
  border-radius: var(--border-radius);
  border: 1px solid var(--color-border);
  font-size: var(--font-size-sm);
}

.chart-legend ol {
  margin: 0;
  padding-left: var(--spacing-lg);
  line-height: 1.4;
  display: grid;
  grid-template-columns: 1fr;
  row-gap: var(--spacing-xs);
}

.chart-legend li + li {
  margin-top: 0;
}

body.theme-dark .chart-legend {
  background: #273142;
  border-color: var(--color-border);
  color: #e5e7eb;
}

.chart-legend--two-cols ol {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--spacing-lg);
}

.chart-legend--tooltip {
  position: absolute;
  right: var(--spacing-sm);
  top: calc(100% + var(--spacing-xs));
  min-width: 260px;
  max-width: 320px;
  box-shadow: var(--shadow-lg);
  z-index: 10;
}

@media (max-width: 900px) {
  .chart-legend--two-cols ol {
    grid-template-columns: 1fr;
  }
}

.chart-card {
  background-color: var(--color-surface);
  border-radius: var(--border-radius);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-md);
  height: 100%;
  transition: box-shadow var(--transition-duration) var(--transition-timing), transform var(--transition-duration) var(--transition-timing);
}

.chart-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

.chart-card--full {
  grid-column: 1 / -1;
}

.chart-card__header {
  margin-bottom: var(--spacing-md);
}

.chart-card__title {
  font-size: var(--font-size-lg);
  margin: 0 0 var(--spacing-xs);
}

.chart-card__subtitle {
  color: var(--color-text-light);
  font-size: var(--font-size-sm);
}

.chart-card__content {
  height: 400px;
  position: relative;
}

.chart-card--radar .chart-card__content {
  height: 320px;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-sm);
}

.chart-card--radar canvas {
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  max-height: 100%;
}

/* Ancien style à garder pour compatibilité */
.chart-card--radar canvas.legacy {
  display: block;
  margin: 0 auto;
  max-width: 90%;
  max-height: 90%;
}

.chart-card__note {
  color: var(--color-text-light);
  font-size: var(--font-size-sm);
  margin-top: var(--spacing-xs);
}

.risk-matrix {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 1px;
  height: 100%;
  background-color: var(--color-border);
  border-radius: var(--border-radius-sm);
  overflow: hidden;
}

.matrix-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-weight: bold;
  font-size: var(--font-size-sm);
  background-color: var(--color-surface);
}

.matrix-cell__label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.matrix-cell__count {
  position: absolute;
  top: var(--spacing-xs);
  right: var(--spacing-xs);
  background-color: var(--color-primary);
  color: white;
  border-radius: var(--border-radius-full);
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xs);
}

.matrix-cell--insignifiant { background-color: rgba(93, 135, 143, 0.1); }
.matrix-cell--mineur { background-color: rgba(50, 192, 134, 0.1); }
.matrix-cell--significatif { background-color: rgba(255, 193, 133, 0.2); }
.matrix-cell--grave { background-color: rgba(219, 177, 69, 0.2); }
.matrix-cell--critique { background-color: rgba(219, 69, 69, 0.2); }

/* Tables */
.table-container {
  background-color: var(--color-surface);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  max-width: 100%;
  overflow: hidden;
  overflow-x: auto;
  box-sizing: border-box;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  background-color: rgba(0, 0, 0, 0.03);
  padding: var(--spacing-md);
  font-weight: 600;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--font-size-sm);
}

.table td {
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
  font-size: var(--font-size-sm);
}

/* Info Boxes */
.info-box {
  display: flex;
  align-items: flex-start;
  background-color: var(--color-info-light);
  border-left: 4px solid var(--color-info);
  border-radius: var(--border-radius);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.info-box__icon {
  margin-right: var(--spacing-sm);
  color: var(--color-info-dark);
  font-size: var(--font-size-lg);
  line-height: 1;
}

.info-box__text {
  margin: 0;
  font-size: var(--font-size-sm);
}


/* SoA table specific layout - 6 colonnes optimisées */
#soaTable {
  table-layout: fixed;
  width: 100%;
}

/* Colonne 1: Contrôle (Réf + Titre + Domaine) - 25% */
#soaTable th:nth-child(1),
#soaTable td:nth-child(1) {
  width: 25%;
}

/* Colonne 2: Applicabilité + Source - 14% */
#soaTable th:nth-child(2),
#soaTable td:nth-child(2) {
  width: 14%;
}

/* Colonne 3: Implémentation (État + Responsable + Date) - 15% */
#soaTable th:nth-child(3),
#soaTable td:nth-child(3) {
  width: 15%;
}

/* Colonne 4: Risques liés - 12% */
#soaTable th:nth-child(4),
#soaTable td:nth-child(4) {
  width: 12%;
}

/* Colonne 5: Documentation (Preuves + Revue) - 14% */
#soaTable th:nth-child(5),
#soaTable td:nth-child(5) {
  width: 14%;
}

/* Colonne 6: Justification - 20% */
#soaTable th:nth-child(6),
#soaTable td:nth-child(6) {
  width: 20%;
}

/* Cellules SoA */
#soaTable td {
  vertical-align: top;
  padding: var(--spacing-sm);
}

#soaTable th {
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: var(--font-size-sm);
}

/* En-tête du contrôle avec ref et domaine */
.soa-control-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: 0.35rem;
  flex-wrap: wrap;
}

.soa-control-ref {
  font-size: var(--font-size-base);
  color: var(--color-primary);
}

/* Inputs et selects compacts dans SoA */
#soaTable input[type="text"],
#soaTable input[type="date"],
#soaTable select,
#soaTable textarea {
  font-size: var(--font-size-xs);
  padding: 0.35rem var(--spacing-sm);
  width: 100%;
  box-sizing: border-box;
}

#soaTable select {
  padding-right: 1.8rem;
}

#soaTable .mt-1 {
  margin-top: 0.4rem;
}

/* Conteneur SoA */
#soa .table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

#soa .table-container::-webkit-scrollbar {
  height: 8px;
}

#soa .table-container::-webkit-scrollbar-track {
  background: transparent;
  border-radius: var(--border-radius-sm);
}

#soa .table-container::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--border-radius-sm);
}

#soa .table-container::-webkit-scrollbar-thumb:hover {
  background: var(--color-secondary);
}

/* Document Review table layout (5 colonnes - voir .table--doc-review pour les largeurs) */
/* Le padding vient de .doc-review-chapter-header (l'ancien padding:0 !important
   écrasait tout par spécificité #id et collait le titre de chapitre au bord). */
#docReviewTable .table-section td {
  font-weight: 600;
}

/* Anciennes règles #controlsTable supprimées — remplacées par .table--controls nth-child (ligne 4641+) */


.table tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

/* Affordance clic-ligne uniforme : lignes de tableau ouvrant une fiche/modale */
.row-clickable {
  cursor: pointer;
}
.row-clickable:hover {
  background-color: var(--color-surface-secondary, rgba(0, 0, 0, 0.03));
}

/* Cellule échéance dépassée (plan d'actions et tableaux écran) */
.cell-overdue {
  color: var(--color-danger);
  font-weight: 600;
}

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  justify-content: center;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-xs);
  font-weight: 500;
}

.status-badge--non_implemente {
  background-color: rgba(219, 69, 69, 0.1);
  color: var(--color-danger);
}

.status-badge--en_cours {
  background-color: rgba(255, 193, 133, 0.2);
  color: var(--color-warning-dark);
}

.status-badge--implemente {
  background-color: rgba(50, 192, 134, 0.1);
  color: var(--color-success);
}

.status-badge--verifie {
  background-color: rgba(31, 184, 205, 0.1);
  color: var(--color-primary);
}

.status-badge--insignifiant {
  background-color: rgba(93, 135, 143, 0.1);
  color: var(--color-secondary-dark);
}

.status-badge--mineur {
  background-color: rgba(50, 192, 134, 0.1);
  color: var(--color-success);
}

.status-badge--significatif {
  background-color: rgba(255, 193, 133, 0.2);
  color: var(--color-warning-dark);
}

.status-badge--grave {
  background-color: rgba(219, 177, 69, 0.2);
  color: #a68a1b;
}

.status-badge--critique {
  background-color: rgba(219, 69, 69, 0.1);
  color: var(--color-danger);
}

/* Project risk status badges */
.status-badge--rouge {
  background-color: rgba(219, 69, 69, 0.12);
  color: var(--color-danger);
}
.status-badge--jaune {
  background-color: rgba(255, 193, 133, 0.22);
  color: var(--color-warning-dark);
}
.status-badge--vert {
  background-color: rgba(50, 192, 134, 0.14);
  color: var(--color-success);
}
.status-badge--a_realiser {
  background-color: rgba(93, 135, 143, 0.14);
  color: var(--color-secondary-dark);
}
.status-badge--suspendue {
  background-color: rgba(31, 184, 205, 0.12);
  color: var(--color-primary);
}

/* Legacy classes for non-conformités */
.status-badge--faible {
  background-color: rgba(50, 192, 134, 0.1);
  color: var(--color-success);
}
.status-badge--moyen {
  background-color: rgba(255, 193, 133, 0.2);
  color: var(--color-warning-dark);
}
.status-badge--eleve {
  background-color: rgba(219, 177, 69, 0.2);
  color: #a68a1b;
}

/* Non-applicable badge for SoA */
.status-badge--non-applicable {
  background-color: rgba(108, 117, 125, 0.15);
  color: #5a6268;
  border: 1px dashed rgba(108, 117, 125, 0.4);
  font-size: var(--font-size-xs);
}

.status-badge--non-applicable i {
  margin-right: var(--spacing-xs);
  font-size: var(--font-size-xs);
}

/* Control SoA indicator in table */
.control-soa-indicator {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  margin-top: var(--spacing-xs);
}

.soa-link {
  color: var(--color-primary);
  font-size: var(--font-size-xs);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  transition: color 0.2s ease;
}

.soa-link:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

/* Highlight row animation for SoA navigation */
.highlight-row {
  animation: highlightRow 2.5s ease-out;
}

@keyframes highlightRow {
  0% {
    background-color: rgba(31, 184, 205, 0.3);
  }
  100% {
    background-color: transparent;
  }
}

/* SoA Alert in modal */
.soa-alert {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  border-radius: var(--border-radius);
  margin-bottom: var(--spacing-lg);
}

.soa-alert--warning {
  background-color: rgba(255, 193, 133, 0.15);
  border: 1px solid rgba(255, 193, 133, 0.4);
}

.soa-alert__icon {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: var(--border-radius-full);
  background-color: var(--color-warning);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-sm);
}

.soa-alert__content {
  flex: 1;
}

.soa-alert__content strong {
  display: block;
  color: var(--color-warning-dark);
  margin-bottom: var(--spacing-xs);
}

.soa-alert__justification {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin: var(--spacing-xs) 0;
  font-style: italic;
}

.soa-alert__link {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: var(--font-size-sm);
  color: var(--color-primary);
  text-decoration: none;
  margin-top: var(--spacing-xs);
}

.soa-alert__link:hover {
  text-decoration: underline;
}

/* Risk row severities */
.risk-row--insignifiant {
  background-color: rgba(93, 135, 143, 0.1);
  color: var(--color-text);
}

.risk-row--mineur {
  background-color: rgba(50, 192, 134, 0.1);
  color: var(--color-text);
}

.risk-row--significatif {
  background-color: rgba(255, 193, 133, 0.2);
  color: var(--color-text);
}

.risk-row--grave {
  background-color: rgba(219, 177, 69, 0.2);
  color: var(--color-text);
}

.risk-row--critique {
  background-color: rgba(219, 69, 69, 0.1);
  color: var(--color-text);
}

/* SoA Risks column */
.soa-risks {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-xs);
  align-items: center;
}

.soa-risks__empty {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  font-style: italic;
}

.soa-risks__badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem var(--spacing-sm);
  border-radius: var(--border-radius-xl);
  font-size: var(--font-size-xs);
  font-weight: 500;
  /* Un libellé long ne doit pas déborder de la colonne : il passe à la ligne dans la pastille. */
  white-space: normal;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.soa-risks__badge--critique {
  background-color: rgba(219, 69, 69, 0.15);
  color: var(--color-danger-dark);
}

.soa-risks__badge--grave {
  background-color: rgba(219, 177, 69, 0.15);
  color: var(--color-warning-dark);
}

.soa-risks__badge--significatif {
  background-color: rgba(255, 193, 133, 0.2);
  color: var(--color-warning);
}

.soa-risks__badge--mineur {
  background-color: rgba(50, 192, 134, 0.15);
  color: var(--color-success-dark);
}

.soa-risks__badge--insignifiant {
  background-color: rgba(93, 135, 143, 0.15);
  color: #436972;
}

.soa-edit-risks {
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: var(--font-size-xs);
  margin-left: var(--spacing-xs);
}

.soa-edit-risks:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Lignes SOA - couleurs selon applicabilité */
.soa-row--applicable {
  background-color: rgba(34, 197, 94, 0.08);
}

.soa-row--applicable:hover {
  background-color: rgba(34, 197, 94, 0.15);
}

.soa-row--not-applicable {
  background-color: rgba(148, 163, 184, 0.15);
  color: var(--color-text-light);
}

.soa-row--not-applicable:hover {
  background-color: rgba(148, 163, 184, 0.22);
}

.soa-row--not-applicable td {
  opacity: 0.7;
}

.soa-row--not-applicable td:first-child,
.soa-row--not-applicable td:nth-child(2) {
  text-decoration: line-through;
  text-decoration-color: rgba(148, 163, 184, 0.5);
}

/* ============================================================
   SOA - Déclaration d'applicabilité améliorée ISO 27001:2022
   ============================================================ */

/* Indicateurs de couverture SOA */
.soa-coverage {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background: var(--color-bg-secondary);
  border-radius: var(--border-radius);
  margin-bottom: var(--spacing-md);
  align-items: center;
}

.soa-coverage__item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--color-bg);
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--color-border);
}

.soa-coverage__label {
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
}

.soa-coverage__value {
  font-weight: 700;
  font-size: var(--font-size-md);
  color: var(--color-text);
}

.soa-coverage__item--progress {
  flex: 1;
  min-width: 200px;
}

.soa-coverage__bar {
  flex: 1;
  height: 8px;
  background: var(--color-border);
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  margin: 0 var(--spacing-md);
}

.soa-coverage__fill {
  height: 100%;
  border-radius: var(--border-radius-sm);
  transition: width 0.5s ease;
}

.soa-coverage__fill--good { background: linear-gradient(90deg, var(--color-success), var(--color-success-dark)); }
.soa-coverage__fill--medium { background: linear-gradient(90deg, var(--color-warning), var(--color-warning-dark)); }
.soa-coverage__fill--low { background: linear-gradient(90deg, var(--color-danger), var(--color-danger-dark)); }

.soa-coverage__item--domains {
  display: flex;
  gap: var(--spacing-md);
  flex-wrap: wrap;
}

.soa-domain-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--spacing-xs) var(--spacing-sm);
}

.soa-domain-stat__label {
  font-size: var(--font-size-xs);
  color: var(--color-text-light);
  text-transform: uppercase;
}

.soa-domain-stat__value {
  font-weight: 700;
  font-size: var(--font-size-sm);
}

/* Badges de domaine */
.badge--domain {
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
}

.badge--organisationnel { background: rgba(59, 130, 246, 0.15); color: var(--color-domain-org); }
.badge--humain { background: rgba(139, 92, 246, 0.15); color: var(--color-domain-human); }
.badge--physique { background: rgba(249, 115, 22, 0.15); color: var(--color-domain-physical); }
.badge--technologique { background: rgba(6, 182, 212, 0.15); color: var(--color-domain-tech); }

/* Contenu contrôle dans SOA */
.soa-control-title {
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
}

.soa-control-desc {
  font-size: var(--font-size-xs);
  color: var(--color-text-light);
  line-height: 1.3;
}

/* Champ exclusion */
.soa-exclusion {
  margin-top: var(--spacing-sm);
  background: rgba(239, 68, 68, 0.05);
  border-color: rgba(239, 68, 68, 0.3);
}

/* Form control small */
.form-control--sm {
  padding: 0.35rem var(--spacing-sm);
  font-size: var(--font-size-sm);
}

.mt-1 { margin-top: var(--spacing-sm); }

/* Nouveaux champs SOA - ISO 27001:2022 compliance */
.soa-owner,
.soa-evidence,
.soa-review-date {
  font-size: var(--font-size-xs);
  padding: 0.3rem 0.4rem;
}

.soa-owner {
  min-width: 100px;
}

.soa-evidence {
  min-width: 90px;
}

.soa-review-date {
  min-width: 110px;
}

/* Indication visuelle des champs manquants */
.soa-row--applicable .soa-owner:placeholder-shown,
.soa-row--applicable .soa-evidence:placeholder-shown {
  background-color: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.3);
}

/* Indication de revue obsolète (>6 mois) */
.soa-review-date.review-outdated {
  background-color: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
}

/* Badge variants for SoA and Doc Review read-only display */
.badge--success { background: rgba(34, 197, 94, 0.15); color: var(--color-success-dark, #1a7a4e); }
.badge--muted { background: var(--color-surface-secondary); color: var(--color-text-light); }
.badge--outline { background: transparent; border: 1px solid var(--color-border); color: var(--color-text); }
.badge--warning { background: rgba(245, 158, 11, 0.15); color: #92610a; }
.badge--danger { background: rgba(239, 68, 68, 0.15); color: var(--color-danger-dark, #a63030); }

/* Meta-line sous un badge ou texte principal (responsable, date, etc.) */
.soa-meta-line {
  font-size: var(--font-size-xs);
  color: var(--color-text-light);
  margin-top: 2px;
  line-height: 1.3;
}

/* Table SOA responsive */
.table--soa {
  font-size: var(--font-size-sm);
}

.table--soa th {
  font-size: var(--font-size-xs);
  white-space: nowrap;
  padding: var(--spacing-sm) 0.4rem;
}

.table--soa td {
  /* padding and vertical-align controlled by #soaTable td */
}

/* ============================================================
   Doc Review - Statistiques et indicateurs visuels
   ============================================================ */

.doc-review-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background: var(--color-bg-secondary);
  border-radius: var(--border-radius);
  margin-bottom: var(--spacing-md);
  align-items: center;
}

.doc-review-stats__item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--color-bg);
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--color-border);
  font-size: var(--font-size-sm);
}

.doc-review-stats__item i {
  font-size: var(--font-size-lg);
}

.doc-review-stats__item span:nth-child(2) {
  font-weight: 700;
  font-size: var(--font-size-md);
}

.doc-review-stats__item--conforme i { color: #22c55e; }
.doc-review-stats__item--partiel i { color: #f59e0b; }
.doc-review-stats__item--non-conforme i { color: #ef4444; }

.doc-review-stats__progress {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  flex: 1;
  min-width: 200px;
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--color-bg);
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--color-border);
}

.doc-review-stats__label {
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
  white-space: nowrap;
}

.doc-review-stats__bar {
  flex: 1;
  height: 8px;
  background: var(--color-border);
  border-radius: var(--border-radius-sm);
  overflow: hidden;
}

.doc-review-stats__fill {
  height: 100%;
  border-radius: var(--border-radius-sm);
  transition: width 0.5s ease;
}

.doc-review-stats__fill--good { background: linear-gradient(90deg, var(--color-success), var(--color-success-dark)); }
.doc-review-stats__fill--medium { background: linear-gradient(90deg, var(--color-warning), var(--color-warning-dark)); }
.doc-review-stats__fill--low { background: linear-gradient(90deg, var(--color-danger), var(--color-danger-dark)); }

.doc-review-stats__value {
  font-weight: 700;
  min-width: 40px;
  text-align: right;
}

/* Lignes Doc Review selon statut */
.doc-review-row--conforme {
  background-color: rgba(34, 197, 94, 0.08);
}

.doc-review-row--conforme:hover {
  background-color: rgba(34, 197, 94, 0.15);
}

.doc-review-row--partiel {
  background-color: rgba(245, 158, 11, 0.08);
}

.doc-review-row--partiel:hover {
  background-color: rgba(245, 158, 11, 0.15);
}

.doc-review-row--non-conforme {
  background-color: rgba(239, 68, 68, 0.08);
}

.doc-review-row--non-conforme:hover {
  background-color: rgba(239, 68, 68, 0.15);
}

.doc-review-row--na {
  background-color: rgba(148, 163, 184, 0.1);
  opacity: 0.7;
}

.doc-review-desc {
  font-size: var(--font-size-sm);
  line-height: 1.4;
}

.doc-review-link {
  display: inline-block;
  margin-top: var(--spacing-xs);
  color: var(--color-primary);
  font-size: var(--font-size-sm);
}

.doc-review-link:hover {
  text-decoration: underline;
}

/* Textarea de justification dans les tableaux SoA et autres */
.soa-justification,
.doc-review-justification,
.doc-review-tool,
textarea.form-control.soa-justification[disabled],
textarea.form-control.doc-review-justification[disabled],
textarea.form-control.doc-review-tool[disabled] {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 80px;
  resize: vertical;
  font-size: var(--font-size-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  line-height: 1.5;
  box-sizing: border-box;
}

/* SoA column widths: defined by #soaTable ID rules (6-column layout) */

/* Tableau Document Review - layout 5 colonnes (refonte alignée sur SoA) */
.table--doc-review { table-layout: fixed; width: 100%; font-size: var(--font-size-sm); }
.table--doc-review th { font-size: var(--font-size-xs); white-space: nowrap; padding: var(--spacing-sm) var(--spacing-md); }
.table--doc-review td { vertical-align: top; padding: var(--spacing-sm) var(--spacing-md); overflow-wrap: anywhere; }
.table--doc-review th:nth-child(1),
.table--doc-review td:nth-child(1) { width: 28%; min-width: 200px; } /* Clause / Exigence */
.table--doc-review th:nth-child(2),
.table--doc-review td:nth-child(2) { width: 14%; min-width: 120px; } /* Conformité */
.table--doc-review th:nth-child(3),
.table--doc-review td:nth-child(3) { width: 26%; min-width: 200px; } /* Justification */
.table--doc-review th:nth-child(4),
.table--doc-review td:nth-child(4) { width: 18%; min-width: 140px; } /* Documentation */
.table--doc-review th:nth-child(5),
.table--doc-review td:nth-child(5) { width: 14%; min-width: 120px; } /* Revue */

/* Cellule Clause / Exigence - layout structuré comme SoA */
.doc-review-cell-clause { }
.doc-review-clause-ref {
  display: block;
  font-weight: 700;
  font-size: var(--font-size-sm);
  color: var(--color-primary);
  margin-bottom: var(--spacing-xs);
}
.doc-review-clause-desc {
  font-size: var(--font-size-xs);
  color: var(--color-text-light);
  line-height: 1.4;
}

/* En-tête de chapitre DocReview - style gradient comme SoA */
.doc-review-chapter-header {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark, var(--color-primary)));
  color: #fff !important;
  font-weight: 600;
  padding: var(--spacing-sm) var(--spacing-md) !important;
  font-size: var(--font-size-sm);
  letter-spacing: 0.01em;
}

/* Inputs compacts dans DocReview */
#docReviewTable input[type="text"],
#docReviewTable input[type="date"],
#docReviewTable select,
#docReviewTable textarea {
  font-size: var(--font-size-xs);
  padding: 0.35rem var(--spacing-sm);
  width: 100%;
  box-sizing: border-box;
}

/* Justification cell wrapper with expand button */
.doc-review-justification-wrap {
  position: relative;
  display: flex;
  gap: var(--spacing-xs);
  align-items: flex-start;
}
.doc-review-justification-wrap .doc-review-justification {
  flex: 1;
  min-width: 0;
}
.doc-review-expand-btn {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  padding: var(--spacing-xs) var(--spacing-xs);
  color: var(--color-text-secondary, #64748b);
  font-size: var(--font-size-xs);
  line-height: 1;
  transition: color 0.15s, border-color 0.15s;
  margin-top: var(--spacing-xs);
}
.doc-review-expand-btn:hover {
  color: var(--color-primary, #6366f1);
  border-color: var(--color-primary, #6366f1);
}

/* ============================================================
   Système générique de commentaires (CSI Comments)
   ============================================================ */
.csi-comments-list {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: var(--spacing-sm);
}
.csi-comment-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border, #e9ecef);
}
.csi-comment-item__body {
  flex: 1;
}
.csi-comment-item__date {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
}
.csi-comment-item__text {
  margin: 4px 0 0;
  white-space: pre-wrap;
  line-height: 1.4;
}
.csi-comment-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  margin-left: 4px;
  line-height: 1;
}
.csi-comment-btn {
  position: relative;
}
.csi-comments-empty {
  color: var(--color-text-secondary);
  text-align: center;
  padding: 16px 0;
  font-style: italic;
}

/* ============================================================
   SoA - Description expand/collapse
   ============================================================ */
.soa-desc-expand {
  display: inline;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-primary);
  font-size: var(--font-size-xs);
  padding: 0 2px;
  vertical-align: baseline;
  transition: color 0.15s;
}
.soa-desc-expand:hover {
  color: var(--color-primary-dark, var(--color-primary));
}
.soa-control-desc[data-truncated="false"] {
  white-space: normal;
}

/* Tableau KPI - largeurs de colonnes */
#kpiTable th:nth-child(1),
#kpiTable td:nth-child(1) {
  width: 20%;
  min-width: 150px;
}

#kpiTable th:nth-child(2),
#kpiTable td:nth-child(2) {
  width: 30%;
  min-width: 200px;
}

#kpiTable th:nth-child(3),
#kpiTable td:nth-child(3) {
  width: 30%;
  min-width: 180px;
}

#kpiTable th:nth-child(4),
#kpiTable td:nth-child(4) {
  width: 120px;
  min-width: 100px;
}
#kpiTable { table-layout: fixed; }
#kpiTable td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Colonnes avec cell-clamp — overflow visible */
#kpiTable td:nth-child(1),
#kpiTable td:nth-child(2),
#kpiTable td:nth-child(3) {
  overflow: visible;
}
#kpiTable td:nth-child(4) {
  overflow: visible;
  white-space: nowrap;
}

/* Fix pour éviter que les textareas et inputs soient trop compressés */
.table textarea.form-control,
.table input.form-control {
  min-width: 150px;
  box-sizing: border-box;
}

/* Inputs dans les tableaux - ne pas afficher la validation visuelle */
.table input.form-control:valid,
.table input.form-control:invalid {
  border-color: var(--color-border);
}

.table input.form-control:focus {
  border-color: var(--color-primary);
}

/* ============================================================
   Contrôles ISO27002:2022 - Styles améliorés
   ============================================================ */

/* Tableau Contrôles - 7 colonnes, layout fixe */
.table--controls { table-layout: fixed; width: 100%; }
.table--controls th:nth-child(1),
.table--controls td:nth-child(1) { width: 5%; } /* Réf */
.table--controls th:nth-child(2),
.table--controls td:nth-child(2) { width: 45%; } /* Contrôle + Desc + badges */
.table--controls th:nth-child(3),
.table--controls td:nth-child(3) { width: 10%; } /* Propriétaire */
.table--controls th:nth-child(4),
.table--controls td:nth-child(4) { width: 10%; } /* Statut */
.table--controls th:nth-child(5),
.table--controls td:nth-child(5) { width: 10%; } /* Maturité */
.table--controls th:nth-child(6),
.table--controls td:nth-child(6) { width: 12%; } /* Date éval */
.table--controls th:nth-child(7),
.table--controls td:nth-child(7) { width: 8%; } /* Preuves */
.table--controls th:nth-child(7) { text-align: center; } /* en-tête aligné sur .evidence-cell */
.table--controls td { overflow: hidden; text-overflow: ellipsis; }

.table--cyfun-controls,
.table--recyf-controls {
  table-layout: fixed;
  width: 100%;
}

/* Lot 1b (refonte UX) : CyFun 9 → 7 colonnes (Catégorie fusionnée sous la Réf., Moy. supprimée) */
table.table--cyfun-controls {
  min-width: 1080px;
}

/* Lot 1b (refonte UX) : ReCyF 9 → 7 colonnes (Thématique retirée, Justification supprimée) */
table.table--recyf-controls {
  min-width: 1100px;
}

.table--cyfun-controls td,
.table--recyf-controls td {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Catégorie en sous-ligne discrète sous la référence */
.framework-cat-subline {
  font-size: 0.72em;
  color: var(--color-text-light, #9ca3af);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table--cyfun-controls th:nth-child(1),
.table--cyfun-controls td:nth-child(1) { width: 14%; }
.table--cyfun-controls th:nth-child(2),
.table--cyfun-controls td:nth-child(2) { width: 9%; }
.table--cyfun-controls th:nth-child(3),
.table--cyfun-controls td:nth-child(3) { width: 39%; }
.table--cyfun-controls th:nth-child(4),
.table--cyfun-controls td:nth-child(4) { width: 13%; }
.table--cyfun-controls th:nth-child(5),
.table--cyfun-controls td:nth-child(5) { width: 12%; white-space: nowrap; }
.table--cyfun-controls th:nth-child(6),
.table--cyfun-controls td:nth-child(6),
.table--cyfun-controls th:nth-child(7),
.table--cyfun-controls td:nth-child(7) { width: 6%; text-align: center; }

.table--recyf-controls th:nth-child(1),
.table--recyf-controls td:nth-child(1) { width: 8%; }
.table--recyf-controls th:nth-child(2),
.table--recyf-controls td:nth-child(2) { width: 9%; }
.table--recyf-controls th:nth-child(3),
.table--recyf-controls td:nth-child(3) { width: 35%; }
.table--recyf-controls th:nth-child(4),
.table--recyf-controls td:nth-child(4) { width: 12%; }
.table--recyf-controls th:nth-child(5),
.table--recyf-controls td:nth-child(5) { width: 11%; white-space: nowrap; }
.table--recyf-controls th:nth-child(6),
.table--recyf-controls td:nth-child(6) { width: 7%; text-align: center; }
.table--recyf-controls th:nth-child(7),
.table--recyf-controls td:nth-child(7) { width: 18%; }

.table--recyf-controls select {
  min-width: 150px;
  width: 100%;
}

#nis2-controls .table-container,
#recyf-controls .table-container {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

/* GOV-NIS2 S5 (M19) : la cellule Responsables contient deux lignes (divs enfants) —
   text-overflow ne s'applique jamais au contenu de blocs enfants : sans ces règles,
   un nom long était coupé au pixel, sans points de suspension. */
.table--cyfun-controls .framework-owner-cell > div,
.table--recyf-controls .framework-owner-cell > div {
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 1400px) {
  table.table--cyfun-controls {
    min-width: 880px;
  }

  table.table--recyf-controls {
    min-width: 900px;
  }

  /* GOV-NIS2 S5 (audit 2026-08-20, M19) : la colonne Responsables portait le masquage
     historique de l'ancienne colonne mono-ligne — sous 1400px (1366×768 bureautique
     standard) les DEUX responsables disparaissaient sans repli. Le conteneur scrolle
     déjà (overflow-x:auto) : la colonne reste visible. */
}

.control-title {
  font-weight: 600;
  margin-bottom: 2px;
}

.control-description {
  font-size: 0.82em;
  color: var(--text-secondary, #666);
  line-height: 1.4;
  margin-top: 2px;
  margin-bottom: 4px;
  cursor: pointer;
  word-break: break-word;
}

.control-description--collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.control-expand-icon {
  font-size: 0.75em;
  margin-left: 6px;
  color: var(--color-primary, #4f46e5);
  cursor: pointer;
  opacity: 0.6;
  transition: transform 0.2s ease, opacity 0.2s ease;
  vertical-align: middle;
}

.control-expand-icon:hover {
  opacity: 1;
}

.control-expand-icon.expanded {
  transform: rotate(180deg);
}

.badge--type {
  font-size: var(--font-size-xs, 0.75rem);
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--color-bg-secondary, #f1f5f9);
  color: var(--color-text-light, #64748b);
}

.control-attrs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-xs);
  margin-top: var(--spacing-xs);
}

.control-capability {
  font-size: var(--font-size-xs);
  color: var(--color-text-light);
  background: var(--color-bg-secondary);
  padding: var(--spacing-xs) var(--spacing-xs);
  border-radius: var(--border-radius-sm);
}


/* CMM Badges */
.cmm-badge {
  display: inline-block;
  padding: var(--spacing-xs) var(--spacing-xs);
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-xs);
  font-weight: 600;
}

.cmm-badge--initial { background: var(--color-danger-light); color: var(--color-danger-dark); }
.cmm-badge--repetable, .cmm-badge--répétable { background: var(--color-warning-light); color: var(--color-warning-dark); }
.cmm-badge--defini, .cmm-badge--défini { background: var(--color-info-light); color: var(--color-info-dark); }
.cmm-badge--gere, .cmm-badge--géré { background: var(--color-success-light); color: var(--color-success-dark); }
.cmm-badge--optimise, .cmm-badge--optimisé { background: var(--color-success-dark); color: var(--color-success-light); }

/* Efficacité */
.effectiveness {
  font-size: var(--font-size-xs);
  margin-top: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-xs);
  border-radius: var(--border-radius-sm);
}

.effectiveness--good { background: var(--color-success-light); color: var(--color-success-dark); }
.effectiveness--medium { background: var(--color-warning-light); color: var(--color-warning-dark); }
.effectiveness--bad { background: var(--color-danger-light); color: var(--color-danger-dark); }
.effectiveness--neutral { background: #f1f5f9; color: #64748b; }

/* Preuves */
.evidence-cell {
  text-align: center;
}

.evidence-yes {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--font-size-xs);
  color: #16a34a;
  font-weight: 600;
  cursor: help;
}

.evidence-yes i { font-size: 0.85em; }

.evidence-no {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--font-size-xs);
  color: var(--color-text-light, #94a3b8);
}

.evidence-no i { font-size: 0.85em; }

.kpi-ref {
  color: #3b82f6;
  font-size: var(--font-size-sm);
  cursor: help;
}

/* Link badges */
.link-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-xs);
  font-weight: 500;
}

.link-badge--control {
  background-color: rgba(50, 192, 134, 0.1);
  color: var(--color-success);
}

.link-badge--risk {
  background-color: rgba(255, 193, 133, 0.2);
  color: var(--color-warning-dark);
}

.link-badge--nc {
  background-color: rgba(219, 69, 69, 0.1);
  color: var(--color-danger);
}

.link-badge--audit {
  background-color: rgba(31, 184, 205, 0.1);
  color: var(--color-primary);
}

.link-badge--threat {
  background-color: rgba(93, 135, 143, 0.1);
  color: var(--color-secondary-dark);
}

.link-badge--continuous {
  background-color: var(--color-primary-light);
  color: var(--color-primary-dark);
}
.link-badge--asset {
  background-color: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}
/* Lot 0 actifs (2026-09, D7) : sous-ligne de badges d'actifs dans la cellule titre
   (sœur du .cell-clamp — jamais dedans, le line-clamp la tronquerait) */
.asset-badges-line {
  margin-top: 2px;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  font-size: 0.72rem;
  line-height: 1.3;
}
/* Lot 4 actifs (2026-09, D11) : encart de conformité en tête de module */
.critical-assets__compliance {
  font-size: 0.8rem;
  color: var(--color-text-light, #6b7280);
  margin-top: 4px;
}
/* Lot 3 actifs (2026-09, A8) : avertissement de cohérence classe/RTO/MTPD — informatif */
.asset-coherence-hint {
  display: block;
  color: var(--color-warning, #b45309);
  margin: 4px 0 0;
}
/* RA-ACTIFS (2026-09, D10) : couverture d'un actif par les analyses de risques */
.asset-product__coverage {
  font-size: 0.72rem;
  color: var(--color-text-light, #6b7280);
  margin-top: 2px;
}
.risk-action-link {
  cursor: pointer;
  text-decoration: none;
}

.risk-action-link:hover {
  text-decoration: underline;
}

.risk-action-link:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.critical-asset-link {
  cursor: pointer;
  text-decoration: none;
}

.critical-asset-link:hover {
  text-decoration: underline;
}

.critical-asset-link:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Critical assets */
.critical-assets__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.critical-assets__filter {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  min-width: 180px;
}

.critical-assets__filter label {
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
}

.critical-assets__table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: var(--spacing-md) 0 var(--spacing-sm);
}

.critical-assets__meta {
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
}

/* Project risks KPI row */
.project-risks__kpi-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}
.project-risks__kpi-card {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md) var(--spacing-lg);
  background: var(--color-surface);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--color-border);
  position: relative;
  overflow: hidden;
}
.project-risks__kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-lg);
  flex-shrink: 0;
}
.project-risks__kpi-icon--analyses {
  background: rgba(34, 197, 94, 0.12);
  color: var(--color-success);
}
.project-risks__kpi-icon--recos {
  background: rgba(59, 130, 246, 0.12);
  color: var(--color-info, #3b82f6);
}
.project-risks__kpi-data {
  flex: 1;
  min-width: 0;
}
.project-risks__kpi-values {
  display: flex;
  align-items: baseline;
  gap: var(--spacing-xs);
  font-size: var(--font-size-xl);
  font-weight: 700;
}
.project-risks__kpi-value--success {
  color: var(--color-success);
}
.project-risks__kpi-value--total {
  color: var(--color-text-light);
  font-size: var(--font-size-lg);
}
.project-risks__kpi-separator {
  color: var(--color-text-light);
  font-size: var(--font-size-lg);
}
.project-risks__kpi-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
  margin-top: var(--spacing-xs);
}
.project-risks__kpi-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-border);
}
.project-risks__kpi-bar-fill {
  height: 100%;
  transition: width 0.5s ease;
  border-radius: 0 2px 0 0;
}
.project-risks__kpi-bar-fill--success {
  background: var(--color-success);
}
.project-risks__kpi-bar-fill--info {
  background: var(--color-info, #3b82f6);
}

/* Priority badges */
.pr-priority-badge {
  display: inline-block;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--border-radius-lg);
  font-size: var(--font-size-xs);
  font-weight: 600;
  white-space: nowrap;
}
/* FIX-I18N-PRIORITY-CRITICAL (audit 2026-06-10) : pastille de la priorité P0 « critical » */
.pr-priority-badge--critical { background: rgba(219,69,69,0.18); color: var(--color-danger); }
.pr-priority-badge--high { background: rgba(219,69,69,0.12); color: var(--color-danger); }
.pr-priority-badge--medium { background: rgba(255,193,133,0.12); color: var(--color-warning-dark); }
.pr-priority-badge--low { background: rgba(50,192,134,0.12); color: var(--color-success-dark); }

@media (max-width: 640px) {
  .project-risks__kpi-row {
    grid-template-columns: 1fr;
  }
}

.project-risk-name {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.project-risk-indicator {
  width: 20px;
  height: 20px;
  border-radius: var(--border-radius-full);
  background-color: var(--color-border);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.04);
  flex: 0 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  color: #fff;
}

.project-risk-indicator--red {
  background-color: var(--color-danger);
}

.project-risk-indicator--yellow {
  background-color: var(--color-warning-dark);
}

.project-risk-indicator--green {
  background-color: var(--color-success);
}

.project-risk-indicator--todo {
  background-color: var(--color-secondary-dark);
}

.project-risk-indicator--suspended {
  background-color: var(--color-primary);
}

.project-risk-link {
  color: var(--color-primary);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.project-risk-link:hover {
  text-decoration: underline;
}

.table--project-risks tr.project-risk-row--red td:first-child {
  box-shadow: inset 4px 0 0 rgba(219, 69, 69, 0.65);
}

.table--project-risks tr.project-risk-row--yellow td:first-child {
  box-shadow: inset 4px 0 0 rgba(255, 193, 133, 0.7);
}

.table--project-risks tr.project-risk-row--green td:first-child {
  box-shadow: inset 4px 0 0 rgba(50, 192, 134, 0.65);
}

.table--project-risks tr.project-risk-row--todo td:first-child {
  box-shadow: inset 4px 0 0 rgba(93, 135, 143, 0.65);
}

.table--project-risks tr.project-risk-row--suspended td:first-child {
  box-shadow: inset 4px 0 0 rgba(31, 184, 205, 0.65);
}

/* Column widths for Risques SMSI table (7 columns) */
.table--risks-smsi {
  table-layout: fixed;
  min-width: 900px;
}
.table--risks-smsi th:nth-child(1) { width: 22%; }
.table--risks-smsi th:nth-child(2) { width: 12%; }
.table--risks-smsi th:nth-child(3) { width: 12%; }
.table--risks-smsi th:nth-child(4) { width: 12%; }
.table--risks-smsi th:nth-child(5) { width: 17%; }
.table--risks-smsi th:nth-child(6) { width: 12%; }
.table--risks-smsi th:nth-child(7) { width: 13%; }
.table--risks-smsi td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Colonnes avec cell-clamp : overflow visible pour laisser le clamp gérer */
.table--risks-smsi td:nth-child(1),
.table--risks-smsi td:nth-child(4),
.table--risks-smsi td:nth-child(5),
.table--risks-smsi td:nth-child(6) {
  overflow: visible;
}
.table--risks-smsi .status-badge {
  white-space: nowrap;
  font-size: var(--font-size-xs);
}

/* Reusable line-clamp wrapper — toujours DANS un td, jamais SUR le td */
.cell-clamp {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  word-break: break-word;
  line-height: 1.4;
}
.cell-clamp--2 { -webkit-line-clamp: 2; max-height: calc(1.4em * 2); }
.cell-clamp--3 { -webkit-line-clamp: 3; max-height: calc(1.4em * 3); }

/* ============================================================
   Column widths & truncation for governance tables
   ============================================================ */

/* === Actions table (9 cols) === */
/* Lot 1a (refonte UX) : 8 colonnes — ID, Action, Lien, Priorité, Statut, Avancement, Échéance, Responsable */
.table--actions { table-layout: fixed; min-width: 900px; }
.table--actions th:nth-child(1) { width: 8%; }
.table--actions th:nth-child(2) { width: 28%; }
.table--actions th:nth-child(3) { width: 14%; }
.table--actions th:nth-child(4) { width: 10%; }
.table--actions th:nth-child(5) { width: 12%; }
.table--actions th:nth-child(6) { width: 11%; }
.table--actions th:nth-child(7) { width: 9%; }
.table--actions th:nth-child(8) { width: 8%; }
.table--actions td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Colonnes avec cell-clamp ou badges — overflow visible */
.table--actions td:nth-child(2),
.table--actions td:nth-child(3),
.table--actions td:nth-child(4),
.table--actions td:nth-child(5) {
  overflow: visible;
}

/* === Threats table (7 cols — Lot 1a refonte UX) === */
.table--threats { table-layout: fixed; min-width: 900px; }
.table--threats th:nth-child(1) { width: 26%; }
.table--threats th:nth-child(2) { width: 10%; }
.table--threats th:nth-child(3) { width: 10%; }
.table--threats th:nth-child(4) { width: 8%; }
.table--threats th:nth-child(5) { width: 12%; }
.table--threats th:nth-child(6) { width: 14%; }
.table--threats th:nth-child(7) { width: 20%; }
.table--threats td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Colonnes avec cell-clamp ou badges — overflow visible */
.table--threats td:nth-child(1),
.table--threats td:nth-child(5),
.table--threats td:nth-child(6) {
  overflow: visible;
}

/* === Non-conformities table (7 cols — Lot 1a refonte UX) === */
.table--nc { table-layout: fixed; min-width: 900px; }
.table--nc th:nth-child(1) { width: 30%; }
.table--nc th:nth-child(2) { width: 10%; }
.table--nc th:nth-child(3) { width: 11%; }
.table--nc th:nth-child(4) { width: 11%; }
.table--nc th:nth-child(5) { width: 13%; }
.table--nc th:nth-child(6) { width: 14%; }
.table--nc th:nth-child(7) { width: 11%; }
.table--nc td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Colonnes avec cell-clamp — overflow visible */
.table--nc td:nth-child(1),
.table--nc td:nth-child(2),
.table--nc td:nth-child(3) {
  overflow: visible;
}

/* === Audits table (7 cols) === */
.table--audits { table-layout: fixed; min-width: 800px; }
.table--audits th:nth-child(1) { width: 22%; }
.table--audits th:nth-child(2) { width: 12%; }
.table--audits th:nth-child(3) { width: 18%; }
.table--audits th:nth-child(4) { width: 12%; }
.table--audits th:nth-child(5) { width: 12%; }
.table--audits th:nth-child(6) { width: 10%; }
.table--audits th:nth-child(7) { width: 14%; }
.table--audits td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Colonnes avec cell-clamp — overflow visible */
.table--audits td:nth-child(1),
.table--audits td:nth-child(3),
.table--audits td:nth-child(6) {
  overflow: visible;
}

/* === Reviews table (5 cols) === */
.table--reviews { table-layout: fixed; min-width: 700px; }
.table--reviews th:nth-child(1) { width: 12%; }
.table--reviews th:nth-child(2) { width: 22%; }
.table--reviews th:nth-child(3) { width: 25%; }
.table--reviews th:nth-child(4) { width: 25%; }
.table--reviews th:nth-child(5) { width: 16%; }
.table--reviews td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Colonnes avec cell-clamp — overflow visible */
.table--reviews td:nth-child(2),
.table--reviews td:nth-child(3),
.table--reviews td:nth-child(4) {
  overflow: visible;
}

/* === Stakeholders table (4 cols) === */
/* Lot 1b : Commentaires réduits (~20 %) au profit de Nom */
.table--stakeholders { table-layout: fixed; }
.table--stakeholders th:nth-child(1) { width: 36%; }
.table--stakeholders th:nth-child(2) { width: 20%; }
.table--stakeholders th:nth-child(3) { width: 24%; }
.table--stakeholders th:nth-child(4) { width: 20%; }
.table--stakeholders td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* cell-clamp wrapper handles line-clamping inside td */

/* === Documents table (4 cols) === */
.table--documents { table-layout: fixed; }
.table--documents th:nth-child(1) { width: 25%; }
.table--documents th:nth-child(2) { width: 25%; }
.table--documents th:nth-child(3) { width: 20%; }
.table--documents th:nth-child(4) { width: 30%; }
.table--documents td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Column widths for project risks table (7 columns) */
.table--project-risks {
  table-layout: fixed;
}
table.table--project-risks {
  min-width: 980px;
}
.table--project-risks th:nth-child(1) { width: 18%; }
.table--project-risks th:nth-child(2) { width: 12%; }
.table--project-risks th:nth-child(3) { width: 24%; }
.table--project-risks th:nth-child(4) { width: 9%; }
.table--project-risks th:nth-child(5) { width: 11%; }
.table--project-risks th:nth-child(6) { width: 11%; }
.table--project-risks th:nth-child(7) { width: 15%; }
.table--project-risks td {
  overflow: hidden;
  text-overflow: ellipsis;
}
.table--project-risks td:nth-child(5) {
  overflow: visible;
}
.table--project-risks td:nth-child(4),
.table--project-risks td:nth-child(5),
.table--project-risks td:nth-child(6) {
  white-space: nowrap;
}
.table--project-risks .status-badge {
  white-space: nowrap;
  font-size: var(--font-size-xs);
}
.project-risk-desc {
  white-space: normal;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
  max-height: calc(1.4em * 5);
}
.project-risk-note {
  color: var(--color-info, #3b82f6);
  font-style: italic;
  font-size: var(--font-size-sm);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Status breakdown counters */
.pr-status-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-xs);
  margin-top: var(--spacing-xs);
}
.pr-status-count {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: var(--font-size-xs);
  font-weight: 600;
  padding: 1px var(--spacing-xs);
  border-radius: var(--border-radius);
  line-height: 1.4;
}
.pr-status-count i {
  font-size: 0.55rem;
}
.pr-status-count--red {
  background-color: rgba(219, 69, 69, 0.12);
  color: var(--color-danger);
}
.pr-status-count--yellow {
  background-color: rgba(255, 193, 133, 0.22);
  color: var(--color-warning-dark);
}
.pr-status-count--green {
  background-color: rgba(50, 192, 134, 0.14);
  color: var(--color-success);
}
.pr-status-count--todo {
  background-color: rgba(93, 135, 143, 0.14);
  color: var(--color-secondary-dark);
}
.pr-status-count--suspended {
  background-color: rgba(31, 184, 205, 0.12);
  color: var(--color-primary);
}

/* Link button in name column */
.pr-link-btn {
  display: inline-flex;
  align-items: center;
  margin-left: 0.4rem;
  color: var(--color-info, #3b82f6);
  font-size: var(--font-size-xs);
  opacity: 0.7;
  transition: opacity 0.15s;
  text-decoration: none;
}
.pr-link-btn:hover {
  opacity: 1;
}

/* Lot 1a (refonte UX) : 9 colonnes — Priorité, Bénéficiaire, Produit, Type, RTO/RPO, Dispo, Impact, DACP, MFA */
.table--critical-assets { min-width: 900px; }
.table--critical-assets th:nth-child(1),
.table--critical-assets td:nth-child(1) {
  width: 80px;
  text-align: center;
}

.asset-rto-rpo {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.asset-priority {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--border-radius-lg);
  background: rgba(248, 113, 113, 0.15);
  color: #b91c1c;
  font-weight: 700;
}

.asset-product__tags {
  display: flex;
  gap: var(--spacing-xs);
  margin-bottom: var(--spacing-xs);
}

.asset-product__code {
  font-weight: 700;
}

.asset-product__name {
  color: var(--color-text-light);
  font-style: italic;
}

.asset-availability__note {
  color: var(--color-text-light);
  font-style: italic;
  font-size: var(--font-size-sm);
}

.asset-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.65rem;
  border-radius: var(--border-radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
  white-space: nowrap;
  word-break: keep-all;
  border: 1px solid rgba(248, 113, 113, 0.4);
  color: #b91c1c;
  background: rgba(248, 113, 113, 0.1);
}

.asset-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.6rem;
  border-radius: var(--border-radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
  background: var(--color-surface-secondary);
  color: var(--color-text);
}

.asset-tag--alert {
  background: rgba(219, 69, 69, 0.12);
  color: var(--color-danger);
}

.asset-tag--conf {
  background: rgba(255, 193, 133, 0.2);
  color: var(--color-warning-dark);
}

.asset-tag--impact {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.asset-tag--yes {
  background: rgba(50, 192, 134, 0.1);
  color: var(--color-success);
}

.asset-tag--no {
  background: rgba(148, 163, 184, 0.2);
  color: var(--color-text-light);
}

.asset-tag--mfa {
  background: rgba(219, 69, 69, 0.12);
  color: var(--color-danger);
}

.asset-mfa {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

/* Legend for action link types */
.actions-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
}

/* Priority styles */
.priority--low {
  background-color: rgba(50, 192, 134, 0.1);
  color: var(--color-success);
}

.priority--medium {
  background-color: rgba(255, 193, 133, 0.2);
  color: var(--color-warning-dark);
}

.priority--high {
  background-color: rgba(219, 177, 69, 0.2);
  color: #a68a1b;
}

.priority--critical {
  background-color: rgba(219, 69, 69, 0.1);
  color: var(--color-danger);
}

/* Progress bar */
.progress-bar {
  height: 8px;
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  margin-bottom: var(--spacing-xs);
}

.progress-bar__fill {
  height: 100%;
  background-color: var(--color-primary);
  border-radius: var(--border-radius-sm);
}

.nis2-progress-cell {
  min-width: 140px;
}
.nis2-progress-cell .progress-bar {
  margin-bottom: var(--spacing-xs);
}
.nis2-progress-cell .progress-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-light);
}

/* Action buttons */
.action-buttons {
  display: flex;
  gap: var(--spacing-sm);
}

.icon-btn {
  background: none;
  border: none;
  padding: var(--spacing-xs);
  cursor: pointer;
  font-size: var(--font-size-md);
  border-radius: var(--border-radius-sm);
  transition: background-color var(--transition-duration) ease;
}

.icon-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.icon-btn--danger:hover {
  color: var(--color-danger);
}

body.theme-dark .icon-btn {
  color: #e5e7eb;
}
body.theme-dark .icon-btn:hover {
  background-color: rgba(255, 255, 255, 0.08);
}
body.theme-dark .icon-btn--danger {
  color: #fca5a5;
}
body.theme-dark .icon-btn--danger:hover {
  color: #f87171;
}

/* Search box */
.search-box {
  position: relative;
  flex: 1;
  max-width: 300px;
}

.search-box i {
  position: absolute;
  left: var(--spacing-sm);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-light);
}

.search-box input {
  padding-left: calc(var(--spacing-sm) * 2 + 1em);
}

/* Form controls */
.form-control {
  display: block;
  width: 100%;
  padding: var(--spacing-md);
  font-size: var(--font-size-md);
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  transition: border-color var(--transition-duration) ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
}

.form-control[readonly] {
  background-color: rgba(0, 0, 0, 0.03);
}

/* Textareas - styles globaux */
textarea.form-control {
  min-height: 80px;
  resize: vertical;
  line-height: 1.5;
}

/* Textareas dans les modals */
.modal__body textarea.form-control {
  min-height: 100px;
  max-height: 300px;
}

/* Textareas readonly avec beaucoup de contenu */
textarea.form-control[readonly],
textarea.form-control[disabled] {
  min-height: 60px;
  background-color: rgba(0, 0, 0, 0.03);
  cursor: not-allowed;
}

/* Select multiples */
select.form-control[multiple] {
  min-height: 120px;
  padding: var(--spacing-sm);
}

select.form-control[multiple] option {
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--border-radius-sm);
  margin-bottom: var(--spacing-xs);
}

select.form-control[multiple] option:checked {
  background: linear-gradient(0deg, var(--color-primary-light) 0%, var(--color-primary-light) 100%);
  color: var(--color-primary-dark);
}

/* Required field indicator */
.modal__label--required::after {
  content: " *";
  color: var(--color-danger, #dc3545);
}

/* Password input wrapper */
.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper .form-control {
  padding-right: 2.75rem;
}

.password-toggle-btn {
  position: absolute;
  right: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--spacing-xs);
  color: var(--color-text-muted, #6c757d);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-sm);
  transition: color 0.2s ease, background-color 0.2s ease;
}

.password-toggle-btn:hover {
  color: var(--color-primary);
  background-color: rgba(0, 0, 0, 0.05);
}

.password-toggle-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.password-toggle-btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* Buttons — V3 : ombre douce, dégradé subtil sur les variantes pleines,
   micro-élévation au survol, focus clavier visible. Tout en variables de thème. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-sm) var(--spacing-md);
  font-weight: 600;
  font-size: var(--font-size-md);
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  transition: all var(--transition-duration) ease;
}

.btn:hover {
  background-color: rgba(0, 0, 0, 0.03);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.14);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1);
}

.btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.btn--primary,
.btn--secondary,
.btn--success,
.btn--danger {
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(0, 0, 0, 0.05));
}

.btn--primary {
  color: white;
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn--primary:hover {
  background-color: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
}

.btn--secondary {
  color: white;
  background-color: var(--color-secondary);
  border-color: var(--color-secondary);
}

.btn--secondary:hover {
  background-color: var(--color-secondary-dark);
  border-color: var(--color-secondary-dark);
}

.btn--danger {
  color: white;
  background-color: var(--color-danger);
  border-color: var(--color-danger);
}

.btn--danger:hover {
  background-color: var(--color-danger-dark);
  border-color: var(--color-danger-dark);
}

.btn--danger:disabled {
  background: var(--color-border) !important;
  border-color: var(--color-border) !important;
  color: var(--color-text-muted) !important;
  box-shadow: none !important;
  opacity: 0.6;
  cursor: not-allowed;
}

.btn--success {
  color: white;
  background-color: var(--color-success);
  border-color: var(--color-success);
}

.btn--success:hover {
  background-color: var(--color-success-dark);
  border-color: var(--color-success-dark);
}

.btn--outline {
  background-color: transparent;
  border: 1px solid var(--color-border);
}

.btn--outline:hover {
  background-color: rgba(0, 0, 0, 0.03);
}

.btn--ghost {
  background: transparent;
  border: none;
  color: var(--color-text-light);
  padding: var(--spacing-xs);
  box-shadow: none;
}
.btn--ghost:hover {
  color: var(--color-primary);
  background: rgba(0, 0, 0, 0.04);
  transform: none;
  box-shadow: none;
}

.btn:disabled,
.btn[disabled] {
  background: var(--color-border);
  border-color: var(--color-border);
  color: var(--color-text-light);
  box-shadow: none;
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.btn--primary:disabled,
.btn--secondary:disabled,
.btn--success:disabled,
.btn--outline:disabled,
.btn--ghost:disabled {
  background: var(--color-border);
  border-color: var(--color-border);
  color: var(--color-text-light);
  box-shadow: none;
  opacity: 0.6;
  cursor: not-allowed;
}

.btn--sm {
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: var(--font-size-sm);
}

.btn--lg {
  padding: var(--spacing-md) var(--spacing-lg);
  font-size: var(--font-size-lg);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition-duration) ease, visibility var(--transition-duration) ease;
}

.modal-overlay--visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal {
  background-color: var(--color-surface);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow: hidden;
  transform: scale(0.9);
  transition: transform var(--transition-duration) ease;
}

.modal-overlay--visible .modal {
  transform: scale(1);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: 1px solid var(--color-border);
}

.modal__title {
  margin: 0;
  font-size: var(--font-size-lg);
}

.modal__close {
  background: none;
  border: none;
  font-size: var(--font-size-lg);
  cursor: pointer;
  padding: var(--spacing-xs);
  border-radius: var(--border-radius-sm);
  transition: background-color var(--transition-duration) ease;
}

.modal__close:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.modal__body {
  padding: var(--spacing-lg);
  overflow-y: auto;
  max-height: calc(90vh - 140px);
}

.modal__label {
  display: block;
  margin-top: var(--spacing-md);
  margin-bottom: var(--spacing-xs);
  font-weight: 500;
}

.modal__message {
  margin: 0 0 var(--spacing-sm);
  color: var(--color-text);
}

.modal__toolbar {
  margin-bottom: var(--spacing-sm);
}

.modal__checkbox-row {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-sm);
}

.modal__checkbox {
  width: auto;
  margin: 0;
}

.modal__label--checkbox {
  margin: 0;
}

/* Project risks modal */
.project-risk-recos {
  margin-top: var(--spacing-lg);
  display: grid;
  gap: var(--spacing-sm);
}
.project-risk-recos__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-sm);
}
.project-risk-recos__title {
  margin: 0;
  font-size: var(--font-size-md);
}
.project-risk-reco {
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: var(--spacing-sm);
  background: var(--color-surface-secondary);
  display: grid;
  gap: var(--spacing-sm);
}
.project-risk-reco__row {
  display: grid;
  gap: var(--spacing-xs);
}
.project-risk-reco__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}
.project-risk-reco__check {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: var(--font-size-sm);
  color: var(--color-text);
}
.project-risk-reco__check input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--spacing-md);
  padding: var(--spacing-md) var(--spacing-lg);
  border-top: 1px solid var(--color-border);
}

/* Welcome modal */
.welcome-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-lg);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.45), rgba(15, 23, 42, 0.2));
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 10000;
}

.welcome-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.welcome-modal {
  position: relative;
  width: min(720px, 100%);
  padding: clamp(20px, 4vw, 32px);
  border-radius: var(--border-radius-xl);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
  overflow: hidden;
}

.welcome-modal::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -10%;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(14, 116, 144, 0.25), transparent 65%);
  pointer-events: none;
}

.welcome-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: var(--border-radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface-secondary);
  color: var(--color-text);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.welcome-modal__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs) calc(var(--spacing-sm) + var(--spacing-xs));
  border-radius: var(--border-radius-full);
  border: 1px dashed var(--color-border);
  background: var(--color-surface-secondary);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-light);
}

.welcome-modal__title {
  margin: var(--spacing-sm) 0;
  font-size: clamp(22px, 4vw, 32px);
  color: var(--color-text);
}

.welcome-modal__lead {
  margin: 0;
  color: var(--color-text-light);
  line-height: 1.6;
}

.welcome-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
}

.welcome-modal__note {
  margin-top: var(--spacing-md);
  padding: var(--spacing-md);
  border-radius: var(--border-radius);
  border: 1px solid var(--color-border);
  background: var(--color-surface-secondary);
  color: var(--color-text);
}

.welcome-modal__note p {
  margin: 0;
  line-height: 1.6;
}

.welcome-modal__callout {
  margin-top: var(--spacing-md);
  padding: var(--spacing-md);
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  background: linear-gradient(120deg, rgba(14, 116, 144, 0.15), rgba(14, 116, 144, 0.03));
  color: var(--color-text);
  font-weight: 600;
}

.welcome-modal__browser-note {
  margin: var(--spacing-md) 0 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
}

body.theme-dark .welcome-modal {
  background: #1f2937;
  border-color: rgba(148, 163, 184, 0.2);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.45);
}

body.theme-dark .welcome-modal__badge,
body.theme-dark .welcome-modal__note,
body.theme-dark .welcome-modal__close {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(148, 163, 184, 0.2);
}

/* Language selector modal */
.language-modal {
  max-width: 400px;
}

.language-options {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  margin: var(--spacing-md) 0;
}

.language-option {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md) var(--spacing-lg);
  border: 2px solid var(--color-border);
  border-radius: var(--border-radius);
  background: var(--color-surface);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: var(--font-size-lg);
}

.language-option:hover {
  border-color: var(--color-primary);
  background: var(--color-surface-secondary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.language-option:focus-visible {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(31, 184, 205, 0.2);
}

.language-option__flag {
  font-size: var(--font-size-xxl);
}

.language-option__name {
  font-weight: 500;
  color: var(--color-text);
}

body.theme-dark .language-option {
  background: rgba(15, 23, 42, 0.5);
  border-color: rgba(148, 163, 184, 0.2);
}

body.theme-dark .language-option:hover {
  background: rgba(15, 23, 42, 0.7);
  border-color: var(--color-primary);
}

body.theme-dark .language-option__name {
  color: var(--color-text);
}

/* =====================================================
   SETUP WIZARD - Premier lancement
   ===================================================== */

.wizard-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, rgba(45, 62, 74, 0.95) 0%, rgba(31, 48, 62, 0.98) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: var(--spacing-lg);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.wizard-overlay.is-visible {
  opacity: 1;
}

.wizard-modal {
  background: var(--color-surface);
  border-radius: var(--border-radius-xl);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: wizardSlideIn 0.4s ease-out;
}

@keyframes wizardSlideIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.wizard-modal__header {
  padding: var(--spacing-md) var(--spacing-xl);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-secondary);
}

.wizard-progress {
  height: 4px;
  background: var(--color-border);
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  margin-bottom: var(--spacing-md);
}

.wizard-progress__bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-success));
  border-radius: var(--border-radius-sm);
  transition: width 0.4s ease;
}

.wizard-steps-indicator {
  display: flex;
  justify-content: center;
  gap: var(--spacing-lg);
}

.wizard-step-dot {
  width: 32px;
  height: 32px;
  border-radius: var(--border-radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-sm);
  font-weight: 600;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  color: var(--color-text-secondary);
  transition: all 0.3s ease;
}

.wizard-step-dot--active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(31, 184, 205, 0.4);
}

.wizard-step-dot--done {
  background: var(--color-success);
  border-color: var(--color-success);
  color: white;
}

.wizard-modal__body {
  display: grid;
  grid-template-columns: 320px 1fr;
  flex: 1;
  overflow: hidden;
}

.wizard-modal__image {
  background: linear-gradient(135deg, #e8d5e0 0%, #d4c4d9 50%, #c9d4e8 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.wizard-hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.9;
}

.wizard-modal__image-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--spacing-lg);
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
  color: white;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: var(--font-size-lg);
  font-weight: 600;
}

.wizard-modal__image-overlay i {
  font-size: var(--font-size-xl);
}

.wizard-modal__content {
  display: flex;
  flex-direction: column;
  padding: var(--spacing-xl);
  overflow-y: auto;
}

.wizard-content-inner {
  flex: 1;
}

.wizard-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 var(--spacing-sm) 0;
}

.wizard-subtitle {
  font-size: var(--font-size-md);
  color: var(--color-text-secondary);
  margin: 0 0 var(--spacing-xl) 0;
  line-height: 1.5;
}

.wizard-modal__footer {
  display: flex;
  justify-content: space-between;
  gap: var(--spacing-md);
  padding-top: var(--spacing-lg);
  margin-top: auto;
  border-top: 1px solid var(--color-border);
}

.wizard-modal__footer .btn {
  padding: var(--spacing-sm) var(--spacing-xl);
  font-size: var(--font-size-md);
}

.wizard-modal__footer .btn--primary {
  min-width: 160px;
}

/* Language selection step */
.wizard-language-grid {
  display: grid;
  gap: var(--spacing-md);
}

.wizard-lang-btn {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md) var(--spacing-lg);
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.wizard-lang-btn:hover {
  border-color: var(--color-primary);
  background: var(--color-surface-secondary);
  transform: translateX(4px);
}

.wizard-lang-btn--selected {
  border-color: var(--color-primary);
  background: rgba(31, 184, 205, 0.08);
  box-shadow: 0 4px 12px rgba(31, 184, 205, 0.15);
}

.wizard-lang-btn__flag {
  font-size: var(--font-size-xxl);
}

.wizard-lang-btn__name {
  font-size: var(--font-size-lg);
  font-weight: 500;
  color: var(--color-text);
}

.wizard-lang-btn__check {
  margin-left: auto;
  width: 24px;
  height: 24px;
  border-radius: var(--border-radius-full);
  background: var(--color-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.2s ease;
}

.wizard-lang-btn--selected .wizard-lang-btn__check {
  opacity: 1;
  transform: scale(1);
}

/* Welcome step - Features */
.wizard-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-md);
}

.wizard-feature {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background: var(--color-surface-secondary);
  border-radius: var(--border-radius);
  transition: transform 0.2s ease;
}

.wizard-feature:hover {
  transform: translateY(-2px);
}

.wizard-feature__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--border-radius-lg);
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-lg);
  flex-shrink: 0;
}

.wizard-feature__text {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.wizard-feature__text strong {
  color: var(--color-text);
  font-size: var(--font-size-sm);
}

.wizard-feature__text span {
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
}

/* Demo choice step */
.wizard-demo-choice {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.wizard-choice-card {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-lg);
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  position: relative;
}

.wizard-choice-card:hover {
  border-color: var(--color-primary);
  background: var(--color-surface-secondary);
}

.wizard-choice-card--selected {
  border-color: var(--color-primary);
  background: rgba(31, 184, 205, 0.08);
  box-shadow: 0 4px 16px rgba(31, 184, 205, 0.2);
}

.wizard-choice-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--border-radius-lg);
  background: var(--color-surface-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-lg);
  color: var(--color-primary);
  flex-shrink: 0;
}

.wizard-choice-card--selected .wizard-choice-card__icon {
  background: var(--color-primary);
  color: white;
}

.wizard-choice-card__content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.wizard-choice-card__content strong {
  color: var(--color-text);
  font-size: var(--font-size-md);
}

.wizard-choice-card__content span {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

.wizard-choice-card__badge {
  position: absolute;
  top: -8px;
  right: var(--spacing-md);
  background: var(--color-success);
  color: white;
  font-size: var(--font-size-xs);
  font-weight: 600;
  padding: var(--spacing-xs) 10px;
  border-radius: var(--border-radius-lg);
  opacity: 0;
  transform: translateY(4px);
  transition: all 0.2s ease;
}

.wizard-choice-card--selected .wizard-choice-card__badge {
  opacity: 1;
  transform: translateY(0);
}

.wizard-hint {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  margin-top: var(--spacing-md);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.wizard-hint i {
  color: var(--color-info);
}

/* Framework selection step */
.wizard-frameworks-list {
  display: flex;
  flex-direction: column;
  gap: calc(var(--spacing-sm) + var(--spacing-xs));
  margin: var(--spacing-md) 0;
}

.wizard-framework-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  border: 2px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  transition: border-color 0.2s;
  cursor: pointer;
}

.wizard-framework-item:hover {
  border-color: var(--color-primary);
}

.wizard-framework-item--locked {
  cursor: default;
  background: var(--color-bg-subtle, rgba(0,0,0,0.02));
}

.wizard-framework-item__icon {
  font-size: var(--font-size-xl);
  width: 40px;
  text-align: center;
  flex-shrink: 0;
}

.wizard-framework-item__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.wizard-framework-item__info strong {
  font-size: var(--font-size-sm);
}

.wizard-framework-item__info span {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.wizard-framework-item__toggle {
  flex-shrink: 0;
}

.wizard-framework-item__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: var(--font-size-xs);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--border-radius-full);
  background: var(--color-info-bg, #e0f2fe);
  color: var(--color-info, #0284c7);
  font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
  .wizard-modal {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .wizard-modal__body {
    grid-template-columns: 1fr;
  }

  .wizard-modal__image {
    display: none;
  }

  .wizard-features {
    grid-template-columns: 1fr;
  }

  .wizard-modal__footer {
    flex-direction: column;
  }

  .wizard-modal__footer .btn {
    width: 100%;
  }
}

/* Dark theme */
body.theme-dark .wizard-modal {
  background: var(--color-surface);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
}

body.theme-dark .wizard-modal__header {
  background: rgba(15, 23, 42, 0.5);
}

body.theme-dark .wizard-lang-btn,
body.theme-dark .wizard-choice-card {
  background: rgba(15, 23, 42, 0.3);
  border-color: rgba(148, 163, 184, 0.2);
}

body.theme-dark .wizard-lang-btn:hover,
body.theme-dark .wizard-choice-card:hover {
  background: rgba(15, 23, 42, 0.5);
}

body.theme-dark .wizard-feature {
  background: rgba(15, 23, 42, 0.3);
}

body.theme-dark .wizard-framework-item {
  background: rgba(15, 23, 42, 0.3);
  border-color: rgba(148, 163, 184, 0.2);
}

body.theme-dark .wizard-framework-item:hover {
  background: rgba(15, 23, 42, 0.5);
}

body.theme-dark .wizard-framework-item--locked {
  background: rgba(15, 23, 42, 0.15);
}

/* ============================================================
   Connected Users Indicator (replaces old Sync button)
   ============================================================ */

/* ── Refonte header 2026-07 : présence (zone statut) ─────────────────────── */
.csi-presence {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
  border: 1px solid transparent;
  border-radius: var(--border-radius-full);
  background: var(--color-surface-secondary);
  cursor: default;
  white-space: nowrap;
}

.csi-presence:focus {
  outline: none;
  border-color: var(--color-primary);
}

.csi-presence i {
  color: var(--color-primary);
  font-size: var(--font-size-sm);
}

.connected-users__count {
  font-weight: 600;
  color: var(--color-text);
}

/* ── Refonte header 2026-07 : menu utilisateur (avatar + items) ──────────── */
.csi-usermenu {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.csi-usermenu--open {
  z-index: 1060;
}

.csi-usermenu__trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  min-height: 38px;
  padding: 2px;
  padding-right: var(--spacing-sm);
  font-size: var(--font-size-sm);
  color: var(--color-text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--border-radius-full);
  cursor: pointer;
  white-space: nowrap;
}

.csi-usermenu__trigger:hover,
.csi-usermenu__trigger:focus {
  border-color: var(--color-primary);
  outline: none;
}

.csi-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 50%;
  background: var(--color-primary-dark);
  color: #fff;
  font-size: var(--font-size-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: box-shadow var(--transition-duration) ease;
}

.csi-usermenu__trigger:hover .csi-avatar {
  box-shadow: 0 0 0 3px var(--color-surface-secondary);
}

/* Etat "menu applicatif" : aucun compte connecte (editions locales). Le disque plein est
   fait pour des initiales ; ici c'est un bouton de menu (engrenage) → traitement allege,
   qui se remplit au survol pour garder l'affordance. */
.csi-avatar--menu {
  background: var(--color-surface-secondary);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  font-size: 1rem;
}

.csi-usermenu__trigger:hover .csi-avatar--menu,
.csi-usermenu__trigger:focus .csi-avatar--menu {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  color: #fff;
}

body.theme-dark .csi-avatar--menu {
  background: transparent;
  color: var(--color-text-secondary);
  border-color: var(--color-border);
}

body.theme-dark .csi-usermenu__trigger:hover .csi-avatar--menu,
body.theme-dark .csi-usermenu__trigger:focus .csi-avatar--menu {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-background);
}

body.theme-dark .csi-avatar {
  background: var(--color-primary);
  color: var(--color-background);
}

.csi-usermenu__name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.csi-usermenu__name:empty {
  display: none;
}

.csi-usermenu__caret {
  font-size: 0.65em;
  opacity: 0.7;
}

/* Menu déroulant : clone de .csi-scope__menu, ancré à droite, ombre plus marquée */
.csi-usermenu__menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 1060;
  min-width: 230px;
  width: max-content;
  max-width: min(320px, calc(100vw - (2 * var(--spacing-md))));
  padding: var(--spacing-xs);
  flex-direction: column;
  background: var(--color-surface, #ffffff);
  background-clip: padding-box;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  isolation: isolate;
}

.csi-usermenu--open .csi-usermenu__menu {
  display: flex;
}

.csi-usermenu__head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--spacing-xs) var(--spacing-sm) var(--spacing-sm);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--spacing-xs);
}

.csi-usermenu__head-name {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.csi-usermenu__head-role {
  font-size: var(--font-size-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.csi-usermenu__item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  width: 100%;
  min-height: 40px;
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: var(--font-size-sm);
  text-align: left;
  color: var(--color-text);
  background: transparent;
  border: none;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  white-space: nowrap;
}

.csi-usermenu__item:hover,
.csi-usermenu__item:focus {
  background-color: var(--color-surface-secondary);
  outline: none;
}

.csi-usermenu__item i {
  width: 1.1em;
  flex-shrink: 0;
  color: var(--color-primary);
}

.csi-usermenu__item--danger,
.csi-usermenu__item--danger i {
  color: var(--color-danger);
}

.csi-usermenu__sep {
  display: block;
  height: 1px;
  margin: var(--spacing-xs) var(--spacing-sm);
  background-color: var(--color-border);
}

/* Conteneur serveur (séparateur + déconnexion) : affiché par bundle.js via
   #serverUserIndicator (style.display='') — display:block par classe en repli. */
.csi-usermenu__server {
  display: block;
}

/* Lock badges on nav buttons */
.lock-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  border-radius: var(--border-radius-full);
  font-size: var(--font-size-xs);
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  color: white;
  pointer-events: none;
}

.lock-badge--mine {
  background: #22c55e;
}

.lock-badge--other {
  background: #f59e0b;
}

.nav__item {
  position: relative;
}

/* Settings page */
.settings-page {
  display: grid;
  gap: var(--spacing-lg);
}

.settings-page--grid {
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  align-items: start;
}

.settings-section {
  padding: var(--spacing-lg);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: var(--spacing-md);
}

.settings-section__header {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-sm);
}

.settings-section__icon {
  width: 36px;
  height: 36px;
  border-radius: var(--border-radius-lg);
  display: grid;
  place-items: center;
  background: var(--color-surface-secondary);
  border: 1px solid var(--color-border);
  color: var(--color-primary);
  flex-shrink: 0;
}

.settings-section__header-content {
  display: grid;
  gap: var(--spacing-xs);
}

.settings-section__title {
  margin: 0;
  font-size: var(--font-size-lg);
}

.settings-section__subtitle {
  margin: 0;
  color: var(--color-text-light);
}

.settings-section__body {
  display: grid;
  gap: var(--spacing-md);
}

.settings-section--full {
  grid-column: 1 / -1;
}

.settings-section--danger {
  border-color: rgba(185, 28, 28, 0.2);
  background: linear-gradient(135deg, rgba(185, 28, 28, 0.04), var(--color-surface));
}

.settings-section--danger .settings-section__icon {
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.25);
  background: rgba(185, 28, 28, 0.08);
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

.settings-columns {
  display: grid;
  grid-template-columns: minmax(260px, 1.1fr) minmax(260px, 1fr);
  gap: var(--spacing-lg);
  align-items: start;
}

.settings-columns--snapshots {
  grid-template-columns: minmax(280px, 1.1fr) minmax(260px, 1fr);
}
.settings-columns--snapshots > div {
  display: grid;
  gap: var(--spacing-md);
  align-content: start;
}

.settings-help {
  margin: 0;
  color: var(--color-text-light);
  line-height: 1.6;
}

.settings-steps {
  margin: 0;
  padding-left: 1.2em;
  color: var(--color-text);
  display: grid;
  gap: var(--spacing-xs);
}

.settings-note {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
}


.history-filters {
  display: grid;
  gap: var(--spacing-sm);
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: end;
}

.form-group {
  display: grid;
  gap: var(--spacing-xs);
}

.form-group label {
  font-weight: 500;
  color: var(--color-text);
}

.settings-field-help {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
}

.password-policy {
  margin: var(--spacing-sm) 0 0;
  padding: var(--spacing-sm);
  border-radius: var(--border-radius);
  border: 1px solid var(--color-border);
  background: var(--color-surface-secondary);
  display: grid;
  gap: var(--spacing-xs);
}

.password-policy__title {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
}

.password-policy__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--spacing-xs);
}

.password-policy__item {
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
}

.password-policy__item--ok {
  color: var(--color-success);
}

.password-policy__item--missing {
  color: var(--color-danger);
}

.storage-health {
  display: grid;
  gap: var(--spacing-md);
}

.storage-health__usage {
  display: grid;
  gap: var(--spacing-xs);
}

.storage-meter {
  position: relative;
  height: 10px;
  border-radius: var(--border-radius-full);
  background: var(--color-surface-secondary);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.storage-meter__bar {
  height: 100%;
  width: 0%;
  background: var(--color-success);
  transition: width var(--transition-duration) ease;
}

.storage-meter__bar--warn {
  background: var(--color-warning);
}

.storage-meter__bar--danger {
  background: var(--color-danger);
}

.storage-health__meta {
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
}

.storage-health__stats {
  display: grid;
  gap: var(--spacing-sm);
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.storage-health__stat {
  padding: var(--spacing-sm);
  border-radius: var(--border-radius);
  border: 1px solid var(--color-border);
  background: var(--color-surface-secondary);
  display: grid;
  gap: var(--spacing-xs);
}

.storage-health__label {
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
}

.storage-health__value {
  font-weight: 600;
  color: var(--color-text);
}

.storage-health__warning {
  padding: var(--spacing-sm);
  border-radius: var(--border-radius);
  border: 1px solid rgba(219, 159, 97, 0.35);
  background: rgba(255, 193, 133, 0.2);
  color: var(--color-warning-dark);
  font-size: var(--font-size-sm);
}

.settings-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--spacing-sm);
  align-items: center;
}

.settings-toggle-btn {
  white-space: nowrap;
}

.settings-checkbox {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-weight: 500;
  color: var(--color-text);
}

.settings-checkbox input {
  width: 16px;
  height: 16px;
  margin: 0;
}

@media (max-width: 900px) {
  .settings-page--grid {
    grid-template-columns: 1fr;
  }

  .settings-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .settings-input-row {
    grid-template-columns: 1fr;
  }
}

/* Form grid */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-md);
}

.form-group--full {
  grid-column: 1 / -1;
}

/* Threats section */
#threats-section .table-container {
  margin-bottom: var(--spacing-lg);
}

#threatForm {
  background-color: var(--color-surface);
  padding: var(--spacing-lg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
}

/* Toasts */
.toast-container {
  position: fixed;
  bottom: var(--spacing-lg);
  right: var(--spacing-lg);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.toast {
  background-color: var(--color-surface);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  padding: var(--spacing-md);
  display: flex;
  align-items: center;
  min-width: 300px;
  max-width: 400px;
  border-left: 4px solid var(--color-primary);
  transform: translateX(120%);
  transition: transform var(--transition-duration) ease;
}

.toast--visible {
  transform: translateX(0);
}

.toast--success { border-color: var(--color-success); }
.toast--error { border-color: var(--color-danger); }
.toast--warning { border-color: var(--color-warning); }
.toast--info { border-color: var(--color-info); }

.toast__icon {
  margin-right: var(--spacing-md);
  font-size: var(--font-size-lg);
}

.toast--success .toast__icon { color: var(--color-success); }
.toast--error .toast__icon { color: var(--color-danger); }
.toast--warning .toast__icon { color: var(--color-warning); }
.toast--info .toast__icon { color: var(--color-info); }

.toast__content {
  flex: 1;
}

.toast__message {
  font-size: var(--font-size-sm);
}

.toast__close {
  background: none;
  border: none;
  font-size: var(--font-size-lg);
  cursor: pointer;
  margin-left: var(--spacing-md);
  color: var(--color-text-light);
  border-radius: var(--border-radius-sm);
  padding: var(--spacing-xs);
  transition: background-color var(--transition-duration) ease, color var(--transition-duration) ease;
}

.toast__close:hover {
  background-color: rgba(0, 0, 0, 0.08);
  color: var(--color-text);
}

/* Loading spinner */
.loading-spinner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--color-background);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(0, 0, 0, 0.1);
  border-top-color: var(--color-primary);
  border-radius: var(--border-radius-full);
  animation: spin 1s linear infinite;
  margin-bottom: var(--spacing-md);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.hidden {
  display: none;
}

/* Status */
.status {
  display: inline-flex;
  align-items: center;
  font-size: var(--font-size-sm);
}

.status--success {
  color: var(--color-success);
}

.status--error {
  color: var(--color-danger);
}

.status--warning {
  color: var(--color-warning-dark);
}

.status--info {
  color: var(--color-info);
}

/* Responsive */
@media (max-width: 768px) {
  .header__content {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-md);
  }

  .header__brand {
    width: 100%;
    flex: 0 0 auto;
  }

  /* Empilement conservé : la zone statut passe pleine largeur, alignée à gauche */
  .header__status {
    width: 100%;
    flex: 0 0 auto;
    flex-basis: auto;
    justify-content: flex-start;
  }

  .header__right {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }

  .csi-header-scope {
    width: 100%;
    min-width: 0;
    max-width: none;
    flex-basis: auto;
  }

  .header__actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  /* (fallback vieux markup) menu aligné sur la largeur du slot pleine largeur ;
     dans le fil d'Ariane le menu garde son gabarit propre (min 250px, ancré à gauche) */
  .csi-header-scope .csi-scope__menu {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
  }


  .nav__item {
    padding: var(--spacing-md) var(--spacing-sm);
  }

  .nav__item span {
    display: none;
  }

  .module__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box {
    max-width: none;
  }

  .charts-grid {
    grid-template-columns: 1fr;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  /* Dashboard Hero responsive */
  .dashboard-hero {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }

  .score-global {
    flex-direction: row;
    justify-content: center;
  }

  .score-global__gauge {
    flex-shrink: 0;
  }

  .score-global__svg {
    width: 100px;
    height: 100px;
  }

  .score-global__value {
    font-size: var(--font-size-xl);
  }

  .dashboard-alerts {
    min-height: auto;
  }

  .dashboard-alerts__list {
    flex-direction: column;
  }

  /* Radars responsive */
  .chart-row--radars {
    grid-template-columns: 1fr;
  }

  .chart-card--radar .chart-card__content {
    height: 300px;
    min-height: 260px;
  }

  /* Grille compacte responsive */
  .charts-grid--compact {
    grid-template-columns: repeat(2, 1fr);
  }

  .chart-card--compact .chart-card__content {
    height: 160px;
  }

  /* Dashboard row responsive */
  .dashboard-row {
    grid-template-columns: 1fr;
  }

  .activity-timeline {
    max-height: 180px;
  }

  /* Modal responsive -- full-bleed on mobile */
  .modal {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
    margin: 0;
  }

  .modal__body {
    max-height: calc(100vh - 120px);
    overflow-y: auto;
  }

  /* Toast responsive -- full-width on mobile */
  .toast-container {
    left: var(--spacing-sm);
    right: var(--spacing-sm);
    bottom: var(--spacing-sm);
  }

  .toast {
    min-width: 0;
    max-width: none;
    width: 100%;
  }

  /* Main padding reduction on mobile */
  .main {
    padding: var(--spacing-md);
  }

  /* Module header stacks on mobile */
  .module__header {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Extra small screens */
@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .charts-grid--compact {
    grid-template-columns: 1fr;
  }

  .score-global {
    flex-direction: column;
    text-align: center;
  }

  .score-global__details {
    width: 100%;
  }

  .score-global__item {
    justify-content: space-between;
  }

  .module__header--dashboard {
    flex-direction: column;
    align-items: stretch;
  }

  .module__header--dashboard .btn {
    width: 100%;
    justify-content: center;
  }

  .main {
    padding: var(--spacing-sm);
  }
}

/* Auto Save Status */
.autosave-status {
  position: fixed;
  bottom: var(--spacing-lg);
  left: var(--spacing-lg);
  background-color: var(--color-success);
  color: #fff;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--border-radius);
  font-size: var(--font-size-sm);
  opacity: 0;
  transition: opacity var(--transition-duration) ease;
  pointer-events: none;
  z-index: 1002;
}

/* Refonte header 2026-07 : pastille de synchronisation (zone statut).
   Toujours visible — état neutre « Synchronisé » dès le chargement. */
.csi-sync-dot {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: var(--font-size-xs);
  /* --color-text-light et non text-secondary : contraste AA sur surface-secondary */
  color: var(--color-text-light);
  border-radius: var(--border-radius-full);
  background-color: var(--color-surface-secondary);
  white-space: nowrap;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.csi-sync-dot__point {
  width: 8px;
  height: 8px;
  min-width: 8px;
  border-radius: 50%;
  background-color: var(--color-success);
}

@keyframes autosave-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.csi-sync-dot--saving .csi-sync-dot__point {
  background-color: var(--color-warning);
  animation: autosave-pulse 1s ease-in-out infinite;
}

.csi-sync-dot--error .csi-sync-dot__point {
  background-color: var(--color-danger);
}

/* Flash bref après sauvegarde réussie (classe posée par updateAutoSaveIndicator) */
.csi-sync-dot.autosave-flash {
  background-color: var(--color-success);
  color: #fff;
}

.csi-sync-dot.autosave-flash .csi-sync-dot__point {
  background-color: #fff;
}

/* Document Pyramid */
.pyramid-wrapper {
  text-align: center;
  margin-bottom: var(--spacing-lg);
}

.document-pyramid {
  width: 100%;
  max-width: 300px;
  height: auto;
}

.document-pyramid .pyramid-level {
  stroke: #fff;
  stroke-width: 2;
}

.document-pyramid .level-1 { fill: var(--color-primary-dark); }
.document-pyramid .level-2 { fill: var(--color-primary); }
.document-pyramid .level-3 { fill: var(--color-primary-light); }
.document-pyramid .level-4 { fill: var(--color-secondary); }

.document-pyramid text {
  font-size: clamp(0.6rem, 2vw, var(--font-size-sm));
  fill: #fff;
  font-weight: bold;
  text-anchor: middle;
}
/* NIS2 Programme */
.nis2-top-grid {
  align-items: stretch;
}

#addNis2DomainBtn i,
#addNis2ActionBtn i {
  margin-right: var(--spacing-xs);
}

.nis2-status-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.nis2-status-item {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid var(--nis2-status-border, var(--color-border));
  border-radius: var(--border-radius-lg);
  background: var(--color-surface-secondary);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.nis2-status-item::after {
  display: none;
}

.nis2-status-item--done {
  --nis2-status-accent: #0f9b7a;
  --nis2-status-soft: rgba(15, 155, 122, 0.15);
  --nis2-status-border: rgba(15, 155, 122, 0.35);
}
.nis2-status-item--in_progress {
  --nis2-status-accent: #f59e0b;
  --nis2-status-soft: rgba(245, 158, 11, 0.14);
  --nis2-status-border: rgba(245, 158, 11, 0.35);
}
.nis2-status-item--todo {
  --nis2-status-accent: #6b7280;
  --nis2-status-soft: rgba(107, 114, 128, 0.12);
  --nis2-status-border: rgba(107, 114, 128, 0.28);
}

.nis2-status-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--border-radius-lg);
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--nis2-status-accent, #0d9488), #0b786f);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
  z-index: 1;
}

.nis2-status-content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  z-index: 1;
}

.nis2-status-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs) 7px;
  border-radius: var(--border-radius-full);
  background: rgba(255, 255, 255, 0.7);
  color: var(--color-text);
  border: 1px dashed var(--nis2-status-border, var(--color-border));
  width: fit-content;
}

.nis2-status-chip__label {
  font-weight: 700;
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nis2-status-text {
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.25;
}

.nis2-status-dot {
  width: 12px;
  height: 12px;
  border-radius: var(--border-radius-full);
  flex-shrink: 0;
}

.nis2-status-dot--done { background-color: var(--color-success); }
.nis2-status-dot--progress { background-color: var(--color-warning); }
.nis2-status-dot--todo { background-color: var(--color-border); border: 1px dashed var(--color-secondary); }
.nis2-status-dot--suspended { background-color: var(--color-warning); border: 1px dashed var(--color-secondary); }
.nis2-status-item--critical {
  border-color: #f87171;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.45), rgba(185, 28, 28, 0.75));
  color: #fff;
}
.nis2-status-item--critical .nis2-status-dot {
  background-color: #ef4444;
  border-color: #ef4444;
}
.nis2-status-item--critical .nis2-status-chip {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}
.nis2-status-item--critical .nis2-status-text {
  color: #fff;
}
body.theme-dark .nis2-status-item--critical {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.35), rgba(127, 29, 29, 0.75));
  border-color: #f87171;
}

body.theme-dark .nis2-status-item {
  background: var(--color-surface-secondary);
  border-color: var(--color-border);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
}
body.theme-dark .nis2-status-chip {
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
}
body.theme-dark .nis2-status-text {
  color: #e5e7eb;
}

.chart-card__header--split {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-sm);
}

.nis2-plan-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-sm);
  margin: var(--spacing-md) 0;
  padding: var(--spacing-sm) var(--spacing-md);
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.06), var(--color-surface));
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
}
.nis2-plan-toolbar__group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  align-items: center;
}
.chip-btn {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  padding: 0.35rem var(--spacing-md);
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  cursor: pointer;
  transition: all 0.2s ease;
}
.chip-btn.is-active {
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.14), var(--color-surface));
  border-color: rgba(13, 148, 136, 0.4);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

/* ==================== Section Toolbar ==================== */

/* Toolbar v2 — stacked rows: filters / (advanced) / sort */
.section-toolbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  margin-bottom: var(--spacing-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
}

.section-toolbar__row {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
  min-width: 0;
}

/* Uniform fixed-width filter selects (ellipsis on long labels) */
.section-toolbar__filters select.form-control--sm,
.section-toolbar__advanced select.form-control--sm {
  flex: 0 0 180px;
  width: 180px;
  min-width: 0;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-toolbar__search {
  flex: 0 0 220px;
  width: 220px;
  max-width: 220px;
  min-width: 0;
}

/* Collapsible advanced-filters panel */
.section-toolbar__advanced {
  padding-top: var(--spacing-xs);
  border-top: 1px dashed var(--color-border);
}

.section-toolbar__adv-toggle,
.section-toolbar__reset {
  flex: 0 0 auto;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.section-toolbar__reset {
  margin-left: auto;
}

/* Élément poussé en bout de rangée (ex. bouton « Vider l'historique » du journal) */
.section-toolbar__end {
  margin-left: auto;
  flex: 0 0 auto;
  white-space: nowrap;
}

.section-toolbar__adv-count {
  font-weight: 600;
}

.section-toolbar__adv-chevron {
  font-size: var(--font-size-xs);
}

.section-toolbar__sort {
  /* Sort chips always on their own row, left-aligned */
  justify-content: flex-start;
}

.section-toolbar__sort-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
  white-space: nowrap;
  font-weight: 500;
}

.section-toolbar__sort-chips {
  display: flex;
  gap: var(--spacing-xs);
  flex-wrap: wrap;
}

/* Sort Chip - pill button */
.sort-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: var(--font-size-sm);
  font-weight: 500;
  font-family: inherit;
  line-height: 1.4;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-full);
  background: transparent;
  color: var(--color-text-light);
  cursor: pointer;
  transition: all var(--transition-duration) var(--transition-timing);
  white-space: nowrap;
  user-select: none;
  outline: none;
}

.sort-chip:hover {
  border-color: var(--color-primary-light);
  color: var(--color-primary);
  background: rgba(31, 184, 205, 0.06);
}

.sort-chip:focus-visible {
  box-shadow: 0 0 0 2px rgba(31, 184, 205, 0.25);
  border-color: var(--color-primary);
}

.sort-chip--active {
  background: var(--color-primary);
  color: var(--color-surface);
  border-color: var(--color-primary);
  font-weight: 600;
}

.sort-chip--active:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
}

.sort-chip--active:focus-visible {
  box-shadow: 0 0 0 2px rgba(31, 184, 205, 0.4);
}

.sort-chip i {
  font-size: var(--font-size-xs);
  transition: transform var(--transition-duration) var(--transition-timing);
}

/* Responsive */
@media (max-width: 768px) {
  .section-toolbar__filters select.form-control--sm,
  .section-toolbar__advanced select.form-control--sm {
    flex: 1 1 45%;
    width: auto;
    max-width: none;
    min-width: 100px;
  }

  .section-toolbar__search {
    flex: 1 1 100%;
    width: auto;
    max-width: none;
  }

  .section-toolbar__reset {
    margin-left: 0;
  }
}

/* Print: hide toolbar */
@media print {
  .section-toolbar { display: none; }
}

.nis2-plan-summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  margin: var(--spacing-md) 0;
  grid-column: 1 / -1;
}
.nis2-phases-panel {
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: var(--spacing-sm) var(--spacing-md);
  margin-bottom: var(--spacing-md);
  background: var(--color-surface);
}
.nis2-phases-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
}
.nis2-phases-panel__title {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-weight: 700;
}
.nis2-phases-panel__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}
.phase-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  background: var(--color-surface-secondary);
}
.phase-chip__label {
  font-weight: 700;
}
.phase-chip__order {
  font-size: var(--font-size-xs);
  color: var(--color-text-light);
}
.phase-chip__actions {
  display: inline-flex;
  gap: var(--spacing-xs);
}
.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: 0.4rem 0.8rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  color: var(--color-text);
}

.nis2-plan-grid {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

.nis2-plan-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

.nis2-plan-card {
  position: relative;
  background: linear-gradient(135deg, var(--nis2-accent-soft, rgba(13, 148, 136, 0.08)), var(--color-surface));
  border: 1px solid var(--nis2-accent-border, var(--color-border));
  border-radius: var(--border-radius-lg);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.06);
  padding: var(--spacing-md);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  overflow: hidden;
}
.nis2-plan-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(13, 148, 136, 0.12), transparent 45%);
  pointer-events: none;
}
.nis2-plan-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--spacing-sm);
}
.nis2-plan-card__header-left {
  display: flex;
  gap: var(--spacing-sm);
  align-items: flex-start;
}
.nis2-plan-card__icon {
  width: 42px;
  height: 42px;
  border-radius: var(--border-radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 148, 136, 0.12);
  color: var(--color-primary);
  font-size: var(--font-size-lg);
  flex-shrink: 0;
}
.nis2-plan-card__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
  margin: 0;
}
.nis2-plan-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

.nis2-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: 0.2rem 0.55rem;
  background: var(--color-surface-secondary);
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
}

.nis2-plan-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  background: rgba(255, 255, 255, 0.6);
  border: 1px dashed var(--nis2-accent-border, var(--color-border));
  border-radius: var(--border-radius);
  padding: var(--spacing-sm);
}
.stat-chip i {
  color: var(--nis2-accent, var(--color-primary));
}

.nis2-phase-timeline {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs) 0;
}
.nis2-phase-node {
  width: 32px;
  height: 32px;
  border-radius: var(--border-radius-full);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--color-text);
  background: var(--color-surface-secondary);
  border: 1px solid var(--color-border);
}
.nis2-phase-node--done { background: var(--color-success-light); border-color: var(--color-success); color: var(--color-success-dark); }
.nis2-phase-node--in_progress { background: var(--color-warning-light); border-color: var(--color-warning); color: var(--color-warning-dark); }
.nis2-phase-node--todo { background: var(--color-surface-secondary); border-color: var(--color-border); color: var(--color-text-light); }
.nis2-phase-node--empty { background: var(--color-surface); border-color: var(--color-border); color: var(--color-text-light); }
.nis2-phase-line {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--nis2-accent, var(--color-primary)), transparent);
  opacity: 0.6;
}

.nis2-actions {
  margin-top: var(--spacing-sm);
}

.table--nis2-plan {
  width: 100%;
  border-collapse: collapse;
}

.table--nis2-plan th,
.table--nis2-plan td {
  padding: var(--spacing-sm) var(--spacing-md);
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  font-size: var(--font-size-sm);
  vertical-align: middle;
}

.table--nis2-plan thead {
  background: var(--color-surface-secondary);
}

.table--nis2-plan th:nth-child(2) { width: 120px; }
.table--nis2-plan th:nth-child(3) { width: 110px; }
.table--nis2-plan th:nth-child(4) { width: 140px; }
.table--nis2-plan th:nth-child(5) { width: 120px; }
.table--nis2-plan th:nth-child(6) { width: 110px; }

.table--nis2-plan .status-badge,
.table--nis2-plan .nis2-tag,
.table--nis2-plan td .progress-label {
  white-space: nowrap;
}

.nis2-phase-group td {
  background: var(--color-surface-secondary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-light);
}

.nis2-action-main {
  display: flex;
  gap: var(--spacing-sm);
  align-items: flex-start;
}
.nis2-action-text {
  font-weight: 700;
  color: var(--color-text);
}
.nis2-action-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-xs);
  margin-top: var(--spacing-xs);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: 0.2rem var(--spacing-sm);
  border-radius: var(--border-radius-full);
  font-size: var(--font-size-xs);
  background: var(--color-surface-secondary);
  color: var(--color-text-light);
}
.chip--phase { background: rgba(13, 148, 136, 0.12); color: var(--color-primary); }
.chip--type { background: rgba(59, 130, 246, 0.12); color: #1d4ed8; }
.chip--owner { background: rgba(249, 115, 22, 0.18); color: #9a3412; font-weight: 600; }

.nis2-budget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--spacing-md);
  margin: var(--spacing-md) 0;
}
.nis2-custom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--spacing-md);
  margin: var(--spacing-sm) 0 var(--spacing-md);
}
.nis2-budget-grid .kpi-card,
.nis2-custom-grid .kpi-card {
  cursor: pointer;
}
.nis2-custom-card {
  cursor: pointer;
  border: 1px solid var(--color-border);
  transition: transform var(--transition-duration), box-shadow var(--transition-duration), border-color var(--transition-duration);
}
.nis2-custom-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: var(--color-primary-light);
}
.nis2-custom-card:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 4px;
}
.nis2-custom-card .kpi-card__label {
  font-weight: 700;
}
.nis2-custom-card__hint {
  margin-top: var(--spacing-xs);
  color: var(--color-text-light);
  font-size: var(--font-size-xs);
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
}
.nis2-budget-card__hint {
  margin-top: var(--spacing-xs);
  color: var(--color-text-light);
  font-size: var(--font-size-xs);
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
}
body.theme-dark .nis2-custom-card {
  border-color: rgba(255, 255, 255, 0.08);
}

/* ===================== Budget Cybersécurité ===================== */
.budget-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-md);
  margin: var(--spacing-md) 0;
}
/* Montants budget : xxl tronquait les grands montants (ex. « 4 173 000 € ») au bord de la carte.
   lg tient sur une ligne dans la zone ~106px ; au pire le retour se fait entre groupes de milliers. */
.budget-kpi-card .kpi-card__value {
  font-size: var(--font-size-lg);
  letter-spacing: -0.01em;
}
.budget-kpi-card .kpi-card__detail {
  margin-top: 2px;
  color: var(--color-text-light);
  font-size: var(--font-size-xs);
  font-weight: 600;
}
.budget-status-chips {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  align-items: center;
}
.budget-status-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--color-surface-alt, rgba(0, 0, 0, 0.04));
  border: 1px solid var(--color-border);
  font-size: var(--font-size-sm);
  color: var(--color-text);
}
.budget-status-chip strong { font-weight: 700; }
.budget-status-chip__dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.budget-status-chip.budget-status--planifie .budget-status-chip__dot { background: var(--color-secondary); }
.budget-status-chip.budget-status--engage .budget-status-chip__dot { background: var(--color-warning); }
.budget-status-chip.budget-status--realise .budget-status-chip__dot { background: var(--color-success); }

.budget-charts-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}
.budget-charts-grid .chart-card__content {
  height: 320px;
  position: relative;
}
.budget-charts-grid .chart-card__content canvas { max-height: 100%; }
#budgetByCategoryLegend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  justify-content: center;
  margin-top: var(--spacing-sm);
}
.budget-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
}
.budget-legend__dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.budget-empty-hint { color: var(--color-text-light); font-size: var(--font-size-sm); text-align: center; margin: var(--spacing-sm) 0; }

/* Toolbar v2 : #budgetToolbar réutilise les classes .section-toolbar (voir index.html). */

.budget-lines { margin-top: var(--spacing-sm); overflow-x: auto; }
.budget-line-table { width: 100%; border-collapse: collapse; }
.budget-line-table th,
.budget-line-table td {
  padding: var(--spacing-sm) var(--spacing-md);
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: middle;
}
.budget-line-table thead th {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-secondary);
  background: var(--color-surface-alt, rgba(0, 0, 0, 0.02));
}
.budget-line-table .text-right { text-align: right; }
.budget-line-table .budget-line-label { font-weight: 600; color: var(--color-text); }
.budget-group-row td {
  background: var(--color-surface-alt, rgba(0, 0, 0, 0.03));
  font-weight: 700;
  color: var(--color-text);
  text-transform: none;
}
.budget-total-row td {
  border-top: 2px solid var(--color-border);
  font-weight: 700;
  background: var(--color-surface-alt, rgba(0, 0, 0, 0.04));
}
.budget-line-actions { white-space: nowrap; }
.budget-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: var(--font-size-xs);
  font-weight: 600;
}
.budget-status--planifie { background: rgba(93, 135, 143, 0.15); color: var(--color-secondary); }
.budget-status--engage { background: rgba(249, 115, 22, 0.18); color: #9a3412; }
.budget-status--realise { background: rgba(50, 192, 134, 0.18); color: #15803d; }

.budget-empty { text-align: center; padding: 2.5rem var(--spacing-md); color: var(--color-text-light); }
.budget-empty i { font-size: 2.4rem; color: var(--color-border); margin-bottom: var(--spacing-sm); }
.budget-empty__title { font-weight: 700; color: var(--color-text-secondary); margin: var(--spacing-sm) 0 4px; }
.budget-empty__hint { font-size: var(--font-size-sm); max-width: 460px; margin: 0 auto; }

body.theme-dark .budget-status-chip,
body.theme-dark .budget-line-table thead th,
body.theme-dark .budget-group-row td,
body.theme-dark .budget-total-row td { background: rgba(255, 255, 255, 0.05); }
body.theme-dark .budget-line-table th,
body.theme-dark .budget-line-table td { border-color: rgba(255, 255, 255, 0.08); }
/* Pastilles de statut : texte clair en thème sombre (les couleurs foncées #9a3412 /
   #15803d sont illisibles sur fond sombre translucide). */
body.theme-dark .budget-status--planifie { color: #cbd5e1; }
body.theme-dark .budget-status--engage { color: #fdba74; }
body.theme-dark .budget-status--realise { color: #86efac; }

@media (max-width: 900px) {
  .budget-charts-grid { grid-template-columns: 1fr; }
}

.nis2-plan--executive .table--nis2-plan-executive th,
.nis2-plan--executive .table--nis2-plan-executive td {
  padding: var(--spacing-xs) var(--spacing-sm);
}
.nis2-plan--executive .chip--type,
.nis2-plan--executive .chip--owner {
  display: none;
}
.nis2-plan--executive .nis2-plan-card {
  box-shadow: var(--shadow-sm);
}

.text-right {
  text-align: right;
}

.text-center {
  text-align: center;
}

.nis2-empty {
  border: 1px dashed var(--color-border);
  border-radius: var(--border-radius);
  padding: var(--spacing-md);
  text-align: center;
  color: var(--color-text-light);
}

.nis2-plan-card--pillar1 { --nis2-accent: #0f9b7a; --nis2-accent-soft: rgba(15, 155, 122, 0.18); --nis2-accent-border: rgba(15, 155, 122, 0.4); }
.nis2-plan-card--pillar2 { --nis2-accent: #0b8f65; --nis2-accent-soft: rgba(11, 143, 101, 0.18); --nis2-accent-border: rgba(11, 143, 101, 0.42); }
.nis2-plan-card--pillar3 { --nis2-accent: #0a7c52; --nis2-accent-soft: rgba(10, 124, 82, 0.18); --nis2-accent-border: rgba(10, 124, 82, 0.38); }
.nis2-plan-card--pillar4 { --nis2-accent: #6b7280; --nis2-accent-soft: rgba(107, 114, 128, 0.18); --nis2-accent-border: rgba(107, 114, 128, 0.4); }
.nis2-plan-card--pillar5 { --nis2-accent: #4b5563; --nis2-accent-soft: rgba(75, 85, 99, 0.18); --nis2-accent-border: rgba(75, 85, 99, 0.4); }

body.theme-dark .nis2-plan-toolbar {
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.18), #1f2937);
  border-color: #334155;
}
body.theme-dark .chip-btn {
  background: #111827;
  border-color: #1f2937;
  color: #e5e7eb;
}
body.theme-dark .chip-btn.is-active {
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.28), #0b1525);
  border-color: rgba(13, 148, 136, 0.6);
  color: #a5f3fc;
}
body.theme-dark .stat-chip {
  background: #111827;
  border-color: #1f2937;
  color: #e5e7eb;
}
body.theme-dark .nis2-phases-panel {
  background: #0f172a;
  border-color: #1f2937;
}
body.theme-dark .phase-chip {
  background: rgba(255, 255, 255, 0.06);
  border-color: #1f2937;
  color: #e5e7eb;
}
body.theme-dark .nis2-plan-card {
  background: linear-gradient(135deg, var(--nis2-accent-soft, rgba(13, 148, 136, 0.12)), #0f172a);
  border-color: var(--nis2-accent-border, #1f2937);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
}
body.theme-dark .nis2-plan-card__eyebrow,
body.theme-dark .nis2-action-text,
body.theme-dark .nis2-plan-meta,
body.theme-dark .nis2-plan-card .module__title {
  color: #e5e7eb;
}
body.theme-dark .nis2-plan-stats {
  background: rgba(17, 24, 39, 0.8);
  border-color: rgba(148, 163, 184, 0.3);
}
body.theme-dark .nis2-phase-node {
  border-color: #334155;
}
body.theme-dark .chip {
  background: rgba(255, 255, 255, 0.08);
  color: #e5e7eb;
}
body.theme-dark .sort-chip:hover {
  background: rgba(31, 184, 205, 0.15);
}
body.theme-dark .section-toolbar {
  box-shadow: none;
}

@media (max-width: 900px) {
  .nis2-plan-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .nis2-plan-grid {
    flex-direction: column;
  }
}

/* Socle de sécurité */
.socle-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: var(--spacing-lg);
}

.socle-card {
  position: relative;
  background: linear-gradient(135deg, var(--socle-accent-soft, rgba(13, 148, 136, 0.08)), var(--color-surface));
  border: 1px solid var(--socle-border, var(--color-border));
  border-radius: var(--border-radius-lg);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.06);
  padding: var(--spacing-md);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  overflow: hidden;
}

.socle-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, var(--socle-accent-soft, transparent), transparent 55%);
  pointer-events: none;
}

.socle-card__header {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-sm);
}
.socle-card__meta {
  flex: 1;
  min-width: 0;
}
.socle-card__edit {
  margin-left: auto;
  align-self: flex-start;
}

.socle-card__icon {
  width: 52px;
  height: 52px;
  border-radius: var(--border-radius-lg);
  display: grid;
  place-items: center;
  color: var(--color-surface);
  background: linear-gradient(135deg, var(--socle-accent, #0d9488), #0b786f);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.socle-card__eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: var(--font-size-xs);
  color: var(--socle-accent, var(--color-primary));
  font-weight: 700;
}

.socle-card__title {
  margin: var(--spacing-xs) 0;
  font-size: var(--font-size-lg);
  color: var(--color-text);
}

.socle-card__subtitle {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
}

.socle-card__body h4 {
  margin: var(--spacing-sm) 0 var(--spacing-xs);
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.socle-card__body ul {
  margin: 0;
  padding-left: var(--spacing-lg);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  line-height: 1.5;
}

.socle-card__body li + li {
  margin-top: var(--spacing-xs);
}

.socle-card__footer {
  margin-top: var(--spacing-sm);
  font-size: var(--font-size-sm);
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.6);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--border-radius-sm);
  border: 1px dashed var(--socle-border, var(--color-border));
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.socle-card--pillar1 {
  --socle-accent: #0f9b7a;
  --socle-accent-soft: rgba(15, 155, 122, 0.18);
  --socle-border: rgba(15, 155, 122, 0.4);
  background: linear-gradient(135deg, rgba(15, 155, 122, 0.18), #ffffff);
}
.socle-card--pillar2 {
  --socle-accent: #0b8f65;
  --socle-accent-soft: rgba(11, 143, 101, 0.18);
  --socle-border: rgba(11, 143, 101, 0.42);
  background: linear-gradient(135deg, rgba(11, 143, 101, 0.18), #ffffff);
}
.socle-card--pillar3 {
  --socle-accent: #0a7c52;
  --socle-accent-soft: rgba(10, 124, 82, 0.18);
  --socle-border: rgba(10, 124, 82, 0.38);
  background: linear-gradient(135deg, rgba(10, 124, 82, 0.18), #ffffff);
}
.socle-card--pillar4 {
  --socle-accent: #6b7280;
  --socle-accent-soft: rgba(107, 114, 128, 0.18);
  --socle-border: rgba(107, 114, 128, 0.4);
  background: linear-gradient(135deg, rgba(107, 114, 128, 0.14), #f7f7f7);
}
.socle-card--pillar5 {
  --socle-accent: #4b5563;
  --socle-accent-soft: rgba(75, 85, 99, 0.18);
  --socle-border: rgba(75, 85, 99, 0.4);
  background: linear-gradient(135deg, rgba(75, 85, 99, 0.12), #f8f8f8);
}

@media (max-width: 900px) {
  .socle-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }
}

/* Dark theme for socle cards */
body.theme-dark .socle-card {
  background: linear-gradient(135deg, var(--socle-accent-soft, rgba(13, 148, 136, 0.12)), #1f2937);
  border-color: var(--socle-border, var(--color-border));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
}
body.theme-dark .socle-card__title,
body.theme-dark .socle-card__subtitle,
body.theme-dark .socle-card__body ul,
body.theme-dark .socle-card__footer {
  color: #f8fafc;
}
body.theme-dark .socle-card__eyebrow,
body.theme-dark .socle-card__body h4 {
  color: #cbd5e0;
}
body.theme-dark .socle-card__footer {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--socle-border, var(--color-border));
}
body.theme-dark .socle-card__icon {
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
}

/* Theme Poudre refinements */
body.theme-poudre .app {
  background: transparent;
}
body.theme-poudre .header,
body.theme-poudre .nav,
body.theme-poudre .nav--tertiary,
body.theme-poudre .global-search {
  background-color: rgba(255, 250, 246, 0.92);
  border-bottom-color: rgba(225, 194, 194, 0.65);
  box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
body.theme-poudre .nav--secondary {
  background-color: rgba(252, 232, 221, 0.82);
  border-bottom-color: rgba(225, 194, 194, 0.6);
}
body.theme-poudre .header__title,
body.theme-poudre .module__title,
body.theme-poudre .chart-card__title,
body.theme-poudre .modal__title {
  color: var(--color-secondary-dark);
  font-weight: 700;
  letter-spacing: -0.01em;
}
body.theme-poudre .header__title {
  font-family: var(--font-family);
}
body.theme-poudre .header__title i {
  color: var(--color-primary);
}
body.theme-poudre .module__subtitle,
body.theme-poudre .chart-card__subtitle {
  color: var(--color-text-secondary);
}
body.theme-poudre .nav__content {
  gap: var(--spacing-xs);
  padding: var(--spacing-sm) 0;
}
body.theme-poudre .nav__item {
  border-radius: var(--border-radius);
  padding: var(--spacing-sm) var(--spacing-md);
  font-weight: 500;
  color: var(--color-text-light);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
body.theme-poudre .nav__item:hover {
  background-color: rgba(194, 112, 111, 0.08);
  color: var(--color-primary);
}
body.theme-poudre .nav__item--active {
  background-color: rgba(194, 112, 111, 0.12);
  color: var(--color-primary);
  font-weight: 600;
}
body.theme-poudre .nav__item--active::after {
  display: none;
}
body.theme-poudre .global-search__item {
  background: var(--color-surface);
  border-radius: var(--border-radius-xl);
  border-color: rgba(203, 207, 215, 0.75);
}
body.theme-poudre .global-search__item:hover {
  border-color: rgba(176, 91, 92, 0.5);
  box-shadow: 0 8px 16px rgba(176, 91, 92, 0.12);
}
body.theme-poudre .global-search__type {
  letter-spacing: 0.08em;
}
body.theme-poudre .mode-banner {
  background: linear-gradient(90deg, #fce8dd, #f2ebdf);
  border-bottom-color: rgba(225, 194, 194, 0.6);
}
body.theme-poudre .mode-banner--edit {
  background: linear-gradient(90deg, #e2f0f3, #f2ebdf);
}
body.theme-poudre .mode-banner--locked-by-other {
  background: linear-gradient(90deg, #f7d9b3, #f2ebdf);
  border-bottom-color: rgba(225, 165, 100, 0.6);
}
body.theme-poudre .btn {
  background-color: var(--color-surface);
  border-color: var(--color-border);
  border-radius: var(--border-radius-lg);
  color: var(--color-text);
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
body.theme-poudre .btn:hover {
  background-color: var(--color-surface-secondary);
  transform: translateY(-1px);
}
body.theme-poudre .btn--primary {
  background: linear-gradient(135deg, #d08080 0%, #c2706f 100%);
  border: none;
  border-radius: var(--border-radius-lg);
  box-shadow: 0 4px 14px rgba(194, 112, 111, 0.25);
  color: #fff;
  font-weight: 600;
}
body.theme-poudre .btn--primary:hover {
  background: linear-gradient(135deg, #c2706f 0%, #a25a59 100%);
  box-shadow: 0 6px 20px rgba(194, 112, 111, 0.35);
  transform: translateY(-2px);
}
body.theme-poudre .btn--secondary {
  background: linear-gradient(135deg, #9cb8c5 0%, #8fa8b5 100%);
  border: none;
  border-radius: var(--border-radius-lg);
  box-shadow: 0 4px 14px rgba(143, 168, 181, 0.25);
  color: #fff;
  font-weight: 600;
}
body.theme-poudre .btn--secondary:hover {
  background: linear-gradient(135deg, #8fa8b5 0%, #5f7a8a 100%);
  box-shadow: 0 6px 20px rgba(143, 168, 181, 0.35);
  transform: translateY(-2px);
}
body.theme-poudre .btn--outline {
  background-color: transparent;
  border: 1.5px solid var(--color-primary-light);
  border-radius: var(--border-radius-lg);
  color: var(--color-primary);
}
body.theme-poudre .btn--outline:hover {
  background-color: rgba(194, 112, 111, 0.08);
  border-color: var(--color-primary);
}
body.theme-poudre .btn--danger {
  background: linear-gradient(135deg, #e07070 0%, #d46b6b 100%);
  border: none;
  border-radius: var(--border-radius-lg);
  box-shadow: 0 4px 14px rgba(212, 107, 107, 0.25);
  color: #fff;
}
body.theme-poudre .btn--danger:hover {
  background: linear-gradient(135deg, #d46b6b 0%, #b04a4a 100%);
  box-shadow: 0 6px 20px rgba(212, 107, 107, 0.35);
  transform: translateY(-2px);
}
body.theme-poudre .btn--success {
  background: linear-gradient(135deg, #6db28c 0%, #4d8a68 100%);
  border: none;
  border-radius: var(--border-radius-lg);
  box-shadow: 0 4px 14px rgba(77, 138, 104, 0.25);
  color: #fff;
}
body.theme-poudre .btn--success:hover {
  background: linear-gradient(135deg, #4d8a68 0%, #3a6b50 100%);
  box-shadow: 0 6px 20px rgba(77, 138, 104, 0.35);
  transform: translateY(-2px);
}
body.theme-poudre .form-control {
  background-color: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: 0.625rem var(--spacing-md);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
body.theme-poudre .form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(194, 112, 111, 0.12);
  outline: none;
}
body.theme-poudre .form-control[readonly] {
  background-color: var(--color-surface-secondary);
}
body.theme-poudre .table-container {
  border: 1px solid rgba(225, 194, 194, 0.7);
  box-shadow: var(--shadow-md);
  background: linear-gradient(180deg, #fffaf6 0%, #fff4ec 100%);
}
body.theme-poudre .table th {
  background-color: rgba(203, 207, 215, 0.4);
  color: var(--color-secondary-dark);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
body.theme-poudre .table tbody tr:nth-child(even) {
  background-color: rgba(252, 232, 221, 0.25);
}
body.theme-poudre .table tbody tr:hover {
  background-color: rgba(226, 240, 243, 0.5);
}
body.theme-poudre .info-box {
  background-color: rgba(226, 240, 243, 0.8);
  border-left-color: #b4c5d3;
  box-shadow: var(--shadow-sm);
}
body.theme-poudre .info-box__icon {
  color: var(--color-secondary-dark);
}
body.theme-poudre .chart-card {
  background: linear-gradient(145deg, #ffffff 0%, #faf5f2 100%);
  border: 1px solid rgba(232, 220, 214, 0.5);
  border-radius: var(--border-radius-xl);
  box-shadow: 0 4px 20px rgba(74, 67, 64, 0.06);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
body.theme-poudre .chart-card:hover {
  box-shadow: 0 8px 30px rgba(74, 67, 64, 0.10);
}
body.theme-poudre .chart-legend {
  border-color: rgba(232, 220, 214, 0.5);
  border-radius: var(--border-radius-lg);
  background: rgba(255, 255, 255, 0.8);
}
body.theme-poudre .kpi-card {
  background: linear-gradient(145deg, #ffffff 0%, #faf5f2 100%);
  border: 1px solid rgba(232, 220, 214, 0.6);
  border-radius: var(--border-radius-xl);
  box-shadow: 0 4px 20px rgba(74, 67, 64, 0.06);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
body.theme-poudre .kpi-card:hover {
  box-shadow: 0 8px 30px rgba(74, 67, 64, 0.10);
  transform: translateY(-2px);
}
body.theme-poudre .kpi-card--primary {
  --kpi-accent: #c2706f;
  --kpi-accent-soft: rgba(194, 112, 111, 0.12);
  --kpi-border: rgba(194, 112, 111, 0.25);
}
body.theme-poudre .kpi-card--success {
  --kpi-accent: #6db28c;
  --kpi-accent-soft: rgba(109, 178, 140, 0.12);
  --kpi-border: rgba(109, 178, 140, 0.25);
}
body.theme-poudre .kpi-card--warning {
  --kpi-accent: #dba66a;
  --kpi-accent-soft: rgba(219, 166, 106, 0.12);
  --kpi-border: rgba(219, 166, 106, 0.25);
}
body.theme-poudre .kpi-card--danger {
  --kpi-accent: #d46b6b;
  --kpi-accent-soft: rgba(212, 107, 107, 0.12);
  --kpi-border: rgba(212, 107, 107, 0.25);
}
body.theme-poudre .kpi-card--info {
  --kpi-accent: #7aa8c2;
  --kpi-accent-soft: rgba(122, 168, 194, 0.12);
  --kpi-border: rgba(122, 168, 194, 0.25);
}

/* Nouvelles couleurs KPI secondaires - Thème Poudre */
body.theme-poudre .kpi-card--purple {
  --kpi-accent: #a88bc2;
  --kpi-accent-soft: rgba(168, 139, 194, 0.12);
  --kpi-border: rgba(168, 139, 194, 0.25);
}
body.theme-poudre .kpi-card--cyan {
  --kpi-accent: #6db2b2;
  --kpi-accent-soft: rgba(109, 178, 178, 0.12);
  --kpi-border: rgba(109, 178, 178, 0.25);
}
body.theme-poudre .kpi-card--orange {
  --kpi-accent: #d49a6a;
  --kpi-accent-soft: rgba(212, 154, 106, 0.12);
  --kpi-border: rgba(212, 154, 106, 0.25);
}
body.theme-poudre .kpi-card--blue {
  --kpi-accent: #7a9ac2;
  --kpi-accent-soft: rgba(122, 154, 194, 0.12);
  --kpi-border: rgba(122, 154, 194, 0.25);
}
body.theme-poudre .kpi-card--teal {
  --kpi-accent: #5fa8a0;
  --kpi-accent-soft: rgba(95, 168, 160, 0.12);
  --kpi-border: rgba(95, 168, 160, 0.25);
}
body.theme-poudre .kpi-card--amber {
  --kpi-accent: #d4a86a;
  --kpi-accent-soft: rgba(212, 168, 106, 0.12);
  --kpi-border: rgba(212, 168, 106, 0.25);
}

/* Dashboard Hero - Thème Poudre */
body.theme-poudre .score-global {
  background: linear-gradient(145deg, #ffffff 0%, #faf5f2 100%);
  border: 1px solid rgba(194, 112, 111, 0.2);
}

body.theme-poudre .score-global__track {
  stroke: rgba(194, 112, 111, 0.15);
  stroke-dasharray: 8 4;
}

body.theme-poudre .score-global__value {
  fill: #3d3835;
}

body.theme-poudre .score-global__label {
  fill: #6b6360;
}

body.theme-poudre .score-global__dot--iso { background: linear-gradient(135deg, #c2706f, #6db28c); }
body.theme-poudre .score-global__dot--nis2 { background: linear-gradient(135deg, #7aa8c2, #a88bc2); }
body.theme-poudre .score-global__dot--risk { background: linear-gradient(135deg, #dba66a, #d46b6b); }

body.theme-poudre .dashboard-alerts {
  background: linear-gradient(145deg, #ffffff 0%, #fdf8f6 100%);
  border: 1px solid rgba(212, 107, 107, 0.15);
}

body.theme-poudre .dashboard-alerts__header {
  color: #c2706f;
}
body.theme-poudre .dashboard-activity {
  background: linear-gradient(145deg, #ffffff 0%, #fdf8f6 100%);
  border: 1px solid rgba(122, 168, 194, 0.15);
}
body.theme-poudre .dashboard-activity__header { color: #7aa8c2; }

body.theme-poudre .alert-item {
  background: #faf5f2;
  border: 1px solid rgba(232, 220, 214, 0.4);
}

body.theme-poudre .alert-item:hover {
  background: #f5eeea;
  box-shadow: 0 2px 8px rgba(74, 67, 64, 0.08);
}

body.theme-poudre .alert-item__icon--critical {
  background: rgba(212, 107, 107, 0.12);
  color: #b85555;
}

body.theme-poudre .alert-item__icon--warning {
  background: rgba(219, 166, 106, 0.15);
  color: #b8884a;
}

body.theme-poudre .alert-item__icon--info {
  background: rgba(122, 168, 194, 0.15);
  color: #5a8aa5;
}

body.theme-poudre .alert-item__icon--purple {
  background: rgba(168, 139, 194, 0.15);
  color: #8a6ba8;
}

/* Thème Poudre - Nouvelles fonctionnalités dashboard */
body.theme-poudre .chart-mini-legend__value {
  color: #3d3835;
}

body.theme-poudre .activity-item {
  border-bottom-color: rgba(232, 220, 214, 0.5);
}

body.theme-poudre .activity-item__icon--control { background: rgba(109, 178, 140, 0.15); color: #5f8b6a; }
body.theme-poudre .activity-item__icon--action { background: rgba(219, 166, 106, 0.15); color: #b8884a; }
body.theme-poudre .activity-item__icon--risk { background: rgba(212, 107, 107, 0.15); color: #b85555; }
body.theme-poudre .activity-item__icon--audit { background: rgba(122, 168, 194, 0.15); color: #5a8aa5; }
body.theme-poudre .activity-item__icon--doc { background: rgba(168, 139, 194, 0.15); color: #8a6ba8; }
body.theme-poudre .activity-item__icon--nc { background: rgba(194, 112, 111, 0.15); color: #a85a59; }

body.theme-poudre .chart-filters {
  background: rgba(232, 220, 214, 0.4);
}

body.theme-poudre .chart-filter {
  color: #6b6360;
}

body.theme-poudre .chart-filter--active {
  background: #c2706f;
  color: #fff;
}

body.theme-poudre .dashboard-footer {
  border-top-color: rgba(232, 220, 214, 0.6);
}

body.theme-poudre .kpi-card__trend--up {
  background: rgba(109, 178, 140, 0.15);
  color: #5f8b6a;
}

body.theme-poudre .kpi-card__trend--down {
  background: rgba(212, 107, 107, 0.15);
  color: #b85555;
}

body.theme-poudre .progress-bar {
  background-color: rgba(225, 194, 194, 0.35);
}
body.theme-poudre .progress-bar__fill {
  background: linear-gradient(90deg, #b05b5c, #be7c7b);
}
body.theme-poudre .status-badge--non_implemente {
  background-color: rgba(176, 91, 92, 0.12);
  color: #8f4143;
}
body.theme-poudre .status-badge--en_cours {
  background-color: rgba(213, 165, 124, 0.25);
  color: #b7845f;
}
body.theme-poudre .status-badge--implemente {
  background-color: rgba(126, 160, 141, 0.2);
  color: #5f7b6a;
}
body.theme-poudre .status-badge--verifie {
  background-color: rgba(180, 197, 211, 0.25);
  color: #5f7386;
}
body.theme-poudre .status-badge--insignifiant {
  background-color: rgba(180, 197, 211, 0.2);
  color: #5f7386;
}
body.theme-poudre .status-badge--significatif {
  background-color: rgba(213, 165, 124, 0.22);
  color: #b7845f;
}
body.theme-poudre .status-badge--grave {
  background-color: rgba(190, 124, 123, 0.22);
  color: #b05b5c;
}
body.theme-poudre .status-badge--critique {
  background-color: rgba(176, 91, 92, 0.22);
  color: #8f4143;
}
body.theme-poudre .status-badge--non-applicable {
  background-color: rgba(143, 130, 128, 0.12);
  color: #6b6360;
  border-color: rgba(143, 130, 128, 0.35);
}
body.theme-poudre .soa-link {
  color: var(--color-primary);
}
body.theme-poudre .soa-link:hover {
  color: var(--color-primary-dark);
}
body.theme-poudre .soa-alert--warning {
  background-color: rgba(219, 166, 106, 0.12);
  border-color: rgba(219, 166, 106, 0.35);
}
body.theme-poudre .soa-alert__icon {
  background-color: #dba66a;
}
body.theme-poudre .soa-alert__content strong {
  color: #b7845f;
}
body.theme-poudre .highlight-row {
  animation: highlightRowPoudre 2.5s ease-out;
}
@keyframes highlightRowPoudre {
  0% {
    background-color: rgba(194, 112, 111, 0.25);
  }
  100% {
    background-color: transparent;
  }
}
/* SoA Risks badges - Poudre theme */
body.theme-poudre .soa-risks__badge--critique {
  background-color: rgba(176, 91, 92, 0.18);
  color: #8f4143;
}
body.theme-poudre .soa-risks__badge--grave {
  background-color: rgba(190, 124, 123, 0.18);
  color: #b05b5c;
}
body.theme-poudre .soa-risks__badge--significatif {
  background-color: rgba(213, 165, 124, 0.2);
  color: #b7845f;
}
body.theme-poudre .soa-risks__badge--mineur {
  background-color: rgba(126, 160, 141, 0.18);
  color: #5f7b6a;
}
body.theme-poudre .soa-risks__badge--insignifiant {
  background-color: rgba(180, 197, 211, 0.18);
  color: #5f7386;
}
body.theme-poudre .soa-risks__empty {
  color: #8f8580;
}

/* SOA rows - Poudre theme */
body.theme-poudre .soa-row--applicable {
  background-color: rgba(109, 178, 140, 0.12);
}

body.theme-poudre .soa-row--applicable:hover {
  background-color: rgba(109, 178, 140, 0.2);
}

body.theme-poudre .soa-row--not-applicable {
  background-color: rgba(143, 133, 128, 0.15);
}

body.theme-poudre .soa-row--not-applicable:hover {
  background-color: rgba(143, 133, 128, 0.22);
}

body.theme-poudre .soa-row--not-applicable td:first-child,
body.theme-poudre .soa-row--not-applicable td:nth-child(2) {
  text-decoration-color: rgba(143, 133, 128, 0.5);
}

/* Textareas dans les tableaux - Poudre theme */
body.theme-poudre .soa-justification,
body.theme-poudre .doc-review-justification,
body.theme-poudre .doc-review-tool {
  border-color: var(--color-border);
  background-color: var(--color-surface);
  border-radius: var(--border-radius);
}

body.theme-poudre .soa-justification:focus,
body.theme-poudre .doc-review-justification:focus,
body.theme-poudre .doc-review-tool:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(194, 112, 111, 0.1);
}

/* Supprimer la bordure verte de validation dans Poudre */
body.theme-poudre .table textarea.form-control:valid:not(:placeholder-shown) {
  border-color: var(--color-border);
}

body.theme-poudre .priority--low {
  background-color: rgba(126, 160, 141, 0.18);
  color: #5f7b6a;
}
body.theme-poudre .priority--medium {
  background-color: rgba(180, 197, 211, 0.22);
  color: #5f7386;
}
body.theme-poudre .priority--high {
  background-color: rgba(213, 165, 124, 0.22);
  color: #b7845f;
}
body.theme-poudre .priority--critical {
  background-color: rgba(176, 91, 92, 0.18);
  color: #8f4143;
}
body.theme-poudre .matrix-cell--insignifiant { background-color: rgba(180, 197, 211, 0.2); }
body.theme-poudre .matrix-cell--mineur { background-color: rgba(126, 160, 141, 0.18); }
body.theme-poudre .matrix-cell--significatif { background-color: rgba(213, 165, 124, 0.22); }
body.theme-poudre .matrix-cell--grave { background-color: rgba(190, 124, 123, 0.2); }
body.theme-poudre .matrix-cell--critique { background-color: rgba(176, 91, 92, 0.22); }
body.theme-poudre .chip--phase {
  background: rgba(176, 91, 92, 0.18);
  color: #8f4143;
}
body.theme-poudre .chip-btn.is-active {
  background: linear-gradient(135deg, rgba(176, 91, 92, 0.2), var(--color-surface));
  border-color: rgba(176, 91, 92, 0.35);
  color: var(--color-primary-dark);
}
body.theme-poudre .sort-chip {
  border-radius: 1rem;
}
body.theme-poudre .sort-chip--active {
  border-radius: 1rem;
}
body.theme-poudre .nis2-plan-card--pillar1 {
  --nis2-accent: #b05b5c;
  --nis2-accent-soft: rgba(176, 91, 92, 0.18);
  --nis2-accent-border: rgba(176, 91, 92, 0.38);
}
body.theme-poudre .nis2-plan-card--pillar2 {
  --nis2-accent: #7f93a8;
  --nis2-accent-soft: rgba(127, 147, 168, 0.18);
  --nis2-accent-border: rgba(127, 147, 168, 0.35);
}
body.theme-poudre .nis2-plan-card--pillar3 {
  --nis2-accent: #bcb4dc;
  --nis2-accent-soft: rgba(188, 180, 220, 0.2);
  --nis2-accent-border: rgba(188, 180, 220, 0.35);
}
body.theme-poudre .nis2-plan-card--pillar4 {
  --nis2-accent: #be7c7b;
  --nis2-accent-soft: rgba(190, 124, 123, 0.18);
  --nis2-accent-border: rgba(190, 124, 123, 0.35);
}
body.theme-poudre .nis2-plan-card--pillar5 {
  --nis2-accent: #ce9b9b;
  --nis2-accent-soft: rgba(206, 155, 155, 0.2);
  --nis2-accent-border: rgba(206, 155, 155, 0.35);
}
body.theme-poudre .socle-card--pillar1 {
  --socle-accent: #b05b5c;
  --socle-accent-soft: rgba(176, 91, 92, 0.18);
  --socle-border: rgba(176, 91, 92, 0.35);
  background: linear-gradient(135deg, rgba(176, 91, 92, 0.16), #fffaf6);
}
body.theme-poudre .socle-card--pillar2 {
  --socle-accent: #7f93a8;
  --socle-accent-soft: rgba(127, 147, 168, 0.18);
  --socle-border: rgba(127, 147, 168, 0.35);
  background: linear-gradient(135deg, rgba(127, 147, 168, 0.16), #fffaf6);
}
body.theme-poudre .socle-card--pillar3 {
  --socle-accent: #bcb4dc;
  --socle-accent-soft: rgba(188, 180, 220, 0.18);
  --socle-border: rgba(188, 180, 220, 0.35);
  background: linear-gradient(135deg, rgba(188, 180, 220, 0.16), #fffaf6);
}
body.theme-poudre .socle-card--pillar4 {
  --socle-accent: #be7c7b;
  --socle-accent-soft: rgba(190, 124, 123, 0.18);
  --socle-border: rgba(190, 124, 123, 0.35);
  background: linear-gradient(135deg, rgba(190, 124, 123, 0.16), #fffaf6);
}
body.theme-poudre .socle-card--pillar5 {
  --socle-accent: #ce9b9b;
  --socle-accent-soft: rgba(206, 155, 155, 0.18);
  --socle-border: rgba(206, 155, 155, 0.35);
  background: linear-gradient(135deg, rgba(206, 155, 155, 0.16), #fffaf6);
}
body.theme-poudre .modal {
  border: 1px solid rgba(225, 194, 194, 0.65);
}
body.theme-poudre .modal__header {
  background: rgba(252, 232, 221, 0.8);
}
body.theme-poudre .modal-overlay {
  background-color: rgba(110, 98, 92, 0.42);
}
body.theme-poudre .nis2-custom-card .kpi-card__value,
body.theme-poudre .nis2-custom-card .kpi-card__eyebrow,
body.theme-poudre .nis2-custom-card .kpi-card__label {
  font-weight: 600;
}
body.theme-poudre .nis2-status-text,
body.theme-poudre .nis2-action-text,
body.theme-poudre .nis2-phase-group td {
  font-weight: 600;
}
body.theme-poudre .nis2-status-chip__label,
body.theme-poudre .stat-chip {
  font-weight: 500;
}

/* Impression Programme NIS2 */
@page {
  size: A4 landscape;
  margin: 0;
}

body.print-nis2-program {
  background: var(--color-background);
}

body.print-nis2-program .header,
body.print-nis2-program .nav,
body.print-nis2-program .nav--secondary,
body.print-nis2-program .nav--tertiary,
body.print-nis2-program .global-search,
body.print-nis2-program .footer,
body.print-nis2-program #modeBanner,
body.print-nis2-program #modalOverlay,
body.print-nis2-program #toastContainer,
body.print-nis2-program #autoSaveStatus {
  display: none !important;
}

body.print-nis2-program .main {
  max-width: none;
  width: 100%;
  padding: 0;
}

body.print-nis2-program .module {
  display: none !important;
  opacity: 1 !important;
}

body.print-nis2-program #nis2-program {
  display: block !important;
}

body.print-nis2-program .module__header {
  margin: 0;
  padding: calc(var(--spacing-sm) + var(--spacing-xs)) var(--spacing-md) var(--spacing-sm);
}

body.print-nis2-program .chart-card,
body.print-nis2-program .socle-card,
body.print-nis2-program .nis2-plan-card,
body.print-nis2-program .nis2-plan-toolbar,
body.print-nis2-program .info-box,
body.print-nis2-program .module__header,
body.print-nis2-program .nis2-phases-panel,
body.print-nis2-program .nis2-plan-summary-strip,
body.print-nis2-program .table--nis2-plan,
body.print-nis2-program .table--nis2-plan tr,
body.print-nis2-program .nis2-top-grid,
body.print-nis2-program .socle-grid {
  break-inside: avoid;
  page-break-inside: avoid;
}

body.print-nis2-program .charts-grid.nis2-top-grid .chart-card__content {
  min-height: 360px;
  height: auto;
}
body.print-nis2-program .chart-card--actions-nis2 .chart-card__content,
body.print-nis2-program .chart-card--actions-domain .chart-card__content {
  min-height: 280px;
  height: auto;
}
body.print-nis2-program canvas {
  width: 100% !important;
  height: auto !important;
  display: block;
}

@media print {
  html, body {
    width: 100%;
    min-height: 100%;
    background: var(--color-background);
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.print-nis2-program .main {
    padding: 0;
  }

  body.print-nis2-program .module__header {
    margin-top: 0;
  }

  body.print-nis2-program .chart-card,
  body.print-nis2-program .socle-card,
  body.print-nis2-program .nis2-plan-card {
    box-shadow: none;
  }

  body.print-nis2-program .table--nis2-plan th,
  body.print-nis2-program .table--nis2-plan td {
    padding: var(--spacing-sm) 10px;
  }
}

/* Styles HTML2Canvas pour PDF fidèle NIS2 */
#nis2-program * {
  /* Forcer les couleurs exactes en PDF */
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  color-adjust: exact;
}

#nis2-program canvas {
  /* Canvas doivent rester rendus correctement */
  display: block !important;
  width: 100% !important;
  height: auto !important;
  background: var(--color-surface) !important;
  border: 1px solid var(--color-border);
  margin-bottom: var(--spacing-md);
  border-radius: var(--border-radius);
}

#nis2-program .chart-card {
  page-break-inside: avoid;
  break-inside: avoid;
  margin-bottom: var(--spacing-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: var(--spacing-md);
}

#nis2-program .chart-card__header {
  margin-bottom: var(--spacing-md);
}

#nis2-program .chart-card__title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  margin: 0 0 var(--spacing-xs) 0;
  color: var(--color-primary);
}

#nis2-program .chart-card__subtitle {
  font-size: var(--font-size-xs);
  color: var(--color-text-light);
  margin: 0;
}

#nis2-program .socle-card {
  page-break-inside: avoid;
  break-inside: avoid;
  margin-bottom: var(--spacing-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: var(--spacing-md);
}

#nis2-program .socle-card__header {
  display: flex;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  align-items: flex-start;
}

#nis2-program .socle-card__icon {
  font-size: var(--font-size-xl);
  color: var(--color-primary);
  min-width: 30px;
}

#nis2-program .socle-card__title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  margin: 0 0 var(--spacing-xs) 0;
  color: var(--color-text);
}

#nis2-program .table--nis2-plan {
  width: 100%;
  border-collapse: collapse;
  margin: var(--spacing-md) 0;
  font-size: var(--font-size-xs);
}

#nis2-program .table--nis2-plan thead {
  background: var(--color-surface-secondary);
}

#nis2-program .table--nis2-plan th,
#nis2-program .table--nis2-plan td {
  padding: var(--spacing-sm);
  border: 1px solid var(--color-border);
  text-align: left;
}

#nis2-program .table--nis2-plan th {
  font-weight: 600;
  background: var(--color-primary);
  color: var(--color-surface);
}

#nis2-program .table--nis2-plan tbody tr:nth-child(even) {
  background: var(--color-surface-secondary);
}

#nis2-program .module__header {
  margin: 0 0 var(--spacing-md) 0;
  padding: 0 0 var(--spacing-md) 0;
  border-bottom: 2px solid var(--color-primary);
}

#nis2-program .module__title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--color-primary);
  margin: 0;
}

#nis2-program .charts-grid,
#nis2-program .socle-grid {
  display: grid;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}

#nis2-program .charts-grid.nis2-top-grid {
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 1400px) {
  #nis2-program .charts-grid.nis2-top-grid {
    grid-template-columns: 1fr;
  }
}

/* Dark theme overrides for NIS2 program capture styles */
body.theme-dark #nis2-program canvas {
  background: var(--color-surface) !important;
  border-color: var(--color-border);
}
body.theme-dark #nis2-program .chart-card {
  background: var(--color-surface);
  border-color: var(--color-border);
}
body.theme-dark #nis2-program .chart-card__title {
  color: var(--color-primary);
}
body.theme-dark #nis2-program .chart-card__subtitle {
  color: var(--color-text-light);
}
body.theme-dark #nis2-program .socle-card {
  background: linear-gradient(135deg, var(--socle-accent-soft, rgba(13, 148, 136, 0.12)), #1f2937);
  border-color: var(--socle-border, var(--color-border));
}
body.theme-dark #nis2-program .socle-card__title {
  color: var(--color-text);
}
body.theme-dark #nis2-program .socle-card__icon {
  color: var(--color-surface);
}
body.theme-dark #nis2-program .table--nis2-plan thead {
  background: var(--color-surface-secondary);
}
body.theme-dark #nis2-program .table--nis2-plan th,
body.theme-dark #nis2-program .table--nis2-plan td {
  border-color: var(--color-border);
  color: var(--color-text);
}
body.theme-dark #nis2-program .table--nis2-plan tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}

/* Impression NIS2 inline (ancienne implémentation) */
body.print-nis2-inline {
  background: var(--color-background);
}
body.print-nis2-inline .header,
body.print-nis2-inline .nav,
body.print-nis2-inline .nav--secondary,
body.print-nis2-inline .nav--tertiary,
body.print-nis2-inline .global-search,
body.print-nis2-inline .footer,
body.print-nis2-inline #modeBanner,
body.print-nis2-inline #modalOverlay,
body.print-nis2-inline #toastContainer,
body.print-nis2-inline #autoSaveStatus {
  display: none !important;
}
body.print-nis2-inline .main {
  max-width: none;
  width: 100%;
  padding: 0;
}
body.print-nis2-inline .module {
  display: none !important;
  opacity: 1 !important;
}
body.print-nis2-inline #nis2-program {
  display: block !important;
}
body.print-nis2-inline .module__header {
  margin: 0;
  padding: calc(var(--spacing-sm) + var(--spacing-xs)) var(--spacing-md) var(--spacing-sm);
}
body.print-nis2-inline .chart-card,
body.print-nis2-inline .socle-card,
body.print-nis2-inline .nis2-plan-card,
body.print-nis2-inline .nis2-plan-toolbar,
body.print-nis2-inline .info-box,
body.print-nis2-inline .module__header,
body.print-nis2-inline .nis2-phases-panel,
body.print-nis2-inline .nis2-plan-summary-strip,
body.print-nis2-inline .table--nis2-plan,
body.print-nis2-inline .table--nis2-plan tr,
body.print-nis2-inline .nis2-top-grid,
body.print-nis2-inline .socle-grid {
  break-inside: avoid;
  page-break-inside: avoid;
}
body.print-nis2-inline .charts-grid.nis2-top-grid .chart-card__content {
  min-height: 360px;
  height: auto;
}
body.print-nis2-inline .chart-card--actions-nis2 .chart-card__content,
body.print-nis2-inline .chart-card--actions-domain .chart-card__content {
  min-height: 280px;
  height: auto;
}
body.print-nis2-inline img.print-canvas-snapshot {
  width: 100% !important;
  height: auto !important;
  display: block;
}
@media print {
  body.print-nis2-inline,
  body.print-nis2-inline * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  body.print-nis2-inline .chart-card,
  body.print-nis2-inline .socle-card,
  body.print-nis2-inline .nis2-plan-card {
    box-shadow: none;
  }
}

/* ==========================================================================
   UX Improvements - Accessibilité et Responsive
   ========================================================================== */

/* Focus visible amélioré pour l'accessibilité clavier */
:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(31, 184, 205, 0.15);
}

/* Supprime l'outline par défaut pour les clics souris */
:focus:not(:focus-visible) {
  outline: none;
}

/* Minimum touch target WCAG 2.5.8 */
@media (pointer: coarse) {
  .icon-btn,
  .btn--sm {
    min-height: 44px;
    min-width: 44px;
  }

  /* Refonte header 2026-07 : contrôles du header confortables au doigt */
  .csi-usermenu__trigger,
  .csi-usermenu__item,
  .csi-presence,
  .csi-sync-dot {
    min-height: 44px;
  }
}

/* Empty state for tables */
.table__empty-state {
  text-align: center;
  padding: var(--spacing-xl) var(--spacing-lg);
  color: var(--color-text-light);
  font-style: italic;
}

/* Tables responsive - scroll horizontal sur mobile */
@media (max-width: 768px) {
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 calc(-1 * var(--spacing-md));
    padding: 0 var(--spacing-md);
  }

  .table {
    min-width: 600px;
  }

  /* Indicateur de scroll */
  .table-container::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 20px;
    background: linear-gradient(to left, var(--color-surface), transparent);
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-duration);
  }

  .table-container:not(:has(:hover))::after {
    opacity: 1;
  }
}

/* Navigation mobile - Tooltips sur icônes */
@media (max-width: 768px) {
  .nav__item {
    position: relative;
  }

  .nav__item[title]::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-text);
    color: var(--color-surface);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-xs);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-duration), visibility var(--transition-duration);
    z-index: 100;
    pointer-events: none;
  }

  .nav__item[title]:hover::after,
  .nav__item[title]:focus::after {
    opacity: 1;
    visibility: visible;
  }
}

/* Amélioration des contrastes pour WCAG AA */
.text-muted,
.form-hint,
.table td.text-secondary {
  color: #5a6a77; /* Ratio de contraste amélioré */
}

/* Skeleton loader pour chargement */
.skeleton {
  background: linear-gradient(90deg,
    var(--color-surface-secondary) 25%,
    var(--color-border) 50%,
    var(--color-surface-secondary) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--border-radius-sm);
}

.skeleton-text {
  height: 1em;
  margin-bottom: 0.5em;
}

.skeleton-text:last-child {
  width: 70%;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Loading state pour boutons */
.btn--loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn--loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1em;
  height: 1em;
  margin: -0.5em 0 0 -0.5em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: var(--border-radius-full);
  animation: btn-spinner 0.6s linear infinite;
}

@keyframes btn-spinner {
  to { transform: rotate(360deg); }
}

/* États disabled améliorés */
.form-control:disabled,
.form-control[readonly] {
  background-color: var(--color-surface-secondary);
  color: var(--color-text-light);
  cursor: not-allowed;
  border-style: dashed;
}

/* Modal - Animation simple sans sursaut */
/* Note: L'animation est gérée par la transition dans .modal (scale 0.9 -> 1) */

/* Confirmation suppression - style warning */
.btn--danger-confirm {
  background-color: var(--color-danger);
  color: white;
  animation: pulse-warning 1s ease-in-out infinite;
}

@keyframes pulse-warning {
  0%, 100% { box-shadow: 0 0 0 0 rgba(219, 69, 69, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(219, 69, 69, 0); }
}

/* Form validation feedback - seulement pour les inputs de formulaires, pas les textareas des tableaux */
.form-group .form-control:invalid:not(:placeholder-shown):not(textarea) {
  border-color: var(--color-danger);
}

.form-group .form-control:valid:not(:placeholder-shown):not(textarea) {
  border-color: var(--color-success);
}

/* Les textareas dans les tableaux ne doivent pas avoir de validation visuelle automatique */
.table textarea.form-control,
.table textarea.form-control:valid,
.table textarea.form-control:invalid {
  border-color: var(--color-border);
}

.table textarea.form-control:focus {
  border-color: var(--color-primary);
}

.form-hint {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  margin-top: var(--spacing-xs);
}

.form-hint--error {
  color: var(--color-danger);
}

/* Amélioration KPI cards sur mobile */
@media (max-width: 768px) {
  .kpi-card {
    padding: var(--spacing-sm);
  }

  .kpi-card__icon {
    width: 40px;
    height: 40px;
    font-size: var(--font-size-md);
  }

  .kpi-card__value {
    font-size: var(--font-size-lg);
  }
}

/* Skip link pour accessibilité */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--color-primary);
  color: white;
  padding: var(--spacing-sm) var(--spacing-md);
  z-index: 10000;
  transition: top var(--transition-duration);
}

.skip-link:focus {
  top: 0;
}

/* ============================================================
   QUALITY REFINEMENTS - Typography & Visual Polish
   ============================================================ */

/* Global transition smoothing */
.btn,
.nav__item,
.form-control,
.kpi-card,
.chart-card,
.table tbody tr,
.modal,
.status-badge,
.chip-btn,
.icon-btn {
  transition: all var(--transition-duration) var(--transition-timing, ease);
}

/* Enhanced heading styles */
h1, h2, h3, h4, h5, h6,
.module__title,
.chart-card__title,
.kpi-card__label {
  letter-spacing: var(--letter-spacing-tight, -0.02em);
  line-height: var(--line-height-tight, 1.25);
}

/* Body text refinements */
p, .table td, .form-control, .info-box {
  line-height: var(--line-height-relaxed, 1.625);
}

/* Small text refinements */
.status-badge,
.chip,
.eyebrow,
.kpi-card__eyebrow,
small,
.text-sm {
  letter-spacing: var(--letter-spacing-wide, 0.025em);
}

/* ============================================================
   THEME POUDRE - Premium Visual Polish
   ============================================================ */

/* Enhanced header for Poudre */
body.theme-poudre .header__title {
  font-weight: 800;
  letter-spacing: -0.03em;
}

/* Refined subtitles */
body.theme-poudre .header__subtitle {
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--color-text-light);
}

/* Better text contrast for important elements */
body.theme-poudre .module__title {
  color: #4a4340;
  font-weight: 700;
}

body.theme-poudre .chart-card__title {
  color: #4a4340;
}

body.theme-poudre .kpi-card__value {
  color: #3d3835;
  font-weight: 700;
}

body.theme-poudre .kpi-card__label {
  color: var(--color-text);
  font-weight: 600;
}

/* Table improvements */
body.theme-poudre .table th {
  font-weight: 700;
  font-size: 0.7rem;
  color: #5f7386;
}

body.theme-poudre .table td {
  color: var(--color-text);
}

/* Button refinements */
body.theme-poudre .btn {
  font-weight: 600;
  letter-spacing: 0.01em;
}

body.theme-poudre .btn--primary {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Input focus states */
body.theme-poudre .form-control:focus {
  box-shadow: 0 0 0 3px rgba(176, 91, 92, 0.12), 0 0 0 1px rgba(176, 91, 92, 0.3);
}

/* Card hover effects */
body.theme-poudre .chart-card:hover,
body.theme-poudre .kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Navigation active state glow */
body.theme-poudre .nav__item--active {
  box-shadow: inset 0 0 0 1px rgba(176, 91, 92, 0.2), 0 2px 8px rgba(176, 91, 92, 0.08);
}

/* ============================================================
   THEME DARK - Enhanced Readability & Depth
   ============================================================ */

/* Better surface hierarchy */
body.theme-dark .header,
body.theme-dark .nav,
body.theme-dark .global-search {
  background-color: rgba(30, 41, 59, 0.95);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom-color: rgba(51, 65, 85, 0.8);
}

body.theme-dark .global-search__label mark {
  background-color: rgba(250, 204, 21, 0.25);
}

/* Card backgrounds with subtle gradients */
body.theme-dark .chart-card {
  background: linear-gradient(180deg, #1e293b 0%, #172033 100%);
  border-color: rgba(51, 65, 85, 0.6);
}

body.theme-dark .kpi-card {
  background: linear-gradient(135deg, rgba(51, 65, 85, 0.4), rgba(30, 41, 59, 0.8));
}

/* Text hierarchy */
body.theme-dark .module__title,
body.theme-dark .chart-card__title {
  color: #f8fafc;
}

body.theme-dark .module__subtitle,
body.theme-dark .chart-card__subtitle {
  color: #94a3b8;
}

/* Table improvements */
body.theme-dark .table th {
  background-color: rgba(51, 65, 85, 0.5);
  color: #cbd5e1;
}

body.theme-dark .table td {
  color: #e2e8f0;
}

body.theme-dark .table tbody tr:hover {
  background-color: rgba(56, 189, 248, 0.08);
}

/* SOA rows - dark theme */
body.theme-dark .soa-row--applicable {
  background-color: rgba(34, 197, 94, 0.12);
}

body.theme-dark .soa-row--applicable:hover {
  background-color: rgba(34, 197, 94, 0.2);
}

body.theme-dark .soa-row--not-applicable {
  background-color: rgba(71, 85, 105, 0.25);
}

body.theme-dark .soa-row--not-applicable:hover {
  background-color: rgba(71, 85, 105, 0.35);
}

body.theme-dark .soa-row--not-applicable td:first-child,
body.theme-dark .soa-row--not-applicable td:nth-child(2) {
  text-decoration-color: rgba(148, 163, 184, 0.4);
}

/* Button glow effects */
body.theme-dark .btn--primary {
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.3);
}

body.theme-dark .btn--primary:hover {
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.4);
}

body.theme-dark .btn--success {
  box-shadow: 0 4px 14px rgba(74, 222, 128, 0.3);
}
body.theme-dark .btn--success:hover {
  box-shadow: 0 6px 20px rgba(74, 222, 128, 0.4);
}

/* Input styling */
body.theme-dark .form-control {
  background-color: #0f172a;
  border-color: #334155;
  color: #f1f5f9;
}

body.theme-dark .form-control:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

body.theme-dark .form-control::placeholder {
  color: #64748b;
}

/* Modal styling */
body.theme-dark .modal {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border-color: #334155;
}

body.theme-dark .modal__header {
  background: rgba(51, 65, 85, 0.4);
  border-bottom-color: #334155;
}

body.theme-dark .modal-overlay {
  background-color: rgba(0, 0, 0, 0.7);
}

/* ============================================================
   THEME LIGHT - Clean & Crisp
   ============================================================ */

body.theme-light .header,
body.theme-light .nav,
body.theme-light .global-search {
  background-color: rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

body.theme-light .chart-card:hover,
body.theme-light .kpi-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* ============================================================
   SETTINGS PAGE REDESIGN - Premium UX
   ============================================================ */

/* === SETTINGS LAYOUT === */
.settings-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--spacing-xl);
  min-height: 500px;
  align-items: start;
}

.settings-sidebar {
  position: sticky;
  top: var(--spacing-lg);
  background: var(--color-surface);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-sm);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.settings-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--spacing-xs);
}

.settings-nav__item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: 0.65rem var(--spacing-md);
  border-radius: var(--border-radius);
  cursor: pointer;
  color: var(--color-text);
  font-size: var(--font-size-sm);
  font-weight: 500;
  transition: all 0.2s var(--transition-timing, ease);
  border: 1px solid transparent;
}

.settings-nav__item:hover {
  background: var(--color-surface-secondary);
  color: var(--color-primary);
}

.settings-nav__item--active {
  background: linear-gradient(135deg, rgba(31, 184, 205, 0.1), rgba(31, 184, 205, 0.05));
  border-color: rgba(31, 184, 205, 0.2);
  color: var(--color-primary);
  font-weight: 600;
}

.settings-nav__item--danger {
  color: var(--color-danger);
}

.settings-nav__item--danger:hover {
  background: rgba(239, 68, 68, 0.08);
  color: var(--color-danger);
}

.settings-nav__item--danger.settings-nav__item--active {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.25);
}

.settings-nav__icon {
  width: 18px;
  text-align: center;
  opacity: 0.85;
  font-size: var(--font-size-sm);
}

.settings-nav__badge {
  margin-left: auto;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--border-radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
  background: var(--color-primary);
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.settings-nav__badge--locked {
  background: var(--color-text-light);
}

/* === SETTINGS CONTENT AREA === */
.settings-content-area {
  display: grid;
  gap: var(--spacing-lg);
  opacity: 1;
  transition: opacity 0.15s ease;
}

.settings-content-area--transitioning {
  opacity: 0;
}

/* === SETTINGS CARDS === */
.settings-card {
  background: var(--color-surface);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--color-border);
  overflow: hidden;
  transition: box-shadow 0.3s var(--transition-timing, ease), transform 0.2s var(--transition-timing, ease);
  animation: settings-fade-in 0.3s ease backwards;
}

.settings-card:hover {
  box-shadow: var(--shadow-md);
}

.settings-content-area > .settings-card:nth-child(1) { animation-delay: 0ms; }
.settings-content-area > .settings-card:nth-child(2) { animation-delay: 60ms; }
.settings-content-area > .settings-card:nth-child(3) { animation-delay: 120ms; }

.settings-card__header {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-lg);
  background: linear-gradient(180deg, var(--color-surface) 0%, var(--color-surface-secondary) 100%);
  border-bottom: 1px solid var(--color-border);
}

.settings-card__icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--border-radius-lg);
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: white;
  font-size: var(--font-size-lg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

.settings-card__header-text {
  flex: 1;
  min-width: 0;
}

.settings-card__title {
  margin: 0;
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.settings-card__desc {
  margin: var(--spacing-xs) 0 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
}

.settings-card__status {
  width: 10px;
  height: 10px;
  border-radius: var(--border-radius-full);
  background: var(--color-warning);
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(255, 193, 133, 0.2);
}

.settings-card__status--ok {
  background: var(--color-success);
  box-shadow: 0 0 0 3px rgba(50, 192, 134, 0.2);
}

.settings-card__body {
  padding: var(--spacing-lg);
  display: grid;
  gap: var(--spacing-md);
}

/* Card variants */
.settings-card--danger {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.02), var(--color-surface));
  border-color: rgba(239, 68, 68, 0.2);
}

.settings-card--danger .settings-card__header {
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.06), rgba(239, 68, 68, 0.02));
}

.settings-card--danger .settings-card__icon-wrap {
  background: linear-gradient(135deg, var(--color-danger), var(--color-danger-dark));
}

/* === SETTINGS FORM FIELDS === */
.settings-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-md);
}

.settings-form-grid--single-col {
  grid-template-columns: 1fr;
  max-width: 400px;
}

.settings-form-grid--targets {
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 640px) {
  .settings-form-grid--targets {
    grid-template-columns: 1fr;
  }
}

.settings-info-banner {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--color-primary-bg, #eff6ff);
  border: 1px solid var(--color-primary-light, #bfdbfe);
  border-radius: var(--radius-md, 8px);
  font-size: 0.85rem;
  color: var(--color-primary-dark, #1e40af);
  margin-bottom: var(--spacing-md);
  line-height: 1.5;
}

.settings-info-banner i {
  margin-top: 2px;
  flex-shrink: 0;
}

.settings-form-group {
  display: grid;
  gap: var(--spacing-xs);
}

.settings-form-group--full {
  grid-column: 1 / -1;
}

.settings-form-label {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text);
}

.settings-form-help {
  font-size: var(--font-size-xs);
  color: var(--color-text-light);
  margin-top: var(--spacing-xs);
}

/* === SETTINGS LOGO UPLOAD === */
.settings-logo-preview-wrap {
  display: flex;
  justify-content: center;
  padding: var(--spacing-md);
  border: 2px dashed var(--color-border);
  border-radius: var(--border-radius);
  min-height: 80px;
  background: var(--color-surface-secondary);
}
.settings-logo-preview {
  max-width: 200px;
  max-height: 80px;
  object-fit: contain;
}
.settings-logo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
  color: var(--color-text-light);
  font-size: var(--font-size-sm);
}
.settings-logo-placeholder i {
  font-size: var(--font-size-xxl);
  opacity: 0.4;
}

/* === QUICK ACTIONS GRID === */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--spacing-md);
}

.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-lg) var(--spacing-md);
  border: 2px dashed var(--color-border);
  border-radius: var(--border-radius-lg);
  background: var(--color-surface-secondary);
  cursor: pointer;
  transition: all 0.2s var(--transition-timing, ease);
  text-align: center;
}

.quick-action:hover {
  border-color: var(--color-primary);
  border-style: solid;
  background: var(--color-surface);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.quick-action:active {
  transform: translateY(0);
}

.quick-action__icon {
  width: 42px;
  height: 42px;
  border-radius: var(--border-radius-lg);
  display: grid;
  place-items: center;
  background: var(--color-surface);
  color: var(--color-primary);
  font-size: var(--font-size-lg);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.quick-action:hover .quick-action__icon {
  background: var(--color-primary);
  color: white;
  box-shadow: var(--shadow-md);
}

.quick-action__label {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text);
}

.quick-action__hint {
  font-size: var(--font-size-xs);
  color: var(--color-text-light);
}

/* === STORAGE GAUGE === */
.storage-gauge {
  position: relative;
  height: 10px;
  background: var(--color-surface-secondary);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}

.storage-gauge__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-success), var(--color-success-light));
  border-radius: var(--border-radius);
  transition: width 0.5s ease-out, background 0.3s ease;
}

.storage-gauge__fill--warning {
  background: linear-gradient(90deg, var(--color-warning), var(--color-warning-light));
}

.storage-gauge__fill--danger {
  background: linear-gradient(90deg, var(--color-danger), var(--color-danger-light));
  animation: storage-pulse 1.5s ease-in-out infinite;
}

@keyframes storage-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.storage-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--spacing-md);
  margin-top: var(--spacing-md);
}

.storage-stat {
  padding: var(--spacing-md);
  background: var(--color-surface-secondary);
  border-radius: var(--border-radius);
  text-align: center;
  border: 1px solid var(--color-border);
}

.storage-stat__value {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-text);
}

.storage-stat__label {
  font-size: var(--font-size-xs);
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: var(--spacing-xs);
}

/* === SNAPSHOTS TIMELINE === */
.snapshots-timeline {
  position: relative;
  padding-left: var(--spacing-lg);
  max-height: 280px;
  overflow-y: auto;
}

.snapshots-timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--color-border);
  border-radius: 1px;
}

.snapshot-item {
  position: relative;
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--color-surface);
  border-radius: var(--border-radius);
  margin-bottom: var(--spacing-sm);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-sm);
  transition: all 0.2s ease;
}

.snapshot-item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--spacing-lg) + 2px);
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: var(--border-radius-full);
  background: var(--color-surface);
  border: 2px solid var(--color-primary);
  z-index: 1;
}

.snapshot-item--auto::before {
  border-color: var(--color-secondary);
}

.snapshot-item:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
  transform: translateX(4px);
}

.snapshot-item__info {
  flex: 1;
  min-width: 0;
}

.snapshot-item__name {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.snapshot-item__date {
  font-size: var(--font-size-xs);
  color: var(--color-text-light);
}

.snapshot-item__tag {
  font-size: var(--font-size-xs);
  padding: var(--spacing-xs) var(--spacing-xs);
  border-radius: var(--border-radius-sm);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.snapshot-item__tag--manual {
  background: rgba(14, 116, 144, 0.12);
  color: var(--color-tag-manual);
}

.snapshot-item__tag--auto {
  background: rgba(124, 58, 237, 0.12);
  color: var(--color-tag-auto);
}

.snapshot-item__actions {
  display: flex;
  gap: var(--spacing-xs);
  opacity: 0;
  transition: opacity 0.2s;
}

.snapshot-item:hover .snapshot-item__actions {
  opacity: 1;
}

/* === DANGER WARNING BOX === */
.danger-warning {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background: rgba(239, 68, 68, 0.06);
  border-radius: var(--border-radius);
  border-left: 4px solid var(--color-danger);
  margin-bottom: var(--spacing-md);
}

.danger-warning[hidden] {
  display: none;
}

.danger-warning__icon {
  color: var(--color-danger);
  font-size: var(--font-size-lg);
  flex-shrink: 0;
}

.danger-warning__text {
  font-size: var(--font-size-sm);
  color: var(--color-text);
  line-height: 1.5;
}

/* === PASSWORD STRENGTH === */
.password-strength {
  height: 4px;
  border-radius: var(--border-radius-sm);
  background: var(--color-border);
  margin-top: var(--spacing-xs);
  overflow: hidden;
}

.password-strength__bar {
  height: 100%;
  transition: width 0.3s ease, background 0.3s ease;
  border-radius: var(--border-radius-sm);
}

.password-strength__bar--weak { width: 25%; background: var(--color-danger); }
.password-strength__bar--fair { width: 50%; background: var(--color-warning); }
.password-strength__bar--good { width: 75%; background: var(--color-info); }
.password-strength__bar--strong { width: 100%; background: var(--color-success); }

/* === SETTINGS CARD ACTIONS === */
.settings-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--color-border);
  margin-top: var(--spacing-sm);
}

/* === SETTINGS DIVIDER === */
.settings-divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--spacing-md) 0;
}

/* === ANIMATIONS === */
@keyframes settings-fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes success-pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.btn--success-flash {
  animation: success-pulse 0.6s ease;
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .settings-layout {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }

  .settings-sidebar {
    position: static;
    overflow-x: auto;
    padding: var(--spacing-xs);
  }

  .settings-nav {
    display: flex;
    gap: var(--spacing-xs);
    white-space: nowrap;
    padding-bottom: var(--spacing-xs);
  }

  .settings-nav__item {
    flex-shrink: 0;
    padding: var(--spacing-sm) var(--spacing-md);
  }

  .settings-nav__item span:not(.settings-nav__icon) {
    display: none;
  }

  .settings-nav__icon {
    margin: 0;
  }

  .quick-actions {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* === THEME: BLEU === */
body.theme-bleu .settings-sidebar {
  background: rgba(245, 247, 250, 0.95);
  border-color: rgba(0, 0, 179, 0.15);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

body.theme-bleu .settings-nav__item:hover {
  background: rgba(0, 0, 179, 0.08);
}

body.theme-bleu .settings-nav__item--active {
  background: linear-gradient(135deg, rgba(0, 0, 179, 0.12), rgba(0, 0, 179, 0.05));
  border-color: rgba(0, 0, 179, 0.25);
  color: var(--color-primary-dark);
}

body.theme-bleu .settings-card {
  background: linear-gradient(180deg, #ffffff 0%, #F5F7FA 100%);
  border-color: rgba(0, 0, 179, 0.12);
}

body.theme-bleu .settings-card__header {
  background: linear-gradient(180deg, rgba(0, 0, 179, 0.06) 0%, rgba(0, 0, 179, 0.02) 100%);
}

body.theme-bleu .settings-card__icon-wrap {
  background: var(--gradient-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 179, 0.25);
}

body.theme-bleu .quick-action:hover {
  border-color: var(--color-primary);
}

body.theme-bleu .quick-action:hover .quick-action__icon {
  background: var(--gradient-primary);
  color: #fff;
}

body.theme-bleu .quick-action__icon {
  color: var(--color-primary);
}

body.theme-bleu .snapshot-item::before {
  border-color: var(--color-primary);
}

body.theme-bleu .snapshot-item:hover {
  border-color: var(--color-primary);
}

/* === THEME: POUDRE === */
body.theme-poudre .settings-sidebar {
  background: rgba(255, 250, 246, 0.95);
  border-color: rgba(225, 194, 194, 0.5);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

body.theme-poudre .settings-nav__item:hover {
  background: rgba(225, 194, 194, 0.25);
}

body.theme-poudre .settings-nav__item--active {
  background: linear-gradient(135deg, rgba(176, 91, 92, 0.12), rgba(176, 91, 92, 0.05));
  border-color: rgba(176, 91, 92, 0.2);
  color: var(--color-primary-dark);
}

body.theme-poudre .settings-card {
  background: linear-gradient(180deg, #fffaf6 0%, #fff8f4 100%);
  border-color: rgba(225, 194, 194, 0.5);
}

body.theme-poudre .settings-card__header {
  background: linear-gradient(180deg, rgba(252, 232, 221, 0.4) 0%, rgba(252, 232, 221, 0.15) 100%);
}

body.theme-poudre .settings-card__icon-wrap {
  background: linear-gradient(135deg, #b05b5c, #be7c7b);
  box-shadow: 0 4px 12px rgba(176, 91, 92, 0.2);
}

body.theme-poudre .quick-action:hover {
  border-color: #b05b5c;
}

body.theme-poudre .quick-action:hover .quick-action__icon {
  background: linear-gradient(135deg, #b05b5c, #be7c7b);
}

body.theme-poudre .quick-action__icon {
  color: #b05b5c;
}

body.theme-poudre .snapshot-item::before {
  border-color: #b05b5c;
}

body.theme-poudre .snapshot-item:hover {
  border-color: #b05b5c;
}

/* === THEME: DARK === */
body.theme-dark .settings-sidebar {
  background: rgba(30, 41, 59, 0.95);
  border-color: #334155;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

body.theme-dark .settings-nav__item:hover {
  background: rgba(51, 65, 85, 0.5);
}

body.theme-dark .settings-nav__item--active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(56, 189, 248, 0.05));
  border-color: rgba(56, 189, 248, 0.25);
  color: #38bdf8;
}

body.theme-dark .settings-card {
  background: linear-gradient(180deg, #1e293b 0%, #172033 100%);
  border-color: #334155;
}

body.theme-dark .settings-card__header {
  background: linear-gradient(180deg, rgba(51, 65, 85, 0.4) 0%, transparent 100%);
  border-bottom-color: #334155;
}

body.theme-dark .settings-card__icon-wrap {
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
}

body.theme-dark .quick-action {
  background: rgba(51, 65, 85, 0.4);
  border-color: #334155;
}

body.theme-dark .quick-action:hover {
  background: #1e293b;
  border-color: #38bdf8;
}

body.theme-dark .quick-action:hover .quick-action__icon {
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
}

body.theme-dark .quick-action__icon {
  background: #0f172a;
  color: #38bdf8;
}

body.theme-dark .storage-stat {
  background: rgba(51, 65, 85, 0.4);
  border-color: #334155;
}

body.theme-dark .snapshot-item {
  background: rgba(30, 41, 59, 0.8);
  border-color: #334155;
}

body.theme-dark .snapshot-item::before {
  border-color: #38bdf8;
}

body.theme-dark .snapshot-item:hover {
  border-color: #38bdf8;
  background: #1e293b;
}

body.theme-dark .danger-warning {
  background: rgba(239, 68, 68, 0.1);
}

/* ============================================================
   MODE COMPACT POUR TABLEAUX
   ============================================================ */

/* Toggle button for compact mode */
.compact-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: 0.375rem var(--spacing-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.compact-toggle:hover {
  background: var(--color-background);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.compact-toggle.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

.compact-toggle i {
  font-size: var(--font-size-sm);
}

/* Compact mode styles */
body.compact-mode .table {
  font-size: 0.8125rem;
}

body.compact-mode .table th,
body.compact-mode .table td {
  padding: 0.375rem var(--spacing-sm);
}

body.compact-mode .table th {
  font-size: var(--font-size-xs);
  font-weight: 600;
}

body.compact-mode .badge {
  font-size: 0.6875rem;
  padding: 0.125rem 0.375rem;
}

body.compact-mode .btn--sm {
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: var(--font-size-xs);
}

body.compact-mode .btn--xs {
  padding: 0.125rem 0.375rem;
  font-size: 0.6875rem;
}

body.compact-mode .card {
  padding: var(--spacing-sm);
}

body.compact-mode .card__header {
  padding: var(--spacing-sm);
  margin-bottom: var(--spacing-xs);
}

body.compact-mode .card__body {
  padding: var(--spacing-sm);
}

body.compact-mode .module__header {
  padding: var(--spacing-sm) var(--spacing-md);
}

body.compact-mode .module__title {
  font-size: var(--font-size-lg);
}

body.compact-mode .form-group {
  margin-bottom: var(--spacing-sm);
}

body.compact-mode .form-label {
  font-size: var(--font-size-xs);
  margin-bottom: var(--spacing-xs);
}

body.compact-mode .form-control {
  padding: 0.375rem var(--spacing-sm);
  font-size: 0.8125rem;
}

body.compact-mode textarea.form-control {
  min-height: 60px;
}

/* Compact mode in specific themes */
body.theme-bleu.compact-mode .compact-toggle.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

body.theme-poudre.compact-mode .compact-toggle.active {
  background: #b05b5c;
  border-color: #b05b5c;
}

body.theme-dark.compact-mode .compact-toggle.active {
  background: #38bdf8;
  border-color: #38bdf8;
}

/* Animation for compact mode toggle */
body.compact-mode .table,
body.compact-mode .card,
body.compact-mode .badge,
body.compact-mode .btn {
  transition: all 0.2s ease-out;
}

/* ============================================================
   PRINT STYLES - Consistent across themes
   ============================================================ */

@media print {
  body {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .btn, .nav, .header__actions, .global-search {
    display: none !important;
  }

  .header, #modeBanner, .mode-banner, .footer, .autosave-status, .toast-container {
    display: none !important;
  }

  .chart-card, .kpi-card, .table {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }
}

/* ============================================================
   RISK ANALYSIS MODULE (ra- prefix)
   ============================================================ */

/* --- List View --- */
.ra-empty-state {
  text-align: center;
  padding: var(--spacing-xl) var(--spacing-lg);
  color: var(--color-text-light);
}
.ra-empty-state i {
  font-size: 3rem;
  margin-bottom: var(--spacing-md);
  opacity: 0.4;
}
.ra-empty-state p {
  margin: var(--spacing-sm) 0;
}
.ra-list-table {
  width: 100%;
  border-collapse: collapse;
}
.ra-list-table th,
.ra-list-table td {
  padding: var(--spacing-sm) var(--spacing-md);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--font-size-sm);
}
.ra-list-table th {
  font-weight: 600;
  color: var(--color-text-light);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
}
.ra-list-table tr:hover {
  background: var(--color-surface-secondary);
}
.ra-list-actions {
  display: flex;
  gap: var(--spacing-xs);
}
.ra-list-actions .btn {
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: var(--font-size-xs);
}
.ra-sync-btn {
  color: var(--color-accent, #4f8cff);
}
/* Lot 1b : menu « ⋯ » des actions de ligne (analyse de risques) */
.ra-more-wrap {
  position: relative;
  display: inline-block;
}
.ra-more-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 180px;
  padding: 4px;
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius, 8px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}
.ra-more-menu[hidden] {
  display: none;
}
.ra-more-menu .btn {
  justify-content: flex-start;
  text-align: left;
  white-space: nowrap;
}
.ra-score-cell {
  white-space: nowrap;
}
.ra-score-cell .ra-light {
  vertical-align: middle;
  margin-right: 4px;
}
.ra-status-badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: var(--border-radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
  white-space: nowrap;
}
.ra-status-badge--draft {
  background: var(--color-warning-light);
  color: #7a5a00;
}
.ra-status-badge--complete {
  background: var(--color-success-light);
  color: #1a5c3a;
}

/* --- Traffic lights (small inline) --- */
.ra-light {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: var(--border-radius-full);
  vertical-align: middle;
}
.ra-light--green { background: var(--color-success); }
.ra-light--yellow { background: var(--color-warning); }
.ra-light--red { background: var(--color-danger); }
.ra-light--grey { background: var(--color-border); }

/* --- Wizard Container --- */
.ra-wizard {
  background: var(--color-surface);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--color-border);
  overflow: hidden;
}
.ra-wizard__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-secondary);
}
.ra-wizard__header h3 {
  margin: 0;
  font-size: var(--font-size-lg);
  color: var(--color-text);
}
.ra-wizard__header .btn {
  font-size: var(--font-size-sm);
}

/* --- Step Progress Bar --- */
.ra-wizard__progress {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-md) var(--spacing-lg);
  gap: 0;
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
}
.ra-step-item {
  display: flex;
  align-items: center;
  gap: 0;
  cursor: pointer;
  flex-shrink: 0;
}
.ra-step-dot {
  width: 28px;
  height: 28px;
  border-radius: var(--border-radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xs);
  font-weight: 700;
  background: var(--color-surface-secondary);
  color: var(--color-text-light);
  border: 2px solid var(--color-border);
  transition: all 0.2s ease;
}
.ra-step-dot--active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  transform: scale(1.15);
}
.ra-step-dot--completed {
  background: var(--color-success);
  color: #fff;
  border-color: var(--color-success);
}
.ra-step-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-light);
  margin-left: var(--spacing-xs);
  white-space: nowrap;
}
.ra-step-label--active {
  color: var(--color-primary);
  font-weight: 600;
}
.ra-step-connector {
  width: 24px;
  height: 2px;
  background: var(--color-border);
  margin: 0 var(--spacing-xs);
  flex-shrink: 0;
}
.ra-step-connector--completed {
  background: var(--color-success);
}

/* --- Wizard Body & Footer --- */
.ra-wizard__body {
  padding: var(--spacing-lg);
  min-height: 300px;
}
.ra-wizard__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-md) var(--spacing-lg);
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-secondary);
}

/* --- Form Groups --- */
.ra-form-group {
  margin-bottom: var(--spacing-lg);
}
.ra-form-label {
  display: block;
  font-weight: 600;
  font-size: var(--font-size-sm);
  margin-bottom: var(--spacing-xs);
  color: var(--color-text);
}
.ra-form-label .ra-required {
  color: var(--color-danger);
  margin-left: var(--spacing-xs);
}
.ra-form-hint {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  margin-top: var(--spacing-xs);
  margin-bottom: var(--spacing-xs);
}
.ra-form-group input[type="text"],
.ra-form-group input[type="number"],
.ra-form-group textarea,
.ra-form-group select {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  font-size: var(--font-size-sm);
  color: var(--color-text);
  background: var(--color-surface);
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.ra-form-group input:focus,
.ra-form-group textarea:focus,
.ra-form-group select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(31, 184, 205, 0.15);
}
.ra-form-group textarea {
  resize: vertical;
  min-height: 80px;
}
.ra-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-md);
}
.ra-checkbox-group {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
}
.ra-checkbox-group label {
  font-size: var(--font-size-sm);
  color: var(--color-text);
  cursor: pointer;
}

/* --- CIA Grid (Step 2) --- */
.ra-cia-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-lg);
}
.ra-cia-card {
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-md);
  text-align: center;
}
.ra-cia-card h4 {
  margin: 0 0 var(--spacing-sm);
  font-size: var(--font-size-md);
  color: var(--color-text);
}
.ra-cia-card i {
  font-size: var(--font-size-xl);
  margin-bottom: var(--spacing-sm);
  color: var(--color-primary);
}
.ra-cia-options {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  margin-top: var(--spacing-sm);
}
.ra-cia-option {
  padding: var(--spacing-sm) var(--spacing-md);
  border: 2px solid var(--color-border);
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: var(--font-size-sm);
  transition: all 0.2s ease;
  background: var(--color-surface);
}
.ra-cia-option:hover {
  border-color: var(--color-primary-light);
  background: var(--color-surface-secondary);
}
.ra-cia-option--selected {
  border-color: var(--color-primary);
  background: rgba(31, 184, 205, 0.08);
  font-weight: 600;
}

/* --- RTO/RPO Indicator (Step 3) --- */
.ra-rto-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-xl);
}
.ra-rto-card {
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-lg);
}
.ra-rto-card h4 {
  margin: 0 0 var(--spacing-sm);
}
.ra-rto-indicator {
  margin-top: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--border-radius);
  font-size: var(--font-size-sm);
  font-weight: 600;
  text-align: center;
}
.ra-rto-indicator--strict { background: rgba(219, 69, 69, 0.12); color: var(--color-danger); }
.ra-rto-indicator--moderate { background: rgba(255, 193, 133, 0.25); color: #b37a30; }
.ra-rto-indicator--relaxed { background: rgba(50, 192, 134, 0.12); color: var(--color-success-dark); }

/* --- Controls Questionnaire (Step 5) --- */
.ra-domain-section {
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  margin-bottom: var(--spacing-md);
  overflow: hidden;
}
.ra-domain-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-sm) var(--spacing-md);
  cursor: pointer;
  background: var(--color-surface-secondary);
  transition: background 0.2s;
  user-select: none;
}
.ra-domain-header:hover {
  background: var(--color-border);
}
.ra-domain-header__left {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-weight: 600;
  font-size: var(--font-size-sm);
}
.ra-domain-header__left i {
  width: 20px;
  text-align: center;
  color: var(--color-primary);
}
.ra-domain-progress {
  font-size: var(--font-size-xs);
  padding: 0.15rem var(--spacing-sm);
  border-radius: var(--border-radius-full);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  font-weight: 600;
}
.ra-domain-progress--complete {
  background: var(--color-success-light);
  border-color: var(--color-success);
  color: #1a5c3a;
}
.ra-domain-chevron {
  transition: transform 0.2s;
  color: var(--color-text-light);
}
.ra-domain-header--expanded .ra-domain-chevron {
  transform: rotate(180deg);
}
.ra-domain-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.25s ease;
  padding: 0 var(--spacing-md);
}
.ra-domain-body--visible {
  max-height: 5000px;
  padding: var(--spacing-md);
}
.ra-question {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-sm);
}
.ra-question__text {
  font-size: var(--font-size-sm);
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
  color: var(--color-text);
}
.ra-question__hint {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-sm);
  font-style: italic;
}
.ra-answer-group {
  display: flex;
  gap: var(--spacing-xs);
  flex-wrap: wrap;
}
.ra-answer-btn {
  padding: 0.3rem var(--spacing-md);
  border: 2px solid var(--color-border);
  border-radius: var(--border-radius);
  background: var(--color-surface);
  cursor: pointer;
  font-size: var(--font-size-xs);
  font-weight: 600;
  transition: all 0.15s ease;
  color: var(--color-text-light);
  position: relative;
  z-index: 1;
}
.ra-answer-btn:hover {
  background: var(--color-surface-secondary);
}
.ra-answer-btn--implemented { border-color: var(--color-success); color: var(--color-success-dark); }
.ra-answer-btn--implemented.ra-answer-btn--selected { background: var(--color-success); color: var(--color-surface); }
.ra-answer-btn--partial { border-color: var(--color-warning); color: var(--color-warning-dark); }
.ra-answer-btn--partial.ra-answer-btn--selected { background: var(--color-warning); color: var(--color-surface); }
.ra-answer-btn--no { border-color: var(--color-danger); color: var(--color-danger); }
.ra-answer-btn--no.ra-answer-btn--selected { background: var(--color-danger); color: var(--color-surface); }
.ra-answer-btn--na { border-color: var(--color-text-secondary); color: var(--color-text-secondary); }
.ra-answer-btn--na.ra-answer-btn--selected { background: var(--color-text-secondary); color: var(--color-surface); }
.ra-answer-btn--planned { border-color: var(--color-info); color: var(--color-info-dark); }
.ra-answer-btn--planned.ra-answer-btn--selected { background: var(--color-info); color: var(--color-surface); }
.ra-answer-btn--toVerify { border-color: var(--color-tag-auto); color: var(--color-tag-auto); }
.ra-answer-btn--toVerify.ra-answer-btn--selected { background: var(--color-tag-auto); color: var(--color-surface); }
.ra-planned-banner {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid var(--color-info, #3b82f6);
  border-radius: var(--border-radius);
  padding: var(--spacing-md) var(--spacing-md);
  margin: var(--spacing-md) 0;
  color: #1d4ed8;
  font-size: var(--font-size-sm);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}
.ra-planned-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
  font-size: var(--font-size-xs);
  padding: 0.1rem 0.4rem;
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  white-space: nowrap;
}
/* Controls table in preview */
.ra-preview-controls-domain { margin-bottom: var(--spacing-md); }
.ra-preview-controls-domain h5 {
  margin: var(--spacing-md) 0 var(--spacing-sm);
  font-size: var(--font-size-sm);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}
.ra-controls-table { width: 100%; border-collapse: collapse; font-size: var(--font-size-sm); }
.ra-controls-table th { text-align: left; padding: var(--spacing-sm) var(--spacing-md); background: var(--color-bg-secondary, #f1f5f9); border-bottom: 2px solid var(--color-border, #e2e8f0); font-weight: 600; font-size: var(--font-size-sm); }
.ra-controls-table td { padding: var(--spacing-sm) var(--spacing-md); border-bottom: 1px solid var(--color-border, #e2e8f0); vertical-align: top; }
.ra-controls-table tr:nth-child(even) td { background: var(--color-bg-secondary, #f8fafc); }
.ra-ctrl-comment { font-size: var(--font-size-sm); color: var(--color-text-secondary); }
/* Status badges — controls table context */
.ra-controls-table .ra-status-badge {
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-xs);
}
.ra-status-badge--implemented { background: rgba(50,192,134,0.12); color: var(--color-success-dark); }
.ra-status-badge--partial { background: rgba(255,193,133,0.12); color: var(--color-warning-dark); }
.ra-status-badge--planned { background: rgba(31,184,205,0.12); color: var(--color-primary-dark); }
.ra-status-badge--no { background: rgba(219,69,69,0.12); color: var(--color-danger-dark); }
.ra-status-badge--na { background: rgba(93,135,143,0.12); color: var(--color-secondary-dark); }
.ra-status-badge--toVerify { background: rgba(124,58,237,0.12); color: var(--color-tag-auto); }
/* Improved planned controls warning box */
.ra-planned-warning-box {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-md);
  background: rgba(249, 115, 22, 0.08);
  border: 2px solid var(--color-warning, #f97316);
  border-radius: var(--border-radius);
  padding: var(--spacing-md) 1.25rem;
  margin: var(--spacing-md) 0 var(--spacing-md);
}
.ra-planned-warning-icon {
  color: var(--color-warning, #f97316);
  font-size: 1.3rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.ra-planned-warning-text {
  color: #92400e;
  font-size: var(--font-size-sm);
  line-height: 1.5;
  font-weight: 500;
}
/* Highlighted section for priority mitigation measures */
.ra-preview-section--highlight {
  border-left: 4px solid var(--color-primary, #3b82f6);
  background: rgba(59, 130, 246, 0.04);
  padding: var(--spacing-md) 1.25rem;
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
}
.ra-preview-section--highlight h4 {
  color: var(--color-primary, #3b82f6);
  font-size: var(--font-size-lg);
}
.ra-finalrec-card--highlight {
  border-left: 3px solid var(--color-primary, #3b82f6);
  padding-left: var(--spacing-md);
}
/* Badge auto-sync dans project risks */
.pr-auto-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
  font-size: var(--font-size-xs);
  padding: 0.1rem 0.4rem;
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  margin-left: 0.4rem;
  white-space: nowrap;
}
.pr-auto-badge--link {
  cursor: pointer;
  text-decoration: none;
}
.pr-auto-badge--link:hover {
  background: rgba(59, 130, 246, 0.2);
}
/* Banner auto-sync dans modal project risk */
.pr-auto-sync-banner {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid var(--color-info, #3b82f6);
  border-radius: var(--border-radius);
  padding: var(--spacing-sm) var(--spacing-md);
  margin-bottom: var(--spacing-md);
  color: #1d4ed8;
  font-size: var(--font-size-sm);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.ra-question__comment {
  margin-top: var(--spacing-sm);
}
.ra-question__comment textarea {
  width: 100%;
  padding: var(--spacing-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-xs);
  resize: vertical;
  min-height: 40px;
  background: var(--color-surface);
  color: var(--color-text);
  box-sizing: border-box;
}

/* --- Risk Cards (Step 6) --- */
.ra-risk-catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}
.ra-risk-card {
  border: 2px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-md);
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--color-surface);
}
.ra-risk-card:hover {
  border-color: var(--color-primary-light);
  box-shadow: var(--shadow-sm);
}
.ra-risk-card--selected {
  border-color: var(--color-primary);
  background: rgba(31, 184, 205, 0.05);
}
.ra-risk-card__title {
  font-weight: 700;
  font-size: var(--font-size-sm);
  margin-bottom: var(--spacing-xs);
}
.ra-risk-card__scenario {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
}
.ra-risk-tuner {
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-sm);
  background: var(--color-surface);
}
.ra-risk-tuner__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-sm);
}
.ra-risk-tuner__header h4 {
  margin: 0;
  font-size: var(--font-size-sm);
}
.ra-custom-risk-title {
  flex: 1;
  min-width: 120px;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: var(--font-size-sm);
  font-weight: 600;
  background: var(--color-surface);
  color: var(--color-text);
}
.ra-custom-risk-title:focus {
  outline: 2px solid var(--color-primary);
  border-color: var(--color-primary);
}
.ra-custom-risk-delete {
  background: none;
  border: none;
  color: var(--color-danger, #dc3545);
  cursor: pointer;
  padding: var(--spacing-xs);
  font-size: var(--font-size-sm);
  opacity: 0.6;
  transition: opacity 0.15s;
  flex-shrink: 0;
}
.ra-custom-risk-delete:hover { opacity: 1; }
.ra-custom-risk-delete:disabled { opacity: 0.3; cursor: not-allowed; }
.ra-preview-info {
  background: var(--color-info-bg, rgba(59,130,246,0.08));
  border-left: 3px solid var(--color-primary);
  padding: var(--spacing-sm) var(--spacing-md);
  margin-bottom: var(--spacing-lg);
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
  border-radius: var(--border-radius-sm);
}
.ra-preview-info i { margin-right: var(--spacing-xs); color: var(--color-primary); }
.ra-subsection-title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-light);
  margin-top: var(--spacing-md);
  margin-bottom: var(--spacing-xs);
  padding-bottom: var(--spacing-xs);
  border-bottom: 1px solid var(--color-border);
}
.ra-inline-score {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-weight: 700;
  font-size: var(--font-size-sm);
}
.ra-risk-tuner__controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-md);
}
.ra-risk-tuner__controls select {
  width: 100%;
  padding: var(--spacing-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-sm);
  background: var(--color-surface);
  color: var(--color-text);
}
.ra-risk-tuner__row {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  flex-wrap: wrap;
  margin-top: var(--spacing-sm);
}

/* --- Results Dashboard (Step 7) --- */
.ra-results__summary {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
  padding: var(--spacing-lg);
  background: var(--color-surface-secondary);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--color-border);
}
.ra-global-light {
  width: 80px;
  height: 80px;
  border-radius: var(--border-radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xxl);
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.ra-global-light--green { background: var(--color-success); }
.ra-global-light--yellow { background: var(--color-warning); color: #7a5a00; }
.ra-global-light--red { background: var(--color-danger); }
.ra-summary-details h3 {
  margin: 0 0 var(--spacing-xs);
  font-size: var(--font-size-lg);
}
.ra-summary-details p {
  margin: var(--spacing-xs) 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}
.ra-key-points {
  list-style: none;
  padding: 0;
  margin: var(--spacing-md) 0 0;
}
.ra-key-points li {
  padding: var(--spacing-xs) 0;
  font-size: var(--font-size-sm);
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-sm);
}
.ra-key-points li i {
  margin-top: var(--spacing-xs);
  flex-shrink: 0;
}

/* --- Domain Table --- */
.ra-domain-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--spacing-lg);
}
.ra-domain-table th,
.ra-domain-table td {
  padding: var(--spacing-sm) var(--spacing-md);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--font-size-sm);
}
.ra-domain-table th {
  font-weight: 600;
  color: var(--color-text-light);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
}
.ra-maturity-bar {
  height: 6px;
  border-radius: var(--border-radius-sm);
  background: var(--color-border);
  overflow: hidden;
  width: 100%;
  max-width: 120px;
}
.ra-maturity-bar__fill {
  height: 100%;
  border-radius: var(--border-radius-sm);
  transition: width 0.3s ease;
}
.ra-maturity-bar__fill--green { background: var(--color-success); }
.ra-maturity-bar__fill--yellow { background: var(--color-warning); }
.ra-maturity-bar__fill--red { background: var(--color-danger); }

/* --- Risk Register --- */
.ra-risk-register {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--spacing-lg);
  table-layout: fixed;
}
.ra-risk-register th,
.ra-risk-register td {
  padding: var(--spacing-sm);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--font-size-xs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ra-risk-register td:first-child {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  word-break: break-word;
}
.ra-risk-register th {
  font-weight: 600;
  color: var(--color-text-light);
  text-transform: uppercase;
  font-size: var(--font-size-xs);
}
.ra-traffic-cell {
  text-align: center;
}

/* --- Recommendations Table --- */
.ra-rec-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--spacing-lg);
}
.ra-rec-table th,
.ra-rec-table td {
  padding: var(--spacing-sm) var(--spacing-md);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--font-size-sm);
}
.ra-rec-table th {
  font-weight: 600;
  color: var(--color-text-light);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
}
.ra-rec-row {
  cursor: pointer;
  transition: background 0.15s;
}
.ra-rec-row:hover {
  background: var(--color-surface-secondary);
}
.ra-rec-detail {
  display: table-row;
}
.ra-rec-detail td {
  padding: 0;
  background: var(--color-surface-secondary);
  font-size: var(--font-size-xs);
}
.ra-rec-detail ul {
  margin: var(--spacing-xs) 0;
  padding-left: var(--spacing-lg);
}
.ra-rec-detail li {
  margin-bottom: var(--spacing-xs);
}
.ra-priority-badge {
  display: inline-block;
  padding: 0.15rem var(--spacing-sm);
  border-radius: var(--border-radius-full);
  font-size: var(--font-size-xs);
  font-weight: 700;
}
.ra-priority-badge--P1 { background: rgba(219, 69, 69, 0.15); color: var(--color-danger); }
.ra-priority-badge--P2 { background: rgba(255, 193, 133, 0.3); color: #b37a30; }
.ra-priority-badge--P3 { background: rgba(50, 192, 134, 0.15); color: var(--color-success-dark); }

/* --- Radar Chart --- */
.ra-radar-wrapper {
  max-width: 450px;
  margin: 0 auto var(--spacing-lg);
}

/* --- Section Titles --- */
.ra-section-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  margin: var(--spacing-xl) 0 var(--spacing-md);
  padding-bottom: var(--spacing-sm);
  border-bottom: 2px solid var(--color-primary);
  color: var(--color-text);
}
.ra-section-title i {
  margin-right: var(--spacing-sm);
  color: var(--color-primary);
}

/* --- Step 8 Export (redesign: 2 cards) --- */
.ra-export-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-lg);
}
@media (max-width: 768px) {
  .ra-export-grid { grid-template-columns: 1fr; }
}
.ra-export-card {
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: var(--spacing-lg);
  background: var(--color-surface);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}
.ra-export-card__icon {
  font-size: var(--font-size-xxl);
  color: var(--color-primary);
}
.ra-export-card h4 {
  margin: 0;
  font-size: var(--font-size-lg);
}
.ra-export-card p {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
  line-height: 1.4;
}
.ra-export-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-xs) calc(var(--spacing-sm) + var(--spacing-xs));
  font-size: var(--font-size-sm);
}
.ra-export-sections label {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  cursor: default;
}
.ra-export-card .btn {
  margin-top: auto;
  align-self: flex-start;
}

/* --- RGPD Block (Step 1 CIA) --- */
.ra-section-divider {
  margin: var(--spacing-lg) 0;
  border: none;
  border-top: 1px solid var(--color-border);
}
.ra-gdpr-block {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  margin-top: var(--spacing-md);
  padding: var(--spacing-md);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  background: var(--color-surface-secondary);
}
.ra-gdpr-item {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}
.ra-gdpr-item label {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}
.ra-gdpr-item select {
  max-width: 200px;
}
.ra-gdpr-explain {
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
  font-style: italic;
  margin-left: var(--spacing-lg);
  line-height: 1.4;
}

/* --- Methodology Preview --- */
.ra-preview-methodology {
  margin-bottom: var(--spacing-lg);
}
.ra-methodology-steps {
  padding-left: var(--spacing-lg);
  line-height: 1.8;
}
.ra-methodology-steps li {
  margin-bottom: var(--spacing-xs);
}
.ra-methodology-scale {
  display: flex;
  gap: var(--spacing-xs);
  margin: var(--spacing-sm) 0;
}
.ra-methodology-scale-item {
  flex: 1;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--border-radius-sm);
  text-align: center;
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: white;
}
.ra-methodology-pdca {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-xs);
  max-width: 400px;
  margin: calc(var(--spacing-sm) + var(--spacing-xs)) auto;
}
.ra-pdca-quadrant {
  padding: calc(var(--spacing-sm) + var(--spacing-xs));
  text-align: center;
  font-size: var(--font-size-sm);
  font-weight: 600;
  border-radius: var(--border-radius-sm);
  color: white;
}
.ra-pdca-quadrant strong {
  display: block;
  font-size: var(--font-size-sm);
  margin-bottom: var(--spacing-xs);
}

/* --- Review Date Section (Step 6) --- */
.ra-review-date-section {
  margin-top: var(--spacing-lg);
  padding: var(--spacing-md);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
}
.ra-review-date-section h4 {
  margin: 0 0 var(--spacing-sm) 0;
}
.ra-review-overdue {
  color: var(--color-danger);
  font-weight: 600;
  font-size: var(--font-size-sm);
}
.ra-review-upcoming {
  color: var(--color-warning);
  font-weight: 600;
  font-size: var(--font-size-sm);
}

/* --- Analyse de sécurité Panel --- */
.ra-spot-panel {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}
.ra-spot-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
}
.ra-traffic-light-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-xs);
  background: #1a1a1a;
  border-radius: var(--border-radius);
  padding: var(--spacing-sm) var(--spacing-xs);
  flex-shrink: 0;
}
.ra-tl-circle {
  width: 20px;
  height: 20px;
  border-radius: var(--border-radius-full);
  background: #444;
  transition: background 0.2s;
}
.ra-tl-circle--red.ra-tl-circle--active { background: var(--color-danger); }
.ra-tl-circle--yellow.ra-tl-circle--active { background: var(--color-warning); }
.ra-tl-circle--green.ra-tl-circle--active { background: var(--color-success); }
.ra-spot-avis {
  font-weight: 700;
  font-size: var(--font-size-lg);
}
.ra-spot-avis--green { color: var(--color-success); }
.ra-spot-avis--yellow { color: #b37a30; }
.ra-spot-avis--red { color: var(--color-danger); }
.ra-spot-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--spacing-md);
}
.ra-spot-table td {
  padding: var(--spacing-sm) calc(var(--spacing-sm) + var(--spacing-xs));
  border-bottom: 1px solid var(--color-border);
  font-size: var(--font-size-sm);
}
.ra-spot-table td:first-child {
  font-weight: 600;
  width: 55%;
}
.ra-spot-value { font-weight: 700; text-align: center; }
.ra-spot-score--green { color: var(--color-success); }
.ra-spot-score--yellow { color: #b37a30; }
.ra-spot-score--red { color: var(--color-danger); }
/* Tous les contrôles marqués « non applicable » : hors périmètre, ni bon ni mauvais —
   surtout pas le rouge d'un « 0 % » qui contredirait les lignes N/A du même tableau. */
.ra-spot-score--grey { color: var(--color-text-secondary, #888); }
.ra-spot-fields {
  display: grid;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
}
.ra-spot-fields label {
  display: block;
  font-weight: 600;
  font-size: var(--font-size-xs);
  margin-bottom: var(--spacing-xs);
  color: var(--color-text-secondary);
}
.ra-spot-fields select,
.ra-spot-fields textarea {
  width: 100%;
  padding: var(--spacing-xs) var(--spacing-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  background: var(--color-bg);
  color: var(--color-text);
  font-family: inherit;
  font-size: var(--font-size-sm);
}
.ra-spot-fields textarea {
  min-height: 50px;
  resize: vertical;
}

/* --- Final Recommendations Cards --- */
.ra-finalrecs-section {
  margin-bottom: var(--spacing-lg);
}
.ra-finalrecs-counter {
  font-weight: 400;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}
.ra-finalrec-card {
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-sm);
  background: var(--color-bg-secondary);
}
.ra-finalrec-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-sm);
}
.ra-finalrec-card__actions {
  display: flex;
  gap: var(--spacing-xs);
  align-items: center;
}
.ra-finalrec-card input[type="text"],
.ra-finalrec-card textarea {
  width: 100%;
  padding: var(--spacing-sm) calc(var(--spacing-sm) + var(--spacing-xs));
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  background: var(--color-bg);
  color: var(--color-text);
  font-family: inherit;
  font-size: var(--font-size-sm);
  margin-bottom: var(--spacing-xs);
}
.ra-finalrec-card textarea {
  min-height: 50px;
  resize: vertical;
}
/* === RA-PROJ (Groupe D) === liaison recommandations↔risques : chips + select natif */
.ra-fr-links {
  margin-bottom: var(--spacing-xs);
}
.ra-fr-links .ra-form-label {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-xs);
}
.ra-fr-links__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-xs);
  margin-bottom: var(--spacing-xs);
}
.ra-fr-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-bg);
  font-size: var(--font-size-xs);
  color: var(--color-text);
}
.ra-fr-chip--na {
  opacity: 0.55;
}
.ra-fr-chip__na {
  font-style: italic;
  color: var(--color-text-secondary);
}
.ra-fr-chip__target {
  color: var(--color-text-secondary);
  white-space: nowrap;
}
.ra-fr-chip__remove {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--color-text-secondary);
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}
.ra-fr-chip__remove:hover {
  color: var(--color-danger);
}
.ra-fr-chip__remove[disabled] {
  cursor: default;
  opacity: 0.4;
}
.ra-fr-links__select {
  font-size: var(--font-size-xs);
  padding: 4px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  background: var(--color-bg);
  color: var(--color-text);
  max-width: 100%;
}
.ra-fr-legacy-label {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  margin-bottom: 2px;
}
/* === RA-PROJ === tableau de projection + paire de matrices */
.ra-proj-section {
  margin: var(--spacing-lg) 0;
}
.ra-proj-table-wrap {
  overflow-x: auto;
}
/* FIX-AUDIT-UX : .ra-risk-register (réutilisée) impose table-layout:fixed + width:100%
   sans largeurs de colonnes → 8 colonnes égales clippées, et le wrapper ne débordait
   jamais donc overflow-x était inerte. Colonnes au contenu + largeur plancher. */
.ra-proj-table {
  table-layout: auto;
  min-width: 900px;
}
.ra-proj-table td,
.ra-proj-table th {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}
.ra-proj-table select {
  padding: 2px 6px;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: var(--font-size-xs);
}
.ra-proj-table input[type="text"] {
  width: 100%;
  min-width: 120px;
  padding: 2px 6px;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: var(--font-size-xs);
}
.ra-proj-row--orphan {
  opacity: 0.75;
}
.ra-proj-orphan-flag {
  color: var(--color-warning-dark, #b8860b);
  font-size: var(--font-size-xs);
  white-space: nowrap;
}
.ra-proj-hint--amber {
  color: var(--color-warning-dark, #b8860b);
}
.ra-proj-close {
  font-size: var(--font-size-xs);
  white-space: nowrap;
}
.ra-proj-close--ok {
  color: var(--color-success, #2e7d32);
}
.ra-proj-close--gap {
  color: var(--color-warning-dark, #b8860b);
}
.ra-proj-matrices-section {
  margin: var(--spacing-md) 0 var(--spacing-lg);
}
.ra-proj-matrices {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-lg);
  align-items: flex-start;
}
.ra-proj-matrices__col h5 {
  margin: 0 0 var(--spacing-xs);
  font-size: var(--font-size-sm);
  color: var(--color-text);
}
/* Compteurs projetés : bordure POINTILLÉE = marqueur de l'hypothétique.
   FIX-AUDIT-CSS : classe de base CHAÎNÉE — la règle .ra-tg-risk-count est déclarée
   plus bas dans le fichier, à spécificité égale elle écrasait ces modificateurs. */
.ra-tg-risk-count.ra-tg-risk-count--proj {
  border: 1.5px dashed var(--color-text);
  background: var(--color-background);
}
/* Risques non couverts : marqueur distinct (grisé) — pas la même sémantique */
.ra-tg-risk-count.ra-tg-risk-count--uncov {
  border: 1.5px solid var(--color-border);
  background: var(--color-background);
  color: var(--color-text-secondary);
  opacity: 0.8;
}
.ra-proj-legend {
  margin-top: var(--spacing-sm);
}
.ra-proj-legend__markers {
  white-space: nowrap;
}
.ra-proj-legend__dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: static;
  width: 16px;
  height: 16px;
  font-size: 10px;
  vertical-align: middle;
}
.ra-proj-banner {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--border-radius);
  font-size: var(--font-size-sm);
  margin-top: var(--spacing-sm);
}
.ra-proj-banner--covered {
  background: color-mix(in srgb, var(--color-danger) 12%, transparent);
  color: var(--color-danger-dark, #bb3030);
  border: 1px solid var(--color-danger-light, #e26969);
}
.ra-proj-banner--uncovered {
  background: color-mix(in srgb, var(--color-warning) 12%, transparent);
  color: var(--color-warning-dark, #b8860b);
  border: 1px solid var(--color-warning-dark, #b8860b);
}
.ra-proj-moves {
  margin-top: var(--spacing-md);
}
.ra-proj-moves h5 {
  margin: 0 0 var(--spacing-xs);
  font-size: var(--font-size-sm);
}
.ra-proj-moves ul {
  margin: 0;
  padding-left: 1.2em;
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
}
.ra-proj-moves li {
  margin-bottom: 2px;
}

/* --- Preview step --- */
.ra-preview {
  max-width: 800px;
  margin: 0 auto;
}
.ra-preview-section {
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-lg);
  border-bottom: 1px solid var(--color-border);
}
.ra-preview-cover {
  text-align: center;
  padding: var(--spacing-xl) 0;
}
.ra-preview-cover h2 {
  font-size: var(--font-size-xl);
  margin-bottom: var(--spacing-xs);
}
.ra-preview-cover h3 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--spacing-sm);
  color: var(--color-text-secondary);
}
.ra-preview-cover p {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}
.ra-preview-kv {
  margin-bottom: var(--spacing-xs);
  font-size: var(--font-size-sm);
}
.ra-preview-kv strong {
  display: inline-block;
  min-width: 140px;
}
.ra-preview table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--spacing-md);
  font-size: var(--font-size-sm);
}
.ra-preview table th,
.ra-preview table td {
  padding: var(--spacing-xs) 10px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
}
.ra-preview table th {
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}
.ra-preview-disclaimer {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  font-style: italic;
  padding: var(--spacing-md);
  background: var(--color-bg-secondary);
  border-radius: var(--border-radius);
}

/* --- Preview: CIA Visual Bars --- */
.ra-preview-cia-bars {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  margin: var(--spacing-md) 0;
}
.ra-preview-cia-row {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}
.ra-preview-cia-label {
  min-width: 130px;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text);
}
.ra-preview-cia-label i {
  margin-right: var(--spacing-xs);
  color: var(--color-primary);
}
.ra-preview-cia-track {
  display: flex;
  gap: var(--spacing-xs);
  flex: 1;
  max-width: 200px;
}
.ra-preview-cia-seg {
  height: 20px;
  flex: 1;
  border-radius: var(--border-radius-sm);
  background: var(--color-surface-secondary, #f0f0f0);
  border: 1px solid var(--color-border);
}
.ra-preview-cia-seg--filled.ra-preview-cia-seg--green {
  background: var(--color-success);
  border-color: var(--color-success);
}
.ra-preview-cia-seg--filled.ra-preview-cia-seg--yellow {
  background: var(--color-warning);
  border-color: var(--color-warning);
}
.ra-preview-cia-seg--filled.ra-preview-cia-seg--red {
  background: var(--color-danger);
  border-color: var(--color-danger);
}
.ra-preview-cia-value {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  min-width: 100px;
}

/* --- Preview: RTO/RPO Gauge --- */
.ra-preview-rto-section {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  margin: var(--spacing-md) 0;
}
.ra-preview-rto-gauge {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}
.ra-preview-rto-label {
  min-width: 90px;
  font-size: var(--font-size-sm);
}
.ra-preview-rto-track {
  position: relative;
  display: flex;
  height: 14px;
  flex: 1;
  max-width: 300px;
  border-radius: var(--border-radius);
  overflow: hidden;
}
.ra-preview-rto-zone { height: 100%; }
.ra-preview-rto-zone--strict { background: var(--color-danger); }
.ra-preview-rto-zone--moderate { background: var(--color-warning); }
.ra-preview-rto-zone--standard { background: #f9c350; }
.ra-preview-rto-zone--relaxed { background: var(--color-success); }
.ra-preview-rto-marker {
  position: absolute;
  top: -3px;
  width: 3px;
  height: 20px;
  background: var(--color-text);
  border-radius: var(--border-radius-sm);
  transform: translateX(-50%);
  box-shadow: 0 0 3px rgba(0,0,0,0.3);
}
.ra-preview-rto-indicator {
  font-size: var(--font-size-xs);
  font-weight: 600;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--border-radius);
}

/* --- Preview: Treatment Distribution --- */
.ra-preview-treatment-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-md);
  margin-top: var(--spacing-sm);
}
.ra-preview-treatment-card {
  text-align: center;
  padding: var(--spacing-md);
  background: var(--color-surface-secondary, #f8fafc);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--color-border);
}
.ra-preview-treatment-count {
  font-size: var(--font-size-xl);
  font-weight: 700;
}
.ra-preview-treatment-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  margin-top: var(--spacing-xs);
}
.ra-preview-treatment-label i { margin-right: var(--spacing-xs); }

/* --- Preview: Level dot for 5-level risk --- */
.ra-preview table .ra-level-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: var(--border-radius-full);
  vertical-align: middle;
}
.ra-preview table .ra-level-dot + small {
  margin-left: var(--spacing-xs);
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
}

/* --- Responsive for preview enrichments --- */
@media (max-width: 768px) {
  .ra-preview-cia-row { flex-wrap: wrap; }
  .ra-preview-cia-track { max-width: 100%; }
  .ra-preview-treatment-grid { grid-template-columns: repeat(2, 1fr); }
  .ra-preview-rto-gauge { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .ra-preview-treatment-grid { grid-template-columns: 1fr 1fr; }
}

/* --- Threshold Management Panel --- */
.ra-list-toolbar {
  display: flex;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
}
.ra-list-toolbar .btn--active {
  background: var(--color-primary);
  color: #fff;
}
.ra-threshold-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}
.ra-threshold-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-md);
}
.ra-threshold-panel__header .ra-section-title {
  margin: 0;
}
.ra-threshold-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-lg);
}
.ra-threshold-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  background: var(--color-surface-secondary);
  cursor: pointer;
  min-width: 200px;
  transition: border-color 0.15s;
}
.ra-threshold-card--selected {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb, 99,102,241), 0.15);
}
.ra-threshold-card__info { flex: 1; }
.ra-threshold-card__actions { display: flex; gap: var(--spacing-xs); }
.ra-threshold-badge-active {
  display: inline-block;
  font-size: var(--font-size-xs);
  color: var(--color-success);
  font-weight: 600;
  margin-left: var(--spacing-xs);
}
.ra-threshold-editor {
  margin-top: var(--spacing-md);
}
.ra-threshold-levels-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-xs);
}
.ra-threshold-level-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}
.ra-color-input {
  width: 28px;
  height: 28px;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  padding: 1px;
  cursor: pointer;
  background: none;
}
.ra-level-input {
  width: 100px;
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: var(--font-size-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  background: var(--color-surface);
  color: var(--color-text);
}

/* --- 5×5 Threshold Grid --- */
.ra-threshold-grid {
  display: grid;
  grid-template-columns: 80px repeat(5, 1fr);
  gap: var(--spacing-xs);
  margin: var(--spacing-md) 0;
  max-width: 520px;
}
.ra-threshold-grid--results {
  max-width: 480px;
}
.ra-tg-corner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  padding: var(--spacing-xs);
  position: relative;
}
.ra-tg-axis-label {
  display: block;
  font-weight: 600;
  white-space: nowrap;
}
.ra-tg-axis-g { margin-bottom: var(--spacing-xs); }
.ra-tg-axis-p { font-size: 9px; }
.ra-tg-header {
  text-align: center;
  font-size: var(--font-size-xs);
  font-weight: 600;
  padding: var(--spacing-xs) var(--spacing-xs);
  color: var(--color-text);
  background: var(--color-surface-secondary);
  border-radius: var(--border-radius-sm);
}
.ra-tg-header small,
.ra-tg-rowlabel small {
  font-weight: 400;
  opacity: 0.7;
  font-size: 9px;
}
.ra-tg-rowlabel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: var(--font-size-xs);
  font-weight: 600;
  padding: var(--spacing-xs) var(--spacing-xs);
  color: var(--color-text);
  background: var(--color-surface-secondary);
  border-radius: var(--border-radius-sm);
}
.ra-tg-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  position: relative;
}
.ra-tg-cell:hover {
  opacity: 0.85;
  transform: scale(1.04);
}
.ra-threshold-grid--results .ra-tg-cell {
  cursor: default;
}
.ra-threshold-grid--results .ra-tg-cell:hover {
  transform: none;
}
.ra-tg-score {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: rgba(0,0,0,0.5);
}
.ra-tg-cell--has-risk {
  box-shadow: inset 0 0 0 2px rgba(0,0,0,0.3);
}
.ra-tg-risk-count {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--border-radius-full);
  background: rgba(255,255,255,0.9);
  color: #333;
  font-weight: 700;
  font-size: var(--font-size-sm);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* --- Threshold Legend --- */
.ra-threshold-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm) var(--spacing-md);
  margin-top: var(--spacing-sm);
}
.ra-threshold-legend--results {
  margin-top: var(--spacing-md);
}
.ra-threshold-legend-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}
.ra-threshold-legend-dot {
  width: 14px;
  height: 14px;
  border-radius: var(--border-radius-sm);
  flex-shrink: 0;
}

/* --- Risk Level Dot (5-color) --- */
.ra-level-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: var(--border-radius-full);
  vertical-align: middle;
}
.ra-light--orange { background: #f97316; }

/* --- Results Matrix Wrapper --- */
.ra-results-matrix {
  margin: var(--spacing-lg) 0;
  padding: var(--spacing-md);
  background: var(--color-surface-secondary);
  border-radius: var(--border-radius-lg);
}
.ra-threshold-matrix-section {
  margin-top: var(--spacing-md);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .ra-cia-grid {
    grid-template-columns: 1fr;
  }
  .ra-rto-grid {
    grid-template-columns: 1fr;
  }
  .ra-form-row {
    grid-template-columns: 1fr;
  }
  .ra-results__summary {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .ra-global-light {
    margin: 0 auto;
  }
  .ra-risk-catalog {
    grid-template-columns: 1fr;
  }
  .ra-wizard__progress {
    padding: var(--spacing-sm);
  }
  .ra-step-label {
    display: none;
  }
  .ra-risk-tuner__controls {
    grid-template-columns: 1fr;
  }
  .ra-threshold-grid {
    grid-template-columns: 50px repeat(5, 1fr);
    max-width: 100%;
  }
  .ra-tg-cell { min-height: 38px; }
  .ra-threshold-list { flex-direction: column; }
  .ra-threshold-card { min-width: unset; }
  .ra-threshold-levels-list { flex-direction: column; }
}
@media (max-width: 480px) {
  .ra-wizard__body {
    padding: var(--spacing-md);
  }
  .ra-answer-group {
    flex-direction: column;
  }
  .ra-answer-btn {
    width: 100%;
    text-align: center;
  }
}

/* ============================================================
   Impact Picker Modal — Risk Analysis integration
   ============================================================ */
.ra-impact-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-md, 1rem);
}
.ra-impact-modal {
  background: var(--color-surface, #fff);
  border-radius: var(--border-radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.ra-impact-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md, 1rem) var(--spacing-lg, 1.5rem);
  border-bottom: 1px solid var(--color-border, #e5e7eb);
}
.ra-impact-modal__header h3 {
  font-size: var(--font-size-lg, 1.125rem);
  font-weight: 600;
  color: var(--color-text, #111827);
  margin: 0;
}
.ra-impact-modal__close {
  background: none;
  border: none;
  font-size: var(--font-size-xl);
  cursor: pointer;
  color: var(--color-text-light, #9ca3af);
  padding: var(--spacing-xs) var(--spacing-sm);
  line-height: 1;
}
.ra-impact-modal__close:hover {
  color: var(--color-text, #111827);
}
.ra-impact-modal__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--spacing-lg, 1.5rem);
}
.ra-impact-modal__hint {
  font-size: var(--font-size-sm, 0.875rem);
  color: var(--color-text-light, #9ca3af);
  margin-bottom: var(--spacing-md, 1rem);
  line-height: 1.5;
}
.ra-impact-dim-row {
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--border-radius-sm);
  padding: var(--spacing-sm, 0.5rem) var(--spacing-md, 1rem);
  margin-bottom: var(--spacing-sm, 0.5rem);
}
.ra-impact-dim-label {
  font-size: var(--font-size-sm, 0.875rem);
  font-weight: 600;
  color: var(--color-text, #111827);
  margin-bottom: var(--spacing-xs);
}
.ra-impact-dim-levels {
  display: flex;
  gap: var(--spacing-xs);
  flex-wrap: wrap;
  margin-bottom: var(--spacing-xs);
}
.ra-impact-level-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--border-radius-full);
  border: 2px solid var(--color-border, #e5e7eb);
  background: var(--color-surface, #fff);
  color: var(--color-text, #111827);
  font-weight: 700;
  font-size: var(--font-size-sm, 0.875rem);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ra-impact-level-btn:hover {
  transform: scale(1.1);
}
.ra-impact-level-btn[data-level="1"] { border-color: #86efac; }
.ra-impact-level-btn[data-level="2"] { border-color: #fde68a; }
.ra-impact-level-btn[data-level="3"] { border-color: #fed7aa; }
.ra-impact-level-btn[data-level="4"] { border-color: #fca5a5; }
.ra-impact-level-btn[data-level="5"] { border-color: #f87171; }
.ra-impact-level-btn--selected[data-level="1"] { background: #86efac; color: #14532d; border-color: #22c55e; }
.ra-impact-level-btn--selected[data-level="2"] { background: #fde68a; color: #713f12; border-color: #eab308; }
.ra-impact-level-btn--selected[data-level="3"] { background: #fed7aa; color: #7c2d12; border-color: #f97316; }
.ra-impact-level-btn--selected[data-level="4"] { background: #fca5a5; color: #7f1d1d; border-color: #ef4444; }
.ra-impact-level-btn--selected[data-level="5"] { background: #f87171; color: #fff; border-color: #dc2626; }
.ra-impact-dim-desc {
  font-size: var(--font-size-xs, 0.75rem);
  color: var(--color-text-secondary, #6b7280);
  line-height: 1.4;
  min-height: 18px;
  font-style: italic;
}
.ra-impact-modal__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md, 1rem) var(--spacing-lg, 1.5rem);
  border-top: 1px solid var(--color-border, #e5e7eb);
  gap: var(--spacing-sm, 0.5rem);
}
.ra-impact-computed {
  font-size: var(--font-size-md, 1rem);
  font-weight: 600;
  color: var(--color-text, #111827);
}
.ra-impact-computed strong {
  font-size: var(--font-size-lg);
  color: var(--color-primary, #3b82f6);
}
.ra-impact-modal__footer .btn {
  min-width: 100px;
}
.ra-matrix-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: var(--font-size-xs, 0.75rem);
  color: var(--color-primary, #3b82f6);
  background: rgba(59, 130, 246, 0.08);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--border-radius-full);
  margin-left: var(--spacing-xs);
  vertical-align: middle;
}
.ra-matrix-badge i { font-size: var(--font-size-xs); }
@media (max-width: 640px) {
  .ra-impact-modal { max-width: 100%; }
  .ra-impact-level-btn { width: 32px; height: 32px; font-size: var(--font-size-xs); }
}

/* ============================================================
   UX IMPROVEMENTS — Hover, Animations, Tabs, TOC, Chips, Confirm
   ============================================================ */

/* --- Phase A: Table row hover feedback --- */
.ra-list-table tbody tr { cursor: pointer; transition: background 0.15s; }
.ra-controls-table tbody tr:hover { background: var(--color-surface-secondary, rgba(0,0,0,0.03)); }
.project-risk-row { cursor: pointer; transition: background 0.15s; }
.project-risk-row:hover { background: var(--color-surface-secondary, rgba(0,0,0,0.03)); }

/* --- Phase B: Domain expand/collapse animation --- */
.ra-domain-body {
  display: block !important;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.25s ease;
  padding: 0 var(--spacing-md, 1rem);
}
.ra-domain-body--visible {
  max-height: 5000px;
  padding: var(--spacing-md, 1rem);
}

/* --- Phase B: Recommendation chevrons + smooth expand --- */
.ra-rec-chevron {
  display: inline-block;
  transition: transform 0.2s;
  font-size: 0.6rem;
  margin-right: var(--spacing-xs);
  color: var(--color-text-light);
}
.ra-rec-row--expanded .ra-rec-chevron { transform: rotate(90deg); }
.ra-rec-row { cursor: pointer; }
.ra-rec-detail { display: table-row; }
.ra-rec-detail td { padding: 0 !important; }
.ra-rec-detail__inner {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 var(--spacing-md, 1rem);
  background: var(--color-surface-secondary);
  font-size: var(--font-size-xs);
}
.ra-rec-detail--visible .ra-rec-detail__inner {
  max-height: 600px;
  padding: var(--spacing-md, 1rem);
}

/* --- Phase B: Wizard sticky header + slide animation --- */
.ra-wizard__sticky-top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--color-surface, #fff);
  border-bottom: 1px solid var(--color-border);
}
.ra-wizard__sticky-top .ra-wizard__header { border-bottom: none; }
@keyframes raSlideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
.ra-step-slide-in { animation: raSlideIn 0.25s ease-out; }

/* --- Phase C: Analysis list filters --- */
.ra-list-filters {
  display: flex;
  gap: var(--spacing-sm, 0.5rem);
  margin-bottom: var(--spacing-md, 16px);
  flex-wrap: wrap;
  align-items: center;
}
.ra-list-filters input,
.ra-list-filters select {
  padding: var(--spacing-xs, 0.25rem) var(--spacing-sm, 0.5rem);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  font-size: var(--font-size-sm, 0.85rem);
  background: var(--color-surface);
  color: var(--color-text);
  height: 36px;
}
.ra-list-filters input[type="search"] {
  flex: 1;
  min-width: 180px;
}

/* --- Phase C: Results tabs (Step 6) --- */
.ra-results-tabs {
  display: flex;
  gap: var(--spacing-xs, 0.25rem);
  margin-bottom: var(--spacing-lg, 24px);
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 0;
  flex-wrap: wrap;
}
.ra-results-tab {
  padding: var(--spacing-sm, 0.5rem) var(--spacing-md, 1rem);
  background: none;
  border: none;
  cursor: pointer;
  font-size: var(--font-size-sm, 0.85rem);
  font-weight: 600;
  color: var(--color-text-light);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  white-space: nowrap;
}
.ra-results-tab:hover { color: var(--color-primary); }
.ra-results-tab--active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

/* --- Phase C: Preview TOC --- */
.ra-preview-toc {
  position: sticky;
  top: 120px;
  float: right;
  width: 180px;
  margin-left: var(--spacing-md, 16px);
  margin-bottom: var(--spacing-md, 16px);
  padding: var(--spacing-sm, 0.5rem);
  background: var(--color-surface-secondary, #f8fafc);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  font-size: var(--font-size-xs, 0.75rem);
  max-height: 60vh;
  overflow-y: auto;
  z-index: 5;
}
.ra-preview-toc strong { display: block; margin-bottom: var(--spacing-xs); }
.ra-preview-toc ul { list-style: none; padding: 0; margin: 0; }
.ra-preview-toc li { margin-bottom: 1px; }
.ra-preview-toc__link {
  color: var(--color-text-light);
  text-decoration: none;
  display: block;
  padding: var(--spacing-xs) var(--spacing-xs);
  border-radius: var(--border-radius-sm);
  transition: all 0.15s;
}
.ra-preview-toc__link:hover { background: var(--color-border); color: var(--color-text); }
.ra-preview-toc__link--active {
  color: var(--color-primary);
  font-weight: 600;
  background: rgba(31,184,205,0.08);
}
@media (max-width: 768px) {
  .ra-preview-toc {
    float: none;
    width: 100%;
    position: relative;
    top: auto;
    margin: 0 0 var(--spacing-md, 1rem);
    max-height: none;
  }
  .ra-preview-toc ul { display: flex; flex-wrap: wrap; gap: var(--spacing-xs); }
  .ra-preview-toc li { margin: 0; }
}

/* --- Phase D: Custom confirm modal --- */
.confirm-modal__icon {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: var(--spacing-md, 16px);
}
.confirm-modal__icon--warning { color: var(--color-warning); }
.confirm-modal__icon--danger { color: var(--color-danger); }
.confirm-modal__icon--info { color: var(--color-primary); }
.confirm-modal__message {
  text-align: center;
  font-size: var(--font-size-md, 1rem);
  color: var(--color-text);
  line-height: 1.6;
  white-space: pre-line;
}

/* --- Phase E: Tags chips input --- */
.tags-input-container {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs, 0.25rem) var(--spacing-sm, 0.5rem);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  background: var(--color-surface);
  min-height: 38px;
  align-items: center;
  cursor: text;
}
.tags-input-container:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
}
.tags-chips { display: contents; }
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-sm);
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--border-radius-lg);
  font-size: var(--font-size-xs, 0.75rem);
  font-weight: 500;
  white-space: nowrap;
}
.tag-chip__remove {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  font-size: var(--font-size-sm);
  padding: 0 var(--spacing-xs);
  line-height: 1;
}
.tag-chip__remove:hover { color: #fff; }
.tags-input {
  flex: 1;
  min-width: 100px;
  border: none;
  outline: none;
  padding: var(--spacing-xs, 0.25rem);
  font-size: var(--font-size-sm, 0.85rem);
  background: transparent;
  color: var(--color-text);
}

/* --- Phase E: Searchable Select Component --- */
.searchable-select {
  position: relative;
  width: 100%;
}
.searchable-select__trigger {
  cursor: pointer;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  padding-right: 2.2em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 12px;
}
.searchable-select__trigger:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
}
.searchable-select__dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1050;
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.08);
  max-height: 340px;
  flex-direction: column;
  margin-top: 2px;
}
.searchable-select--open .searchable-select__dropdown {
  display: flex;
}
.searchable-select__search {
  padding: var(--spacing-sm) var(--spacing-md);
  border: none;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--font-size-sm, 0.85rem);
  outline: none;
  width: 100%;
  box-sizing: border-box;
  background: var(--color-surface, #fff);
  color: var(--color-text);
}
.searchable-select__search::placeholder {
  color: var(--color-text-light, #9ca3af);
}
.searchable-select__search:focus {
  border-bottom-color: var(--color-primary);
}
.searchable-select__list {
  overflow-y: auto;
  max-height: 290px;
  padding: 2px 0;
}
.searchable-select__group-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-md);
  font-size: var(--font-size-xs, 0.75rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-light, #6b7280);
  background: var(--color-surface-secondary, #f9fafb);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 2;
}
.searchable-select__subgroup-header {
  padding: var(--spacing-xs) var(--spacing-md) var(--spacing-xs) var(--spacing-lg, 1.5rem);
  font-size: var(--font-size-xs, 0.75rem);
  font-weight: 600;
  color: var(--color-text-secondary, #4b5563);
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.searchable-select__option {
  padding: var(--spacing-xs) var(--spacing-md) var(--spacing-xs) calc(var(--spacing-lg, 1.5rem) + var(--spacing-sm, 0.5rem));
  font-size: var(--font-size-sm, 0.85rem);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background-color 0.12s ease;
  color: var(--color-text);
}
.searchable-select__option:hover,
.searchable-select__option--focused {
  background-color: rgba(31, 184, 205, 0.08);
}
.searchable-select__option--selected {
  background-color: rgba(31, 184, 205, 0.14);
  font-weight: 600;
}
.searchable-select__option--selected::before {
  content: "\2713 ";
  color: var(--color-primary);
  font-weight: 700;
}
.searchable-select__empty {
  padding: var(--spacing-md) var(--spacing-lg);
  text-align: center;
  color: var(--color-text-light, #9ca3af);
  font-size: var(--font-size-sm, 0.85rem);
}
.searchable-select__fw-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* CyFun 2025 - Key Measure Styling */
.nis2-control-row--key-measure {
  background: rgba(217, 119, 6, 0.04) !important;
}
.nis2-control-row--key-measure:hover {
  background: rgba(217, 119, 6, 0.08) !important;
}
.nis2-desc-cell {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cyfun-level-option:has(input:checked) {
  border-color: var(--color-primary) !important;
  background: rgba(31, 184, 205, 0.04);
}

/* CyFun Level Modal */
.cyfun-level-modal {
  max-width: 520px;
}
.cyfun-level-info {
  background: var(--color-info-light, #eff6ff);
  border: 1px solid var(--color-border, #bfdbfe);
  border-radius: var(--border-radius);
  padding: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
  font-size: var(--font-size-sm);
}
.cyfun-level-info__icon {
  color: var(--color-primary);
  margin-right: var(--spacing-xs);
}
.cyfun-level-info a {
  color: var(--color-primary);
  text-decoration: underline;
}
.cyfun-level-options {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}
.cyfun-level-option {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm);
  border: 2px solid var(--color-border);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: border-color var(--transition-duration) var(--transition-timing),
              background var(--transition-duration) var(--transition-timing);
}
.cyfun-level-option input[type="radio"] {
  margin-top: var(--spacing-xs);
}
.cyfun-level-option__title--basic { color: var(--color-success-dark, #059669); }
.cyfun-level-option__title--important { color: var(--color-warning-dark, #d97706); }
.cyfun-level-option__title--essential { color: var(--color-danger, #dc2626); }
.cyfun-level-option__meta {
  color: var(--color-text-secondary);
}
.cyfun-level-option__desc {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin: var(--spacing-xs) 0 0;
}
.cyfun-level-lang {
  margin-top: var(--spacing-md);
  padding-top: var(--spacing-sm);
  border-top: 1px solid var(--color-border);
}
.cyfun-level-lang__label {
  font-weight: 600;
  display: block;
  margin-bottom: var(--spacing-sm);
}
.cyfun-level-lang__options {
  display: flex;
  gap: var(--spacing-md);
}
.cyfun-level-lang__option {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  cursor: pointer;
}
.cyfun-level-lang__hint {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  margin: var(--spacing-xs) 0 0;
}
.nis2-controls-count {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}
.nis2-key-measure-icon {
  color: var(--color-warning-dark, #d97706);
  font-size: var(--font-size-xs);
}

.key-measure-card {
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: var(--spacing-md);
  background: var(--color-surface);
  transition: box-shadow var(--transition-duration) ease;
}
.key-measure-card:hover {
  box-shadow: var(--shadow-md);
}
.key-measure-card--pass {
  border-left: 3px solid var(--color-success-dark);
}
.key-measure-card--fail {
  border-left: 3px solid var(--color-danger);
}
.scoring-widget {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
  padding: var(--spacing-lg);
  background: var(--color-surface);
  border-radius: var(--border-radius);
  border: 1px solid var(--color-border);
}
.scoring-widget__score {
  font-size: var(--font-size-xxl);
  font-weight: 700;
  line-height: 1;
}
.scoring-widget__label {
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
}
.cyfun-level-badge {
  display: inline-block;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
}
.cyfun-level-badge--basic { background: var(--color-success-light); color: var(--color-success-dark); }
.cyfun-level-badge--important { background: var(--color-warning-light); color: var(--color-warning-dark); }
.cyfun-level-badge--essential { background: var(--color-danger-light); color: var(--color-danger); }

/* CyFun 2025 - Dark theme */
body.theme-dark .nis2-control-row--key-measure {
  background: rgba(217, 119, 6, 0.08) !important;
}
body.theme-dark .key-measure-card {
  background: var(--color-surface, #1e293b);
  border-color: var(--color-border, #334155);
}
body.theme-dark .scoring-widget {
  background: var(--color-surface, #1e293b);
  border-color: var(--color-border, #334155);
}

/* ============================================================
   WCAG 2.1 AA Accessibility
   ============================================================ */

/* Accessibility: respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Screen reader only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* WCAG 2.5.8: Minimum touch target size */
.icon-btn,
.btn--sm,
.chart-filter-btn {
  min-width: 44px;
  min-height: 44px;
}

/* Toast close button focus visibility */
.toast__close:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* Table row cursor for clickable rows */
.table tbody tr[onclick],
.table tbody tr[style*="cursor"] {
  cursor: pointer;
}

/* =============================================================
 * Trial Banner & License Activation
 * ============================================================= */

.csi-trial-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-sm);
  font-weight: 500;
  z-index: 9998;
  padding: 0 var(--spacing-md);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.csi-trial-banner--active {
  background: var(--color-warning-bg, #fef3c7);
  color: var(--color-warning-text, #92400e);
}

.csi-trial-banner--expired {
  background: var(--color-danger-bg, #fef2f2);
  color: var(--color-danger, #dc2626);
}

.csi-trial-banner--licensed {
  display: none;
}

/* Push content down when trial banner is visible */
body:has(.csi-trial-banner) .header,
body.has-trial-banner .header {
  margin-top: 36px;
}

body:has(.csi-trial-banner) .nav-ribbon,
body.has-trial-banner .nav-ribbon {
  top: calc(var(--header-height, 56px) + 36px);
}

.csi-license-textarea {
  width: 100%;
  min-height: 80px;
  padding: calc(var(--spacing-sm) + var(--spacing-xs));
  border: 1px solid var(--color-border, #ddd);
  border-radius: var(--border-radius);
  font-family: monospace;
  font-size: var(--font-size-sm);
  resize: vertical;
  box-sizing: border-box;
  background: var(--color-surface, #fff);
  color: var(--color-text, #333);
}

.csi-license-textarea:focus {
  outline: none;
  border-color: var(--color-primary, #3b82f6);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.wizard-step-license {
  padding: var(--spacing-sm) 0;
}

/* Print styles */
/* === Wizard: server-check list === */
.wizard-check-list {
  list-style: none;
  padding: 0;
  margin: var(--spacing-md) 0;
}
.wizard-check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px calc(var(--spacing-sm) + var(--spacing-xs));
  border-radius: var(--border-radius);
  margin-bottom: var(--spacing-xs);
  font-size: var(--font-size-sm);
  background: var(--color-surface-alt, #f8f9fa);
  transition: background 0.2s;
}
.wizard-check-item--ok {
  color: var(--color-success, #22c55e);
}
.wizard-check-item--error {
  color: var(--color-danger, #dc3545);
}
.wizard-check-item--pending {
  color: var(--color-text-secondary, #888);
}
.wizard-check-item i {
  width: 18px;
  text-align: center;
}

/* === Wizard: Password setup step === */
.wizard-password-setup {
  max-width: 420px;
  margin: 0 auto;
}
.wizard-pwd-field label {
  display: block;
  font-weight: 600;
  font-size: var(--font-size-sm);
  margin-bottom: var(--spacing-xs);
  color: var(--color-text-secondary, #64748b);
}
.wizard-pwd-field input {
  width: 100%;
}

/* === Wizard: Transversality slide === */
.wizard-transversality {
  text-align: center;
}
.wizard-trans-diagram {
  margin: 0 auto var(--spacing-lg);
  max-width: 360px;
}
.wizard-trans-svg {
  width: 100%;
  height: auto;
}
.wizard-trans-benefits {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}
.wizard-trans-benefit {
  display: flex;
  align-items: flex-start;
  gap: calc(var(--spacing-sm) + var(--spacing-xs));
  padding: calc(var(--spacing-sm) + var(--spacing-xs)) 14px;
  border-radius: var(--border-radius);
  background: var(--color-surface-alt, #f8f9fa);
  border: 1px solid var(--color-border, #e2e8f0);
}
.wizard-trans-benefit__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-full);
  background: var(--color-primary-bg, rgba(176, 124, 124, 0.1));
  color: var(--color-primary, #b07c7c);
  font-size: var(--font-size-md);
}
.wizard-trans-benefit__text strong {
  display: block;
  font-size: var(--font-size-sm);
  margin-bottom: var(--spacing-xs);
}
.wizard-trans-benefit__text p {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary, #64748b);
  line-height: 1.4;
}

/* === Wizard: Server promo slide (local) === */
.wizard-promo {
  text-align: left;
}
.wizard-promo-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: var(--spacing-lg);
}
.wizard-promo-feature {
  display: flex;
  align-items: flex-start;
  gap: calc(var(--spacing-sm) + var(--spacing-xs));
  padding: calc(var(--spacing-sm) + var(--spacing-xs)) 14px;
  border-radius: var(--border-radius);
  background: var(--color-surface-alt, #f8f9fa);
  border: 1px solid var(--color-border, #e2e8f0);
}
.wizard-promo-feature__icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-lg);
  font-size: var(--font-size-md);
}
.wizard-promo-feature__text strong {
  display: block;
  font-size: var(--font-size-sm);
  margin-bottom: var(--spacing-xs);
}
.wizard-promo-feature__text p {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary, #64748b);
  line-height: 1.4;
}
.wizard-promo-cta {
  text-align: center;
  padding-top: var(--spacing-sm);
}
.wizard-promo-link {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: 10px var(--spacing-lg);
  border-radius: var(--border-radius);
  background: var(--color-primary, #b07c7c);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: var(--font-size-sm);
  transition: opacity 0.2s;
}
.wizard-promo-link:hover {
  opacity: 0.85;
  color: #fff;
}

/* === Wizard: Server capabilities slide === */
.wizard-cap-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(var(--spacing-sm) + var(--spacing-xs));
}
@media (max-width: 640px) {
  .wizard-cap-grid {
    grid-template-columns: 1fr;
  }
}
.wizard-cap-card {
  background: var(--color-surface-alt, #f8f9fa);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--border-radius);
  padding: var(--spacing-md);
  text-align: center;
}
.wizard-cap-card__icon {
  width: 42px;
  height: 42px;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-full);
  background: var(--color-primary-bg, rgba(176, 124, 124, 0.1));
  color: var(--color-primary, #b07c7c);
  font-size: var(--font-size-lg);
}
.wizard-cap-card strong {
  display: block;
  font-size: var(--font-size-sm);
  margin-bottom: var(--spacing-xs);
}
.wizard-cap-card p {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary, #64748b);
  line-height: 1.4;
}

/* Theme overrides for wizard components */
.theme-dark .wizard-trans-benefit,
.theme-dark .wizard-promo-feature,
.theme-dark .wizard-cap-card {
  background: var(--color-surface-alt, #1e293b);
  border-color: var(--color-border, #334155);
}
.theme-dark .wizard-trans-benefit__text p,
.theme-dark .wizard-promo-feature__text p,
.theme-dark .wizard-cap-card p {
  color: var(--text-secondary, #94a3b8);
}

/* === Settings: Users table === */
.users-table-wrap {
  overflow-x: auto;
  margin-top: var(--spacing-sm);
}
.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}
.users-table th {
  text-align: left;
  padding: 10px calc(var(--spacing-sm) + var(--spacing-xs));
  border-bottom: 2px solid var(--color-border, #e2e8f0);
  color: var(--color-text-secondary, #64748b);
  font-weight: 600;
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.users-table td {
  padding: 10px calc(var(--spacing-sm) + var(--spacing-xs));
  border-bottom: 1px solid var(--color-border, #e2e8f0);
  vertical-align: middle;
}
.users-table__row:hover {
  background: var(--color-surface-alt, #f8f9fa);
}
.users-table__row--suspended {
  opacity: 0.7;
}
.users-badge {
  display: inline-block;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--border-radius-lg);
  font-size: var(--font-size-xs);
  font-weight: 600;
}
.users-badge--admin {
  background: var(--color-primary-bg, #dbeafe);
  color: var(--color-primary, #3b82f6);
}
.users-badge--editor {
  background: var(--color-info-bg, #e0f2fe);
  color: var(--color-info, #0ea5e9);
}
.users-badge--viewer {
  background: var(--color-warning-bg, #fef3c7);
  color: var(--color-warning, #d97706);
}
.users-badge--active {
  background: var(--color-success-bg, #dcfce7);
  color: var(--color-success, #22c55e);
}
.users-badge--suspended {
  background: var(--color-danger-bg, #fef2f2);
  color: var(--color-danger, #dc3545);
}
.users-badge--temp {
  margin-left: 6px;
  background: #f59e0b;
  color: #fff;
  font-size: 0.75em;
}
.users-badge--sso {
  margin-left: 4px;
  padding: 2px 6px;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 4px;
  font-size: 0.7rem;
}
body.theme-dark .users-badge--temp {
  background: #b45309;
  color: #fff;
}
body.theme-dark .users-badge--sso {
  background: rgba(29, 78, 216, 0.28);
  color: #93c5fd;
}
.users-actions {
  display: flex;
  gap: var(--spacing-xs);
  flex-wrap: wrap;
}
.users-self-label {
  color: var(--color-text-secondary, #94a3b8);
  font-style: italic;
  font-size: var(--font-size-sm);
}
.users-status {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary, #64748b);
  margin-bottom: var(--spacing-sm);
}
.users-create-msg {
  font-size: var(--font-size-sm);
  padding: 0;
  margin-bottom: var(--spacing-sm);
  min-height: 1.2em;
}
.users-create-msg--error {
  color: var(--color-danger, #dc3545);
  background: var(--color-danger-bg, #fef2f2);
  padding: var(--spacing-sm) calc(var(--spacing-sm) + var(--spacing-xs));
  border-radius: var(--border-radius);
}
.btn--xs {
  padding: var(--spacing-xs) 10px;
  font-size: var(--font-size-sm);
  border-radius: var(--border-radius-sm);
}
.btn--danger {
  background: var(--color-danger, #dc3545);
  color: white;
  border: none;
  cursor: pointer;
}
.btn--danger:hover {
  background: #b91c1c;
}

/* ========== Legacy Import Module ========== */
.legacy-import__report {
  max-height: 60vh;
  overflow-y: auto;
  font-size: var(--font-size-sm);
  line-height: 1.5;
}
.legacy-import__section {
  margin-bottom: 1rem;
  padding: 0.75rem;
  border-radius: var(--border-radius);
  background: var(--bg-secondary, #f8f9fa);
}
.legacy-import__section--warning {
  background: var(--bg-warning-subtle, #fff8e1);
  border-left: 3px solid var(--color-warning, #f5a623);
}
.legacy-import__section--danger {
  background: var(--bg-danger-subtle, #ffeaea);
  border-left: 3px solid var(--color-danger, #e53e3e);
}
.legacy-import__heading {
  margin: 0 0 0.5rem 0;
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--text-primary);
}
.legacy-import__subtitle {
  margin: 0.5rem 0 0.25rem 0;
  font-weight: 500;
  color: var(--text-secondary);
}
.legacy-import__details {
  margin: 0.25rem 0 0 1rem;
  padding: 0;
  color: var(--text-secondary);
}
.legacy-import__details li {
  margin-bottom: 0.15rem;
}
.legacy-import__table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}
.legacy-import__table th,
.legacy-import__table td {
  padding: 0.35rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}
.legacy-import__table th {
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
}
.legacy-import__table code {
  font-size: 0.85em;
  padding: 0.1em 0.3em;
  border-radius: 3px;
  background: var(--bg-tertiary, #edf2f7);
}

@media print {
  .header, .nav-ribbon, .mode-banner, .global-search,
  .footer, .toast-container, #modalOverlay,
  .csi-trial-banner {
    display: none !important;
  }
  .module { display: block !important; overflow: visible !important; }
  .module--active { page-break-before: auto; }
  body { font-size: var(--font-size-md); }
}

/* ============================================================
   Multi-entités (CSI-ME) — intégré au design system
   Tokens réels + thème clair/sombre automatique (color-* / spacing-* /
   border-radius-* / font-size-* / shadow-*). Convention de teinte des
   pastilles alignée sur .status-badge (rgba palette 0.1 + color token).
   ============================================================ */

/* — Bandeaux de périmètre (sous l'en-tête) — */
.csi-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  text-align: center;
}
.csi-banner i { opacity: 0.85; }
/* (refonte header 2026-07) .csi-banner--scope supprimé : le bandeau « Périmètre :
   {name} » n'est plus rendu — l'info vit dans le fil d'Ariane (.csi-scope-breadcrumb,
   point orange) + titre d'onglet/favicon badgés. */
.csi-banner--entity {
  background-color: rgba(50, 192, 134, 0.12);
  color: var(--color-text);
  border-bottom: 1px solid rgba(50, 192, 134, 0.28);
}
.csi-banner--entity i { color: var(--color-success-dark); }
.csi-banner__action {
  margin-left: var(--spacing-sm);
  font-size: var(--font-size-xs);
  font-weight: 500;
  padding: 2px var(--spacing-sm);
  border-radius: var(--border-radius-full);
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background-color var(--transition-duration) ease;
}
.csi-banner__action:hover { opacity: 0.85; text-decoration: underline; }

/* — Libellé réutilisé par les contrôles des modales multi-entités — */
.csi-perimeter__label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

/* — Commutateur de périmètre (en-tête) : pastille + menu déroulant —
   Un seul contrôle compact (l'ancien trio label + select + bouton élargissait
   la barre d'actions et provoquait des retours à la ligne). */
.csi-scope {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
}
.csi-scope__btn {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  max-width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: var(--font-size-sm);
  font-weight: 500;
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-surface-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--transition-duration) ease;
}
.csi-scope__btn > i.fas { color: var(--color-primary); }
.csi-scope__btn:hover:not(:disabled),
.csi-scope__btn:focus { border-color: var(--color-primary); outline: none; }
.csi-scope__btn:disabled { opacity: 0.6; cursor: wait; }
.csi-scope__name {
  min-width: 0;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.csi-scope__caret { font-size: 0.65em; opacity: 0.7; }
.csi-header-scope .csi-scope { width: 100%; }
.csi-header-scope .csi-scope__btn {
  width: 100%;
  justify-content: flex-start;
}
.csi-header-scope .csi-scope__caret { margin-left: auto; }
.csi-header-scope .csi-scope__name { max-width: none; }
/* Périmètre ≠ principal : teinte d'avertissement (pastille fallback) */
.csi-scope--sub .csi-scope__btn {
  background-color: rgba(255, 193, 133, 0.25);
  border-color: rgba(255, 193, 133, 0.5);
}
.csi-scope--sub .csi-scope__btn > i.fas { color: var(--color-warning-dark); }

/* — Fil d'Ariane de périmètre (refonte header 2026-07) —
   Le commutateur remplace le sous-titre dans .header__brand : trigger inline
   discret (pas de fond ni bordure au repos), largeur naturelle, ellipsis,
   menu existant ancré sous le trigger. 4 thèmes via tokens uniquement. */
.header__subtitle.csi-subtitle--hidden { display: none; }
.csi-scope-breadcrumb {
  min-width: 0;
  /* même retrait que le sous-titre : texte aligné sur celui du titre */
  padding-left: calc(1em + var(--spacing-sm));
}
.csi-scope-breadcrumb .csi-scope { max-width: 100%; }
.csi-scope-breadcrumb .csi-scope__btn {
  min-height: 30px;
  margin-left: calc(-1 * var(--spacing-xs));
  padding: 2px var(--spacing-xs);
  font-weight: 400;
  background-color: transparent;
  border-color: transparent;
  border-radius: var(--border-radius-sm);
  transition: background-color var(--transition-duration) ease;
}
.csi-scope-breadcrumb .csi-scope__btn:hover:not(:disabled),
.csi-scope-breadcrumb .csi-scope__btn:focus {
  background-color: var(--color-surface-secondary);
  border-color: transparent;
}
/* Focus clavier : on restaure l'anneau global (le variant ne peut pas s'appuyer
   sur la bordure comme la pastille — PAS de outline:none ici). */
.csi-scope-breadcrumb .csi-scope__btn:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}
.csi-scope-breadcrumb .csi-scope__label { color: var(--color-text-secondary); }
.csi-scope-breadcrumb .csi-scope__chevron {
  color: var(--color-text-light);
  font-weight: 400;
}
.csi-scope-breadcrumb .csi-scope__name {
  max-width: 40ch;
  font-weight: 600;
  flex: 0 0 auto; /* ne cède pas de largeur aux voisins tant que < 40ch (sinon ellipse à 4px près) */
}
/* Périmètre ≠ principal : la teinte pleine de la pastille devient un point
   orange devant le nom (l'info reste aussi sur le titre d'onglet + favicon). */
.csi-scope-breadcrumb .csi-scope--sub .csi-scope__btn {
  background-color: transparent;
  border-color: transparent;
}
.csi-scope-breadcrumb .csi-scope--sub .csi-scope__btn:hover:not(:disabled),
.csi-scope-breadcrumb .csi-scope--sub .csi-scope__btn:focus {
  background-color: var(--color-surface-secondary);
}
.csi-scope-breadcrumb .csi-scope--sub .csi-scope__name::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: var(--spacing-xs);
  border-radius: 50%;
  background-color: var(--color-warning-dark);
}
.csi-scope--open { z-index: 1060; }
.csi-scope__menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 1060; /* aligné sur .searchable-select__dropdown, au-dessus du ruban nav */
  min-width: 250px;
  width: max-content;
  max-width: min(320px, calc(100vw - (2 * var(--spacing-md))));
  padding: var(--spacing-xs);
  flex-direction: column;
  background: var(--color-surface, #ffffff);
  background-clip: padding-box;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
  pointer-events: auto;
  isolation: isolate;
}
.csi-scope--open .csi-scope__menu { display: flex; }
.csi-scope__head {
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: var(--font-size-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}
.csi-scope__filter {
  margin: 0 var(--spacing-xs) var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: var(--font-size-sm);
  color: var(--color-text);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  outline: none;
}
.csi-scope__filter:focus { border-color: var(--color-primary); }
.csi-scope__list {
  max-height: 260px;
  overflow-y: auto;
}
.csi-scope__item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  width: 100%;
  min-height: 40px;
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: var(--font-size-sm);
  text-align: left;
  color: var(--color-text);
  background: transparent;
  border: none;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
}
.csi-scope__item:hover,
.csi-scope__item:focus {
  background-color: var(--color-surface-secondary);
  outline: none;
}
.csi-scope__item[aria-checked="true"] { font-weight: 600; }
.csi-scope__check { width: 1em; flex-shrink: 0; color: var(--color-primary); }
.csi-scope__check--off { visibility: hidden; }
.csi-scope__item-name {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.csi-scope__item--action i { width: 1em; flex-shrink: 0; color: var(--color-primary); }
.csi-scope__hint {
  flex: 0 0 auto;
  margin-left: auto;
  padding-left: var(--spacing-sm);
  font-size: var(--font-size-xs);
  color: var(--color-text-light);
}
.csi-scope__sep {
  height: 1px;
  margin: var(--spacing-xs) var(--spacing-sm);
  background-color: var(--color-border);
}

/* — Pastille d'entité — */
.csi-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--spacing-sm);
  border-radius: var(--border-radius-full);
  font-size: var(--font-size-xs);
  font-weight: 500;
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  background-color: rgba(31, 184, 205, 0.12);
  color: var(--color-text);
  border: 1px solid rgba(31, 184, 205, 0.35);
}
.csi-lock-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: 2px var(--spacing-sm);
  border-radius: var(--border-radius-full);
  font-size: var(--font-size-xs);
  font-weight: 500;
  background-color: rgba(255, 193, 133, 0.22);
  color: var(--color-text);
}
.csi-lock-pill i { color: var(--color-warning-dark); }
.csi-free { font-size: var(--font-size-xs); color: var(--color-text); font-weight: 500; }
.csi-free::before { content: '●'; color: var(--color-success); margin-right: 4px; font-size: 0.6rem; vertical-align: middle; }

/* — Tuile « Vue groupe » (tableau de bord) — */
.csi-tile {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--spacing-lg);
  margin-top: var(--spacing-lg);
  overflow-x: auto; /* (audit a11y) 6 colonnes nowrap — pas de débordement de page */
}
.csi-tile__head {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
}
.csi-tile__head i { color: var(--color-primary); }
.csi-tile__title { margin: 0; font-size: var(--font-size-md); font-weight: 600; color: var(--color-text); }
.csi-tile__count { margin-left: auto; font-size: var(--font-size-sm); color: var(--color-text-secondary); }
.csi-tile__empty { margin: 0; font-size: var(--font-size-sm); color: var(--color-text-secondary); }

/* — Tables CSI (réutilise .table, quelques densifications) — */
.csi-table { width: 100%; border-collapse: collapse; font-size: var(--font-size-sm); }
.csi-table th {
  text-align: left;
  padding: var(--spacing-sm);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  font-weight: 600;
  white-space: nowrap;
}
.csi-table td {
  padding: var(--spacing-sm);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  vertical-align: middle;
}
.csi-table tbody tr:hover { background-color: var(--color-surface-secondary); }
.csi-table th.csi-sortable { cursor: pointer; user-select: none; padding: 0; }
.csi-table th.csi-sortable:hover { color: var(--color-primary); }
.csi-th-btn {
  background: none;
  border: none;
  padding: var(--spacing-sm);
  width: 100%;
  text-align: inherit;
  font: inherit;
  font-weight: 600;
  color: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.csi-th-btn:hover { color: var(--color-primary); }
.csi-muted { color: var(--color-text-secondary); }
.csi-num { text-align: center; }
.csi-right { text-align: right; }

/* — Modale CSI large (réutilise .modal-overlay / .modal) — */
.modal--lg { max-width: 1000px; }
.modal--md { max-width: 760px; }
.csi-modal-scroll {
  overflow: auto;
  flex: 1;
  min-height: 0;
}
.modal.csi-modal {
  display: flex;
  flex-direction: column;
  max-height: 88vh;
}
.csi-modal .modal__body {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  max-height: none;
}
.csi-modal__controls {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}
.csi-modal__hint { margin: 0; font-size: var(--font-size-xs); color: var(--color-text-secondary); }
.csi-modal__foot { font-size: var(--font-size-xs); color: var(--color-text-secondary); }

/* — Chips de filtre d'entité — */
.csi-chips { display: flex; gap: var(--spacing-xs); flex-wrap: wrap; }
.csi-chip {
  font-size: var(--font-size-xs);
  border-radius: var(--border-radius-full);
  padding: 3px var(--spacing-sm);
  cursor: pointer;
  border: 1px solid var(--color-primary);
  background-color: rgba(31, 184, 205, 0.12);
  color: var(--color-text);
  transition: all var(--transition-duration) ease;
}
.csi-chip--off {
  border-color: var(--color-border);
  background-color: transparent;
  color: var(--color-text-secondary);
  text-decoration: line-through; /* état off non porté que par la couleur (WCAG 1.4.1) */
  opacity: 0.8;
}

/* — Barre de répartition (déplacer la sélection) — */
.csi-movebar {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
  padding: var(--spacing-sm) var(--spacing-md);
  background-color: rgba(31, 184, 205, 0.1);
  border: 1px solid rgba(31, 184, 205, 0.25);
  border-radius: var(--border-radius);
}
.csi-movebar__count { font-size: var(--font-size-sm); font-weight: 600; color: var(--color-text); }
.csi-movebar__arrow { font-size: var(--font-size-sm); color: var(--color-text-secondary); }

/* — Carte « Opérations » (réutilise .settings-card) — */
.csi-ops-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--spacing-sm); }

/* — Éditeur de droits par section (Réglages) — */
.csi-rights__section {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-xs) 0;
  border-bottom: 1px solid var(--color-border);
}
.csi-rights__name { flex: 1; font-size: var(--font-size-sm); color: var(--color-text); }
.csi-entity-row {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  margin-bottom: var(--spacing-xs);
}
.csi-entity-row__name { flex: 1; color: var(--color-text); }

/* — Utilitaires CSI (Réglages, tuiles, modales) — */
.csi-toggle { display: flex; align-items: center; gap: var(--spacing-sm); font-weight: 500; cursor: pointer; }
.csi-toggle-row { display: flex; align-items: center; gap: var(--spacing-md); margin-bottom: var(--spacing-md); flex-wrap: wrap; }
.csi-toggle-row__count { margin-left: auto; font-size: var(--font-size-sm); color: var(--color-text-secondary); }
.csi-block { border-top: 1px solid var(--color-border); padding-top: var(--spacing-md); margin-top: var(--spacing-md); }
.csi-subhead { font-weight: 600; margin: 0 0 var(--spacing-sm); color: var(--color-text); }
.csi-hint { font-size: var(--font-size-xs); color: var(--color-text-secondary); }
.csi-add-row { display: flex; gap: var(--spacing-sm); align-items: center; margin-top: var(--spacing-sm); }
.csi-grow { flex: 1; }
.csi-mt-sm { margin-top: var(--spacing-sm); }
.csi-error { color: var(--color-danger); }
.csi-ok { color: var(--color-success, #16a34a); font-weight: 500; }
.csi-warn { color: var(--color-warning, #b45309); }
/* === CSI-ME === (import/export par entité) champs de l'assistant, design system */
.csi-select, .csi-input {
  padding: var(--spacing-xs) var(--spacing-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm, 6px);
  background: var(--color-surface, var(--color-bg));
  color: var(--color-text);
  font-size: var(--font-size-sm);
  max-width: 100%;
}
.csi-input { min-width: 240px; }
.csi-radio { display: flex; align-items: center; gap: var(--spacing-xs); margin-bottom: var(--spacing-xs); cursor: pointer; }
.csi-report-list { margin: var(--spacing-sm) 0 0; padding-left: var(--spacing-lg); }
.csi-report-list li { margin-bottom: var(--spacing-xs); }
.csi-report-list .csi-ok { margin-left: var(--spacing-xs); }
.csi-report-list .csi-error { margin-left: var(--spacing-xs); }
.csi-pad { padding: var(--spacing-md); }
.csi-strong { font-weight: 500; }
.csi-suffix { margin-left: var(--spacing-xs); font-size: var(--font-size-xs); color: var(--color-text-secondary); }
.csi-locked { display: inline-flex; align-items: center; gap: var(--spacing-xs); font-size: var(--font-size-sm); }
.csi-check-col { width: 32px; }
.csi-right-select { width: 120px; }
.csi-rights__section--last { border-bottom: none; }
/* La table CSI, quand elle vit dans un .table-container, ne double pas l'ombre */
.csi-modal-scroll.table-container { box-shadow: none; border: 1px solid var(--color-border); }
.csi-search-scope {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  padding: 2px var(--spacing-xs) var(--spacing-xs);
}
/* (audit 2026-07-03, I8) Section en droit 'read' pour un compte de sous-entité :
   badge cadenas discret dans la nav — la section restait présentée comme éditable. */
.csi-nav-readonly { opacity: 0.85; }
.csi-nav-readonly::after {
  content: '\f023'; /* fa-lock */
  font-family: 'Font Awesome 6 Free', 'FontAwesome';
  font-weight: 900;
  font-size: 0.62rem;
  margin-left: var(--spacing-xs);
  opacity: 0.55;
  vertical-align: super;
}
/* (audit a11y 2026-07-03, J8) Mode compact : densité alignée sur .table/.card. */
body.compact-mode .csi-table th,
body.compact-mode .csi-table td { padding: var(--spacing-xs) var(--spacing-sm); font-size: var(--font-size-xs); }
body.compact-mode .csi-th-btn { padding: var(--spacing-xs) var(--spacing-sm); }
body.compact-mode .csi-tile { padding: var(--spacing-md); margin-top: var(--spacing-md); }
body.compact-mode .csi-banner { padding: 4px var(--spacing-sm); font-size: var(--font-size-xs); }

/* (audit global 2026-07-03, MAJEUR thème×impression) Neutraliser le thème SOMBRE (et tout
   thème coloré) à l'IMPRESSION / export PDF : les livrables de conformité (Déclaration
   d'Applicabilité, programme NIS2 / Budget Cybersécurité, dashboard) doivent sortir sur fond
   BLANC avec texte foncé — jamais un fond quasi-noir encré, coûteux et illisible. On force les
   tokens de fond/texte/bordure en clair quel que soit le thème actif ; les composants qui
   dérivent leur fond de ces tokens redeviennent clairs sans règle par élément. */
@media print {
  body.theme-dark,
  body[class*="theme-"] {
    --color-background: #ffffff;
    --color-surface: #ffffff;
    --color-surface-secondary: #f5f5f5;
    --color-text: #111827;
    --color-text-light: #374151;
    --color-text-secondary: #4b5563;
    --color-border: #d1d5db;
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: none;
  }
  body.theme-dark,
  html:has(body.theme-dark) {
    background: #ffffff !important;
    color: #111827 !important;
  }
}

/* (audit global 2026-07-03, MAJEUR) Badge de STATUT d'action dans le plan d'actions —
   le statut pilotait les KPI mais n'était jamais visible/filtrable dans la table. */
.status-badge.status-action--planifie { background-color: rgba(148, 163, 184, 0.16); color: var(--color-text-secondary); }
.status-badge.status-action--en_cours { background-color: rgba(31, 184, 205, 0.14); color: var(--color-text); }
.status-badge.status-action--termine  { background-color: rgba(50, 192, 134, 0.16); color: var(--color-text); }

/* Dashboard multi-entités — mode consolidé */
.dashboard-view-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}
.dashboard-view-switch__label {
  padding: 0 var(--spacing-xs);
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--color-text-secondary);
}
.dashboard-view-switch__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 0;
  border-radius: var(--border-radius);
  padding: 7px 12px;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
}
.dashboard-view-switch__btn--active {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.dashboard-consolidated-note {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin: 0 0 var(--spacing-lg);
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid rgba(31, 184, 205, 0.22);
  border-radius: var(--border-radius-lg);
  background: rgba(31, 184, 205, 0.08);
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}
.dashboard--consolidated .score-global,
.dashboard--consolidated .dashboard-activity,
.dashboard--consolidated .kpi-card[data-nav-target="controls"],
.dashboard--consolidated .chart-row,
.dashboard--consolidated .charts-grid {
  display: none;
}
.dashboard--consolidated .kpi-sparkline,
.dashboard--consolidated .kpi-card__detail {
  display: none;
}
.dashboard-maturity-panel {
  margin: var(--spacing-xl) 0;
  padding: var(--spacing-lg);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-xl);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}
.dashboard-maturity-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}
.dashboard-maturity-panel h3 {
  margin: 0 0 4px;
  color: var(--color-text);
}
.dashboard-maturity-panel p {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}
.dashboard-maturity-table td,
.dashboard-maturity-table th {
  white-space: nowrap;
}
/* Le panorama remonte en tête du dashboard : première marge réduite pour qu'il
   se cale sous la note « lecture seule » sans creuser un blanc en haut de page. */
.dashboard--consolidated .dashboard-maturity-panel {
  margin-top: 0;
}
/* Tonalités du panorama — tokens LOCAUX, calibrés pour le contraste (WCAG AA,
   >= 4.5:1 sur le fond réel de chaque thème). Les tokens globaux --color-*-dark
   ne conviennent pas ici : --color-warning-dark (#db9f61) tombe à 2,3:1 sur fond
   clair, et --color-danger-dark (#bb3030) à 1,8:1 sur le fond sombre (il n'est
   redéfini par aucun thème sombre). Le panorama affiche des chiffres de pilotage
   en tête de tableau de bord : ils doivent rester lisibles partout.
   Les thèmes « bleu » et « poudre » gardent --color-surface: #ffffff : les
   valeurs claires ci-dessous les couvrent aussi. */
.dashboard-maturity-panel {
  --panorama-tone-low: #a32424;      /* 7,4:1 sur #fff — 6,7:1 sur #f2f3f5 */
  --panorama-tone-mid: #7d5210;      /* 6,8:1 — 6,1:1 */
  --panorama-tone-high: #17724c;     /* 5,9:1 — 5,3:1 */
  --panorama-tone-accent: #146b78;   /* 6,2:1 — 5,6:1 */
  --panorama-soft-low: rgba(219, 69, 69, 0.13);
  --panorama-soft-mid: rgba(219, 159, 97, 0.22);
  --panorama-soft-accent: rgba(31, 184, 205, 0.14);
}
body.theme-dark .dashboard-maturity-panel {
  --panorama-tone-low: #fca5a5;      /* 7,7:1 sur #1e293b — 5,5:1 sur #334155 */
  --panorama-tone-mid: #ffc185;      /* 9,2:1 — 6,5:1 */
  --panorama-tone-high: #86efac;     /* 10,4:1 — 7,4:1 */
  --panorama-tone-accent: #5dd6e6;   /* 8,5:1 — 6,0:1 */
  --panorama-soft-low: rgba(248, 113, 113, 0.2);
  --panorama-soft-mid: rgba(251, 191, 36, 0.18);
  --panorama-soft-accent: rgba(60, 200, 218, 0.18);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .dashboard-maturity-panel {
    --panorama-tone-low: #fca5a5;    /* 6,3:1 sur #2d3748 — 5,1:1 sur #38465a */
    --panorama-tone-mid: #ffc185;    /* 7,6:1 — 6,0:1 */
    --panorama-tone-high: #86efac;   /* 8,5:1 — 6,8:1 */
    --panorama-tone-accent: #5dd6e6; /* 7,0:1 — 5,6:1 */
    --panorama-soft-low: rgba(248, 113, 113, 0.2);
    --panorama-soft-mid: rgba(251, 191, 36, 0.18);
    --panorama-soft-accent: rgba(60, 200, 218, 0.18);
  }
}
/* `data-table` n'existe dans AUCUNE feuille de style : le tableau se retrouvait
   sans style de base (cellules à 1px de padding, aucun séparateur de ligne). Le
   markup porte désormais `.table`, le style de tableau de l'application ; les
   règles ci-dessous ne font que l'ajuster. Le <th> triable annule son padding au
   profit de celui du bouton, qui doit couvrir toute la zone cliquable. */
.dashboard-maturity-table th.csi-sortable {
  padding: 0;
}
/* La tuile « Vue groupe » (activité des sous-entités) et le panorama diraient la
   même chose deux fois : en vue consolidée, le panorama fait autorité. La tuile
   reste affichée en vue « Périmètre courant », où le panorama est masqué. */
.dashboard--consolidated #csi-group-tile {
  display: none;
}
.dashboard-group-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
}
.group-chip {
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  background: var(--color-surface-secondary);
}
.group-chip__value {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}
.group-chip__label {
  margin-top: 2px;
  font-size: var(--font-size-xs);
  line-height: var(--line-height-tight);
  color: var(--color-text-secondary);
}
/* Les deux pastilles porteuses d'un signal négatif sont teintées de la même
   façon : n'en teinter qu'une faisait ressortir « Actions en retard » PLUS que
   « Risques Critiques », soit l'inverse de la hiérarchie de gravité. */
.group-chip--danger .group-chip__value { color: var(--panorama-tone-low); }
.group-chip--danger {
  border-color: var(--panorama-tone-low);
  background: var(--panorama-soft-low);
}
.group-chip--warning .group-chip__value { color: var(--panorama-tone-mid); }
.group-chip--warning {
  border-color: var(--panorama-tone-mid);
  background: var(--panorama-soft-mid);
}
/* L'entité à surveiller porte un NOM, pas un nombre : la pastille est plus large
   et son texte plus petit pour rester sur une ligne sans casser la grille. */
.group-chip--wide { grid-column: span 2; }
.group-chip--wide .group-chip__value {
  font-size: var(--font-size-md);
  line-height: var(--line-height-tight);
  white-space: normal;
}
.dashboard-maturity-table .entity-cell { white-space: normal; }
.entity-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--panorama-tone-accent);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.entity-link:hover { text-decoration: underline; }
.entity-link__kind {
  display: block;
  margin-top: 1px;
  font-size: var(--font-size-xs);
  font-weight: 400;
  color: var(--color-text-secondary);
}
.entity-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  margin-left: var(--spacing-xs);
  padding: 1px 7px;
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-xs);
  font-weight: 600;
  vertical-align: 1px;
}
.entity-tag--lock {
  background: var(--panorama-soft-accent);
  color: var(--panorama-tone-accent);
}
.entity-tag--idle {
  background: var(--panorama-soft-mid);
  color: var(--panorama-tone-mid);
}
.entity-ref small,
.entity-activity small,
.entity-score__sub {
  display: block;
  margin-top: 1px;
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
}
.entity-score {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  min-width: 132px;
}
.entity-score__value {
  min-width: 38px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.entity-score__bar {
  display: block;
  flex: 1;
  margin-bottom: 0;
}
/* Seuils partagés avec la jauge SMSI (rouge < 40, ambre 40-69, vert >= 70) :
   la couleur est portée par la classe du conteneur, jamais par du style inline.
   Double classe (spécificité 0,3,0) et propriété `background` en RACCOURCI :
   les thèmes bleu et poudre redéfinissent `.progress-bar__fill` avec un DÉGRADÉ
   en (0,2,1) — un simple background-color aurait été recouvert par l'image, et
   une spécificité (0,2,0) aurait perdu. Sans cela, les trois barres s'affichaient
   de la même couleur dans ces thèmes, en contradiction avec la légende. */
.entity-score.entity-score--low .entity-score__value { color: var(--panorama-tone-low); }
.entity-score.entity-score--low .progress-bar__fill { background: var(--color-danger); }
.entity-score.entity-score--mid .entity-score__value { color: var(--panorama-tone-mid); }
.entity-score.entity-score--mid .progress-bar__fill { background: var(--color-warning-dark); }
.entity-score.entity-score--high .entity-score__value { color: var(--panorama-tone-high); }
.entity-score.entity-score--high .progress-bar__fill { background: var(--color-success); }
.entity-signals {
  display: flex;
  gap: var(--spacing-xs);
}
.entity-signal {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: 2px 8px;
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-xs);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.entity-signal--danger { background: var(--panorama-soft-low); color: var(--panorama-tone-low); }
.entity-signal--warning { background: var(--panorama-soft-mid); color: var(--panorama-tone-mid); }
.entity-signal--neutral {
  background: var(--color-surface-secondary);
  color: var(--color-text-light);
  border: 1px solid var(--color-border);
}
/* Un compteur à zéro reste affiché (colonnes alignées, lecture comparative) mais
   s'efface visuellement : seul ce qui demande une action doit accrocher l'œil.
   La mise en retrait passe par une teinte NEUTRE et non par une opacité : ces
   zéros portent de l'information, et une opacité de 0,45 les faisait tomber
   sous 1,5:1 — illisibles, donc décoratifs, ce qu'ils ne sont pas. */
.entity-signal--zero {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-light);
  font-weight: 400;
}
.dashboard-maturity-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-md);
  margin: var(--spacing-sm) 0 0;
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
}
.score-legend {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.score-legend__dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 2px;
}
.score-legend__dot--low { background: var(--color-danger); }
.score-legend__dot--mid { background: var(--color-warning-dark); }
.score-legend__dot--high { background: var(--color-success); }
@media (max-width: 640px) {
  .group-chip--wide { grid-column: span 1; }
}
.entity-badge {
  display: inline-flex;
  align-items: center;
  max-width: 220px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(91, 141, 239, 0.12);
  color: var(--color-text);
  font-size: var(--font-size-xs);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
.csi-section-native--hidden {
  display: none !important;
}
.module--consolidated-read .module__actions {
  display: none !important;
}
.csi-section-viewbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-md);
  margin: 0 0 var(--spacing-md);
  padding: var(--spacing-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}
/* Toolbar v2 : quand la viewbar est immédiatement suivie d'une .section-toolbar,
   les deux blocs forment UNE seule carte (classes posées en JS dans
   _csiEnsureSectionViewBar — pas de :has, compat vieux navigateurs).
   La rangée « Vue » garde un fond légèrement différent pour rester distincte. */
.csi-section-viewbar--attached {
  margin-bottom: 0;
  border-bottom: 0;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  background: var(--color-surface-secondary);
}
.section-toolbar--attached {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-top: 1px dashed var(--color-border);
  box-shadow: none;
}

.csi-section-viewbar__left,
.csi-section-viewbar__filters {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  min-width: 0;
}
.csi-section-viewbar__filters {
  flex: 1;
  justify-content: flex-end;
}
.csi-section-viewbar__label {
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.csi-section-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: var(--border-radius);
  background: var(--color-surface-secondary);
  white-space: nowrap;
}
.csi-section-toggle__btn {
  border: 0;
  border-radius: var(--border-radius-sm);
  padding: 6px 10px;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 700;
  cursor: pointer;
}
.csi-section-toggle__btn--active {
  background: var(--color-surface);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}
.csi-readonly-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(31, 184, 205, 0.1);
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
  font-weight: 700;
  white-space: nowrap;
}
.csi-section-viewbar [data-csi-entity-filter] {
  max-width: 220px;
}
.csi-section-viewbar [data-csi-section-search] {
  max-width: 280px;
}
.csi-consolidated-section {
  display: block;
}
.csi-consolidated-banner,
.csi-consolidated-loading,
.csi-consolidated-error {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin: 0 0 var(--spacing-md);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--border-radius-lg);
  font-size: var(--font-size-sm);
}
.csi-consolidated-banner {
  justify-content: space-between;
  border: 1px solid rgba(31, 184, 205, 0.22);
  background: rgba(31, 184, 205, 0.08);
  color: var(--color-text-secondary);
}
.csi-consolidated-banner span {
  flex: 1;
  min-width: 0;
}
.csi-consolidated-truncated {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--color-warning-dark);
  font-size: var(--font-size-xs);
  font-weight: 700;
  white-space: nowrap;
}
.csi-consolidated-related {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-md);
  margin: 0 0 var(--spacing-md);
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid rgba(142, 121, 180, 0.26);
  border-radius: var(--border-radius-lg);
  background: linear-gradient(135deg, rgba(142, 121, 180, 0.08), rgba(31, 184, 205, 0.06));
}
.csi-consolidated-related__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.csi-consolidated-related__text strong {
  color: var(--color-text);
  font-size: var(--font-size-sm);
}
.csi-consolidated-related__text span {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}
.csi-consolidated-loading {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
}
.csi-consolidated-error {
  border: 1px solid rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.08);
  color: var(--color-danger);
}
.csi-consolidated-tablewrap {
  margin-top: 0;
}
.csi-consolidated-table th,
.csi-consolidated-table td {
  vertical-align: middle;
}
.csi-actions-col,
.csi-consolidated-actions {
  width: 1%;
  white-space: nowrap;
}
.csi-consolidated-actions .btn {
  white-space: nowrap;
}
@media (max-width: 900px) {
  .module__header--dashboard {
    align-items: stretch;
    gap: var(--spacing-sm);
  }
  .dashboard-view-switch {
    width: 100%;
    justify-content: space-between;
    white-space: normal;
  }
  .dashboard-view-switch__btn {
    flex: 1;
  }
  .csi-section-viewbar {
    align-items: stretch;
    flex-direction: column;
  }
  .csi-section-viewbar__left,
  .csi-section-viewbar__filters {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .csi-section-viewbar [data-csi-entity-filter],
  .csi-section-viewbar [data-csi-section-search] {
    max-width: none;
    flex: 1 1 220px;
  }
  .csi-consolidated-related {
    align-items: stretch;
    flex-direction: column;
  }
  .csi-consolidated-related .btn {
    justify-content: center;
    width: 100%;
  }
}

/* === CSI-BUILD === Bandeau « nouvelle version disponible » (contrôle de fraîcheur du
   client au presence-ping). Discret, en bas à droite, suit les thèmes via variables. */
.update-banner {
  position: fixed;
  right: var(--spacing-lg);
  bottom: var(--spacing-lg);
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-warning-dark);
  border-left: 4px solid var(--color-warning-dark);
  border-radius: 8px;
  box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,.15));
  max-width: 420px;
  font-size: 0.9rem;
}
.update-banner__close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text);
  opacity: .6;
  font-size: 1rem;
  line-height: 1;
  padding: 2px 4px;
}
.update-banner__close:hover { opacity: 1; }

/* === RA-UX (B2) === Critères d'acceptation du risque (ISO 27005) */
.ra-tg-cell--beyond {
  outline: 2px dashed var(--color-danger, #b91c1c); /* FIX-REVUE RA-UX : affordance danger tokenisée */
  outline-offset: -3px;
}
.ra-acceptance-flag {
  color: var(--color-danger, #dc2626);
  margin-left: 4px;
}
.ra-acceptance-banner {
  background: rgba(220, 38, 38, 0.08);
  border-color: var(--color-danger, #dc2626);
  color: var(--color-danger, #b91c1c);
}
.ra-threshold-acceptance {
  margin: var(--spacing-md) 0;
}
.ra-threshold-acceptance__fields {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
  margin-top: var(--spacing-xs);
}
.ra-threshold-acceptance__fields select,
.ra-threshold-acceptance__fields input {
  flex: 1;
  min-width: 220px;
}

/* === RA-UX (B4) === objectifs de sécurité C/I/A par risque et par contrôle */
.ra-cia-targets {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  flex-wrap: wrap;
}
.ra-cia-targets .ra-form-label {
  margin: 0 var(--spacing-xs) 0 0;
}
.ra-cia-chip {
  min-width: 30px;
  padding: 2px 8px;
  border: 2px solid var(--color-border, #d1d5db); /* FIX-REVUE RA-UX : aligné sur .ra-answer-btn */
  border-radius: var(--border-radius-full, 999px);
  background: var(--color-surface, #ffffff);
  color: var(--color-text-secondary, #6b7280);
  font-weight: 600;
  cursor: pointer;
}
.ra-cia-chip:hover:not(:disabled) {
  border-color: var(--color-primary, #1fb8cd);
  color: var(--color-primary, #1fb8cd);
}
.ra-cia-chip--active {
  background: var(--color-primary, #1fb8cd);
  border-color: var(--color-primary, #1fb8cd);
  color: var(--color-surface, #ffffff); /* FIX-REVUE RA-UX : lisible même si le thème éclaircit la primaire */
}
.ra-cia-chip:disabled {
  opacity: 0.55;
  cursor: default;
}
.ra-cia-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: var(--border-radius-full, 999px);
  /* FIX-REVUE RA-UX : motif « teinte primaire » de la maison (cf. .ra-status-badge--planned),
     pas la couleur pleine --color-secondary (contraste illisible) ; taille tokenisée. */
  background: rgba(31, 184, 205, 0.14);
  color: var(--color-primary-dark, #12707e);
  font-size: var(--font-size-xs, 0.75rem);
  font-weight: 700;
  vertical-align: middle;
}


/* === FIX-AUDIT-UX (audit 2026-08-25) — thème sombre : bannières du module Analyse de
   risques. body.theme-dark redéfinit --color-danger/-warning mais AUCUNE variante -dark,
   d'où un texte à ~2,1-2,6:1 (échec AA). Le :not(.ra-acceptance-banner) est IMPÉRATIF :
   la bannière de plancher d'acceptation porte les deux classes. === */
body.theme-dark .ra-proj-banner--covered {
  color: var(--color-danger-light, #fca5a5);
  border-color: var(--color-danger-light, #fca5a5);
}
body.theme-dark .ra-proj-banner--uncovered {
  color: var(--color-warning, #fbbf24);
  border-color: var(--color-warning, #fbbf24);
}
body.theme-dark .ra-planned-banner:not(.ra-acceptance-banner) {
  color: #93c5fd;
}
body.theme-dark .ra-proj-orphan-flag,
body.theme-dark .ra-proj-hint--amber,
body.theme-dark .ra-proj-close--gap {
  color: var(--color-warning, #fbbf24);
}
body.theme-dark .ra-proj-close--ok {
  color: var(--color-success, #4ade80);
}
/* Carte de risque basculée « non applicable » : l'état doit être VISIBLE (le 1er clic
   sur une carte sélectionnée passe en NA, le 2e supprime — audit 2026-08-25). */
.ra-risk-card--na {
  opacity: 0.55;
}
.ra-risk-card--na .ra-risk-card__na-badge {
  display: inline-block;
  margin-left: var(--spacing-xs);
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--color-surface-secondary);
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
  font-weight: 600;
}
