/* =====================================================================
   SUIVI DES PROJETS — Design system
   Palette : bleu marine institutionnel + blanc, rehaussé par les teintes
   du drapeau sénégalais (vert / or / rouge) réutilisées comme code
   sémantique pour la criticité et les statuts dans toute l'application.
   ===================================================================== */

/* Pas de dépendance à une police externe : pile système native, fiable
   sur un intranet ministériel sans accès internet. */

:root {
  /* --- Bleu marine (identité institutionnelle) --- */
  --navy-950: #061B32;
  --navy-900: #0A2A4A;
  --navy-800: #0F3760;
  --navy-700: #14477A;
  --navy-600: #1B5896;
  --navy-500: #2569AC;
  --navy-100: #E8EFF7;
  --navy-50:  #F4F8FC;

  /* --- Accents drapeau du Sénégal (utilisés avec parcimonie) --- */
  --sn-green: #00853F;
  --sn-gold:  #E6B325;
  --sn-red:   #D8232A;

  /* --- Neutres --- */
  --white: #FFFFFF;
  --gray-50: #F7F8FA;
  --gray-100: #EEF1F5;
  --gray-200: #E1E6ED;
  --gray-300: #C7CFDA;
  --gray-500: #7C8AA0;
  --gray-700: #46536A;
  --gray-900: #212B3B;

  /* --- Statuts sémantiques (repris de la logique du classeur Excel) --- */
  --status-faible-bg: #E6F4EA;   --status-faible-fg: #1E7B3A;
  --status-moyenne-bg: #FBF0D9;  --status-moyenne-fg: #966B0A;
  --status-critique-bg: #FBE7E7; --status-critique-fg: var(--sn-red);
  --status-info-bg: #E8EFF7;     --status-info-fg: var(--navy-700);
  --status-teal-bg: #E1F4F2;     --status-teal-fg: #0E7C72;
  --status-violet-bg: #EFE9F8;   --status-violet-fg: #6B3FA0;
  --status-neutral-bg: #EEF1F5;  --status-neutral-fg: #5B6577;

  /* --- Typo / forme --- */
  --font-main: -apple-system, 'Segoe UI', 'Helvetica Neue', Roboto, Arial, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(10, 42, 74, 0.06), 0 1px 3px rgba(10, 42, 74, 0.08);
  --shadow-md: 0 4px 14px rgba(10, 42, 74, 0.10);
  --shadow-lg: 0 20px 45px rgba(6, 27, 50, 0.22);
  --transition: 160ms ease;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  font-family: var(--font-main);
  color: var(--gray-900);
  background: var(--gray-50);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--navy-600); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }
ul { list-style: none; margin: 0; padding: 0; }
img, svg { display: block; }

::selection { background: var(--sn-gold); color: var(--navy-950); }

:focus-visible {
  outline: 3px solid var(--sn-gold);
  outline-offset: 2px;
}

.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap;
}

/* =====================================================================
   ÉCRAN DE CONNEXION
   ===================================================================== */
#screen-login, #screen-force-password-change {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(230,179,37,0.10), transparent 60%),
    radial-gradient(1000px 700px at 110% 110%, rgba(0,133,63,0.14), transparent 55%),
    linear-gradient(160deg, var(--navy-950) 0%, var(--navy-900) 55%, var(--navy-800) 100%);
  position: relative;
}

.login-topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 28px;
  color: rgba(255,255,255,0.85);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.login-topbar img { width: 26px; height: auto; border-radius: 2px; box-shadow: 0 0 0 1px rgba(255,255,255,0.25); }
.login-topbar .motto { color: var(--sn-gold); font-weight: 600; }
.login-topbar .divider { opacity: 0.4; }

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px 36px 32px;
  animation: rise 480ms cubic-bezier(.2,.7,.2,1);
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.login-brand .badge-shield {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--navy-700), var(--navy-950));
  display: flex; align-items: center; justify-content: center;
  color: var(--sn-gold);
  font-weight: 800;
  font-size: 18px;
  flex-shrink: 0;
}
.login-brand h1 { font-size: 17px; color: var(--navy-900); line-height: 1.3; }
.login-brand span { display: block; font-size: 12px; color: var(--gray-500); font-weight: 500; margin-top: 2px; }

.login-card h2 { font-size: 21px; color: var(--navy-900); margin-bottom: 4px; }
.login-card .lead { color: var(--gray-500); font-size: 13.5px; margin-bottom: 24px; }

/* --- Écran de choix du module (Intranet / Gestion des projets) --- */
#screen-module-picker {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, var(--navy-950) 0%, var(--navy-900) 55%, var(--navy-800) 100%);
  position: relative;
}
.module-picker-card {
  width: 100%;
  max-width: 720px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px 36px 36px;
  animation: rise 480ms cubic-bezier(.2,.7,.2,1);
}
.module-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 10px; }
.module-choice {
  display: flex; flex-direction: column; align-items: flex-start; text-align: left;
  gap: 8px;
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 22px 20px;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}
.module-choice:hover { border-color: var(--sn-gold); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.module-choice-ico { width: 46px; height: 46px; object-fit: contain; border-radius: var(--radius-sm); }
.module-choice-title { font-size: 16px; font-weight: 700; color: var(--navy-900); }
.module-choice-desc { font-size: 12.5px; color: var(--gray-500); line-height: 1.5; }
@media (max-width: 640px) {
  .module-choices { grid-template-columns: 1fr; }
  .module-picker-card { padding: 28px 22px 24px; }
}

.header-switch-module-btn {
  background: rgba(255,255,255,0.08);
  border: none; color: var(--white);
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  display: flex; align-items: center; gap: 6px;
  cursor: pointer;
}
.header-switch-module-btn:hover { background: rgba(255,255,255,0.16); }

.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 12.5px; font-weight: 600; color: var(--gray-700);
  margin-bottom: 6px; letter-spacing: 0.01em;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--gray-50);
  transition: border-color var(--transition), background var(--transition);
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--navy-500);
  background: var(--white);
  outline: none;
}
.field-error { color: var(--sn-red); font-size: 12px; margin-top: 5px; display: none; }
.field.has-error input { border-color: var(--sn-red); }
.field.has-error .field-error { display: block; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: var(--radius-sm);
  padding: 11px 18px;
  font-size: 14px; font-weight: 600;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), opacity var(--transition);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--navy-900); color: var(--white); }
