/* 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;
  --color-text: #2d3e4a;
  --color-text-light: #5a6a77;
  --color-text-secondary: #758592;
  --color-border: #e9ecef;

  --border-radius-sm: 0.25rem;
  --border-radius: 0.5rem;
  --border-radius-lg: 0.75rem;

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

  /* 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 */
@media (prefers-color-scheme: dark) {
  :root {
    --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: #fff;
}

/* Focus visible for accessibility */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.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);
}

.header__content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 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);
}
.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: 4px;
}

.header__actions {
  display: flex;
  gap: var(--spacing-sm);
}

/* Theme toggle button */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  border: 1px solid var(--color-border);
  background: linear-gradient(135deg, #f4f7fb 0%, #e7ecf3 100%);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
}

.theme-toggle i {
  font-size: var(--font-size-sm);
}

.theme-toggle--dark {
  background: linear-gradient(135deg, #1e293b 0%, #111827 100%);
  color: #e5e7eb;
  border-color: rgba(255, 255, 255, 0.12);
}

.theme-toggle--dark:hover {
  color: #fff;
}

/* 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;
}
.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;
}
.global-search__type {
  font-size: var(--font-size-xs);
  color: var(--color-text-light);
  text-transform: uppercase;
}
.global-search__module {
  font-size: var(--font-size-sm);
  color: var(--color-primary);
}

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

/* Read-only banner */
.mode-banner {
  background: linear-gradient(90deg, #fdf6e3, #f4e9cf);
  border-bottom: 1px solid var(--color-border);
  padding: var(--spacing-sm) var(--spacing-lg);
  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, #e6f7f1, #d4f2e8);
}

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

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

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

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);
}

body.theme-dark .theme-toggle {
  border-color: rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, #1e293b 0%, #111827 100%);
  color: #e5e7eb;
}

.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: 2px;
}
.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: 2px 8px;
  border-radius: 999px;
  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: #0e7490;
}
.history-item__tag--auto {
  border-color: rgba(124, 58, 237, 0.2);
  color: #7c3aed;
}
.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);
}

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;
}

/* =============================================================================
   THEME MODERNE - Design contemporain et dynamique
   ============================================================================= */