.btn-primary:hover { background: var(--navy-800); box-shadow: var(--shadow-sm); }
.btn-gold { background: var(--sn-gold); color: var(--navy-950); }
.btn-gold:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; color: var(--navy-700); border: 1.5px solid var(--gray-200); }
.btn-ghost:hover { background: var(--navy-50); border-color: var(--navy-200, var(--gray-300)); }
.btn-danger { background: var(--white); color: var(--sn-red); border: 1.5px solid #F3C4C4; }
.btn-danger:hover { background: var(--status-critique-bg); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }
.btn-icon-delete {
  border: none; background: var(--gray-100); color: var(--gray-700); border-radius: 50%;
  width: 24px; height: 24px; font-size: 15px; line-height: 1; cursor: pointer;
}
.btn-icon-delete:hover { background: var(--status-critique-bg); color: var(--sn-red); }

/* --- Vue stratégique : diagramme Cadre -> Objectifs -> Programmes --- */
/* --- Bascule d'affichage de la Vue stratégique (empilé / compact) --- */
.layout-toggle { display: flex; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm); overflow: hidden; margin-right: 4px; }
.layout-toggle-btn {
  border: none; background: var(--white); color: var(--gray-700); padding: 8px 14px; font-size: 12.5px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.layout-toggle-btn + .layout-toggle-btn { border-left: 1.5px solid var(--gray-200); }
.layout-toggle-btn.active { background: var(--navy-900); color: var(--white); }

.strategie-cadre-block { background: var(--white); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); margin-bottom: 20px; overflow: hidden; }
.cadre-header { background: var(--navy-900); color: var(--white); padding: 16px 20px; display: flex; align-items: center; gap: 12px; }
.cadre-header .cadre-ico { font-size: 22px; flex: none; }
.cadre-header strong { font-size: 15px; }
.cadre-header .cell-muted { color: rgba(255,255,255,0.68); font-size: 12px; margin-top: 2px; }
.cadre-actions { margin-left: auto; display: flex; gap: 6px; flex: none; }
.btn-icon-light {
  border: 1.5px solid rgba(255,255,255,0.3); background: transparent; color: var(--white);
  border-radius: var(--radius-sm); padding: 5px 10px; font-size: 11.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn-icon-light:hover { background: rgba(255,255,255,0.12); }

.objectifs-row { display: flex; flex-wrap: wrap; gap: 18px; padding: 20px; }
.objectif-col { flex: 1; min-width: 230px; padding-top: 14px; border-top: 3px solid var(--sn-gold); }

/* Mode "Empilé" (par défaut) : chaque axe occupe toute la largeur, l'un
   sous l'autre, ce qui laisse la place à un texte nettement plus lisible
   que lorsque 4 axes doivent tenir côte à côte. */
.strategie-layout-stacked .objectifs-row { flex-direction: column; }
.strategie-layout-stacked .objectif-col { min-width: 100%; padding: 18px 4px 6px; }
.strategie-layout-stacked .objectif-col + .objectif-col { border-top: none; border-left: 4px solid var(--sn-gold); padding-left: 18px; margin-left: 2px; }
.strategie-layout-stacked .cadre-header strong { font-size: 17px; }
.strategie-layout-stacked .cadre-header .cell-muted { font-size: 13px; }
.strategie-layout-stacked .objectif-header { font-size: 15px; margin-bottom: 14px; }
.strategie-layout-stacked .os-section-toggle { font-size: 12.5px; }
.strategie-layout-stacked .os-nom { font-size: 14px; }
.strategie-layout-stacked .os-code { font-size: 12px; }
.strategie-layout-stacked .os-counts { font-size: 12px; }
.strategie-layout-stacked .os-toggle { padding: 12px 90px 12px 34px; }
.strategie-layout-stacked .os-chevron { top: 15px; }
.strategie-layout-stacked .os-panel { padding: 6px 18px 16px 34px; }
.strategie-layout-stacked .os-panel-section strong { font-size: 12px; }
.strategie-layout-stacked .programme-chip { font-size: 13.5px; padding: 11px 14px; }
.strategie-layout-stacked .programme-chip .chip-meta { font-size: 11.5px; }
.strategie-layout-stacked .programme-projects-list li { font-size: 13px; }
.strategie-layout-stacked .os-indicateur-label { font-size: 13px; }
.strategie-layout-stacked .programmes-list { flex-direction: row; flex-wrap: wrap; }
.strategie-layout-stacked .programme-chip { flex: 0 1 260px; }

/* Mode "Compact" : les axes restent côte à côte (comportement d'origine,
   plus dense, pour une vue d'ensemble rapide). */
.strategie-layout-compact .objectifs-row { flex-direction: row; }
.objectif-header {
  font-size: 13px; font-weight: 700; color: var(--navy-900); margin-bottom: 10px;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 6px;
}
.objectif-actions { display: flex; gap: 4px; flex: none; }
.btn-icon-mini {
  border: none; background: var(--gray-100); color: var(--gray-700); border-radius: 4px;
  width: 22px; height: 22px; font-size: 11px; cursor: pointer; flex: none;
}
.btn-icon-mini:hover { background: var(--gray-200); }
.objectif-empty { font-size: 11.5px; color: var(--gray-300); font-style: italic; margin-bottom: 8px; }

.programmes-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.programme-chip {
  background: var(--navy-50); border-radius: var(--radius-sm); padding: 10px 12px;
  font-size: 12.5px; font-weight: 600; color: var(--navy-900);
}
.programme-chip-header {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; cursor: pointer;
  transition: opacity 120ms ease;
}
.programme-chip-header:hover { opacity: 0.75; }
.programme-chip .chip-meta { background: var(--white); border-radius: 10px; padding: 2px 8px; font-size: 10.5px; color: var(--gray-700); flex: none; white-space: nowrap; }
.programme-projects-list { list-style: none; margin: 8px 0 0; padding: 8px 0 0; border-top: 1px dashed var(--gray-200); display: flex; flex-direction: column; gap: 4px; }
.programme-projects-list li { font-size: 11.5px; font-weight: 500; color: var(--navy-900); cursor: pointer; padding: 3px 6px; border-radius: 4px; }
.programme-projects-list li:hover { background: var(--white); }

.strategie-orphans .programmes-list { flex-direction: row; flex-wrap: wrap; }
.strategie-orphans .programme-chip { flex: 0 1 260px; }

/* --- Puces dépliables des Objectifs stratégiques (OS) --- */
.os-item { position: relative; border: 1px solid var(--gray-100); border-radius: var(--radius-sm); margin-bottom: 8px; background: var(--white); }
.os-toggle {
  width: 100%; text-align: left; border: none; background: transparent; cursor: pointer;
  padding: 9px 76px 9px 30px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.os-chevron { position: absolute; left: 9px; top: 11px; font-size: 10px; color: var(--gray-500); transition: transform 120ms ease; }
.os-item.is-open .os-chevron { transform: rotate(90deg); }
.os-code { font-size: 10.5px; font-weight: 700; color: var(--navy-600); flex: none; }
.os-nom { font-size: 12px; font-weight: 600; color: var(--navy-900); flex: 1; min-width: 120px; }
.os-counts { font-size: 10.5px; color: var(--gray-500); flex: none; white-space: nowrap; }
.os-actions { position: absolute; top: 6px; right: 6px; display: flex; gap: 3px; }
.os-panel { display: none; padding: 4px 14px 12px 30px; border-top: 1px dashed var(--gray-100); }
.os-item.is-open .os-panel { display: block; }
.os-panel-section { margin-top: 8px; }
.os-panel-section strong { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--gray-500); margin-bottom: 6px; }
.os-panel .programmes-list { gap: 6px; }
.os-panel .programme-chip { padding: 7px 10px; font-size: 12px; }

/* Sous-titre réductible "Objectifs stratégiques" par axe */
.os-section-toggle {
  width: 100%; text-align: left; border: none; background: transparent; cursor: pointer;
  display: flex; align-items: center; gap: 6px; padding: 6px 0 8px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.03em; color: var(--gray-500);
}
.os-section-toggle .os-chevron { font-size: 9px; transition: transform 120ms ease; }
.objectif-col.os-section-collapsed .os-section-toggle .os-chevron { transform: rotate(-90deg); }
.objectif-col.os-section-collapsed .os-section-body { display: none; }

/* Indicateurs d'impact (dans la puce OS dépliée) */
.os-indicateur-row { margin-bottom: 10px; }
.os-indicateur-row:last-child { margin-bottom: 0; }
.os-indicateur-label { font-size: 12px; color: var(--navy-900); margin-bottom: 4px; }

@media (max-width: 720px) {
  .objectifs-row { flex-direction: column; }
}

.geo-preview-box { margin-top: 16px; padding-top: 16px; border-top: 1.5px solid var(--gray-200); }
.geo-preview-sample {
  background: var(--navy-950); color: #C9DAF8; padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 11.5px; max-height: 140px; overflow: auto; margin: 8px 0 14px;
}
.import-result-box { margin-top: 14px; padding: 12px 14px; background: var(--navy-50); border-radius: var(--radius-sm); font-size: 13px; }
.geo-import-errors { margin: 8px 0 0; padding-left: 18px; font-size: 12px; color: var(--sn-red); max-height: 120px; overflow-y: auto; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.login-submit { margin-top: 6px; }
.login-error {
  display: none;
  background: var(--status-critique-bg); color: var(--sn-red);
  border-radius: var(--radius-sm); padding: 10px 12px;
  font-size: 13px; margin-bottom: 16px;
}
.login-hint {
  margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--gray-100);
  font-size: 12px; color: var(--gray-500); line-height: 1.6;
}

/* --- Footer ministériel, sur toutes les pages --- */
.app-footer {
  text-align: center; font-size: 10.5px; font-weight: 700; letter-spacing: 0.03em;
  color: var(--white); line-height: 1.6; padding: 14px 24px;
  background: linear-gradient(135deg, var(--navy-950) 0%, var(--navy-900) 60%, var(--navy-800) 100%);
  border-top: 3px solid var(--sn-gold);
  text-transform: uppercase;
}
/* Écrans autonomes (connexion, changement de mot de passe) : positionné en
   position absolue par rapport à l'écran plutôt qu'en flux normal, pour
   ne jamais perturber le centrage vertical/horizontal de la carte, tout
   en restant ancré au bas de l'écran quel que soit son contenu. */
.app-footer--login { position: absolute; left: 0; right: 0; bottom: 0; }

/* =====================================================================
   APPLICATION — SHELL (header, sidebar, contenu)
   ===================================================================== */
#app-shell { display: flex; min-height: 100vh; }

.app-header {
  position: fixed; top: 0; left: 0; right: 0; height: 64px;
  background: var(--navy-950);
  color: var(--white);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px 0 0;
  z-index: 50;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06);
}
.app-header .header-left {
  display: flex; align-items: center; gap: 14px;
  padding: 0 20px;
  width: 260px;
  flex-shrink: 0;
}
.app-header .header-left img { width: 28px; height: auto; border-radius: 3px; box-shadow: 0 0 0 1px rgba(255,255,255,0.25); }
.app-header .header-titles { line-height: 1.25; }
.app-header .header-titles .country { font-size: 10.5px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--sn-gold); font-weight: 700; }
.app-header .header-titles .motto { font-size: 10px; color: rgba(255,255,255,0.65); letter-spacing: 0.04em; }

.header-center {
  flex: 1;
  font-size: 14.5px;
  font-weight: 600;
  color: rgba(255,255,255,0.92);
}
.header-center .sub { display: block; font-size: 11px; font-weight: 400; color: rgba(255,255,255,0.55); margin-top: 1px; }

.header-right { display: flex; align-items: center; gap: 14px; }
.header-alert-btn {
  position: relative;
  background: rgba(255,255,255,0.08);
  border: none; color: var(--white);
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.header-alert-btn .dot {
  position: absolute; top: 5px; right: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--sn-red);
  box-shadow: 0 0 0 2px var(--navy-950);
  display: none;
}
.header-alert-btn.has-alerts .dot { display: block; }

.notif-bell-wrap { position: relative; }
.notif-dropdown {
  position: absolute; top: 46px; right: 0; width: 340px; max-height: 420px;
  background: var(--white); color: var(--navy-900); border-radius: var(--radius-md);
  box-shadow: 0 8px 28px rgba(10, 42, 74, 0.3); overflow: hidden; z-index: 200;
  display: flex; flex-direction: column;
}
.notif-dropdown.hidden { display: none; }
.notif-dropdown-header {
  display: flex; align-items: center; justify-content: space-between; padding: 12px 14px;
  border-bottom: 1px solid var(--gray-200); font-size: 13px; font-weight: 700;
}
.notif-dropdown-header .btn-sm { padding: 4px 8px; font-size: 11px; }
.notif-dropdown-list { overflow-y: auto; max-height: 360px; }
.notif-item {
  display: block; padding: 11px 14px; border-bottom: 1px solid var(--gray-100);
  cursor: pointer; font-size: 12.5px; color: var(--gray-700);
}
.notif-item:hover { background: var(--gray-50); }
.notif-item.is-unread { background: var(--navy-50); }
.notif-item-title { font-weight: 700; color: var(--navy-900); margin-bottom: 2px; }
.notif-item-date { font-size: 10.5px; color: var(--gray-500); margin-top: 4px; }
.notif-dropdown-empty { padding: 26px 14px; text-align: center; font-size: 12.5px; color: var(--gray-300); font-style: italic; }

.header-user { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.header-user .avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(145deg, var(--sn-gold), #C99A1B);
  color: var(--navy-950); font-weight: 800; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.header-user .who { line-height: 1.25; text-align: right; }
.header-user .who .name { font-size: 13px; font-weight: 600; }
.header-user .who .role { font-size: 10.5px; color: rgba(255,255,255,0.6); text-transform: uppercase; letter-spacing: 0.05em; }

.app-sidebar {
  position: fixed; top: 64px; left: 0; bottom: 0; width: 260px;
  background: var(--navy-900);
  padding: 18px 12px 18px;
  overflow-y: auto;
  z-index: 40;
}
.nav-section-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.09em;
  color: rgba(255,255,255,0.35); padding: 14px 12px 6px;
  font-weight: 700;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.78); font-size: 13.5px; font-weight: 500;
  cursor: pointer; margin-bottom: 2px;
  border-left: 3px solid transparent;
  transition: background var(--transition), color var(--transition);
}
.nav-item .ico { width: 18px; text-align: center; font-size: 15px; opacity: 0.9; }
.nav-item:hover { background: rgba(255,255,255,0.06); color: var(--white); }
.nav-item.active {
  background: rgba(230,179,37,0.12);
  color: var(--white);
  border-left-color: var(--sn-gold);
}
.nav-item .count-pill {
  margin-left: auto;
  background: var(--sn-red); color: var(--white);
  font-size: 10.5px; font-weight: 700;
  padding: 1px 7px; border-radius: 999px;
}

.app-main {
  margin-left: 260px; margin-top: 64px;
  width: calc(100% - 260px);
  min-height: calc(100vh - 64px);
  display: flex; flex-direction: column;
}
#view-root { flex: 1; padding: 28px 32px; }

.view-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 22px; flex-wrap: wrap;
}
.view-header h2 { font-size: 22px; color: var(--navy-900); }
.view-header .lead { color: var(--gray-500); font-size: 13.5px; margin-top: 4px; }
.view-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* =====================================================================
   COMPOSANTS
   ===================================================================== */