body.theme-moderne {
  /* Couleurs principales - Rose moderne vivifié */
  --color-primary: #c06c6d;
  --color-primary-light: #d4787a;
  --color-primary-dark: #a85a5b;

  /* Accent corail pour CTA et éléments interactifs */
  --color-accent: #e08f7e;
  --color-accent-light: #f0a999;
  --color-accent-dark: #c77a6a;

  /* Secondaire - Bleu-gris moderne */
  --color-secondary: #7a9aa8;
  --color-secondary-light: #a8c4cf;
  --color-secondary-dark: #5a7a88;

  /* Couleurs sémantiques rafraîchies */
  --color-success: #5cb88a;
  --color-success-light: #7fd4a6;
  --color-success-dark: #489b71;
  --color-warning: #e5a55c;
  --color-warning-light: #f2c88a;
  --color-warning-dark: #c78d45;
  --color-danger: #d45858;
  --color-danger-light: #e88080;
  --color-danger-dark: #b84242;
  --color-info: #5a9ec7;
  --color-info-light: #7fb8db;
  --color-info-dark: #4282a8;

  /* Backgrounds - Tons chauds épurés */
  --color-background: #faf7f5;
  --color-surface: #ffffff;
  --color-surface-secondary: #f5f0ed;

  /* Textes - Contraste amélioré */
  --color-text: #3d3535;
  --color-text-light: #6b6363;
  --color-text-secondary: #8a8282;
  --color-border: #e8ddd8;

  /* Border radius modernes */
  --border-radius-sm: 0.5rem;
  --border-radius: 1rem;
  --border-radius-lg: 1.5rem;

  /* Ombres avec teinte chaude */
  --shadow-sm: 0 2px 4px rgba(192, 108, 109, 0.06), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 8px 24px rgba(192, 108, 109, 0.10), 0 4px 8px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 20px 48px rgba(192, 108, 109, 0.12), 0 8px 16px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 32px 64px rgba(192, 108, 109, 0.14), 0 16px 32px rgba(0, 0, 0, 0.06);
  --shadow-glow: 0 0 30px rgba(192, 108, 109, 0.20);
  --shadow-glow-accent: 0 0 25px rgba(224, 143, 126, 0.25);

  /* Typography - Plus Jakarta Sans pour modernité */
  --font-family: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;

  /* Typographie raffinée */
  --line-height-tight: 1.2;
  --line-height-normal: 1.6;
  --line-height-relaxed: 1.75;
  --letter-spacing-tight: -0.03em;
  --letter-spacing-normal: -0.01em;
  --letter-spacing-wide: 0.02em;

  /* Gradients modernes */
  --gradient-primary: linear-gradient(135deg, #d4787a 0%, #c06c6d 50%, #a85a5b 100%);
  --gradient-accent: linear-gradient(135deg, #f0a999 0%, #e08f7e 50%, #c77a6a 100%);
  --gradient-warm: linear-gradient(135deg, #ffffff 0%, #f5f0ed 100%);
  --gradient-surface: linear-gradient(180deg, #ffffff 0%, #faf7f5 100%);
}

/* Background avec gradient subtil animé */
body.theme-moderne {
  background:
    radial-gradient(ellipse at 15% 20%, rgba(192, 108, 109, 0.08), transparent 50%),
    radial-gradient(ellipse at 85% 10%, rgba(122, 154, 168, 0.10), transparent 55%),
    radial-gradient(ellipse at 90% 85%, rgba(224, 143, 126, 0.08), transparent 50%),
    linear-gradient(180deg, #ffffff 0%, #faf7f5 40%, #f5f0ed 100%);
  background-attachment: fixed;
}

/* Header moderne */
body.theme-moderne .header {
  background: var(--gradient-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

body.theme-moderne .header__title {
  font-weight: 700;
  letter-spacing: var(--letter-spacing-tight);
}

body.theme-moderne .header__subtitle {
  color: var(--color-secondary);
  font-weight: 500;
}

/* Boutons modernes avec gradients */
body.theme-moderne .btn-primary,
body.theme-moderne .btn--primary {
  background: var(--gradient-primary);
  border: none;
  box-shadow: var(--shadow-sm);
  font-weight: 600;
  letter-spacing: var(--letter-spacing-normal);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body.theme-moderne .btn-primary:active,
body.theme-moderne .btn--primary:active {
  transform: translateY(0);
}

/* Boutons secondaires */
body.theme-moderne .btn-secondary,
body.theme-moderne .btn--secondary {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Cards modernes */
body.theme-moderne .card,
body.theme-moderne .panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.theme-moderne .card:hover,
body.theme-moderne .panel:hover {
  border-color: var(--color-primary-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Navigation moderne */
body.theme-moderne .nav__item--active::after {
  background: var(--gradient-primary);
  height: 3px;
  border-radius: 3px 3px 0 0;
}

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

/* Inputs modernes */
body.theme-moderne .form-control,
body.theme-moderne input[type="text"],
body.theme-moderne input[type="email"],
body.theme-moderne input[type="password"],
body.theme-moderne input[type="number"],
body.theme-moderne select,
body.theme-moderne textarea {
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body.theme-moderne .form-control:focus,
body.theme-moderne input:focus,
body.theme-moderne select:focus,
body.theme-moderne textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(192, 108, 109, 0.15);
  outline: none;
}

/* Badges modernes */
body.theme-moderne .badge,
body.theme-moderne .tag {
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 999px;
}

body.theme-moderne .badge-primary {
  background: rgba(192, 108, 109, 0.12);
  color: var(--color-primary-dark);
}

body.theme-moderne .badge-success {
  background: rgba(92, 184, 138, 0.12);
  color: var(--color-success-dark);
}

body.theme-moderne .badge-warning {
  background: rgba(229, 165, 92, 0.12);
  color: var(--color-warning-dark);
}

body.theme-moderne .badge-danger {
  background: rgba(212, 88, 88, 0.12);
  color: var(--color-danger-dark);
}

/* Tables modernes */
body.theme-moderne .table th {
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}

body.theme-moderne .table tbody tr {
  transition: all 0.15s ease;
}

body.theme-moderne .table tbody tr:hover {
  background: var(--color-surface-secondary);
}

body.theme-moderne .table tbody tr:hover td:first-child {
  box-shadow: inset 3px 0 0 var(--color-primary);
}

/* Progress bars avec gradient */
body.theme-moderne .progress-bar,
body.theme-moderne .progress__fill {
  background: var(--gradient-primary);
  border-radius: 999px;
}

/* 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); }
}

body.theme-moderne .module--active {
  animation: moderne-fade-in 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

body.theme-moderne .modal__content {
  animation: moderne-scale-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body.theme-moderne ::-webkit-scrollbar-track {
  background: var(--color-surface-secondary);
  border-radius: 4px;
}

body.theme-moderne ::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}

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

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

/* Selection moderne */
body.theme-moderne ::selection {
  background-color: rgba(192, 108, 109, 0.25);
  color: var(--color-text);
}

/* =============================================================================
   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 */
body.theme-bleu .table th {
  background: var(--color-surface-secondary);
  color: var(--color-secondary);
  border-bottom: 2px solid var(--color-primary);
}

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

/* 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: 4px;
}

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 .global-search {
  background-color: rgba(245, 247, 250, 0.95);
  border-bottom-color: rgba(0, 0, 179, 0.15);
  box-shadow: var(--shadow-sm);
  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: 0.25rem;
  padding: 0.5rem 0;
}

body.theme-bleu .nav__item {
  border-radius: 0.625rem;
  padding: 0.5rem 1rem;
  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: 1rem;
  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);
}

/* Boutons complets */
body.theme-bleu .btn {
  background-color: var(--color-surface);
  border-color: var(--color-border);
  border-radius: 0.75rem;
  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: 0.75rem;
  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: 0.75rem;
  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: 0.75rem;
  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: 0.75rem;
  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);
}

/* Formulaires complets */
body.theme-bleu .form-control {
  background-color: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: 0.75rem;
  padding: 0.625rem 1rem;
  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);
  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: 1.25rem;
  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: 0.75rem;
  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: 1.25rem;
  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 .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: 0.5rem;
}

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;
}

/* 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__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);
}

/* 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 {
  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: var(--spacing-md);
  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;
  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: 16px;
  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: #22c55e;
  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: 28px;
  font-weight: 800;
  text-anchor: middle;
  dominant-baseline: middle;
}

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

.score-global__details {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.score-global__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  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: 50%;
  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: 16px;
  padding: var(--spacing-md);
  display: flex;
  flex-direction: column;
  min-height: 140px;
}

.dashboard-alerts__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  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: 0.875rem;
}

.dashboard-alerts__list {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.5rem;
  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: 0.5rem;
  padding: 0.375rem 0.625rem;
  background: var(--color-surface);
  border-radius: 8px;
  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: 5px;
  display: grid;
  place-items: center;
  font-size: 0.625rem;
  flex-shrink: 0;
}

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

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

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

.alert-item__icon--purple {
  background: rgba(139, 92, 246, 0.15);
  color: #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 0.5rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--color-text-light);
}

/* ========================================
   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: 14px;
  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: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--kpi-accent, var(--color-primary)), rgba(0, 0, 0, 0.15));
  color: #ffffff;
  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: #000;
  font-weight: 700;
}

.kpi-card__value {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
  margin: 2px 0 0;
}

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

/* KPI Value avec Sparkline */
.kpi-card__value-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.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: 2px;
  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 .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: 0.75rem 1rem 0.5rem;
}

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

.chart-card--compact .chart-card__content {
  padding: 0.5rem 1rem 1rem;
  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: 0.5rem;
  padding: 0.5rem 0.75rem 0.75rem;
  font-size: 0.65rem;
}

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

.chart-mini-legend__dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  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: 0.65rem;
  font-weight: 600;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  margin-left: 0.5rem;
}

.kpi-card__trend--up {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}

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

.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: 0.5rem;
  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: 0.75rem;
  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: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 0.7rem;
}

.activity-item__icon--control { background: rgba(34, 197, 94, 0.15); color: #16a34a; }
.activity-item__icon--action { background: rgba(245, 158, 11, 0.15); color: #d97706; }
.activity-item__icon--risk { background: rgba(239, 68, 68, 0.15); color: #dc2626; }
.activity-item__icon--audit { background: rgba(59, 130, 246, 0.15); color: #2563eb; }
.activity-item__icon--doc { background: rgba(139, 92, 246, 0.15); color: #7c3aed; }
.activity-item__icon--nc { background: rgba(236, 72, 153, 0.15); color: #db2777; }

.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: 2rem;
  color: var(--color-text-light);
  text-align: center;
}

.activity-empty i {
  font-size: 2rem;
  opacity: 0.3;
  margin-bottom: 0.5rem;
}

/* Filtres temporels */
.chart-card__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.chart-filter {
  padding: 0.25rem 0.625rem;
  font-size: 0.65rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--color-text-light);
  border-radius: 4px;
  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: 0.5rem;
}

/* 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: 4px;
}

.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: 8px 10px;
  border-radius: 10px;
  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: 8px;
}

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

.actions-legend__label {
  font-weight: 700;
  font-size: 13px;
}

.actions-legend__value {
  font-size: 12px;
  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: 800px) {
  .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: 4px;
}

.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%;
}

.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--radar-program .chart-card__content {
  height: 468px;
  max-height: 468px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chart-card--radar-program canvas {
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  max-height: 100%;
}

.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: 50%;
  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);
  overflow: hidden;
  overflow-x: auto;
}

.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: 0.5rem;
  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 0.5rem;
  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: 4px;
}

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

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

/* Document Review table layout */
#docReviewTable th:nth-child(1),
#docReviewTable td:nth-child(1) {
  width: 15%;
}

#docReviewTable th:nth-child(2),
#docReviewTable td:nth-child(2) {
  width: 35%;
}

#docReviewTable th:nth-child(3),
#docReviewTable td:nth-child(3),
#docReviewTable th:nth-child(4),
#docReviewTable td:nth-child(4) {
  width: 25%;
}

#docReviewTable .table-section td {
  background-color: rgba(0, 0, 0, 0.03);
  font-weight: 600;
}

#controlsTable th:nth-child(1),
#controlsTable td:nth-child(1) {
  width: 8%;
}

#controlsTable th:nth-child(3),
#controlsTable td:nth-child(3) {
  width: 40%;
  font-size: var(--font-size-sm);
}


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

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  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: 0.25rem;
  font-size: 0.7rem;
}

/* 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: 0.25rem;
  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: 50%;
  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: 0.25rem;
  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: #000;
}

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

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

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

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

/* SoA Risks column */
.soa-risks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  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 0.5rem;
  border-radius: 1rem;
  font-size: var(--font-size-xs);
  font-weight: 500;
  white-space: nowrap;
}

.soa-risks__badge--critique {
  background-color: rgba(219, 69, 69, 0.15);
  color: #bb3030;
}

.soa-risks__badge--grave {
  background-color: rgba(219, 177, 69, 0.15);
  color: #a68a1b;
}

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

.soa-risks__badge--mineur {
  background-color: rgba(50, 192, 134, 0.15);
  color: #27a06d;
}

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

.soa-edit-risks {
  padding: 0.25rem 0.5rem;
  font-size: var(--font-size-xs);
  margin-left: 0.25rem;
}

.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-md);
  margin-bottom: var(--spacing-md);
  align-items: center;
}