/* --- Cartes KPI --- */
.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px; margin-bottom: 26px;
}
.kpi-card {
  background: var(--white); border-radius: var(--radius-md);
  padding: 18px 20px; box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--navy-600);
}
.kpi-card .kpi-label { font-size: 12px; color: var(--gray-500); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.kpi-card .kpi-value { font-size: 27px; font-weight: 800; color: var(--navy-900); margin-top: 6px; }
.kpi-card .kpi-sub { font-size: 12px; color: var(--gray-500); margin-top: 3px; }
.kpi-card.accent-gold { border-top-color: var(--sn-gold); }
.kpi-card.accent-green { border-top-color: var(--sn-green); }
.kpi-card.accent-red { border-top-color: var(--sn-red); }
.kpi-card.accent-navy { border-top-color: var(--navy-700); }

/* --- Panneaux / cartes génériques --- */
.panel {
  background: var(--white); border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm); padding: 20px 22px; margin-bottom: 20px;
}
.panel-title { font-size: 14.5px; font-weight: 700; color: var(--navy-900); margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; }

/* --- Calendrier hebdomadaire de suivi --- */
.week-calendar-header {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin-bottom: 14px;
}
.week-calendar-title { font-weight: 700; font-size: 14px; color: var(--navy-900); min-width: 260px; text-align: center; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.week-calendar-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px;
}
.week-loading { grid-column: 1 / -1; text-align: center; padding: 30px 0; }
.week-day {
  background: var(--navy-50); border-radius: var(--radius-sm); min-height: 160px;
  display: flex; flex-direction: column; overflow: hidden; border: 1.5px solid transparent;
}
.week-day.is-today { border-color: var(--sn-gold); background: #FFFBEE; }
.week-day-head {
  font-size: 11.5px; font-weight: 700; color: var(--navy-800); text-transform: uppercase;
  letter-spacing: 0.03em; padding: 9px 10px; border-bottom: 1px solid var(--gray-200);
  display: flex; justify-content: space-between;
}
.week-day-head span { color: var(--gray-500); font-weight: 600; }
.week-day-items { padding: 8px; display: flex; flex-direction: column; gap: 6px; flex: 1; overflow-y: auto; max-height: 220px; }
.week-day-empty { font-size: 11.5px; color: var(--gray-300); text-align: center; padding: 14px 4px; font-style: italic; }
.week-item {
  background: var(--white); border-radius: 6px; padding: 6px 8px; font-size: 11.5px;
  display: flex; gap: 6px; align-items: flex-start; box-shadow: var(--shadow-sm);
  border-left: 3px solid var(--gray-300); cursor: default;
}
.week-item.is-clickable { cursor: pointer; transition: transform 120ms ease, box-shadow 120ms ease; }
.week-item.is-clickable:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.week-item-ico { flex: none; line-height: 1.3; }
.week-item-label { line-height: 1.35; color: var(--navy-900); font-weight: 600; }
.week-item-projet { display: block; font-weight: 500; color: var(--gray-500); font-size: 10.5px; margin-top: 1px; }
.week-item.crit-critique { border-left-color: var(--sn-red); }
.week-item.crit-moyenne { border-left-color: var(--sn-gold); }
.week-item.crit-faible { border-left-color: var(--navy-500); }

/* --- Carte Leaflet (sélection de zones + vue Carte) --- */
.map-toolbar {
  display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; margin-bottom: 12px;
}
.field-inline { display: flex; flex-direction: column; gap: 4px; }
.field-inline label { font-size: 11.5px; font-weight: 700; color: var(--gray-700); text-transform: uppercase; letter-spacing: 0.03em; }
.field-inline select {
  padding: 7px 10px; border-radius: var(--radius-sm); border: 1.5px solid var(--gray-200);
  background: var(--white); font-size: 13px; min-width: 170px;
}

.map-canvas { width: 100%; height: 460px; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); z-index: 1; }
.map-canvas.map-canvas-sm { height: 320px; }

.map-body { display: flex; gap: 14px; align-items: flex-start; }
.map-body .map-canvas { flex: 1; min-width: 0; }

.map-side-panel {
  width: 300px; flex: none; height: 460px; overflow-y: auto; background: var(--navy-50);
  border-radius: var(--radius-md); padding: 14px; box-shadow: var(--shadow-sm);
}
.map-side-panel-empty, .map-side-panel-loading {
  color: var(--gray-500); font-size: 12.5px; text-align: center; padding: 30px 10px;
}
.map-side-panel-header { margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1.5px solid var(--gray-200); }
.map-side-panel-header strong { display: block; font-size: 14px; color: var(--navy-900); margin-bottom: 2px; }
.map-side-panel-header .cell-muted { font-size: 11.5px; }
.map-side-panel-list { display: flex; flex-direction: column; gap: 10px; }

.side-project-card {
  background: var(--white); border-radius: var(--radius-sm); padding: 10px 12px; cursor: pointer;
  box-shadow: var(--shadow-sm); transition: transform 120ms ease, box-shadow 120ms ease;
}
.side-project-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.side-project-card.is-suspended { opacity: 0.55; filter: grayscale(45%); }
.side-project-card.is-suspended:hover { opacity: 0.85; }
.side-project-name { font-size: 13px; font-weight: 700; color: var(--navy-900); margin-bottom: 4px; }
.side-project-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.side-project-stats { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--gray-700); margin-bottom: 4px; }

.map-selection-summary {
  margin-top: 12px; padding: 12px 14px; background: var(--navy-50); border-radius: var(--radius-sm);
  font-size: 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.zone-chip {
  display: inline-flex; align-items: center; gap: 6px; background: var(--white); border: 1.5px solid var(--sn-gold);
  color: var(--navy-900); border-radius: 20px; padding: 4px 6px 4px 12px; font-size: 12.5px; font-weight: 600;
}
.zone-chip button {
  border: none; background: var(--navy-100); color: var(--navy-800); border-radius: 50%;
  width: 18px; height: 18px; font-size: 13px; line-height: 1; cursor: pointer;
}

.map-hint { font-size: 12px; padding-bottom: 8px; }

.map-canvas { width: 100%; height: 460px; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); z-index: 1; }
.map-canvas.map-canvas-sm { height: 320px; }

.map-body { display: flex; gap: 14px; align-items: flex-start; }
.map-body .map-canvas { flex: 1; min-width: 0; }

.map-side-panel {
  width: 300px; flex: none; height: 460px; overflow-y: auto; background: var(--navy-50);
  border-radius: var(--radius-md); padding: 14px; box-shadow: var(--shadow-sm);
}
.map-side-panel-empty, .map-side-panel-loading {
  color: var(--gray-500); font-size: 12.5px; text-align: center; padding: 30px 10px;
}
.map-side-panel-header { margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1.5px solid var(--gray-200); }
.map-side-panel-header strong { display: block; font-size: 14px; color: var(--navy-900); margin-bottom: 2px; }
.map-side-panel-header .cell-muted { font-size: 11.5px; }
.map-side-panel-list { display: flex; flex-direction: column; gap: 10px; }

.side-project-card {
  background: var(--white); border-radius: var(--radius-sm); padding: 10px 12px; cursor: pointer;
  box-shadow: var(--shadow-sm); transition: transform 120ms ease, box-shadow 120ms ease;
}
.side-project-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.side-project-name { font-size: 13px; font-weight: 700; color: var(--navy-900); margin-bottom: 4px; }
.side-project-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.side-project-stats { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--gray-700); margin-bottom: 4px; }

.map-selection-summary {
  margin-top: 12px; padding: 12px 14px; background: var(--navy-50); border-radius: var(--radius-sm);
  font-size: 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.zone-chip {
  display: inline-flex; align-items: center; gap: 6px; background: var(--white); border: 1.5px solid var(--sn-gold);
  color: var(--navy-900); border-radius: 20px; padding: 4px 6px 4px 12px; font-size: 12.5px; font-weight: 600;
}
.zone-chip button {
  border: none; background: var(--navy-100); color: var(--navy-800); border-radius: 50%;
  width: 18px; height: 18px; font-size: 13px; line-height: 1; cursor: pointer;
}

/* Légende de densité : contrôle Leaflet ancré sur la carte (bas-droite) */
.map-legend-control {
  background: var(--white); padding: 10px 14px; border-radius: var(--radius-sm);
  box-shadow: 0 2px 10px rgba(10, 42, 74, 0.25); font-size: 12px; color: var(--gray-700);
  min-width: 150px;
}
.map-legend-control strong { display: block; margin-bottom: 6px; color: var(--navy-900); font-size: 12.5px; }
.map-legend-scale { display: flex; flex-direction: column; gap: 4px; }
.map-legend-item { display: flex; align-items: center; gap: 7px; font-size: 11.5px; }
.map-legend-swatch { width: 15px; height: 15px; border-radius: 3px; display: inline-block; box-shadow: inset 0 0 0 1px rgba(10,42,74,0.15); flex: none; }

/* Sélecteur de couches Leaflet : alignement sur le design system */
.leaflet-control-layers {
  border: none !important; border-radius: var(--radius-sm) !important;
  box-shadow: 0 2px 10px rgba(10, 42, 74, 0.25) !important; font-size: 12.5px;
}
.leaflet-control-layers-expanded {
  padding: 10px 14px !important; color: var(--navy-900);
}
.leaflet-control-layers-base label { display: flex; align-items: center; gap: 6px; padding: 3px 0; font-weight: 600; }

/* --- Analyse des indicateurs (tableau de bord) --- */
.indicators-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

/* --- Financement & Budget (fiche projet) --- */
.budget-charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; margin-bottom: 16px; }
.budget-chart-wrap { width: 100%; }

/* --- Fiche de validation des critères de maturation --- */
.validation-banner {
  padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
}
.validation-banner.is-ok { background: var(--status-faible-bg); color: var(--status-faible-fg); }
.validation-banner.is-pending { background: var(--status-moyenne-bg); color: var(--status-moyenne-fg); }

.criteres-list { display: flex; flex-direction: column; gap: 10px; }
.critere-row { background: var(--navy-50); border-radius: var(--radius-sm); padding: 12px 14px; }
.critere-row.is-valide { background: var(--status-faible-bg); }
.critere-check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--navy-900); }
.critere-check input { width: 17px; height: 17px; margin-top: 1px; flex: none; }
.critere-obligatoire { display: inline-block; background: var(--status-critique-bg); color: var(--status-critique-fg); border-radius: 4px; padding: 1px 6px; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.critere-desc { margin: 4px 0 0 27px; font-size: 12px; }
.critere-commentaire {
  margin: 8px 0 0 27px; width: calc(100% - 27px); padding: 6px 9px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--gray-200); font-size: 12.5px; background: var(--white);
}
.critere-meta { margin: 6px 0 0 27px; font-size: 11px; color: var(--gray-500); }

.critere-admin-row {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--gray-100); font-size: 13px;
}
.critere-admin-row:last-child { border-bottom: none; }

/* --- Fiche de présentation du projet (affichage par défaut) --- */
.fiche-presentation .panel-title { display: flex; align-items: center; }
.fiche-title-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.fiche-title-actions #btn-toggle-fiche { font-size: 10px; transition: transform 150ms ease; }
.fiche-presentation.is-collapsed .fiche-body { display: none; }
.fiche-presentation.is-collapsed .fiche-title-actions #btn-toggle-fiche { transform: rotate(180deg); }

.fiche-body { margin-top: 12px; }
.fiche-section { margin-bottom: 22px; }
.fiche-section:last-of-type { margin-bottom: 14px; }
.fiche-section-title {
  font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--white); background: var(--navy-900); padding: 7px 12px; border-radius: var(--radius-sm);
  margin-bottom: 10px;
}
.fiche-row { display: grid; grid-template-columns: 260px 1fr; gap: 14px; padding: 10px 4px; border-bottom: 1px solid var(--gray-100); }
.fiche-row:last-child { border-bottom: none; }
.fiche-row-label { font-size: 12.5px; font-weight: 700; color: var(--navy-900); }
.fiche-row-content { font-size: 13px; color: var(--gray-700); line-height: 1.5; }
.fiche-row-content p { margin: 0; }
.fiche-empty { font-style: italic; }
.fiche-bullets { margin: 0; padding-left: 18px; }
.fiche-bullets li { margin-bottom: 4px; }
.fiche-signature { display: flex; flex-wrap: wrap; gap: 30px; padding-top: 14px; border-top: 2px dashed var(--gray-100); font-size: 12.5px; color: var(--navy-900); }
.fiche-signature-label { display: block; font-weight: 700; color: var(--gray-500); text-transform: uppercase; font-size: 10.5px; margin-bottom: 4px; letter-spacing: 0.02em; }

.fiche-edit-section-title {
  font-size: 12px; font-weight: 800; text-transform: uppercase; color: var(--navy-900); letter-spacing: 0.03em;
  margin: 18px 0 8px; padding-bottom: 5px; border-bottom: 2px solid var(--sn-gold);
}
.fiche-edit-section-title:first-child { margin-top: 0; }

@media (max-width: 640px) {
  .fiche-row { grid-template-columns: 1fr; gap: 4px; }
}
.budget-chart-svg { width: 100%; height: auto; display: block; }
.indicator-card { background: var(--white); border-radius: var(--radius-md); padding: 16px; box-shadow: var(--shadow-sm); }
.indicator-card-head { margin-bottom: 6px; }
.indicator-card-head strong { display: block; font-size: 13.5px; color: var(--navy-900); line-height: 1.3; }
.indicator-card-head .cell-muted { font-size: 11.5px; }

.indicator-chart-wrap { margin: 8px 0 10px; }
.indicator-chart-svg { width: 100%; height: auto; display: block; }
.indicator-chart-xaxis { display: flex; justify-content: space-between; font-size: 10px; color: var(--gray-500); margin-top: 2px; padding: 0 2px; }
.indicator-chart-empty {
  font-size: 12px; color: var(--gray-500); text-align: center; padding: 24px 10px;
  background: var(--navy-50); border-radius: var(--radius-sm);
}
.indicator-chart-empty-refs { margin-top: 6px; font-size: 11.5px; }

.indicator-card-progress { border-top: 1px solid var(--gray-100); padding-top: 10px; }
.indicator-progress-label { font-size: 11.5px; color: var(--gray-700); margin-bottom: 6px; font-weight: 600; }
.indicator-overshoot { font-size: 11px; color: var(--sn-green); font-weight: 700; margin-top: 4px; }

.leaflet-tooltip.map-label {
  background: transparent; border: none; box-shadow: none; font-weight: 700; font-size: 11px;
  color: var(--navy-900); text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff;
}

.map-popup { font-size: 13px; min-width: 160px; }