.soa-coverage__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  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: 4px;
  overflow: hidden;
  margin: 0 0.75rem;
}

.soa-coverage__fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.soa-coverage__fill--good { background: linear-gradient(90deg, #22c55e, #16a34a); }
.soa-coverage__fill--medium { background: linear-gradient(90deg, #f59e0b, #d97706); }
.soa-coverage__fill--low { background: linear-gradient(90deg, #ef4444, #dc2626); }

.soa-coverage__item--domains {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.soa-domain-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.25rem 0.5rem;
}

.soa-domain-stat__label {
  font-size: 0.7rem;
  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: 0.25rem 0.5rem;
  border-radius: var(--border-radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge--organisationnel { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.badge--humain { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.badge--physique { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.badge--technologique { background: rgba(249, 115, 22, 0.15); color: #f97316; }

/* Contenu contrôle dans SOA */
.soa-control-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

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

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

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

.mt-1 { margin-top: 0.5rem; }

/* 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);
}

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

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

.table--soa td {
  padding: 0.4rem;
  vertical-align: middle;
}

/* Colonne justification plus étroite */
.table--soa .soa-justification {
  font-size: var(--font-size-xs);
  min-height: 50px;
  resize: vertical;
}

/* ============================================================
   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-md);
  margin-bottom: var(--spacing-md);
  align-items: center;
}

.doc-review-stats__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  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: 1.25rem;
}

.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: 0.75rem;
  flex: 1;
  min-width: 200px;
  padding: 0.5rem 1rem;
  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: 4px;
  overflow: hidden;
}

.doc-review-stats__fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.doc-review-stats__fill--good { background: linear-gradient(90deg, #22c55e, #16a34a); }
.doc-review-stats__fill--medium { background: linear-gradient(90deg, #f59e0b, #d97706); }
.doc-review-stats__fill--low { background: linear-gradient(90deg, #ef4444, #dc2626); }

.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: 0.25rem;
  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 {
  width: 100%;
  min-width: 200px;
  max-width: 100%;
  min-height: 70px;
  resize: vertical;
  font-size: var(--font-size-sm);
  padding: 0.5rem 0.75rem;
  line-height: 1.4;
  box-sizing: border-box;
}

/* Tableau SoA - largeurs de colonnes pour la nouvelle structure */
.table--soa th:nth-child(1),
.table--soa td:nth-child(1) { width: 60px; min-width: 60px; } /* Réf */
.table--soa th:nth-child(2),
.table--soa td:nth-child(2) { width: 20%; min-width: 180px; } /* Contrôle */
.table--soa th:nth-child(3),
.table--soa td:nth-child(3) { width: 100px; min-width: 90px; } /* Domaine */
.table--soa th:nth-child(4),
.table--soa td:nth-child(4) { width: 130px; min-width: 120px; } /* Applicabilité */
.table--soa th:nth-child(5),
.table--soa td:nth-child(5) { width: 140px; min-width: 130px; } /* Source */
.table--soa th:nth-child(6),
.table--soa td:nth-child(6) { width: 130px; min-width: 120px; } /* État */
.table--soa th:nth-child(7),
.table--soa td:nth-child(7) { width: 140px; min-width: 130px; } /* Risques */
.table--soa th:nth-child(8),
.table--soa td:nth-child(8) { width: auto; min-width: 180px; } /* Justification */

/* Tableau Document Review - largeurs de colonnes pour la nouvelle structure */
.table--doc-review th:nth-child(1),
.table--doc-review td:nth-child(1) { width: 80px; min-width: 70px; } /* Clause */
.table--doc-review th:nth-child(2),
.table--doc-review td:nth-child(2) { width: 25%; min-width: 180px; } /* Exigence */
.table--doc-review th:nth-child(3),
.table--doc-review td:nth-child(3) { width: 120px; min-width: 110px; } /* Statut */
.table--doc-review th:nth-child(4),
.table--doc-review td:nth-child(4) { width: 100px; min-width: 90px; } /* Responsable */
.table--doc-review th:nth-child(5),
.table--doc-review td:nth-child(5) { width: 18%; min-width: 150px; } /* Justification */
.table--doc-review th:nth-child(6),
.table--doc-review td:nth-child(6) { width: 18%; min-width: 150px; } /* Preuve */
.table--doc-review th:nth-child(7),
.table--doc-review td:nth-child(7) { width: 110px; min-width: 100px; } /* Dates */

/* 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;
}

/* 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 - nouvelles colonnes */
.table--controls th:nth-child(1),
.table--controls td:nth-child(1) { width: 60px; min-width: 55px; } /* Réf */
.table--controls th:nth-child(2),
.table--controls td:nth-child(2) { width: 25%; min-width: 180px; } /* Contrôle + Attrs */
.table--controls th:nth-child(3),
.table--controls td:nth-child(3) { width: 100px; min-width: 90px; } /* Attributs */
.table--controls th:nth-child(4),
.table--controls td:nth-child(4) { width: 100px; min-width: 85px; } /* Propriétaire */
.table--controls th:nth-child(5),
.table--controls td:nth-child(5) { width: 90px; min-width: 80px; } /* Statut */
.table--controls th:nth-child(6),
.table--controls td:nth-child(6) { width: 100px; min-width: 90px; } /* Maturité */
.table--controls th:nth-child(7),
.table--controls td:nth-child(7) { width: 90px; min-width: 80px; } /* Date éval */
.table--controls th:nth-child(8),
.table--controls td:nth-child(8) { width: 80px; min-width: 70px; } /* Preuves */

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

.control-attrs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.control-capability {
  font-size: 0.7rem;
  color: var(--color-text-light);
  background: var(--color-bg-secondary);
  padding: 2px 6px;
  border-radius: 3px;
}

.control-attrs-col {
  font-size: var(--font-size-xs);
}

.control-attr-row {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 3px;
}

.attr-label {
  color: var(--color-text-light);
}

.attr-value {
  font-weight: 500;
}

/* CMM Badges */
.cmm-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
}

.cmm-badge--initial { background: #fee2e2; color: #991b1b; }
.cmm-badge--repetable, .cmm-badge--répétable { background: #ffedd5; color: #c2410c; }
.cmm-badge--defini, .cmm-badge--défini { background: #fef9c3; color: #854d0e; }
.cmm-badge--gere, .cmm-badge--géré { background: #dcfce7; color: #166534; }
.cmm-badge--optimise, .cmm-badge--optimisé { background: #dbeafe; color: #1e40af; }

/* Efficacité */
.effectiveness {
  font-size: 0.7rem;
  margin-top: 4px;
  padding: 2px 4px;
  border-radius: 3px;
}

.effectiveness--good { background: #dcfce7; color: #166534; }
.effectiveness--medium { background: #fef9c3; color: #854d0e; }
.effectiveness--bad { background: #fee2e2; color: #991b1b; }
.effectiveness--neutral { background: #f1f5f9; color: #64748b; }

/* Preuves */
.evidence-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.evidence-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  color: #22c55e;
  cursor: help;
}

.evidence-indicator i { font-size: 0.8rem; }

.no-evidence {
  color: var(--color-text-light);
  font-size: 0.8rem;
}

.kpi-ref {
  color: #3b82f6;
  font-size: 0.8rem;
  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;
}
.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 filters */
.project-risks__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

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

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

.project-risks__filter--search {
  flex: 1 1 260px;
}

.project-risks__filter--checkbox {
  min-width: auto;
}

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

.project-risk-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--color-border);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.04);
  flex: 0 0 10px;
}

.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;
}

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

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

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

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

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

.critical-assets-table th:nth-child(1),
.critical-assets-table td:nth-child(1) {
  width: 80px;
  text-align: center;
}

.asset-priority {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  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: 999px;
  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: 999px;
  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: 4px;
}
.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: 2px;
}

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);
}

/* 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: 0.25rem;
  color: var(--color-text-muted, #6c757d);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-sm, 0.25rem);
  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 {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-sm) var(--spacing-md);
  font-weight: 500;
  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;
  transition: all var(--transition-duration) ease;
}

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

.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--outline {
  background-color: transparent;
  border: 1px solid var(--color-border);
}

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

.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;
  transition: opacity var(--transition-duration) ease, visibility var(--transition-duration) ease;
}

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

.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: 24px;
  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: 999px;
  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: 6px 12px;
  border-radius: 999px;
  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 {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(31, 184, 205, 0.2);
}

.language-option__flag {
  font-size: 2rem;
}

.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);
  backdrop-filter: blur(8px);
}

.wizard-overlay.is-visible {
  opacity: 1;
}

.wizard-modal {
  background: var(--color-surface);
  border-radius: 20px;
  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: 2px;
  overflow: hidden;
  margin-bottom: var(--spacing-md);
}

.wizard-progress__bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-success));
  border-radius: 2px;
  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: 50%;
  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: 1.5rem;
}

.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: 2rem;
}

.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: 50%;
  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: 10px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.wizard-feature__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.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: 12px;
  background: var(--color-surface-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  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: 4px;
}

.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: 4px 10px;
  border-radius: 12px;
  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);
}

/* 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);
}

/* ============================================================
   License Upload Modal
   ============================================================ */

.license-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.2s ease;
}

.license-modal {
  width: 90%;
  max-width: 500px;
  background: var(--color-surface, #ffffff);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.license-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
}

.license-modal__header h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.license-modal__header i {
  font-size: 1.1rem;
}

.license-modal__close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.2s;
}

.license-modal__close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.license-modal__body {
  padding: 24px;
}

.license-modal__intro {
  margin: 0 0 20px;
  color: var(--color-text-secondary, #6c757d);
  font-size: 0.95rem;
  line-height: 1.5;
}

.license-modal__intro code {
  background: var(--color-surface-raised, #f1f5f9);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--color-primary, #3b82f6);
}

.license-modal__dropzone {
  border: 2px dashed var(--color-border, #e0e0e0);
  border-radius: 12px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--color-surface-raised, #f8fafc);
}

.license-modal__dropzone:hover {
  border-color: var(--color-primary, #3b82f6);
  background: rgba(59, 130, 246, 0.05);
}

.license-modal__dropzone--dragover {
  border-color: var(--color-primary, #3b82f6);
  background: rgba(59, 130, 246, 0.1);
  transform: scale(1.02);
}

.license-modal__dropzone i {
  font-size: 2.5rem;
  color: var(--color-primary, #3b82f6);
  margin-bottom: 12px;
  display: block;
}

.license-modal__dropzone p {
  margin: 0;
  color: var(--color-text-secondary, #6c757d);
  font-size: 0.9rem;
  line-height: 1.5;
}

.license-modal__help {
  margin: 16px 0 0;
  padding: 12px 16px;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--color-text-secondary, #6c757d);
  display: flex;
  align-items: center;
  gap: 8px;
}

.license-modal__help i {
  color: var(--color-primary, #3b82f6);
}

.license-modal__help a {
  color: var(--color-primary, #3b82f6);
  text-decoration: underline;
}

.license-modal__help a:hover {
  text-decoration: none;
}

.license-modal__status {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
}

.license-modal__status--loading {
  background: #e0f2fe;
  color: #0369a1;
}

.license-modal__status--success {
  background: #dcfce7;
  color: #15803d;
}

.license-modal__status--error {
  background: #fee2e2;
  color: #b91c1c;
}

.license-modal__status--warning {
  background: #fef3c7;
  color: #b45309;
}

.license-modal__status-icon {
  font-size: 1.2rem;
}

.license-modal__status-text {
  flex: 1;
}

.license-modal__info {
  margin-top: 20px;
  padding: 16px;
  background: var(--color-surface-raised, #f8fafc);
  border-radius: 8px;
  border: 1px solid var(--color-border, #e0e0e0);
}

.license-modal__info h4 {
  margin: 0 0 12px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-secondary, #6c757d);
}

.license-modal__info dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  font-size: 0.9rem;
}

.license-modal__info dt {
  color: var(--color-text-secondary, #6c757d);
}

.license-modal__info dd {
  margin: 0;
  font-weight: 500;
  color: var(--color-text, #2d3e4a);
}

.license-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  background: var(--color-surface-raised, #f8fafc);
  border-top: 1px solid var(--color-border, #e0e0e0);
}

.license-modal__footer .btn {
  min-width: 120px;
}

/* Dark theme */
body.theme-dark .license-modal {
  background: var(--color-surface);
}

body.theme-dark .license-modal__dropzone {
  background: rgba(15, 23, 42, 0.3);
  border-color: rgba(148, 163, 184, 0.3);
}

body.theme-dark .license-modal__dropzone:hover {
  background: rgba(59, 130, 246, 0.1);
}

body.theme-dark .license-modal__intro code {
  background: rgba(15, 23, 42, 0.5);
}

body.theme-dark .license-modal__info {
  background: rgba(15, 23, 42, 0.3);
  border-color: rgba(148, 163, 184, 0.2);
}

body.theme-dark .license-modal__footer {
  background: rgba(15, 23, 42, 0.3);
  border-color: rgba(148, 163, 184, 0.2);
}

body.theme-dark .license-modal__help {
  background: rgba(15, 23, 42, 0.3);
}

/* ============================================================
   Server Sync Panel
   ============================================================ */

.sync-panel-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.sync-panel-overlay--visible {
  opacity: 1;
  visibility: visible;
}

.sync-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 380px;
  height: 100vh;
  background: var(--color-surface, #ffffff);
  border-left: 1px solid var(--color-border, #e0e0e0);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
  z-index: 10000;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}

.sync-panel--visible {
  right: 0;
}

.sync-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border, #e0e0e0);
  background: var(--color-surface-raised, #f8f9fa);
}

.sync-panel__header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text, #2d3e4a);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sync-panel__header h3 i {
  color: var(--color-primary, #3b82f6);
}

.sync-panel__close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-text-secondary, #6c757d);
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}

.sync-panel__close:hover {
  background: var(--color-surface-hover, #e9ecef);
  color: var(--color-text, #2d3e4a);
}

.sync-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.sync-panel__section {
  margin-bottom: 24px;
}

.sync-panel__section-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-secondary, #6c757d);
  margin-bottom: 12px;
}

.sync-panel__status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--color-surface-raised, #f8f9fa);
  border-radius: 8px;
  margin-bottom: 16px;
}

.sync-panel__status-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.sync-panel__status-icon--ok {
  background: #d4edda;
  color: #28a745;
}

.sync-panel__status-icon--syncing {
  background: #cce5ff;
  color: #3b82f6;
}

.sync-panel__status-icon--error {
  background: #f8d7da;
  color: #dc3545;
}

.sync-panel__status-text {
  flex: 1;
}

.sync-panel__status-label {
  font-weight: 600;
  color: var(--color-text, #2d3e4a);
  margin-bottom: 2px;
}

.sync-panel__status-detail {
  font-size: 0.85rem;
  color: var(--color-text-secondary, #6c757d);
}

.sync-panel__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sync-panel__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border: 1px solid var(--color-border, #e0e0e0);
  border-radius: 8px;
  background: var(--color-surface, #ffffff);
  color: var(--color-text, #2d3e4a);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.sync-panel__btn:hover:not(:disabled) {
  background: var(--color-surface-hover, #f8f9fa);
  border-color: var(--color-primary, #3b82f6);
}

.sync-panel__btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.sync-panel__btn--primary {
  background: var(--color-primary, #3b82f6);
  border-color: var(--color-primary, #3b82f6);
  color: white;
}

.sync-panel__btn--primary:hover:not(:disabled) {
  background: var(--color-primary-dark, #2563eb);
  border-color: var(--color-primary-dark, #2563eb);
}

.sync-panel__meta {
  margin-top: 16px;
  padding: 12px;
  background: var(--color-surface-raised, #f8f9fa);
  border-radius: 8px;
  font-size: 0.85rem;
}

.sync-panel__meta-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  color: var(--color-text-secondary, #6c757d);
}

.sync-panel__meta-row span:last-child {
  font-weight: 500;
  color: var(--color-text, #2d3e4a);
}

.sync-panel__footer {
  padding: 16px 20px;
  border-top: 1px solid var(--color-border, #e0e0e0);
  background: var(--color-surface-raised, #f8f9fa);
}

.sync-panel__footer-note {
  margin: 0;
  font-size: 0.8rem;
  color: var(--color-text-secondary, #6c757d);
  text-align: center;
}

@keyframes sync-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.sync-panel__status-icon--syncing i {
  animation: sync-spin 1s linear infinite;
}

/* Dark theme */
body.theme-dark .sync-panel {
  background: var(--color-surface, #1e1e1e);
  border-color: var(--color-border, #333);
}

body.theme-dark .sync-panel__header,
body.theme-dark .sync-panel__footer {
  background: var(--color-surface-raised, #252525);
}

body.theme-dark .sync-panel__status,
body.theme-dark .sync-panel__meta {
  background: var(--color-surface-raised, #252525);
}

/* 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: 12px;
  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);
}

.settings-meta {
  display: grid;
  gap: var(--spacing-xs);
  padding: var(--spacing-sm);
  border-radius: var(--border-radius);
  border: 1px dashed var(--color-border);
  background: var(--color-surface-secondary);
  font-size: var(--font-size-sm);
  color: var(--color-text);
}

.settings-sync-diagnostic {
  display: grid;
  gap: var(--spacing-sm);
  padding: var(--spacing-md);
  border-radius: var(--border-radius);
  border: 1px dashed var(--color-border);
  background: var(--color-surface-secondary);
}

.settings-sync-status {
  display: grid;
  gap: 6px;
  font-size: var(--font-size-sm);
  color: var(--color-text);
}

.settings-sync-status__note {
  color: var(--color-text-light);
  font-size: var(--font-size-xs);
}

.settings-sync-status__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--spacing-sm);
}

.settings-sync-status__label {
  font-weight: 600;
  color: var(--color-text);
}

.settings-sync-status__value {
  color: var(--color-text-light);
  text-align: right;
}

.settings-sync-status__row--ok .settings-sync-status__value {
  color: var(--color-success);
}

.settings-sync-status__row--warn .settings-sync-status__value {
  color: var(--color-warning-dark);
}

.settings-sync-status__row--error .settings-sync-status__value {
  color: var(--color-danger);
}

.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: 999px;
  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: 560px) {
  .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);
}

/* 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: 50%;
  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__right {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }

  .header__actions {
    width: 100%;
    justify-content: space-between;
  }


  .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: 24px;
  }

  .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;
  }
}

/* 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;
  }
}

/* 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;
}

/* Auto-save indicator in header */
.autosave-indicator {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  padding: 0.25rem 0.5rem;
  border-radius: var(--border-radius);
  background-color: var(--color-surface);
  margin-right: 0.5rem;
  transition: all 0.3s ease;
}

.autosave-indicator:empty {
  display: none;
}

.autosave-indicator.autosave-flash {
  background-color: var(--color-success);
  color: #fff;
}

@keyframes autosave-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.autosave-indicator.autosave-saving {
  animation: autosave-pulse 1s ease-in-out infinite;
}

/* 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;
}
.manual-content {
  font-size: var(--font-size-sm);
  line-height: 1.6;
}

.manual-content h1 {
  font-size: var(--font-size-xl);
  margin-top: var(--spacing-lg);
}

.manual-content h2 {
  font-size: var(--font-size-lg);
  margin-top: var(--spacing-lg);
}

.manual-content h3 {
  font-size: var(--font-size-md);
  margin-top: var(--spacing-md);
}

.manual-content code {
  background-color: var(--color-surface-secondary);
  padding: 0.2em 0.4em;
  border-radius: var(--border-radius-sm);
}

.manual-content pre {
  background-color: var(--color-surface-secondary);
  padding: var(--spacing-sm);
  border-radius: var(--border-radius-sm);
  overflow: auto;
}

.manual-content ul {
  padding-left: var(--spacing-lg);
}

.manual-content blockquote {
  border-left: 4px solid var(--color-info);
  background-color: var(--color-info-light);
  padding: var(--spacing-sm) var(--spacing-md);
  margin: var(--spacing-md) 0;
}

/* ============================================================
   Mode d'emploi amélioré - Styles complets
   ============================================================ */

.manual-intro {
  font-size: var(--font-size-md);
  color: var(--color-text-light);
  margin-bottom: var(--spacing-lg);
  line-height: 1.7;
}

.manual-alert {
  padding: var(--spacing-md);
  border-radius: var(--border-radius);
  margin: var(--spacing-md) 0;
  border-left: 4px solid;
}

.manual-alert--warning {
  background: rgba(255, 193, 133, 0.15);
  border-color: var(--color-warning-dark);
  color: var(--color-text);
}

.manual-alert--info {
  background: rgba(93, 135, 143, 0.1);
  border-color: var(--color-info);
  color: var(--color-text);
}

.manual-alert--success {
  background: rgba(50, 192, 134, 0.1);
  border-color: var(--color-success);
  color: var(--color-text);
}

.manual-toc {
  background: var(--color-surface-secondary);
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: var(--border-radius);
  margin: var(--spacing-md) 0;
}

.manual-toc ul {
  columns: 2;
  column-gap: var(--spacing-xl);
  list-style: none;
  padding: 0;
  margin: 0;
}

.manual-toc li {
  padding: var(--spacing-xs) 0;
  break-inside: avoid;
}

.manual-toc a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s;
}

.manual-toc a:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

.manual-divider {
  border: none;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-border), transparent);
  margin: var(--spacing-xl) 0;
}

.manual-steps {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  margin: var(--spacing-md) 0;
}

.manual-step {
  display: flex;
  gap: var(--spacing-md);
  align-items: flex-start;
  padding: var(--spacing-md);
  background: var(--color-surface-secondary);
  border-radius: var(--border-radius);
  border-left: 3px solid var(--color-primary);
}

.manual-step__number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  background: var(--color-primary);
  color: white;
  border-radius: 50%;
  font-weight: 600;
  font-size: var(--font-size-sm);
}

.manual-step__content {
  flex: 1;
}

.manual-step__content strong {
  display: block;
  margin-bottom: var(--spacing-xs);
  color: var(--color-text);
}

.manual-step__content p {
  margin: 0;
  color: var(--color-text-light);
  font-size: var(--font-size-sm);
}

.manual-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--spacing-md);
  margin: var(--spacing-md) 0;
}

.manual-feature {
  padding: var(--spacing-md);
  background: var(--color-surface-secondary);
  border-radius: var(--border-radius);
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.manual-feature:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.manual-feature__icon {
  font-size: 1.5rem;
  display: block;
  margin-bottom: var(--spacing-sm);
}

.manual-feature strong {
  display: block;
  margin-bottom: var(--spacing-xs);
  color: var(--color-text);
}

.manual-feature p {
  margin: 0;
  font-size: var(--font-size-xs);
  color: var(--color-text-light);
}

.manual-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--spacing-md) 0;
  font-size: var(--font-size-sm);
}

.manual-table th,
.manual-table td {
  padding: var(--spacing-sm) var(--spacing-md);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.manual-table th {
  background: var(--color-surface-secondary);
  font-weight: 600;
  color: var(--color-text);
}

.manual-table td {
  color: var(--color-text-light);
}

.manual-table--compact th,
.manual-table--compact td {
  padding: var(--spacing-xs) var(--spacing-sm);
}

.manual-comparison {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-md);
  margin: var(--spacing-md) 0;
}

.manual-comparison__item {
  padding: var(--spacing-md);
  background: var(--color-surface-secondary);
  border-radius: var(--border-radius);
}

.manual-comparison__item h4 {
  margin: 0 0 var(--spacing-sm) 0;
  padding-bottom: var(--spacing-sm);
  border-bottom: 2px solid var(--color-primary);
}

.manual-comparison__item ul {
  margin: 0;
  padding-left: var(--spacing-md);
}

.manual-comparison__item li {
  padding: var(--spacing-xs) 0;
  color: var(--color-text-light);
  font-size: var(--font-size-sm);
}

.manual-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--spacing-sm);
  margin: var(--spacing-md) 0;
}

.manual-kpi {
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--color-surface-secondary);
  border-radius: var(--border-radius);
  border-left: 3px solid var(--color-primary);
}

.manual-kpi strong {
  display: block;
  font-size: var(--font-size-sm);
  color: var(--color-text);
  margin-bottom: var(--spacing-xs);
}

.manual-kpi p {
  margin: 0;
  font-size: var(--font-size-xs);
  color: var(--color-text-light);
}

.manual-params-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--spacing-md);
  margin: var(--spacing-md) 0;
}

.manual-param {
  padding: var(--spacing-md);
  background: var(--color-surface-secondary);
  border-radius: var(--border-radius);
}

.manual-param strong {
  display: block;
  margin-bottom: var(--spacing-sm);
  color: var(--color-text);
}

.manual-param ul {
  margin: 0;
  padding-left: var(--spacing-md);
}

.manual-param li {
  padding: var(--spacing-xs) 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
}

.manual-faq {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  margin: var(--spacing-md) 0;
}

.manual-faq__item {
  padding: var(--spacing-md);
  background: var(--color-surface-secondary);
  border-radius: var(--border-radius);
  border-left: 3px solid var(--color-warning);
}

.manual-faq__item strong {
  display: block;
  margin-bottom: var(--spacing-sm);
  color: var(--color-text);
}

.manual-faq__item p {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
}

.manual-footer {
  text-align: center;
  padding: var(--spacing-lg);
  margin-top: var(--spacing-xl);
  background: var(--color-surface-secondary);
  border-radius: var(--border-radius);
}

.manual-footer p {
  margin: var(--spacing-xs) 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
}

.manual-footer a {
  color: var(--color-primary);
}

.manual-footer__license {
  font-size: var(--font-size-xs);
  color: var(--color-text-lighter);
  font-style: italic;
  margin-top: var(--spacing-sm) !important;
}

.manual-content kbd {
  display: inline-block;
  padding: 0.15em 0.4em;
  font-size: var(--font-size-xs);
  font-family: monospace;
  background: var(--color-surface-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Thème Bleu pour le mode d'emploi */
body.theme-bleu .manual-step {
  background: rgba(0, 0, 179, 0.06);
  border-color: var(--color-primary);
}

body.theme-bleu .manual-feature,
body.theme-bleu .manual-param,
body.theme-bleu .manual-toc,
body.theme-bleu .manual-comparison__item,
body.theme-bleu .manual-kpi,
body.theme-bleu .manual-faq__item,
body.theme-bleu .manual-footer {
  background: rgba(0, 0, 179, 0.04);
}

body.theme-bleu .manual-alert--warning {
  background: rgba(251, 189, 0, 0.12);
}

body.theme-bleu .manual-alert--info {
  background: rgba(5, 99, 193, 0.1);
}

body.theme-bleu .manual-alert--success {
  background: rgba(112, 173, 71, 0.12);
}

/* Thème Poudre pour le mode d'emploi */
body.theme-poudre .manual-step {
  background: rgba(180, 197, 211, 0.15);
  border-color: var(--color-primary);
}

body.theme-poudre .manual-feature,
body.theme-poudre .manual-param,
body.theme-poudre .manual-toc,
body.theme-poudre .manual-comparison__item,
body.theme-poudre .manual-kpi,
body.theme-poudre .manual-faq__item,
body.theme-poudre .manual-footer {
  background: rgba(180, 197, 211, 0.12);
}

body.theme-poudre .manual-alert--warning {
  background: rgba(213, 165, 124, 0.15);
}

body.theme-poudre .manual-alert--info {
  background: rgba(126, 160, 141, 0.12);
}

body.theme-poudre .manual-alert--success {
  background: rgba(126, 160, 141, 0.15);
}

/* Thème sombre pour le mode d'emploi */
body.theme-dark .manual-step,
body.theme-dark .manual-feature,
body.theme-dark .manual-param,
body.theme-dark .manual-toc,
body.theme-dark .manual-comparison__item,
body.theme-dark .manual-kpi,
body.theme-dark .manual-faq__item,
body.theme-dark .manual-footer {
  background: rgba(255, 255, 255, 0.05);
}

body.theme-dark .manual-table th {
  background: rgba(255, 255, 255, 0.08);
}

/* Responsive pour le mode d'emploi */
@media (max-width: 768px) {
  .manual-toc ul {
    columns: 1;
  }

  .manual-feature-grid,
  .manual-params-grid {
    grid-template-columns: 1fr;
  }

  .manual-comparison {
    grid-template-columns: 1fr;
  }
}

#risksTable th:nth-child(1),
#risksTable td:nth-child(1){
  width:40px;
}

/* NIS2 Programme */
.nis2-top-grid {
  align-items: stretch;
}

#addNis2DomainBtn i,
#addNis2ActionBtn i {
  margin-right: 6px;
}

.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: 12px;
  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: 12px;
  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: 4px;
  z-index: 1;
}

.nis2-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 999px;
  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: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nis2-status-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.25;
}

.nis2-status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  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-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 0.75rem;
  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);
}
.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: 14px;
  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: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 148, 136, 0.12);
  color: var(--color-primary);
  font-size: 20px;
  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: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #0f172a;
  background: #e5e7eb;
  border: 1px solid var(--color-border);
}
.nis2-phase-node--done { background: #e1f7ed; border-color: #22c55e; color: #065f46; }
.nis2-phase-node--in_progress { background: #fff4e5; border-color: #f59e0b; color: #92400e; }
.nis2-phase-node--todo { background: #f1f5f9; border-color: #cbd5e1; color: #475569; }
.nis2-phase-node--empty { background: #f8fafc; border-color: #e2e8f0; color: #94a3b8; }
.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);
}

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

.nis2-plan-table th,
.nis2-plan-table td {
  padding: var(--spacing-sm);
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  font-size: var(--font-size-sm);
  vertical-align: middle;
}

.nis2-plan-table thead {
  background: var(--color-surface-secondary);
}

.nis2-plan-table th:nth-child(2) { width: 120px; }
.nis2-plan-table th:nth-child(3) { width: 110px; }
.nis2-plan-table th:nth-child(4) { width: 140px; }
.nis2-plan-table th:nth-child(5) { width: 120px; }
.nis2-plan-table th:nth-child(6) { width: 110px; }

.nis2-plan-table .status-badge,
.nis2-plan-table .nis2-tag,
.nis2-plan-table 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 0.5rem;
  border-radius: 999px;
  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: 6px;
}
.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: 6px;
}
body.theme-dark .nis2-custom-card {
  border-color: rgba(255, 255, 255, 0.08);
}

.nis2-plan--executive .nis2-plan-table--executive th,
.nis2-plan--executive .nis2-plan-table--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;
}

@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: 14px;
  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: 14px;
  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: 2px 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: 4px;
}

.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);
  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: 0.25rem;
  padding: 0.5rem 0;
}
body.theme-poudre .nav__item {
  border-radius: 0.625rem;
  padding: 0.5rem 1rem;
  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: 1rem;
  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 .btn {
  background-color: var(--color-surface);
  border-color: var(--color-border);
  border-radius: 0.75rem;
  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: 0.75rem;
  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: 0.75rem;
  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: 0.75rem;
  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: 0.75rem;
  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 .form-control {
  background-color: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: 0.75rem;
  padding: 0.625rem 1rem;
  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: 1.25rem;
  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: 0.75rem;
  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: 1.25rem;
  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 .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: 0.5rem;
}

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 .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: 12px 16px 8px;
}

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 .nis2-plan-table,
body.print-nis2-program .nis2-plan-table 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 .nis2-plan-table th,
  body.print-nis2-program .nis2-plan-table td {
    padding: 8px 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: white !important;
  border: 1px solid #e9ecef;
  margin-bottom: 12px;
  border-radius: 6px;
}

#nis2-program .chart-card {
  page-break-inside: avoid;
  break-inside: avoid;
  margin-bottom: 16px;
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  padding: 12px;
}

#nis2-program .chart-card__header {
  margin-bottom: 12px;
}

#nis2-program .chart-card__title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px 0;
  color: #1fb8cd;
}

#nis2-program .chart-card__subtitle {
  font-size: 12px;
  color: #5a6a77;
  margin: 0;
}

#nis2-program .socle-card {
  page-break-inside: avoid;
  break-inside: avoid;
  margin-bottom: 16px;
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  padding: 12px;
}

#nis2-program .socle-card__header {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  align-items: flex-start;
}

#nis2-program .socle-card__icon {
  font-size: 24px;
  color: #1fb8cd;
  min-width: 30px;
}

#nis2-program .socle-card__title {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 4px 0;
  color: #2d3e4a;
}

#nis2-program .nis2-plan-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 12px;
}

#nis2-program .nis2-plan-table thead {
  background: #f2f3f5;
}

#nis2-program .nis2-plan-table th,
#nis2-program .nis2-plan-table td {
  padding: 8px 10px;
  border: 1px solid #e9ecef;
  text-align: left;
}

#nis2-program .nis2-plan-table th {
  font-weight: 600;
  background: #1fb8cd;
  color: white;
}

#nis2-program .nis2-plan-table tbody tr:nth-child(even) {
  background: #f9f9f9;
}

#nis2-program .module__header {
  margin: 0 0 12px 0;
  padding: 0 0 12px 0;
  border-bottom: 2px solid #1fb8cd;
}

#nis2-program .module__title {
  font-size: 22px;
  font-weight: 600;
  color: #1fb8cd;
  margin: 0;
}

#nis2-program .charts-grid,
#nis2-program .socle-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 20px;
}

#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 .nis2-plan-table thead {
  background: var(--color-surface-secondary);
}
body.theme-dark #nis2-program .nis2-plan-table th,
body.theme-dark #nis2-program .nis2-plan-table td {
  border-color: var(--color-border);
  color: var(--color-text);
}
body.theme-dark #nis2-program .nis2-plan-table 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: 12px 16px 8px;
}
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 .nis2-plan-table,
body.print-nis2-inline .nis2-plan-table 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;
}

/* 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: 4px 8px;
    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: 50%;
  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);
  backdrop-filter: blur(12px);
  border-bottom-color: rgba(51, 65, 85, 0.8);
}

/* 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);
}

/* 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);
  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: 2px;
}

.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: 0.9em;
}

.settings-nav__badge {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.65rem;
  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: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: white;
  font-size: 1.1rem;
  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: 2px 0 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
}

.settings-card__status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  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-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: 2px;
}

/* === 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: 10px;
  display: grid;
  place-items: center;
  background: var(--color-surface);
  color: var(--color-primary);
  font-size: 1.1rem;
  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: 5px;
  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: 5px;
  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: 2px;
}

/* === 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: 50%;
  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: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.snapshot-item__tag--manual {
  background: rgba(14, 116, 144, 0.12);
  color: #0e7490;
}

.snapshot-item__tag--auto {
  background: rgba(124, 58, 237, 0.12);
  color: #7c3aed;
}

.snapshot-item__actions {
  display: flex;
  gap: 4px;
  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__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: 2px;
  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: 2px;
}

.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: 0.5rem 0.75rem;
  }

  .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);
  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);
  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;
  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: 0.5rem;
  padding: 0.375rem 0.75rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  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: 0.875rem;
}

/* Compact mode styles */
body.compact-mode .table {
  font-size: 0.8125rem;
}

body.compact-mode .table th,
body.compact-mode .table td {
  padding: 0.375rem 0.5rem;
}

body.compact-mode .table th {
  font-size: 0.75rem;
  font-weight: 600;
}

body.compact-mode .badge {
  font-size: 0.6875rem;
  padding: 0.125rem 0.375rem;
}

body.compact-mode .btn--sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

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: 1.125rem;
}

body.compact-mode .form-group {
  margin-bottom: var(--spacing-sm);
}

body.compact-mode .form-label {
  font-size: 0.75rem;
  margin-bottom: 0.25rem;
}

body.compact-mode .form-control {
  padding: 0.375rem 0.5rem;
  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;
  }

  .chart-card, .kpi-card, .table {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }
}