@media (max-width: 900px) {
  .map-body { flex-direction: column; }
  .map-side-panel { width: 100%; height: auto; max-height: 300px; }
}
@media (max-width: 720px) {
  .map-canvas { height: 320px; }
  .map-toolbar { gap: 10px; }
  .field-inline select { min-width: 130px; }
  .leaflet-control-layers-expanded { font-size: 11.5px; padding: 8px 10px !important; }
}

/* --- Assistant de création de projet en étapes guidées --- */
.wizard-steps { display: flex; align-items: center; margin-bottom: 22px; flex-wrap: wrap; gap: 0; }
.wizard-step { display: flex; align-items: center; gap: 8px; opacity: 0.5; }
.wizard-step.is-active, .wizard-step.is-done { opacity: 1; }
.wizard-step-num {
  width: 26px; height: 26px; border-radius: 50%; background: var(--gray-200); color: var(--navy-900);
  display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700; flex: none;
}
.wizard-step.is-active .wizard-step-num { background: var(--navy-900); color: var(--white); }
.wizard-step.is-done .wizard-step-num { background: var(--sn-green); color: var(--white); }
.wizard-step-label { font-size: 12.5px; font-weight: 600; color: var(--navy-800); white-space: nowrap; }
.wizard-step-sep { flex: 1; height: 2px; background: var(--gray-200); margin: 0 8px; min-width: 16px; }
.wizard-body { min-height: 320px; }

.link-btn {
  border: none; background: none; color: var(--navy-600); font-weight: 600; font-size: 11.5px;
  cursor: pointer; padding: 0; margin-left: 6px; text-decoration: underline;
}

.maturation-list { display: flex; flex-direction: column; gap: 10px; }
.maturation-option {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm); cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--navy-900);
}
.maturation-option:has(input:checked) { border-color: var(--sn-gold); background: #FFFBEE; }
.maturation-option input { width: 17px; height: 17px; }

.recap-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.recap-table th { text-align: left; padding: 9px 12px 9px 0; color: var(--gray-700); font-weight: 600; width: 220px; vertical-align: top; }
.recap-table td { padding: 9px 0; border-top: 1px solid var(--gray-100); }
.recap-table th { border-top: 1px solid var(--gray-100); }

@media (max-width: 900px) {
  .week-calendar-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 640px) {
  .week-calendar-grid { grid-template-columns: repeat(2, 1fr); }
  .week-calendar-title { min-width: 0; font-size: 12.5px; }
}

/* --- Filtres --- */
.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.toolbar select, .toolbar input[type="text"], .toolbar input[type="search"] {
  padding: 8px 11px; border-radius: var(--radius-sm); border: 1.5px solid var(--gray-200);
  background: var(--white); font-size: 13px; min-width: 150px;
}

/* --- Tables --- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); background: var(--white); }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data-table th {
  text-align: left; background: var(--navy-50); color: var(--navy-800);
  font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 12px 14px; font-weight: 700; white-space: nowrap;
  border-bottom: 1.5px solid var(--gray-200);
}
table.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; color: var(--gray-900); }
table.data-table tbody tr:last-child td { border-bottom: none; }
table.data-table tbody tr:nth-child(even) { background: var(--gray-50); }
table.data-table tbody tr:hover { background: var(--navy-50); }
table.data-table tbody tr.row-highlight { background: var(--status-critique-bg); }
table.data-table .cell-muted { color: var(--gray-500); }
table.data-table .cell-actions { display: flex; gap: 6px; white-space: nowrap; }
.icon-btn {
  border: none; background: var(--gray-100); color: var(--navy-700);
  width: 30px; height: 30px; border-radius: 8px; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--navy-100); }
.icon-btn.danger:hover { background: var(--status-critique-bg); color: var(--sn-red); }

.empty-state {
  text-align: center; padding: 50px 20px; color: var(--gray-500);
}
.empty-state .ico { font-size: 34px; margin-bottom: 10px; opacity: 0.6; }
.empty-state h4 { color: var(--gray-700); font-size: 15px; margin-bottom: 6px; }
.empty-state p { font-size: 13px; max-width: 360px; margin: 0 auto; }

.loading-row td { text-align: center; padding: 30px; color: var(--gray-500); }
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid var(--gray-200); border-top-color: var(--navy-600);
  animation: spin 700ms linear infinite; display: inline-block; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Badges (criticité / statut) : couleurs inspirées du drapeau --- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.01em;
  white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-faible, .badge-realise, .badge-decide     { background: var(--status-faible-bg); color: var(--status-faible-fg); }
.badge-moyenne, .badge-encours, .badge-attente   { background: var(--status-moyenne-bg); color: var(--status-moyenne-fg); }
.badge-critique, .badge-retard, .badge-bloque, .badge-rejete { background: var(--status-critique-bg); color: var(--status-critique-fg); }
.badge-info, .badge-nondemarre, .badge-conseil   { background: var(--status-info-bg); color: var(--status-info-fg); }
.badge-neutral { background: var(--gray-100); color: var(--gray-700); }
.badge-suspendu {
  background: var(--gray-50); color: var(--gray-500); border: 1.5px dashed var(--gray-300);
}

/* Projets suspendus : rendu volontairement terne ("désactivé") pour se
   distinguer des projets actifs et attirer l'attention par contraste. */
tr.is-suspended { opacity: 0.55; filter: grayscale(45%); }
tr.is-suspended:hover { opacity: 0.8; }
.project-card.is-suspended { opacity: 0.55; filter: grayscale(45%); border-left-color: var(--gray-300); }
.project-card.is-suspended:hover { opacity: 0.85; }

/* --- Barre de progression --- */
.progress { background: var(--gray-100); border-radius: 999px; height: 8px; overflow: hidden; width: 100%; min-width: 70px; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--navy-600), var(--sn-green)); border-radius: 999px; transition: width 400ms ease; }
.progress-row { display: flex; align-items: center; gap: 10px; }
.progress-row .pct { font-size: 12px; font-weight: 700; color: var(--navy-800); width: 34px; text-align: right; }

/* --- Onglets --- */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--gray-200); margin-bottom: 18px; }
.tab-btn {
  border: none; background: transparent; padding: 10px 16px;
  font-size: 13.5px; font-weight: 600; color: var(--gray-500);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.tab-btn.active { color: var(--navy-800); border-bottom-color: var(--sn-gold); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* --- Cartes projet (grille) --- */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.project-card {
  background: var(--white); border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
  padding: 18px; cursor: pointer; transition: box-shadow var(--transition), transform var(--transition);
  border-left: 4px solid var(--navy-600);
}
.project-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.project-card .pc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.project-card h4 { font-size: 15px; color: var(--navy-900); line-height: 1.35; }
.project-card .pc-meta { font-size: 12px; color: var(--gray-500); margin-top: 4px; }
.project-card .pc-maturation {
  display: inline-block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--navy-700); background: var(--navy-50); border-radius: 4px; padding: 3px 8px; margin-bottom: 10px;
}
.project-card .pc-stats { display: flex; justify-content: space-between; margin-top: 14px; font-size: 12px; color: var(--gray-500); }
.project-card .pc-stats strong { color: var(--navy-900); font-size: 13px; }

.badge-maturation { background: var(--navy-100); color: var(--navy-800); }

/* --- Onglets de niveau de maturation (liste des projets) --- */
.tab-count {
  display: inline-block; min-width: 18px; padding: 1px 6px; margin-left: 4px; border-radius: 10px;
  background: var(--gray-100); color: var(--gray-700); font-size: 11px; font-weight: 700;
}
.tab-btn.active .tab-count { background: var(--sn-gold); color: var(--navy-950); }

/* --- Alertes --- */
.alert-list { display: flex; flex-direction: column; gap: 10px; }
.alert-item {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--white); border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
  padding: 14px 16px; border-left: 4px solid var(--gray-300);
}
.alert-item.niveau-critique { border-left-color: var(--sn-red); }
.alert-item.niveau-avertissement { border-left-color: var(--sn-gold); }
.alert-item.niveau-info { border-left-color: var(--navy-500); }
.alert-item .al-ico { font-size: 18px; margin-top: 1px; }
.alert-item .al-body { flex: 1; }
.alert-item .al-title { font-size: 13.5px; color: var(--gray-900); line-height: 1.5; }
.alert-item .al-meta { font-size: 11.5px; color: var(--gray-500); margin-top: 4px; }
.alert-item .al-actions { flex-shrink: 0; }

/* --- Rubriques Alertes dépassées / à venir --- */
.alerts-section { margin-bottom: 18px; }
.alerts-section:last-child { margin-bottom: 0; }
.alerts-section-count {
  display: inline-block; background: var(--gray-100); color: var(--gray-700);
  border-radius: 999px; padding: 1px 9px; font-size: 11.5px; font-weight: 700; margin-left: 4px;
}
#alerts-section-depassees .alerts-section-count { background: rgba(200,40,40,0.12); color: var(--sn-red); }
#alerts-section-avenir .alerts-section-count { background: rgba(230,179,37,0.16); color: var(--navy-900); }

/* --- Mon Agenda (planning personnel) --- */
.agenda-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.agenda-toolbar h3 { margin: 0; font-size: 16px; color: var(--navy-900); min-width: 190px; text-align: center; }
.agenda-legend { display: flex; gap: 14px; margin-left: auto; font-size: 11.5px; color: var(--gray-500); flex-wrap: wrap; }
.agenda-legend-item { display: flex; align-items: center; gap: 4px; }

/* --- Sélecteur avec recherche (listes longues) --- */
.searchable-select { position: relative; }
.searchable-select-input { width: 100%; }
.searchable-select-results {
  display: none; position: absolute; top: calc(100% + 2px); left: 0; right: 0; z-index: 60;
  background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md); max-height: 220px; overflow-y: auto;
}
.searchable-select-item { padding: 8px 12px; font-size: 13px; color: var(--navy-900); cursor: pointer; }
.searchable-select-item:hover { background: var(--navy-50); }
.searchable-select-empty { padding: 10px 12px; font-size: 12.5px; color: var(--gray-500); font-style: italic; }
.agenda-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.agenda-dot.prio-critique { background: var(--sn-red); }
.agenda-dot.prio-haute { background: var(--sn-gold); }
.agenda-dot.prio-normale { background: var(--navy-500); }

.agenda-grid { background: var(--white); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); overflow: hidden; }
.agenda-grid-header { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--navy-900); }
.agenda-day-name { color: var(--white); text-align: center; padding: 8px 0; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.agenda-grid-body { display: grid; grid-template-columns: repeat(7, 1fr); }
.agenda-day-cell {
  min-height: 100px; border-right: 1px solid var(--gray-100); border-bottom: 1px solid var(--gray-100);
  padding: 6px; cursor: pointer; transition: background 120ms ease;
}
.agenda-day-cell:hover { background: var(--navy-50); }
.agenda-day-cell.is-out { background: var(--gray-50); }
.agenda-day-cell.is-out .agenda-day-num { color: var(--gray-300); }
.agenda-day-num { font-size: 12px; font-weight: 700; color: var(--navy-900); margin-bottom: 4px; }
.agenda-day-cell.is-today .agenda-day-num {
  background: var(--sn-gold); color: var(--navy-950); border-radius: 50%;
  width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center;
}
.agenda-day-events { display: flex; flex-direction: column; gap: 3px; }
.agenda-event-chip {
  font-size: 10.5px; padding: 2px 6px; border-radius: 4px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; cursor: pointer; font-weight: 600;
}
.agenda-event-chip.prio-critique { background: var(--sn-red); color: var(--white); }
.agenda-event-chip.prio-haute { background: var(--sn-gold); color: var(--navy-950); }
.agenda-event-chip.prio-normale { background: var(--navy-700); color: var(--white); }
.agenda-more { font-size: 10px; color: var(--gray-500); padding-left: 4px; }

@media (max-width: 900px) {
  .agenda-day-cell { min-height: 70px; }
  .agenda-legend { display: none; }
}

/* --- Formulaires en grille (modales) --- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

/* --- Modales --- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(6, 27, 50, 0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 20px; backdrop-filter: blur(2px);
}
.modal {
  background: var(--white); border-radius: var(--radius-lg);
  width: 100%; max-width: 620px; max-height: 88vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: rise 220ms ease;
}
.modal.modal-lg { max-width: 860px; }
.modal.modal-xl { max-width: 1080px; width: 95%; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--gray-100);
}
.modal-header h3 { font-size: 16.5px; color: var(--navy-900); }
.modal-close { background: none; border: none; font-size: 20px; color: var(--gray-500); line-height: 1; padding: 4px; }
.modal-close:hover { color: var(--sn-red); }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-footer { padding: 16px 22px; border-top: 1px solid var(--gray-100); display: flex; justify-content: flex-end; gap: 10px; }

/* --- Toasts --- */
#toast-stack {
  position: fixed; bottom: 20px; right: 20px; z-index: 400;
  display: flex; flex-direction: column-reverse; gap: 10px; max-width: 340px;
  pointer-events: none;
}
.toast { pointer-events: auto; }
.toast {
  background: var(--navy-950); color: var(--white);
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 13px; box-shadow: var(--shadow-md);
  display: flex; align-items: center; gap: 10px;
  animation: toast-in 220ms ease;
  border-left: 4px solid var(--sn-gold);
}
.toast.toast-success { border-left-color: var(--sn-green); }
.toast.toast-error { border-left-color: var(--sn-red); }
@keyframes toast-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: translateX(0); } }

/* --- Dropzone import --- */
.dropzone {
  border: 2px dashed var(--gray-300); border-radius: var(--radius-md);
  padding: 34px 20px; text-align: center; color: var(--gray-500);
  background: var(--navy-50); transition: border-color var(--transition), background var(--transition);
  cursor: pointer;
}
.dropzone.drag-over { border-color: var(--navy-600); background: var(--navy-100); color: var(--navy-800); }
.dropzone .dz-ico { font-size: 30px; margin-bottom: 10px; }
.dropzone strong { color: var(--navy-800); }
.dropzone input[type="file"] { display: none; }

.import-summary { margin-top: 18px; }
.import-summary .is-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.import-summary .is-num { background: var(--navy-50); border-radius: var(--radius-sm); padding: 12px; text-align: center; }
.import-summary .is-num b { display: block; font-size: 20px; color: var(--navy-900); }
.import-summary .is-num span { font-size: 11px; color: var(--gray-500); text-transform: uppercase; }

/* --- Portfolio switcher (admin/gestionnaire) --- */
.portfolio-switch { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.portfolio-switch select { min-width: 220px; }

/* --- Divers --- */
.text-muted { color: var(--gray-500); }
.mt-0 { margin-top: 0; }
.section-divider { height: 1px; background: var(--gray-100); margin: 22px 0; }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
.sidebar-toggle { display: none; background: none; border: none; color: var(--white); font-size: 20px; padding: 6px 10px; }

@media (max-width: 1024px) {
  .app-sidebar { transform: translateX(-100%); transition: transform 220ms ease; box-shadow: var(--shadow-lg); }
  .app-sidebar.open { transform: translateX(0); }
  .app-main { margin-left: 0; width: 100%; }
  .sidebar-toggle { display: inline-flex; align-items: center; }
  .app-header .header-left { width: auto; padding-left: 8px; }
  #sidebar-backdrop { display: none; position: fixed; inset: 0; top: 64px; background: rgba(6,27,50,0.45); z-index: 39; }
  #sidebar-backdrop.show { display: block; }
}

@media (max-width: 720px) {
  #view-root { padding: 20px 16px; }
  .header-center { display: none; }
  .header-user .who { display: none; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .view-header { flex-direction: column; }
  .login-card { padding: 30px 22px 26px; }
  .import-summary .is-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  table.data-table th, table.data-table td { padding: 10px 8px; font-size: 12.5px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* =====================================================================
   INTRANET — dossiers, décisions, notes, réunions
   ===================================================================== */
.btn-secondary { background: var(--navy-50); color: var(--navy-800); border: 1.5px solid var(--navy-100, var(--gray-200)); }
.btn-secondary:hover { background: var(--navy-100, var(--gray-100)); }

.row-clickable { cursor: pointer; }
.row-clickable:hover { background: var(--navy-50); }

.checkbox-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 220px; overflow-y: auto;
  border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--white);
}
.checkbox-list-item { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 500; cursor: pointer; }
.checkbox-list-item input[type="checkbox"] { width: 16px; height: 16px; }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.note-card { cursor: pointer; transition: box-shadow 160ms ease, transform 160ms ease; }
.note-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.note-card p { font-size: 12.5px; margin: 4px 0; }

.option-row {
  display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr auto; gap: 8px; margin-bottom: 8px; align-items: center;
}
.option-row input { padding: 8px 10px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm); font-size: 13px; }
.option-row.option-row--retenue { grid-template-columns: auto 1.2fr 1fr 1fr 1fr auto; }
.opt-retenue-radio { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--gray-700); white-space: nowrap; }
.opt-retenue-radio input { width: auto; padding: 0; }
@media (max-width: 720px) { .option-row, .option-row.option-row--retenue { grid-template-columns: 1fr; } }

.form-actions { display: flex; justify-content: flex-end; margin-top: 10px; }

/* --- Éditeur de texte avancé (Quill) --------------------------------- */
.rich-editor-field { margin-bottom: 14px; }
.rich-editor-field > label { display: block; font-size: 12.5px; font-weight: 700; color: var(--gray-700); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.03em; }
.rich-editor { background: var(--white); border-radius: var(--radius-sm); }
.rich-editor .ql-toolbar.ql-snow { border-color: var(--gray-200); border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: var(--gray-50); }
.rich-editor .ql-container.ql-snow { border-color: var(--gray-200); border-radius: 0 0 var(--radius-sm) var(--radius-sm); font-size: 13.5px; }
.rich-editor .ql-editor { min-height: 110px; max-height: 320px; overflow-y: auto; }
.rich-editor.rich-editor-lg .ql-editor { min-height: 170px; }
.rich-editor.rich-editor-readonly .ql-container.ql-snow { border-radius: var(--radius-sm); background: var(--gray-50); }
.rich-editor.rich-editor-readonly .ql-editor { min-height: 0; cursor: default; }

.kanban-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; align-items: start; }
.kanban-column {
  background: var(--gray-50); border-radius: var(--radius-md); padding: 10px; min-height: 60px;
  border-top: 3px solid var(--gray-300);
}
.kanban-col-header {
  display: flex; align-items: center; justify-content: space-between; padding: 6px 6px 10px;
  font-size: 12.5px; font-weight: 700; color: var(--navy-900); text-transform: uppercase; letter-spacing: 0.03em;
}
.kanban-col-count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 11px; background: var(--navy-900); color: var(--white); font-size: 11.5px; font-weight: 700;
}

/* Couleurs par statut — un ton agréable et distinct par colonne, Bloqué
   en rouge pour signaler l'urgence (autres tons pastel, cohérents avec
   les badges de statut déjà utilisés ailleurs dans l'application). */
.kanban-column--bleu    { background: var(--status-info-bg);     border-top-color: var(--navy-500); }
.kanban-column--ambre   { background: var(--status-moyenne-bg);  border-top-color: var(--sn-gold); }
.kanban-column--rouge   { background: var(--status-critique-bg); border-top-color: var(--sn-red); }
.kanban-column--vert    { background: var(--status-faible-bg);   border-top-color: var(--sn-green); }
.kanban-column--teal    { background: var(--status-teal-bg);     border-top-color: var(--status-teal-fg); }
.kanban-column--violet  { background: var(--status-violet-bg);   border-top-color: var(--status-violet-fg); }
.kanban-column--neutre  { background: var(--status-neutral-bg);  border-top-color: var(--gray-500); }

.kanban-column--bleu .kanban-col-count   { background: var(--navy-500); }
.kanban-column--ambre .kanban-col-count  { background: var(--status-moyenne-fg); }
.kanban-column--rouge .kanban-col-count  { background: var(--sn-red); }
.kanban-column--vert .kanban-col-count   { background: var(--sn-green); }
.kanban-column--teal .kanban-col-count   { background: var(--status-teal-fg); }
.kanban-column--violet .kanban-col-count { background: var(--status-violet-fg); }
.kanban-column--neutre .kanban-col-count { background: var(--status-neutral-fg); }
.kanban-col-body { display: flex; flex-direction: column; gap: 10px; }
.kanban-col-empty { font-size: 11.5px; color: var(--gray-300); font-style: italic; text-align: center; padding: 14px 4px; }
.kanban-card {
  background: var(--white); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm);
  padding: 12px; cursor: pointer; transition: box-shadow 160ms ease, transform 160ms ease;
}
.kanban-card:hover { box-shadow: 0 4px 14px rgba(10, 42, 74, 0.14); transform: translateY(-1px); }
.kanban-card p { font-size: 12px; margin: 4px 0; color: var(--gray-700); }
.kanban-card-title { font-size: 13px; font-weight: 600; color: var(--navy-900); margin-bottom: 4px; }
.kanban-card-actions { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.kanban-card-actions select { font-size: 11.5px; padding: 4px 6px; }

/* --- Base documentaire : mots-clés (pastilles) --- */
.kw-input { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 8px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm); background: var(--white); }
.kw-input-field { flex: 1; min-width: 140px; border: none !important; outline: none; box-shadow: none !important; padding: 4px !important; font-size: 13px; }
.kw-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--navy-50); color: var(--navy-900); border: 1px solid var(--gray-200); border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; }
.kw-chip-x { border: none; background: none; cursor: pointer; font-size: 15px; line-height: 1; color: var(--gray-500); padding: 0; }
.kw-chip-ro { font-weight: 500; margin: 1px 0; }
.kw-chip-btn { cursor: pointer; }
.kw-chip-btn small { color: var(--gray-500); }
.kw-chip-btn.active { background: var(--navy-900); color: var(--white); border-color: var(--navy-900); }
.kw-chip-btn.active small { color: #C9DAF8; }
.kw-cloud { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 12px; }
