/* ==========================================
   STYLE GLOBAL - Interface PUI FOREM
   ========================================== */

body {
  font-family: 'Segoe UI', sans-serif;
  background: #f4f7f6;
  margin: 0;
  padding: 30px 0;
  color: #333;
}

/* ——————  FEUILLE CENTRALE —————— */

.pui-form {
  width: 1150px;
  margin: 0 auto;
  background: #ffffff;
  position: relative;
  border-left: 2px solid #ccc;  /* lignes gris clair */
  border-right: 2px solid #ccc;
  padding: 40px 30px 60px 30px;
  box-shadow: 0 0 15px rgba(0,0,0,0.05);
  box-sizing: border-box;
}

/* ——————  TITRES HIÉRARCHIQUES —————— */

.titre-n1 {
  background: #2F3A44;          /* gris bleuté foncé */
  color: #FFFFFF;
  font-weight: bold;
  padding: 12px 20px;
  margin: 40px -30px 20px -30px; /* fond sur toute la feuille */
  font-size: 18px;
}

.titre-n2 {
  background: #5A6B7A;          /* gris bleuté moyen */
  color: #FFFFFF;
  font-weight: bold;
  padding: 10px 20px;
  margin: 30px -30px 15px -30px;
  font-size: 16px;
}

.titre-n3 {
  background: #AEB8C2;          /* gris bleuté clair */
  color: #000;
  font-weight: normal;
  padding: 8px 20px;
  margin: 25px -30px 10px -30px;
  font-size: 15px;
}

.titre-n4 {
  background: #E3E7EB;          /* gris très clair */
  color: #000;
  font-weight: normal;
  padding: 8px 20px;
  margin: 15px -30px 10px -30px;
  font-size: 14px;
}

/* ——————  TABLEAUX —————— */

table {
  width: calc(100% - 20px);   /* pour laisser 10px d’espace de chaque côté */
  margin: 10px auto 20px auto;
  border-collapse: collapse;
  border: 1px solid #ccc;
  font-size: 13px;
}

th, td {
  border: 1px solid #ccc;
  padding: 8px;
  text-align: left;
}

thead tr.titre-n4 th {
  background: #E3E7EB;
  color: #000;
  text-align: left;
  font-weight: bold;
}

/* ——————  FORMULAIRES —————— */

input[type="text"],
input[type="number"],
input[type="date"],
textarea,
select {
  width: 100%;
  padding: 6px;
  border: 1px solid #ccc;
  border-radius: 3px;
  box-sizing: border-box;
  background: transparent;
  font-size: 13px;
}

input:disabled,
textarea:disabled,
select:disabled {
  background: #f5f5f5;
  color: #777;
}

/* Uniformiser la hauteur et l'apparence de tous les champs */
input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
select,
textarea {
  box-sizing: border-box;
  height: 30px;
  line-height: 30px;
  padding: 2px 6px;
  font-family: inherit;
  font-size: 14px;
}
/* Ajuste spécifiquement les zones de texte multi‑lignes */
textarea {
  min-height: 60px;
  line-height: normal;
}
.header-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;  /* ← garde gauche et droite sur la même ligne */
  padding: 8px 10px;
  background: white;
  border-bottom: 2px solid #ddd;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.left-group {
  display: flex;
  align-items: center;
  gap: 10px; /* espace entre logo et recherche */
  flex-shrink: 1; /* autorise ce groupe à réduire si la fenêtre est étroite */
}

.right-group {
  display: flex;
  align-items: center;
  gap: 6px; /* espace entre les boutons */
  flex-shrink: 0; /* garde les boutons regroupés à droite */
}

.logo-forem {
  height: 45px;
  margin-right: 5px;
  vertical-align: middle;
}


/* ——————  LIGNES DE TEXTE / BLOCS —————— */

.text-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0;
}

/* ——————  BOUTONS —————— */

.btn-back {
  display: inline-flex;
  align-items: center;
  background: #E3E7EB;
  color: #2F3A44;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 13px;
  transition: background 0.2s;
  margin-bottom: 20px;
}
.btn-back:hover { background: #d7dce0; }

.btn-action {
  cursor: pointer;
  border: none;
  font-weight: bold;
  color: #fff;
  border-radius: 4px;
  padding: 4px 9px;
  font-size: 13px;
  transition: opacity 0.2s;
}
.btn-action:hover { opacity: 0.8; }

.btn-green { background: #27ae60; }
.btn-red   { background: #e74c3c; }

.btn-save {
  background: #2ecc71;
  border: none;
  color: #fff;
  padding: 12px 25px;
  font-weight: bold;
  font-size: 15px;
  border-radius: 4px;
  margin-top: 40px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* ——————  BLOCS DE CONTACT / CADRES —————— */

.contact-box {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 15px;
  margin-bottom: 25px;
  background: transparent;
}

/* ——————  ICONES + / x —————— */

.icon-btn {
  cursor: pointer;
  font-weight: bold;
  display: inline-block;
  width: 22px;
  height: 22px;
  line-height: 22px;
  text-align: center;
  border-radius: 50%;
  color: #fff;
}

.icon-btn.add { background: #27ae60; }
.icon-btn.remove { background: #e74c3c; }

/* Indicateur d’erreur */
.input-error {
  border-color: red !important;
  background: #ffe6e6;
}
/* ——————  BOUTON SUPPRESSION DE LIGNE VIDE —————— */
.table-remove-btn {
  position: absolute;
  right: -35px;          /* espace entre le bord du tableau et la zone utile */
  top: 50%;
  transform: translateY(-50%);
  background: #e74c3c;
  color: #fff;
  font-weight: bold;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  line-height: 22px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.table-remove-btn:hover {
  background: #c0392b;
}
table td:last-child,
table th:last-child {
  text-align: center;
  width: 70px;
  white-space: nowrap;
}
#bloc_desenfumage_details {
  transition: all 0.3s ease;
}
/* Points 6.1 et 6.2 : zones de texte non redimensionnables horizontalement,
   hauteur initiale = deux fois la hauteur standard */
textarea[name="acces_grands_axes"],
textarea[name="acces_site"] {
  resize: vertical;      /* redimension uniquement vertical */
  min-height: 30px;      /* hauteur minimale = champ standard */
  height: 60px;          /* hauteur par défaut = 2 × minimale */
  line-height: 30px;     /* alignement du texte cohérent */
}

/* -------- Table des matières + Table des annexes : règles unifiées -------- */

.table-annexes {
  width: 750px;
  margin: 25px auto;
  border-collapse: collapse;
}

/* Règle maîtresse : padding uniforme sur TOUTES les cellules
   Écrase th,td { padding:8px } et tout line-height parasite */
.table-annexes td,
.table-annexes th {
  border: 1px solid #ccc;
  font-size: 13px;
  padding: 3px 8px;           /* hauteur compacte, identique TOC et annexes */
  line-height: 1.4;
}

.table-annexes thead th {
  text-align: center;
  font-weight: bold;
}

/* Indentation des niveaux TOC — sur le TD directement */
.table-annexes .toc-l1 { padding-left: 8px; }
.table-annexes .toc-l2 { padding-left: 2em; }
.table-annexes .toc-l3 { padding-left: 4em; }

/* Liens dans les tables */
.table-annexes td a,
.table-annexes .toc-item {
  color: inherit;
  text-decoration: none;
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  display: block;
  padding: 0;                 /* pas de padding sur le lien : le TD gère la hauteur */
}
.table-annexes td a:hover,
.table-annexes .toc-item:hover {
  font-weight: bold;
  text-decoration: none;
}

/* Indentation fallback hors .table-annexes */
.toc-l1 { padding-left: 0; }
.toc-l2 { padding-left: 2ch; }
.toc-l3 { padding-left: 4ch; }

/* Boutons flottants "remonter" */
.fab-stack {
  position: fixed;
  right: 22px;          /* distance du bord droit */
  bottom: 22px;         /* distance du bas */
  display: flex;
  flex-direction: column;
  gap: 12px;            /* espace entre les deux boutons */
  z-index: 2000;        /* au-dessus du contenu */
}

/* style commun aux deux boutons */
.fab {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #cfcfcf;  /* contour gris */
  color: #2F3A44;             /* icône gris bleuté du thème */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;      /* pas de soulignement */
  font-size: 20px;            /* taille de l’icône */
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
  border-color: #bdbdbd;
}

/* Accessibilité: focus visible au clavier */
.fab:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(47,58,68,0.2);
}

/* Cacher/montrer selon le scroll (optionnel, contrôlé par JS) */
.fab-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.fab-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* ——————  ICONE INFO GPS —————— */
.gps-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2F3A44;
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  font-style: normal;
  cursor: help;
  vertical-align: middle;
  flex-shrink: 0;
  user-select: none;
}

/* ==========================================
   PAGE DE CONNEXION (login.php)
   Styles déplacés depuis le bloc <style> inline pour compatibilité
   CSP stricte (style-src 'self' sans 'unsafe-inline').
   Tout est porté sous .login-page pour ne PAS interférer avec le
   style global du formulaire PIU (et inversement).
   ========================================== */

body.login-page {
  font-family: sans-serif;
  background-color: #f0f0f0;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  margin: 0;
  padding: 0;
}

.login-page .login-box {
  background: #ffffff;
  padding: 30px;
  border: 1px solid #ccc;
  width: 100%;
  max-width: 350px;
  text-align: center;
  box-sizing: border-box;
}

.login-page h2 {
  color: #333;
  margin-bottom: 25px;
  font-weight: normal;
  font-size: 22px;
}

.login-page .form-group {
  margin-bottom: 20px;
  text-align: left;
}

.login-page label {
  display: block;
  margin-bottom: 8px;
  color: #333;
  font-size: 14px;
}

.login-page input[type="email"],
.login-page input[type="password"] {
  width: 100%;
  padding: 10px;
  border: 1px solid #999;
  box-sizing: border-box;
  outline: none;
  height: auto;          /* neutralise la hauteur 30px du style global des champs */
  line-height: normal;
  font-size: 14px;
}

.login-page button {
  width: 100%;
  padding: 12px;
  background-color: #333;
  color: #fff;
  border: none;
  font-size: 16px;
  cursor: pointer;
}

.login-page button:hover {
  background-color: #000;
}

.login-page .error-msg {
  color: #fff;
  background: #d32f2f;
  padding: 10px;
  margin-bottom: 20px;
  font-size: 14px;
}

.login-page .success-msg {
  color: #fff;
  background: #4CAF50;
  padding: 10px;
  margin-bottom: 20px;
  font-size: 14px;
}

.login-page .link {
  font-size: 12px;
  margin-top: 15px;
  display: block;
  color: #666;
  text-decoration: none;
}

.login-page .link:hover {
  text-decoration: underline;
}

/* ==========================================
   PAGE « SESSION EXPIRÉE » (security.php → sec_die_session_expiree)
   Styles déplacés depuis le bloc <style> inline pour compatibilité
   CSP stricte. Portée sous .session-expiree pour ne pas interférer
   avec le reste du site.
   ========================================== */

body.session-expiree {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #f4f6f8;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

.session-expiree .se-box {
  background: #fff;
  border: 1px solid #e0e4e8;
  border-radius: 10px;
  padding: 32px 40px;
  max-width: 440px;
  text-align: center;
  box-shadow: 0 4px 18px rgba(0,0,0,.08);
}

.session-expiree .se-box h1 {
  font-size: 19px;
  color: #2F3A44;
  margin: 0 0 12px;
}

.session-expiree .se-box p {
  font-size: 15px;
  color: #5A6B7A;
  line-height: 1.5;
  margin: 0 0 20px;
}

.session-expiree .se-box a {
  display: inline-block;
  background: #2F3A44;
  color: #fff;
  text-decoration: none;
  padding: 10px 22px;
  border-radius: 6px;
  font-size: 15px;
}

.session-expiree .se-box a:hover {
  background: #3d4b57;
}

/* ==========================================
   PAGE « PREMIÈRE CONNEXION » (register.php)
   Styles déplacés depuis le bloc <style> inline (CSP stricte).
   Portée sous .register-page pour isolation.
   ========================================== */

body.register-page {
  font-family: sans-serif;
  background-color: #f0f0f0;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  margin: 0;
  padding: 0;
}

.register-page .box {
  background: #ffffff;
  padding: 30px;
  border: 1px solid #ccc;
  width: 100%;
  max-width: 400px;
  box-sizing: border-box;
}

.register-page input,
.register-page button {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  box-sizing: border-box;
  height: auto;          /* neutralise la hauteur 30px du style global des champs */
  line-height: normal;
}

.register-page button {
  background-color: #333;
  color: #fff;
  border: none;
  cursor: pointer;
}

.register-page .err {
  background: #d32f2f;
  color: white;
  padding: 10px;
  margin-bottom: 15px;
}

.register-page .success-box {
  background-color: #4CAF50;
  color: white;
  padding: 20px;
  border-radius: 5px;
  text-align: center;
  margin-bottom: 20px;
  font-weight: bold;
  line-height: 1.5;
}

.register-page .link-retour {
  display: block;
  text-align: center;
  margin-top: 20px;
  color: #0066cc;
  text-decoration: none;
  font-weight: bold;
}

.register-page .link-retour:hover {
  text-decoration: underline;
}

/* Lien « Annuler » (ex-style inline) */
.register-page .link-annuler {
  display: block;
  text-align: center;
  margin-top: 10px;
  color: #666;
  font-size: 13px;
  text-decoration: none;
}

/* ==========================================
   TABLEAU DE BORD (dashboard.php)
   Styles déplacés depuis le bloc <style> inline (CSP stricte).
   Le body est porté sous .dashboard-page pour ne pas écraser le body global.
   ========================================== */
body.dashboard-page { font-family: sans-serif; background: #f4f7f6; margin: 0; padding: 0; color: #333; }

    /* ═══════════════════════════════════
       BARRE DE NAVIGATION
    ═══════════════════════════════════ */
    .navbar {
      background: #fff;
      border-bottom: 2px solid #ddd;
      position: sticky;
      top: 0;
      z-index: 1000;
      padding: 0 12px;

    }

    /* Rangée unique, flex-wrap pour passer à la ligne si besoin */
    .navbar-inner {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 8px;
      padding: 8px 0;
    }

    /* Logo */
    .navbar-logo { height: 42px; flex-shrink: 0; }

    /* Recherche */
    .navbar-search { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
    .navbar-search input {
      padding: 5px 8px; width: 190px; border: 1px solid #ccc;
      border-radius: 4px; font-size: 13px;
    }
    .navbar-search .btn-ok {
      padding: 5px 11px; background: #2F3A44; color: #fff;
      border: none; border-radius: 4px; font-size: 13px; cursor: pointer;
    }
    .navbar-search .btn-ok:hover { background: #1e2a32; }
    .navbar-search .btn-clear {
      padding: 5px 9px; background: transparent; border: 1px solid #aaa;
      border-radius: 4px; font-size: 12px; color: #666; text-decoration: none; cursor: pointer;
    }

    /* Salutation */
    .navbar-hello { font-weight: bold; font-size: 13px; color: #2F3A44; white-space: nowrap; flex-shrink: 0; }

    /* Spacer : pousse urgences+burger+profil vers la droite */
    .navbar-spacer { flex: 1 1 0; min-width: 0; }

    /* Séparateur */
    .navbar-sep { width: 8px; flex-shrink: 0; }

    /* Groupe droite : urgences + burger + profil — indivisible */
    .navbar-right {
      display: flex;
      align-items: center;
      flex-wrap: nowrap;   /* jamais de rupture interne */
      flex-shrink: 0;      /* ne se rétrécit pas */
    }

    /* Bouton burger */
    .burger-wrap { position: relative; flex-shrink: 0; z-index: 10; }
    .burger-btn {
      width: 34px; height: 34px; background: #fff;
      border: 1px solid #bbb; border-radius: 6px;
      cursor: pointer; display: flex; flex-direction: column;
      justify-content: center; align-items: center; gap: 5px; padding: 0;
    }
    .burger-btn span { display: block; width: 18px; height: 2px; background: #999; border-radius: 2px; }
    .burger-btn:hover { border-color: #777; }
    .burger-btn:hover span { background: #444; }

    .burger-menu {
      display: none; position: absolute; right: 0; top: calc(100% + 6px);
      background: #fff; border: 1px solid #ddd; border-radius: 6px;
      min-width: 200px; box-shadow: 0 4px 16px rgba(0,0,0,0.12);
      z-index: 2000; overflow: hidden;
    }
    .burger-menu.open { display: block; }
    .burger-menu a {
      display: block; padding: 11px 18px; font-size: 13px;
      color: #2F3A44; text-decoration: none;
      border-bottom: 1px solid #f0f0f0; font-weight: 500;
    }
    .burger-menu a:last-child { border-bottom: none; }
    .burger-menu a:hover { background: #f4f7f6; }
    .burger-menu a.active { color: #0066cc; font-weight: 700; }

    /* Séparateur de menu (ligne grise) */
    .burger-menu .divider { 
      height: 1px; background: #e0e0e0; margin: 6px 0; 
    }

    /* Bouton profil */
    .profile-wrap { position: relative; flex-shrink: 0; margin-left: 8px; z-index: 10; }
    .profile-btn {
      width: 34px; height: 34px; background: #fff;
      border: 1px solid #bbb; border-radius: 50%;
      cursor: pointer; display: flex; align-items: center;
      justify-content: center; color: #999; font-size: 17px; padding: 0;
    }
    .profile-btn:hover { border-color: #777; color: #444; }

    .profile-menu {
      display: none; position: absolute; right: 0; top: calc(100% + 6px);
      background: #fff; border: 1px solid #ddd; border-radius: 6px;
      min-width: 200px; box-shadow: 0 4px 16px rgba(0,0,0,0.12);
      z-index: 2000; overflow: hidden;
    }
    .profile-menu.open { display: block; }
    .profile-menu .profile-name {
      display: block; padding: 12px 18px 8px;
      font-size: 13px; font-weight: 700; color: #2F3A44;
      border-bottom: 1px solid #f0f0f0; cursor: default;
    }
    .profile-menu a {
      display: block; padding: 10px 18px; font-size: 13px;
      color: #c0392b; text-decoration: none; font-weight: 600;
    }
    .profile-menu a:hover { background: #fdf0ee; }

    /* ═══════════════════════════════════
       LISTE DES BÂTIMENTS
    ═══════════════════════════════════ */
    .list-container { padding: 10px 20px; }

    .batiment-item {
      background: #fff; padding: 10px 15px; margin-bottom: 2px;
      display: flex; align-items: center;
      border-left: 4px solid #2F3A44;
      font-size: 14px; box-shadow: 0 1px 1px rgba(0,0,0,0.05);
    }
    .col-site { flex: 0 0 450px; font-weight: bold; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 15px; }
    .col-site a { color: #2F3A44; text-decoration: none; }
    .col-site a:hover { text-decoration: underline; }
    .col-rue     { flex: 2; color: #444; }
    .col-cp      { flex: 0 0 60px; text-align: center; color: #777; font-weight: bold; }
    .col-commune { flex: 1; color: #444; }
    .col-code    { flex: 0 0 100px; font-family: monospace; color: #888; font-size: 12px; text-align: center; background: #f9f9f9; padding: 4px; border-radius: 3px; }
    .col-actions { flex: 0 0 50px; text-align: right; }

    .btn-edit-pui {
      width: 30px; height: 30px; border-radius: 50%;
      border: 1px solid #bbb; background: #fff;
      display: flex; align-items: center; justify-content: center;
      cursor: pointer; text-decoration: none;
      font-size: 15px; line-height: 1;
      transition: background 0.15s, border-color 0.15s;
    }
    .btn-edit-pui:hover { background: #f0f0f0; border-color: #888; }

    .empty-state { text-align: center; padding: 60px 20px; color: #999; font-size: 15px; }

    /* Logos urgence en fond de navbar */
    #logos-bg {
      position: absolute;
      top: 50%;
      right: 96px;          /* laisser la place à burger+profil */
      transform: translateY(-50%);
      display: flex;
      align-items: center;
      gap: 8px;
      z-index: 0;
      pointer-events: none;
    }
    #logos-bg img {
      height: 48px;
      width: auto;
      opacity: 0.40;
    }

/* Liste des bâtiments (ex-style inline sur <ul>) */
.batiment-list { list-style: none; padding: 0; margin: 0; }

/* Adresse manquante (ex-style inline sur <i>) */
.adresse-vide { color: #ccc; }

/* ==========================================
   PAGES ADMIN (gestion_permissions.php, permissions_matrix.php,
   et autres pages au même gabarit : edittasks, gestion_sites…)
   Barre supérieure + badges + cadre central. Styles déplacés depuis
   les blocs <style> inline (CSP stricte). Les classes burger/profil
   sont déjà globales (définies via dashboard).
   ========================================== */

/* Body de ces pages admin */
body.admin-page {
  background: #f4f7f6;
  font-family: 'Segoe UI', sans-serif;
  margin: 0;
  padding: 20px 0;
}

/* Barre supérieure */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.top-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.urgences-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 4px;
}
.urgences-bar img {
  height: 44px;
  width: auto;
  opacity: 0.20;
}

/* Positionnement relatif des conteneurs burger/profil (ex-style inline) */
.admin-page .burger-wrap,
.admin-page .profile-wrap { position: relative; }

/* Cadre central */
.page-wrap {
  max-width: 95%;
  margin: 0 auto;
  background: #fff;
  padding: 30px;
  box-shadow: 0 0 12px rgba(0,0,0,0.08);
  position: relative;
  overflow: visible;
}
.page-wrap--1200 { width: 1200px; }
.page-wrap--1000 { width: 1000px; }

.page-wrap h1 { font-size: 20px; color: #2F3A44; margin-bottom: 20px; }
.page-wrap h1.h1-compact { margin-bottom: 6px; }

/* Badges de rôle (communs) */
.role-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: bold;
}
.role-badge.role-badge--mt { margin-top: 4px; }
.admin-badge       { background: #ffe0e0; color: #d32f2f; }
.ssa-badge         { background: #e8f5e9; color: #2e7d32; }
.sipp-badge        { background: #e3f2fd; color: #1565c0; }
.risk-badge        { background: #fff3e0; color: #e65100; }
.maintenance-badge { background: #f3e5f5; color: #6a1b9a; }

/* ── Spécifique gestion_permissions.php ── */
.table-wrapper { overflow-x: auto; margin: 20px 0; }
.page-wrap .message { padding: 12px 16px; border-radius: 4px; margin-bottom: 20px; font-size: 14px; }
.page-wrap .message.success { background: #c8e6c9; color: #1b5e20; border-left: 4px solid #27ae60; }
.page-wrap .message.error   { background: #ffcdd2; color: #b71c1c; border-left: 4px solid #d32f2f; }
.user-cell  { font-weight: 500; margin-bottom: 4px; }
.user-email { color: #666; font-size: 12px; margin-bottom: 4px; }
.page-wrap .loading { display: none; text-align: center; color: #666; font-size: 13px; margin-top: 10px; }
.page-wrap .loading.active { display: block; }

/* Tableau des permissions (gestion_permissions) */
.perm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.perm-table thead { background: #f0f0f0; border-bottom: 2px solid #ddd; }
.perm-table th { padding: 12px; text-align: center; font-weight: bold; border: 1px solid #ddd; }
.perm-table th:first-child { text-align: left; width: 250px; }
.perm-table td { padding: 12px; border: 1px solid #f0f0f0; }
.perm-table td:first-child { text-align: left; width: 250px; font-weight: 500; }
.perm-table tr:hover { background: #f9f9f9; }
.perm-table td.cell-center { text-align: center; }
.perm-table input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; accent-color: #27ae60; }

/* ── Spécifique permissions_matrix.php ── */
.subtitle { font-size: 13px; color: #777; margin-bottom: 24px; }
.controls { margin-bottom: 20px; display: flex; gap: 10px; }
.btn {
  padding: 8px 16px; background: #f0f0f0; color: #333; border: none;
  border-radius: 4px; cursor: pointer; font-size: 13px;
  text-decoration: none; display: inline-block;
}
.btn:hover { background: #e0e0e0; }

.matrix-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.matrix-table thead { background: #f0f0f0; border-bottom: 2px solid #ddd; }
.matrix-table th { padding: 12px; text-align: left; font-weight: bold; font-size: 13px; }
.matrix-table td { padding: 12px; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
.matrix-table tr:hover { background: #f9f9f9; }
.user-col  { font-weight: 500; min-width: 200px; }
.email-col { color: #666; font-size: 12px; }
.perms-col { max-width: 350px; word-break: break-word; }
.perm-item { display: inline-block; background: #e3f2fd; color: #0d47a1; padding: 3px 8px; border-radius: 12px; margin: 2px; font-size: 11px; }
.perm-none { color: #999; }

/* Impression matrice */
@media print {
  body.admin-page { background: #fff; padding: 0; }
  .no-print, .admin-page .top-bar { display: none !important; }
}

/* Utilitaires ponctuels (ex-styles inline pages admin) */
.btn-back--flush { margin-bottom: 0; }
.h1-mt20 { margin-top: 20px; }

/* ==========================================
   ENCART ADMINISTRATION (menu_admin_link.php)
   ========================================== */
.admin-link-box {
  margin: 15px 0;
  padding: 12px;
  background: #f0f7ff;
  border-left: 3px solid #0066cc;
  border-radius: 4px;
}
.admin-link-title { color: #0066cc; }
.admin-link {
  color: #0066cc;
  text-decoration: none;
  font-size: 14px;
  margin-top: 8px;
  display: inline-block;
}

/* ==========================================
   PAGE « RÉINITIALISATION MOT DE PASSE » (forgot.php)
   Styles déplacés depuis le bloc <style> inline (CSP stricte).
   ========================================== */
body.forgot-page {
  font-family: sans-serif;
  background-color: #f0f0f0;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  margin: 0;
  padding: 0;
}
.forgot-page .box {
  background: #ffffff;
  padding: 30px;
  border: 1px solid #ccc;
  width: 100%;
  max-width: 350px;
  text-align: center;
  box-sizing: border-box;
}
.forgot-page input,
.forgot-page button {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  box-sizing: border-box;
  height: auto;
  line-height: normal;
}
.forgot-page button {
  background-color: #333;
  color: #fff;
  border: none;
  cursor: pointer;
}

/* ==========================================
   GESTION DES SECTIONS PAR RÔLE (edittasks.php)
   Gabarit .admin-page + classes spécifiques. Styles déplacés depuis
   le bloc <style> inline (CSP stricte).
   ========================================== */

/* Bandeau de titre de section */
.section-row {
  display: flex;
  align-items: center;
  margin-top: 6px;
  border-radius: 3px;
  padding: 0;
}
/* Couleurs par niveau (ex-styles inline dynamiques $bg/$fg) — reprennent les titres */
.section-row--n1 { background: #2F3A44; color: #fff; }
.section-row--n2 { background: #5A6B7A; color: #fff; }
.section-row--n3 { background: #AEB8C2; color: #000; }

.section-label {
  flex: 1;
  font-weight: bold;
  padding: 10px 16px;
  font-size: 14px;
}
/* Taille de police par niveau (ex-style inline dynamique $fsz) */
.section-label--n1 { font-size: 18px; }
.section-label--n2 { font-size: 16px; }
.section-label--n3 { font-size: 15px; }

/* Cases à cocher par rôle */
.roles-group {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  flex-shrink: 0;
}
.role-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 62px;
}
.role-item label {
  font-size: 11px;
  font-weight: bold;
  white-space: nowrap;
}
.role-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #27ae60;
  margin: 0;
}

/* En-tête des colonnes rôles */
.roles-header {
  display: flex;
  justify-content: flex-end;
  padding: 0 12px 6px 0;
  gap: 6px;
}
.roles-header span {
  min-width: 62px;
  text-align: center;
  font-size: 11px;
  font-weight: bold;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Bouton sauvegarder */
.btn-save-wrap { text-align: center; margin-top: 28px; }
.btn-save-tasks {
  background: #27ae60; color: #fff; border: none;
  padding: 12px 40px; font-size: 15px; font-weight: bold;
  border-radius: 4px; cursor: pointer;
}
.btn-save-tasks:hover { background: #1e8449; }

.alert-saved {
  background: #27ae60; color: #fff;
  padding: 10px 20px; border-radius: 4px;
  text-align: center; font-weight: bold;
  margin-bottom: 20px;
}

.note {
  background: #fff8e1; border-left: 4px solid #f9a825;
  padding: 10px 14px; font-size: 13px; color: #555;
  margin-bottom: 20px; border-radius: 2px;
}
.note--mt20 { margin-top: 20px; }

/* Largeur de cadre 900px (edittasks) */
.page-wrap--900 { width: 900px; }

/* ==========================================
   ARI (ari.php)
   Styles déplacés depuis le bloc <style> inline (CSP style-src stricte).
   TOUT est scopé sous .ari-page pour ne pas entrer en collision
   avec les classes homonymes de dashboard (.navbar/.list-container/.batiment-item…).
   ========================================== */
body.ari-page { font-family: sans-serif; background: #f4f7f6; margin: 0; padding: 0; color: #333; }

    /* ═══════════ NAVBAR (identique dashboard) ═══════════ */
.ari-page .navbar {
      background: #fff; border-bottom: 2px solid #ddd;
      position: sticky; top: 0; z-index: 1000; padding: 0 12px;
    }
.ari-page .navbar-inner { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 0; }
.ari-page .navbar-logo { height: 42px; flex-shrink: 0; }
.ari-page .navbar-search { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.ari-page .navbar-search input { padding: 5px 8px; width: 190px; border: 1px solid #ccc; border-radius: 4px; font-size: 13px; }
.ari-page .navbar-search .btn-ok { padding: 5px 11px; background: #2F3A44; color: #fff; border: none; border-radius: 4px; font-size: 13px; cursor: pointer; }
.ari-page .navbar-search .btn-ok:hover { background: #1e2a32; }
.ari-page .navbar-search .btn-clear { padding: 5px 9px; background: transparent; border: 1px solid #aaa; border-radius: 4px; font-size: 12px; color: #666; text-decoration: none; cursor: pointer; }
.ari-page .navbar-hello { font-weight: bold; font-size: 13px; color: #2F3A44; white-space: nowrap; flex-shrink: 0; }
.ari-page .navbar-spacer { flex: 1 1 0; min-width: 0; }
.ari-page .navbar-right { display: flex; align-items: center; flex-wrap: nowrap; flex-shrink: 0; }
.ari-page .burger-wrap { position: relative; flex-shrink: 0; z-index: 10; }
.ari-page .burger-btn { width: 34px; height: 34px; background: #fff; border: 1px solid #bbb; border-radius: 6px; cursor: pointer; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; padding: 0; }
.ari-page .burger-btn span { display: block; width: 18px; height: 2px; background: #999; border-radius: 2px; }
.ari-page .burger-btn:hover { border-color: #777; }
.ari-page .burger-btn:hover span { background: #444; }
.ari-page .burger-menu { display: none; position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid #ddd; border-radius: 6px; min-width: 200px; box-shadow: 0 4px 16px rgba(0,0,0,0.12); z-index: 2000; overflow: hidden; }
.ari-page .burger-menu.open { display: block; }
.ari-page .burger-menu a { display: block; padding: 11px 18px; font-size: 13px; color: #2F3A44; text-decoration: none; border-bottom: 1px solid #f0f0f0; font-weight: 500; }
.ari-page .burger-menu a:last-child { border-bottom: none; }
.ari-page .burger-menu a:hover { background: #f4f7f6; }
.ari-page .burger-menu a.active { color: #c0392b; font-weight: 700; }
.ari-page .profile-wrap { position: relative; flex-shrink: 0; margin-left: 8px; z-index: 10; }
.ari-page .profile-btn { width: 34px; height: 34px; background: #fff; border: 1px solid #bbb; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #999; font-size: 17px; padding: 0; }
.ari-page .profile-btn:hover { border-color: #777; color: #444; }
.ari-page .profile-menu { display: none; position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid #ddd; border-radius: 6px; min-width: 200px; box-shadow: 0 4px 16px rgba(0,0,0,0.12); z-index: 2000; overflow: hidden; }
.ari-page .profile-menu.open { display: block; }
.ari-page .profile-menu .profile-name { display: block; padding: 12px 18px 8px; font-size: 13px; font-weight: 700; color: #2F3A44; border-bottom: 1px solid #f0f0f0; cursor: default; }
.ari-page .profile-menu a { display: block; padding: 10px 18px; font-size: 13px; color: #c0392b; text-decoration: none; font-weight: 600; }
.ari-page .profile-menu a:hover { background: #fdf0ee; }
.ari-page #logos-bg { position: absolute; top: 50%; right: 96px; transform: translateY(-50%); display: flex; align-items: center; gap: 8px; z-index: 0; pointer-events: none; }
.ari-page #logos-bg img { height: 48px; width: auto; opacity: 0.40; }

    /* ═══════════ PAGE TITRE ═══════════ */
.ari-page .page-header {
      padding: 18px 20px 10px 20px;
      display: flex; align-items: center; gap: 12px;
    }
.ari-page .page-header h1 { font-size: 22px; color: #2F3A44; margin: 0; }
.ari-page .page-header .subtitle { font-size: 13px; color: #888; margin: 0; }

    /* ═══════════ LISTE BÂTIMENTS ═══════════ */
.ari-page .list-container { padding: 6px 20px 40px 20px; }

    /* Ligne bâtiment */
.ari-page .batiment-item {
      display: block; padding: 0;   /* neutralise la fuite du .batiment-item GLOBAL de dashboard (display:flex/padding) */
      background: #fff; margin-bottom: 4px;
      border-left: 4px solid #2F3A44;
      box-shadow: 0 1px 2px rgba(0,0,0,0.06);
      overflow: hidden;
    }

.ari-page .batiment-header {
      display: flex; align-items: center; padding: 10px 15px;
      font-size: 14px; cursor: pointer;
      user-select: none;
      transition: background 0.15s;
    }
.ari-page .batiment-header:hover { background: #f8f9fa; }

.ari-page .col-toggle {
      flex: 0 0 32px;
      display: flex; align-items: center; justify-content: center;
    }
.ari-page .toggle-btn {
      width: 26px; height: 26px; border-radius: 50%;
      border: 1px solid #bbb; background: #fff;
      display: flex; align-items: center; justify-content: center;
      font-size: 13px; color: #555; cursor: pointer;
      transition: all 0.2s; flex-shrink: 0;
    }
.ari-page .toggle-btn.open { background: #2F3A44; color: #fff; border-color: #2F3A44; transform: rotate(180deg); }

.ari-page .col-site { flex: 0 0 430px; font-weight: bold; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 15px 0 12px; color: #2F3A44; }
.ari-page .col-rue { flex: 2; color: #555; font-size: 13px; }
.ari-page .col-cp { flex: 0 0 60px; text-align: center; color: #777; font-weight: bold; font-size: 13px; }
.ari-page .col-commune { flex: 1; color: #555; font-size: 13px; }
.ari-page .col-code { flex: 0 0 100px; font-family: monospace; color: #888; font-size: 12px; text-align: center; background: #f9f9f9; padding: 4px; border-radius: 3px; }
.ari-page .col-stats { flex: 0 0 140px; display: flex; gap: 6px; align-items: center; justify-content: flex-end; }

    /* Badges compteurs de statuts */
.ari-page .stat-badge {
      display: inline-flex; align-items: center; justify-content: center;
      min-width: 22px; height: 22px; border-radius: 11px;
      font-size: 11px; font-weight: bold; padding: 0 6px;
    }

    /* ═══════════ PANNEAU ARI DÉROULANT ═══════════ */
.ari-page .ari-panel {
      display: none; border-top: 1px solid #e8eaec;
      background: #fafbfc;
    }
.ari-page .ari-panel.open { display: block; }

    /* Barre d'outils ARI */
.ari-page .ari-toolbar {
      display: flex; align-items: center; gap: 10px;
      padding: 8px 15px 8px 55px;
      background: #f0f2f4; border-bottom: 1px solid #dde1e5;
      flex-wrap: wrap;
    }
.ari-page .ari-toolbar label { font-size: 12px; color: #555; }
.ari-page .ari-toolbar select { font-size: 12px; padding: 3px 6px; border: 1px solid #ccc; border-radius: 3px; }
    /* Groupe catégorie */
.ari-page .ari-category-group { margin: 0; }
.ari-page .ari-category-title {
      background: #2F3A44; color: #fff;
      padding: 5px 15px 5px 55px;
      font-size: 13px; font-weight: bold;
      letter-spacing: 0.3px;
      display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    }
.ari-page .ari-category-title .cat-label { flex-shrink: 0; }

    /* Tableau ARI */
.ari-page .ari-table {
      width: 100%; border-collapse: collapse;
      font-size: 12px;
    }
.ari-page .ari-table thead tr th {
      background: #E3E7EB; color: #333;
      padding: 6px 8px; text-align: left;
      font-weight: bold; font-size: 11px;
      border-bottom: 2px solid #ccc;
      white-space: nowrap;
    }
.ari-page .ari-table tbody tr { border-bottom: 1px solid #eee; }
.ari-page .ari-table tbody tr:hover { background: #f5f7f8; }
.ari-page .ari-table td { padding: 6px 8px; vertical-align: middle; }

    /* Colonnes fixes */
.ari-page .td-ref { width: 42px;  color: #888; font-family: monospace; font-weight: bold; }
.ari-page .td-nature { width: 150px; }
.ari-page .td-consequences { width: 150px; color: #555; }
.ari-page .td-categorie { width: 130px; }
.ari-page .td-statut { width: 90px;  }
.ari-page .td-priorite { width: 90px; text-align: center; }
.ari-page .td-desc { min-width: 200px; }
.ari-page .td-local { width: 130px; color: #666; }
.ari-page .td-mesures { min-width: 200px; color: #444; }
.ari-page .td-delai { width: 110px; }
.ari-page .td-resp { width: 160px; }


    /* Statut badge dans tableau */
.ari-page .statut-pill {
      display: inline-block; padding: 2px 8px; border-radius: 10px;
      font-size: 10px; font-weight: bold; white-space: nowrap;
    }

    /* Priorité */
.ari-page .prio-dot {
      display: inline-block; width: 8px; height: 8px;
      border-radius: 50%; margin-right: 4px; vertical-align: middle;
    }

    /* Input délai */
.ari-page .input-delai {
      width: 100%; padding: 3px 5px; border: 1px solid #ddd;
      border-radius: 3px; font-size: 12px; background: #fff;
      box-sizing: border-box;
    }
.ari-page .input-delai:focus { border-color: #2F3A44; outline: none; }

    /* Radio responsable */
.ari-page .resp-radios { display: flex; flex-wrap: wrap; gap: 4px; }
.ari-page .resp-radio-label {
      display: inline-flex; align-items: center; gap: 3px;
      font-size: 11px; cursor: pointer; white-space: nowrap;
      padding: 2px 6px; border-radius: 3px; border: 1px solid #ddd;
      background: #fff; transition: all 0.15s;
    }
.ari-page .resp-radio-label input[type="radio"] { display: none; }
.ari-page .resp-radio-label.checked-CT { background: #d6eaf8; border-color: #2980b9; color: #1a5276; font-weight: bold; }
.ari-page .resp-radio-label.checked-SIPP { background: #d5f5e3; border-color: #27ae60; color: #1e8449; font-weight: bold; }
.ari-page .resp-radio-label.checked-SSA { background: #fdebd0; border-color: #e67e22; color: #a04000; font-weight: bold; }
.ari-page .resp-radio-label.checked-RISK { background: #f9ebea; border-color: #e74c3c; color: #922b21; font-weight: bold; }


    /* Bouton sauvegarder flottant */
.ari-page .save-bar {
      display: none; position: fixed; bottom: 20px; left: 50%;
      transform: translateX(-50%);
      background: #2F3A44; color: #fff;
      padding: 10px 24px; border-radius: 30px;
      font-size: 14px; font-weight: bold;
      box-shadow: 0 4px 16px rgba(0,0,0,0.25);
      z-index: 3000; cursor: pointer; border: none;
      gap: 10px; align-items: center;
    }
.ari-page .save-bar.visible { display: flex; }
.ari-page .save-bar:hover { background: #1e2a32; }

.ari-page .empty-state { text-align: center; padding: 60px 20px; color: #999; font-size: 15px; }

    /* Aucune ligne ARI */
.ari-page .ari-empty { padding: 14px 20px 14px 55px; color: #aaa; font-size: 12px; font-style: italic; }

    /* ═══════════ NOUVELLES COLONNES ═══════════ */
.ari-page .td-suivi { width: 110px; }
.ari-page .td-commentaires { min-width: 200px; }

.ari-page .select-suivi {
      width: 100%; padding: 2px 4px; border: 1px solid #ddd;
      border-radius: 3px; font-size: 11px; background: #fff;
      box-sizing: border-box; height: 26px;
    }
.ari-page .select-suivi:focus { border-color: #2F3A44; outline: none; }

.ari-page .textarea-comment {
      width: 100%; padding: 3px 5px; border: 1px solid #ddd;
      border-radius: 3px; font-size: 11px; background: #fff;
      box-sizing: border-box; resize: vertical; min-height: 40px;
      font-family: inherit; line-height: 1.4;
    }
.ari-page .textarea-comment:focus { border-color: #2F3A44; outline: none; }

    /* ═══════════ BOUTONS MASQUAGE COLONNES ═══════════ */
.ari-page .col-vis-btn {
      font-size: 9px; padding: 1px 5px; border-radius: 2px;
      border: 1px solid rgba(255,255,255,0.35); background: rgba(255,255,255,0.12);
      color: rgba(255,255,255,0.85);
      cursor: pointer; white-space: nowrap; line-height: 1.6;
      transition: all 0.15s;
    }
.ari-page .col-vis-btn:hover { background: rgba(255,255,255,0.25); border-color: rgba(255,255,255,0.6); color: #fff; }
.ari-page .col-vis-btn.hidden { background: rgba(0,0,0,0.25); color: rgba(255,255,255,0.45); border-color: rgba(255,255,255,0.15); }

    /* Cellules masquées */
.ari-page .col-hidden { display: none !important; }

    /* ── Migration des 7 style= inline (Chantier A) ── */
    /* Badges compteurs (couleurs propres au résumé, ≠ statut) */
    .ari-page .stat-badge--l { background: #fdecea; color: #c0392b; }
    .ari-page .stat-badge--k { background: #fef9e7; color: #d68910; }
    .ari-page .stat-badge--j { background: #eafaf1; color: #1e8449; }
    .ari-page .stat-empty    { font-size: 11px; color: #bbb; }

    /* Pastilles statut (couleurs = $statuts) */
    .ari-page .statut-pill--j { background: #eafaf1; color: #27ae60; }
    .ari-page .statut-pill--k { background: #fef9e7; color: #f39c12; }
    .ari-page .statut-pill--l { background: #fdecea; color: #e74c3c; }
    .ari-page .statut-pill--a { background: #eaf4fb; color: #3498db; }
    .ari-page .statut-pill--x { background: #f4f6f7; color: #95a5a6; }

    /* Points priorité (couleurs = $priorites) */
    .ari-page .prio-dot--1 { background: #e74c3c; }
    .ari-page .prio-dot--2 { background: #e67e22; }
    .ari-page .prio-dot--3 { background: #f39c12; }
    .ari-page .prio-none   { color: #ccc; }

/* ==========================================
   GESTION DES TERRITOIRES (gestion_territoires.php)
   Styles déplacés depuis le bloc <style> inline (CSP style-src stricte).
   TOUT scopé sous .gestion-territoires (leçon dashboard : classes homonymes
   .col-cp/.col-code/.top-bar/.burger-*/.profile-* → isolation obligatoire).
   ========================================== */
body.gestion-territoires { background:#f4f7f6; font-family:'Segoe UI',sans-serif; margin:0; padding:30px 0; }
.gestion-territoires .page-wrap { width:1150px; margin:0 auto; background:#fff; padding:30px 30px 60px; box-shadow:0 0 15px rgba(0,0,0,.05); box-sizing:border-box; position:relative; overflow:visible; }

    /* Top bar */
.gestion-territoires .top-bar { display:flex; align-items:center; justify-content:space-between; margin-bottom:20px; }
.gestion-territoires .top-bar-right { display:flex; align-items:center; gap:8px; }
.gestion-territoires .urgences-bar { display:flex; align-items:center; gap:8px; margin-right:4px; }
.gestion-territoires .urgences-bar img { height:44px; width:auto; opacity:.20; }
.gestion-territoires .burger-wrap { position:relative; }
.gestion-territoires .burger-btn { width:34px; height:34px; background:#fff; border:1px solid #bbb; border-radius:6px; cursor:pointer; display:flex; flex-direction:column; justify-content:center; align-items:center; gap:5px; padding:0; }
.gestion-territoires .burger-btn span { display:block; width:18px; height:2px; background:#999; border-radius:2px; }
.gestion-territoires .burger-btn:hover { border-color:#777; }
.gestion-territoires .burger-menu { display:none; position:absolute; right:0; top:calc(100% + 6px); background:#fff; border:1px solid #ddd; border-radius:6px; min-width:200px; box-shadow:0 4px 16px rgba(0,0,0,.12); z-index:2000; overflow:hidden; }
.gestion-territoires .burger-menu.open { display:block; }
.gestion-territoires .burger-menu a { display:block; padding:11px 18px; font-size:13px; color:#2F3A44; text-decoration:none; border-bottom:1px solid #f0f0f0; font-weight:500; }
.gestion-territoires .burger-menu a:last-child { border-bottom:none; }
.gestion-territoires .burger-menu a:hover { background:#f4f7f6; }
.gestion-territoires .profile-wrap { position:relative; margin-left:8px; }
.gestion-territoires .profile-btn { width:34px; height:34px; background:#fff; border:1px solid #bbb; border-radius:50%; cursor:pointer; display:flex; align-items:center; justify-content:center; color:#999; font-size:17px; padding:0; }
.gestion-territoires .profile-btn:hover { border-color:#777; color:#444; }
.gestion-territoires .profile-menu { display:none; position:absolute; right:0; top:calc(100% + 6px); background:#fff; border:1px solid #ddd; border-radius:6px; min-width:200px; box-shadow:0 4px 16px rgba(0,0,0,.12); z-index:2000; overflow:hidden; }
.gestion-territoires .profile-menu.open { display:block; }
.gestion-territoires .profile-menu .profile-name { display:block; padding:12px 18px 8px; font-size:13px; font-weight:700; color:#2F3A44; border-bottom:1px solid #f0f0f0; cursor:default; }
.gestion-territoires .profile-menu a { display:block; padding:10px 18px; font-size:13px; color:#c0392b; text-decoration:none; font-weight:600; }
.gestion-territoires .profile-menu a:hover { background:#fdf0ee; }

    /* Titre */
.gestion-territoires .title-bar { display:flex; align-items:center; justify-content:space-between; margin-bottom:20px; }
.gestion-territoires .title-bar h1 { font-size:22px; color:#2F3A44; margin:0; }
.gestion-territoires .alert-no-cov { font-size:13px; font-weight:bold; color:#e74c3c; background:#fdf0ee; border:1px solid #f5c6cb; padding:6px 14px; border-radius:4px; }

    /* Onglets */
.gestion-territoires .tabs { display:flex; gap:4px; margin-bottom:24px; border-bottom:2px solid #E3E7EB; }
.gestion-territoires .tab { padding:9px 20px; font-size:14px; font-weight:bold; cursor:pointer; border:1px solid #ddd; border-bottom:none; border-radius:4px 4px 0 0; background:#f4f7f6; color:#5A6B7A; text-decoration:none; }
.gestion-territoires .tab.active { background:#2F3A44; color:#fff; border-color:#2F3A44; }
.gestion-territoires .tab:hover:not(.active) { background:#E3E7EB; }

    /* Formulaire assigner — compact, sans panneau vert */
.gestion-territoires .assign-form { margin-bottom:0; }
.gestion-territoires .assign-form-title { font-size:14px; font-weight:bold; color:#2F3A44; margin-bottom:10px; }
.gestion-territoires .assign-form-row { display:flex; align-items:flex-end; gap:10px; flex-wrap:wrap; }
.gestion-territoires .assign-form-row label { font-size:12px; font-weight:bold; color:#555; display:block; margin-bottom:4px; }
.gestion-territoires .assign-form-row input[type="email"] { padding:7px 10px; border:1px solid #ccc; border-radius:4px; font-size:13px; width:260px; }
.gestion-territoires .btn-assigner { background:#5A6B7A; color:#fff; border:none; padding:8px 18px; border-radius:4px; font-size:13px; font-weight:bold; cursor:pointer; }
.gestion-territoires .btn-assigner:hover { background:#2F3A44; }

    /* Case à cocher dans thead */
.gestion-territoires #cbMaster { width:15px; height:15px; cursor:pointer; accent-color:#5A6B7A; display:block; margin:0 auto; }
.gestion-territoires .btn-sans-couv { background:#5A6B7A; color:#fff; border:none; padding:6px 12px; border-radius:4px; font-size:12px; font-weight:bold; cursor:pointer; }
.gestion-territoires .btn-sans-couv:hover { background:#2F3A44; }
.gestion-territoires .search-wrap { display:flex; align-items:center; gap:6px; margin-left:auto; }
.gestion-territoires .search-wrap input { padding:6px 10px; border:1px solid #ccc; border-radius:4px; font-size:13px; width:240px; }
.gestion-territoires .btn-search { background:#5A6B7A; color:#fff; border:none; padding:6px 12px; border-radius:4px; font-size:14px; cursor:pointer; }
.gestion-territoires .btn-search:hover { background:#2F3A44; }

    /* Table */
.gestion-territoires .assign-table { width:100%; border-collapse:collapse; font-size:13px; }
.gestion-territoires .assign-table th { background:#2F3A44; color:#fff; padding:9px 10px; text-align:left; }
.gestion-territoires .assign-table td { padding:7px 10px; border-bottom:1px solid #eee; vertical-align:middle; }
.gestion-territoires .assign-table tr:hover td { background:#f8f9fa; }
.gestion-territoires .no-coverage td { background:#fff5f5; }
.gestion-territoires .no-coverage:hover td { background:#ffe8e8; }
.gestion-territoires .col-cb { width:32px; min-width:32px; max-width:32px; text-align:center; padding:7px 6px !important; }
.gestion-territoires .col-bat { width:34%; }
.gestion-territoires .col-cp { width:5%; text-align:center; }
.gestion-territoires .col-code { width:9%; font-family:monospace; font-size:11px; color:#888; text-align:center; }
.gestion-territoires .col-int { }

.gestion-territoires .interv-list {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 0;
      width: 100%;
    }
.gestion-territoires .interv-emails {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 3px 6px;   /* 3px vertical (2-3mm), 6px horizontal */
      flex: 1;
    }
.gestion-territoires .interv-row {
      display: inline-flex;
      align-items: center;
      gap: 5px;
    }
.gestion-territoires .interv-email { font-size:13px; color:#2F3A44; }
    /* Petit bouton rouge × */
.gestion-territoires .btn-del-chip {
      width:18px; height:18px; border-radius:50%;
      background:#e74c3c; border:none; color:#fff;
      font-size:13px; line-height:1; cursor:pointer;
      display:flex; align-items:center; justify-content:center;
      padding:0; font-weight:bold; flex-shrink:0;
    }
.gestion-territoires .btn-del-chip:hover { background:#c0392b; }
    /* Petit bouton vert + */
.gestion-territoires .btn-add-interv {
      width:18px; height:18px; border-radius:50%;
      background:#27ae60; border:none; color:#fff;
      font-size:14px; line-height:18px;
      cursor:pointer; text-align:center;
      display:flex; align-items:center; justify-content:center;
      padding:0 0 1px 0;   /* micro-ajustement optique du + */
      font-weight:bold; flex-shrink:0;
    }
.gestion-territoires .btn-add-interv:hover { background:#1e8449; }
    /* Inline ajout */
.gestion-territoires .inline-add { display:none; align-items:center; gap:6px; margin-top:4px; }
.gestion-territoires .inline-add input { padding:4px 8px; border:1px solid #ccc; border-radius:4px; font-size:12px; width:220px; }
.gestion-territoires .btn-inline-save { background:#27ae60; color:#fff; border:none; padding:4px 10px; border-radius:4px; font-size:12px; cursor:pointer; }
.gestion-territoires .btn-inline-cancel { background:#fff; border:1px solid #ccc; padding:4px 8px; border-radius:4px; font-size:12px; cursor:pointer; }
.gestion-territoires .inline-edit { display:none; }
.gestion-territoires .badge-no { background:#f8d7da; color:#721c24; padding:2px 8px; border-radius:10px; font-size:11px; font-weight:bold; }

.gestion-territoires .alert-ok { background:#d4edda; color:#155724; padding:10px 16px; border-radius:4px; margin-bottom:16px; font-weight:bold; }
.gestion-territoires .alert-err { background:#f8d7da; color:#721c24; padding:10px 16px; border-radius:4px; margin-bottom:16px; font-weight:bold; }

    /* ── Migration des 10 style= inline ── */
    .gestion-territoires .btn-back        { margin-bottom: 0; }
    .gestion-territoires .th-int-head     { display: flex; align-items: center; gap: 8px; }
    .gestion-territoires .th-int-tools    { margin-left: auto; display: flex; align-items: center; gap: 6px; }
    .gestion-territoires .search-field    { padding: 4px 8px; border: 1px solid #ccc; border-radius: 4px; font-size: 12px; width: 225px; background: #fff; color: #333; }
    .gestion-territoires .commune-sub     { color: #999; font-size: 11px; display: block; }
    .gestion-territoires .form-del-inline { display: inline; line-height: 1; }
    .gestion-territoires .interv-add-wrap { margin-left: auto; display: flex; align-items: center; }
    .gestion-territoires .inline-add-form { display: flex; gap: 6px; align-items: center; }
    .gestion-territoires .inline-add      { width: 100%; }  /* complète .inline-add (margin-top déjà présent) */

/* ==========================================
   STATISTIQUES (statistiques.php)
   Bloc <style> inline déplacé ici, scopé sous .statistiques
   (homonymes .top-bar/.burger-*/.profile-*/.progress-*/.stat-* -> isolation).
   ========================================== */
body.statistiques { background:#f4f7f6; font-family:'Segoe UI',sans-serif; margin:0; padding:30px 0; }
.statistiques .page-wrap { width:1150px; margin:0 auto; background:#fff; padding:40px 30px 60px; box-shadow:0 0 15px rgba(0,0,0,0.05); box-sizing:border-box; }
.statistiques .stat-block { margin-bottom:4px; }
.statistiques .stat-title { display:flex; align-items:center; justify-content:space-between; cursor:pointer; user-select:none; border-radius:3px; }
.statistiques .stat-title.n1 { background:#2F3A44; color:#fff; font-size:17px; font-weight:bold; margin:0 -30px; padding:11px 50px; }
.statistiques .stat-title.n2 { background:#5A6B7A; color:#fff; font-size:15px; font-weight:bold; margin:4px -30px; padding:9px 50px; }
.statistiques .stat-title.n3 { background:#AEB8C2; color:#000; font-size:14px; margin:3px -30px; padding:8px 66px; }
.statistiques .chevron { width:22px; height:22px; border:2px solid currentColor; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:12px; flex-shrink:0; transition:transform 0.2s; }
.statistiques .stat-title.open .chevron { transform:rotate(180deg); }
.statistiques .stat-body { display:none; padding:16px 0 8px; }
.statistiques .stat-body.open { display:block; }
.statistiques .progress-wrap { margin:10px 0 6px; }
.statistiques .progress-bar-bg { height:24px; background:#e74c3c; border-radius:4px; overflow:hidden; }
.statistiques .progress-bar-fill { height:100%; background:#27ae60; transition:width 0.6s; border-radius:4px 0 0 4px; }
.statistiques .progress-label { display:flex; justify-content:space-between; font-size:12px; color:#555; margin-top:4px; }
.statistiques .progress-score { font-size:18px; font-weight:bold; color:#2F3A44; margin-bottom:8px; }
.statistiques .global-bar { margin-top:40px; padding-top:30px; border-top:2px solid #E3E7EB; }
.statistiques .global-bar .progress-bar-bg { height:32px; }
.statistiques .global-bar .progress-score { font-size:22px; }
  /* ── Top bar ── */
.statistiques .top-bar { display:flex; align-items:center; justify-content:space-between; margin-bottom:24px; }
.statistiques .top-bar-right { display:flex; align-items:center; gap:8px; }
.statistiques .urgences-bar { display:flex; align-items:center; gap:8px; margin-right:4px; }
.statistiques .urgences-bar img { height:44px; width:auto; opacity:.20; }
.statistiques .burger-wrap { position:relative; }
.statistiques .burger-btn { width:34px; height:34px; background:#fff; border:1px solid #bbb; border-radius:6px; cursor:pointer; display:flex; flex-direction:column; justify-content:center; align-items:center; gap:5px; padding:0; }
.statistiques .burger-btn span { display:block; width:18px; height:2px; background:#999; border-radius:2px; }
.statistiques .burger-btn:hover { border-color:#777; }
.statistiques .burger-menu { display:none; position:absolute; right:0; top:calc(100% + 6px); background:#fff; border:1px solid #ddd; border-radius:6px; min-width:200px; box-shadow:0 4px 16px rgba(0,0,0,.12); z-index:2000; overflow:hidden; }
.statistiques .burger-menu.open { display:block; }
.statistiques .burger-menu a { display:block; padding:11px 18px; font-size:13px; color:#2F3A44; text-decoration:none; border-bottom:1px solid #f0f0f0; font-weight:500; }
.statistiques .burger-menu a:last-child { border-bottom:none; }
.statistiques .burger-menu a:hover { background:#f4f7f6; }
.statistiques .profile-wrap { position:relative; margin-left:8px; }
.statistiques .profile-btn { width:34px; height:34px; background:#fff; border:1px solid #bbb; border-radius:50%; cursor:pointer; display:flex; align-items:center; justify-content:center; color:#999; font-size:17px; padding:0; }
.statistiques .profile-btn:hover { border-color:#777; color:#444; }
.statistiques .profile-menu { display:none; position:absolute; right:0; top:calc(100% + 6px); background:#fff; border:1px solid #ddd; border-radius:6px; min-width:200px; box-shadow:0 4px 16px rgba(0,0,0,.12); z-index:2000; overflow:hidden; }
.statistiques .profile-menu.open { display:block; }
.statistiques .profile-menu .profile-name { display:block; padding:12px 18px 8px; font-size:13px; font-weight:700; color:#2F3A44; border-bottom:1px solid #f0f0f0; cursor:default; }
.statistiques .profile-menu a { display:block; padding:10px 18px; font-size:13px; color:#c0392b; text-decoration:none; font-weight:600; }
.statistiques .profile-menu a:hover { background:#fdf0ee; }

    /* ── Migration des style= inline ── */
    .statistiques .btn-back        { margin-bottom: 0; }
    .statistiques .stats-head      { display: flex; align-items: center; justify-content: space-between; margin-bottom: 30px; }
    .statistiques .stats-h1        { font-size: 22px; color: #2F3A44; margin: 0; }
    .statistiques .stats-h2        { font-size: 18px; color: #2F3A44; margin-bottom: 12px; }
    .statistiques .stats-subtitle  { font-size: 12px; color: #999; font-style: italic; }
    .statistiques .count-tag       { font-size: 12px; opacity: 0.8; }
    .statistiques .cp-tag          { font-size: 11px; opacity: 0.7; }
    .statistiques .sec-table       { width: 100%; font-size: 12px; margin-top: 8px; }
    .statistiques .th-etat         { text-align: center; width: 60px; }
    .statistiques .td-etat         { text-align: center; }
    .statistiques .ok-mark         { color: #27ae60; font-weight: bold; }
    .statistiques .ko-mark         { color: #e74c3c; }
    .statistiques .stat-block--mt  { margin-top: 30px; }

/* — Cellule Réf. : support de l'icône historique — */
.ari-page .td-ref { position: relative; padding-right: 20px; }

/* — Icône historique : rond + chevron — */
.ari-page .hist-toggle {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #e6e6e6;
  color: #b0b0b0;
  font-size: 13px;
  line-height: 16px;
  text-align: center;
  cursor: pointer;
  opacity: .35;                       /* historique vide : à peine visible */
  transition: transform .15s ease, opacity .15s ease, background .15s ease;
}
/* Historique non vide : bien visible, bleu fluo */
.ari-page .hist-toggle--full {
  background: #00b0ff;
  color: #fff;
  opacity: 1;
  box-shadow: 0 0 5px rgba(0, 176, 255, .8);
}
/* Déployé : le chevron passe à la verticale */
.ari-page .hist-toggle.open { transform: rotate(90deg); }

/* — Lignes d'historique (masquées par défaut) — */
.ari-page tr.hist-row { display: none; }
.ari-page tr.hist-row.visible { display: table-row; }
.ari-page .hist-ref { text-align: right; color: #9aa5b1; }
/* Les cellules d'une ligne d'historique : fond distinct, texte discret.
   Chaque info reste dans SA colonne (Délai / Suivi / Commentaires). */
.ari-page tr.hist-row > td {
  background: #f7fafc;
  font-size: 12.5px;
  color: #4a5568;
  padding: 5px 8px;
}
.ari-page tr.hist-row > td.td-ref { border-left: 3px solid #00b0ff; }
.ari-page .hist-date  { font-weight: 400; color: #9aa5b1; }   /* discret, comme la méta */
.ari-page .hist-suivi { font-weight: 400; color: #9aa5b1; }   /* discret, comme la date */
.ari-page .hist-comm  { font-style: italic; }
.ari-page .hist-meta  { color: #9aa5b1; font-size: 11.5px; }

/* — Colonne / bouton « Suivre » — */
.ari-page .td-suivre { text-align: center; white-space: nowrap; }
.ari-page .btn-suivre {
  padding: 4px 10px;
  border: 1px solid #00b0ff;
  border-radius: 4px;
  background: #fff;
  color: #0077b3;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.ari-page .btn-suivre:hover:not(:disabled) { background: #00b0ff; color: #fff; }
.ari-page .btn-suivre:disabled { opacity: .5; cursor: default; }

/* ================================================================
   FICHE (fiche.php) — migration CSP : styles inline -> classes
   ================================================================ */
.fiche-page .burger-wrap  { position: relative; }
.fiche-page .profile-wrap { position: relative; margin-left: 6px; }
.fiche-page .fiche-contenu { line-height: 1.6; }
.fiche-page .fiche-vide    { color: #888; font-style: italic; }

/* Bouton « imprimer » de la pile d'actions (partagé avec view.php) */
.fab--print { background: #fff; border: 2px solid #cfcfcf; cursor: pointer; }

/* À l'impression : ne garder que le contenu de la fiche */
@media print {
  .fiche-page .top-bar,
  .fiche-page .fab-stack,
  .fiche-page .btn-back,
  .fiche-page button[data-action="print"] { display: none !important; }
  .fiche-page { padding: 0; }
  .fiche-page .pui-form { box-shadow: none; width: 100%; max-width: 100%; }
}

/* ================================================================
   APERÇUS DE FICHIERS (security.php) — migration CSP
   Classes globales : ces blocs HTML sont injectés dans plusieurs pages.
   ================================================================ */
.apercu-bloc  { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.apercu-ligne { display: flex; align-items: center; gap: 6px; }
.apercu-nom   { font-size: 12px; color: #777; }
.apercu-img   {
  max-width: 500px;          /* correspond au défaut $largeur = 500 */
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid #ccc;
  border-radius: 4px;
}
/* Petit bouton rond de suppression (partagé avec edit.php) */
.btn-suppr-rond {
  background: #e74c3c;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 13px;
  line-height: 20px;
  text-align: center;
  cursor: pointer;
}

/* ================================================================
   DELEGATION (delegation.php) — migration CSP
   ================================================================ */

    .delegation-page { background:#f4f7f6; font-family:'Segoe UI',sans-serif; margin:0; padding:30px 0; }
    .delegation-page .page-wrap { width:1150px; margin:0 auto; background:#fff; padding:30px 30px 60px; box-shadow:0 0 15px rgba(0,0,0,.05); box-sizing:border-box; position:relative; overflow:visible; }

    /* Top bar */
.delegation-page .top-bar { display:flex; align-items:center; justify-content:space-between; margin-bottom:20px; }
    .delegation-page .top-bar-right { display:flex; align-items:center; gap:8px; }
    .delegation-page .urgences-bar { display:flex; align-items:center; gap:8px; margin-right:4px; }
    .delegation-page .urgences-bar img { height:44px; width:auto; opacity:.20; }
    .delegation-page .burger-wrap { position:relative; }
    .delegation-page .burger-btn { width:34px; height:34px; background:#fff; border:1px solid #bbb; border-radius:6px; cursor:pointer; display:flex; flex-direction:column; justify-content:center; align-items:center; gap:5px; padding:0; }
    .delegation-page .burger-btn span { display:block; width:18px; height:2px; background:#999; border-radius:2px; }
    .delegation-page .burger-btn:hover { border-color:#777; }
    .delegation-page .burger-menu { display:none; position:absolute; right:0; top:calc(100% + 6px); background:#fff; border:1px solid #ddd; border-radius:6px; min-width:200px; box-shadow:0 4px 16px rgba(0,0,0,.12); z-index:2000; overflow:hidden; }
    .delegation-page .burger-menu.open { display:block; }
    .delegation-page .burger-menu a { display:block; padding:11px 18px; font-size:13px; color:#2F3A44; text-decoration:none; border-bottom:1px solid #f0f0f0; font-weight:500; }
    .delegation-page .burger-menu a:last-child { border-bottom:none; }
    .delegation-page .burger-menu a:hover { background:#f4f7f6; }
    .delegation-page .profile-wrap { position:relative; margin-left:8px; }
    .delegation-page .profile-btn { width:34px; height:34px; background:#fff; border:1px solid #bbb; border-radius:50%; cursor:pointer; display:flex; align-items:center; justify-content:center; color:#999; font-size:17px; padding:0; }
    .delegation-page .profile-btn:hover { border-color:#777; color:#444; }
    .delegation-page .profile-menu { display:none; position:absolute; right:0; top:calc(100% + 6px); background:#fff; border:1px solid #ddd; border-radius:6px; min-width:200px; box-shadow:0 4px 16px rgba(0,0,0,.12); z-index:2000; overflow:hidden; }
    .delegation-page .profile-menu.open { display:block; }
    .delegation-page .profile-menu .profile-name { display:block; padding:12px 18px 8px; font-size:13px; font-weight:700; color:#2F3A44; border-bottom:1px solid #f0f0f0; cursor:default; }
    .delegation-page .profile-menu a { display:block; padding:10px 18px; font-size:13px; color:#c0392b; text-decoration:none; font-weight:600; }
    .delegation-page .profile-menu a:hover { background:#fdf0ee; }

    /* Titre page */
.delegation-page h1 { font-size:22px; color:#2F3A44; margin:0 0 4px; }
    .delegation-page .subtitle { font-size:13px; color:#777; margin-bottom:20px; }

    /* Barres déroulables (style statistiques) */
.delegation-page .stat-block { margin-bottom:6px; }
    .delegation-page .stat-title {
      display:flex; align-items:center; justify-content:space-between;
      cursor:pointer; user-select:none; border-radius:3px;
      background:#2F3A44; color:#fff; font-size:16px; font-weight:bold;
      margin:0 -30px; padding:11px 50px;
    }
    .delegation-page .stat-title .chevron { width:22px; height:22px; border:2px solid #fff; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:12px; flex-shrink:0; transition:transform .2s; }
    .delegation-page .stat-title.open .chevron { transform:rotate(180deg); }
    .delegation-page .stat-body { display:none; padding:20px 0 8px; }
    .delegation-page .stat-body.open { display:block; }

    /* Formulaire nouvelle délégation */
.delegation-page .new-deleg-header {
      display:flex; align-items:center; justify-content:space-between;
      margin-bottom:16px;
    }
    .delegation-page .new-deleg-header h2 { font-size:17px; color:#2F3A44; margin:0; }
    .delegation-page .new-deleg-actions { display:flex; gap:8px; }

    .delegation-page .btn-grey {
      background:#5A6B7A; color:#fff; border:none;
      padding:8px 20px; border-radius:4px; font-size:13px;
      font-weight:bold; cursor:pointer;
    }
    .delegation-page .btn-grey:hover { background:#2F3A44; }
    .delegation-page .btn-outline-grey {
      background:#fff; color:#5A6B7A; border:1px solid #5A6B7A;
      padding:8px 16px; border-radius:4px; font-size:13px; cursor:pointer;
    }
    .delegation-page .btn-outline-grey:hover { background:#f4f7f6; }

    /* Champs formulaire */
.delegation-page .form-row { display:flex; gap:16px; flex-wrap:wrap; margin-bottom:14px; }
    .delegation-page .form-group { display:flex; flex-direction:column; gap:4px; }
    .delegation-page .form-group label { font-size:12px; font-weight:bold; color:#444; }
    .delegation-page .form-group input { padding:7px 10px; border:1px solid #ccc; border-radius:4px; font-size:13px; }

    /* Barre contrôles tableau */
.delegation-page .table-controls { display:flex; align-items:center; gap:8px; margin-bottom:8px; }
    .delegation-page .btn-sans-couv { background:#5A6B7A; color:#fff; border:none; padding:5px 12px; border-radius:4px; font-size:12px; font-weight:bold; cursor:pointer; }
    .delegation-page .btn-sans-couv:hover { background:#2F3A44; }
    .delegation-page .search-wrap { display:flex; align-items:center; gap:6px; }
    .delegation-page .search-wrap input { padding:5px 9px; border:1px solid #ccc; border-radius:4px; font-size:12px; width:220px; }
    .delegation-page .btn-search { background:#5A6B7A; color:#fff; border:none; padding:5px 10px; border-radius:4px; font-size:13px; cursor:pointer; }
    .delegation-page .btn-search:hover { background:#2F3A44; }

    /* Table bâtiments */
.delegation-page .bat-table { width:100%; border-collapse:collapse; font-size:13px; margin-bottom:0; table-layout:fixed; }
    .delegation-page .bat-table input[type="checkbox"] { width:15px !important; height:15px !important; }
    .delegation-page .bat-table th { background:#2F3A44; color:#fff; padding:8px 10px; text-align:left; }
    .delegation-page .bat-table th.col-cb, .delegation-page .bat-table td.col-cb { width:32px !important; min-width:32px !important; max-width:32px !important; padding:4px 0 !important; text-align:center !important; }
    .delegation-page .bat-table input[type="checkbox"] { width:15px !important; height:15px !important; }
    .delegation-page .bat-table td { padding:7px 10px; border-bottom:1px solid #eee; vertical-align:middle; }
    .delegation-page .bat-table tr:hover td { background:#f8f9fa; }
    .delegation-page .col-bat { width:auto; }
    .delegation-page .col-cp { width:50px; text-align:center; }
    .delegation-page .col-code { width:100px; font-family:monospace; font-size:11px; color:#888; }
    .delegation-page .col-role { width:90px; }

    /* Tables délégations */
.delegation-page .deleg-table { width:100%; border-collapse:collapse; font-size:13px; margin-top:8px; }
    .delegation-page .deleg-table th { background:#5A6B7A; color:#fff; padding:8px 12px; text-align:left; }
    .delegation-page .deleg-table td { padding:8px 12px; border-bottom:1px solid #eee; vertical-align:middle; }
    .delegation-page .deleg-table tr:hover td { background:#f8f9fa; }
    .delegation-page .badge { display:inline-block; padding:2px 8px; border-radius:10px; font-size:11px; font-weight:bold; }
    .delegation-page .badge-active { background:#d4edda; color:#155724; }
    .delegation-page .badge-illimite { background:#cce5ff; color:#004085; }
    .delegation-page .badge-recue { background:#fff3cd; color:#856404; }
    .delegation-page .btn-revoke { background:#e74c3c; color:#fff; border:none; padding:4px 12px; border-radius:3px; font-size:12px; cursor:pointer; }
    .delegation-page .btn-revoke:hover { background:#c0392b; }
    .delegation-page .expired-row td { color:#aaa; }
    .delegation-page .empty-state { color:#999; font-style:italic; padding:12px 0; font-size:13px; }

    /* Messages */
.delegation-page .alert-ok { background:#d4edda; color:#155724; padding:10px 16px; border-radius:4px; margin-bottom:16px; font-weight:bold; }
    .delegation-page .alert-err { background:#f8d7da; color:#721c24; padding:10px 16px; border-radius:4px; margin-bottom:16px; font-weight:bold; }

    /* Bouton + nouvelle délégation */
.delegation-page .btn-new-deleg {
      background:#5A6B7A; color:#fff; border:none;
      padding:9px 20px; border-radius:4px; font-size:14px;
      font-weight:bold; cursor:pointer; margin-bottom:16px;
    }
    .delegation-page .btn-new-deleg:hover { background:#2F3A44; }
  

/* styles inline portés en classes */
.delegation-page .dg1 { margin-bottom:0; }
.delegation-page .dg2 { font-size:14px; font-weight:bold; color:#2F3A44; margin:0 0 8px; }
.delegation-page .dg3 { font-size:14px; font-weight:bold; color:#2F3A44; margin:20px 0 8px; }
.delegation-page .dg4 { font-size:14px; font-weight:bold; color:#aaa; margin:20px 0 8px; }
.delegation-page .dg5 { margin-top:24px; }
.delegation-page .dg6 { display:none; }
.delegation-page .dg7 { font-size:17px; color:#2F3A44; margin:0 0 14px; }
.delegation-page .dg8 { width:240px; }
.delegation-page .dg9 { font-size:11px; color:#999; }
.delegation-page .dg10 { flex:1; }
.delegation-page .dg11 { display:flex; align-items:center; gap:8px; }
.delegation-page .dg12 { margin-left:0; }
.delegation-page .dg13 { width:32px !important; min-width:32px !important; max-width:32px !important; padding:4px 0 !important; }
.delegation-page .dg14 { width:15px !important; height:15px !important; cursor:pointer; accent-color:#5A6B7A; display:block; margin:0 auto; }
.delegation-page .dg15 { color:#999; font-size:11px; display:block; }


/* ================================================================
   GESTION DES SITES (gestion_sites.php) — migration CSP
   ================================================================ */

    .gestion-sites { background:#f4f7f6; font-family:'Segoe UI',sans-serif; margin:0; padding:30px 0; }
    .gestion-sites .page-wrap { width:1150px; margin:0 auto; background:#fff; padding:30px 30px 60px; box-shadow:0 0 15px rgba(0,0,0,.05); box-sizing:border-box; position:relative; overflow:visible; }

    /* Top bar */
.gestion-sites .top-bar { display:flex; align-items:center; justify-content:space-between; margin-bottom:20px; }
    .gestion-sites .top-bar-right { display:flex; align-items:center; gap:8px; }
    .gestion-sites .urgences-bar { display:flex; align-items:center; gap:8px; margin-right:4px; }
    .gestion-sites .urgences-bar img { height:44px; width:auto; opacity:.20; }
    .gestion-sites .burger-wrap { position:relative; }
    .gestion-sites .burger-btn { width:34px; height:34px; background:#fff; border:1px solid #bbb; border-radius:6px; cursor:pointer; display:flex; flex-direction:column; justify-content:center; align-items:center; gap:5px; padding:0; }
    .gestion-sites .burger-btn span { display:block; width:18px; height:2px; background:#999; border-radius:2px; }
    .gestion-sites .burger-btn:hover { border-color:#777; }
    .gestion-sites .burger-menu { display:none; position:absolute; right:0; top:calc(100% + 6px); background:#fff; border:1px solid #ddd; border-radius:6px; min-width:200px; box-shadow:0 4px 16px rgba(0,0,0,.12); z-index:2000; overflow:hidden; }
    .gestion-sites .burger-menu.open { display:block; }
    .gestion-sites .burger-menu a { display:block; padding:11px 18px; font-size:13px; color:#2F3A44; text-decoration:none; border-bottom:1px solid #f0f0f0; font-weight:500; }
    .gestion-sites .burger-menu a:last-child { border-bottom:none; }
    .gestion-sites .burger-menu a:hover { background:#f4f7f6; }
    .gestion-sites .profile-wrap { position:relative; margin-left:8px; }
    .gestion-sites .profile-btn { width:34px; height:34px; background:#fff; border:1px solid #bbb; border-radius:50%; cursor:pointer; display:flex; align-items:center; justify-content:center; color:#999; font-size:17px; padding:0; }
    .gestion-sites .profile-btn:hover { border-color:#777; color:#444; }
    .gestion-sites .profile-menu { display:none; position:absolute; right:0; top:calc(100% + 6px); background:#fff; border:1px solid #ddd; border-radius:6px; min-width:200px; box-shadow:0 4px 16px rgba(0,0,0,.12); z-index:2000; overflow:hidden; }
    .gestion-sites .profile-menu.open { display:block; }
    .gestion-sites .profile-menu .profile-name { display:block; padding:12px 18px 8px; font-size:13px; font-weight:700; color:#2F3A44; border-bottom:1px solid #f0f0f0; cursor:default; }
    .gestion-sites .profile-menu a { display:block; padding:10px 18px; font-size:13px; color:#c0392b; text-decoration:none; font-weight:600; }
    .gestion-sites .profile-menu a:hover { background:#fdf0ee; }

    /* Titre + barre actions */
.gestion-sites .title-bar { display:flex; align-items:center; justify-content:space-between; margin-bottom:20px; }
    .gestion-sites .title-bar h1 { font-size:22px; color:#2F3A44; margin:0; }
    .gestion-sites .btn-grey { background:#5A6B7A; color:#fff; border:none; padding:8px 18px; border-radius:4px; font-size:13px; font-weight:bold; cursor:pointer; text-decoration:none; display:inline-block; }
    .gestion-sites .btn-grey:hover { background:#2F3A44; }
    .gestion-sites .btn-outline { background:#fff; color:#5A6B7A; border:1px solid #5A6B7A; padding:8px 14px; border-radius:4px; font-size:13px; cursor:pointer; }
    .gestion-sites .btn-outline:hover { background:#f4f7f6; }

    /* Barre recherche */
.gestion-sites .search-bar { display:flex; align-items:center; gap:8px; margin-bottom:16px; flex-wrap:wrap; }
    .gestion-sites .search-bar input { padding:7px 10px; border:1px solid #ccc; border-radius:4px; font-size:13px; width:240px; }
    .gestion-sites .btn-search { background:#5A6B7A; color:#fff; border:none; padding:7px 12px; border-radius:4px; font-size:13px; cursor:pointer; }
    .gestion-sites .filter-btn { padding:6px 14px; border:1px solid #ccc; border-radius:4px; font-size:12px; cursor:pointer; background:#fff; }
    .gestion-sites .filter-btn.active { background:#2F3A44; color:#fff; border-color:#2F3A44; }

    /* Table sites */
.gestion-sites .sites-table { width:100%; border-collapse:collapse; font-size:13px; }
    .gestion-sites .sites-table th { background:#2F3A44; color:#fff; padding:9px 12px; text-align:left; position:sticky; top:0; }
    .gestion-sites .sites-table td { padding:8px 12px; border-bottom:1px solid #eee; vertical-align:middle; }
    .gestion-sites .sites-table tr:hover td { background:#f8f9fa; }
    .gestion-sites .badge-actif { background:#d4edda; color:#155724; padding:2px 10px; border-radius:10px; font-size:11px; font-weight:bold; }
    .gestion-sites .badge-inactif { background:#f8d7da; color:#721c24; padding:2px 10px; border-radius:10px; font-size:11px; font-weight:bold; }

    /* Toggle statut */
.gestion-sites .toggle-statut { display:flex; align-items:center; gap:6px; }
    .gestion-sites .toggle-statut label { font-size:12px; cursor:pointer; }
    .gestion-sites input[type="radio"].toggle-radio { cursor:pointer; accent-color:#27ae60; }

    /* Bouton éditer */
.gestion-sites .btn-edit-site { background:none; border:none; cursor:pointer; color:#5A6B7A; font-size:16px; padding:2px 6px; }
    .gestion-sites .btn-edit-site:hover { color:#2F3A44; }

    /* ── Formulaire création/édition ── */
.gestion-sites .form-card {
      background:#f8f9fa; border:1px solid #dee2e6; border-radius:6px;
      padding:24px; margin-bottom:28px;
    }
    .gestion-sites .form-card h2 { font-size:17px; color:#2F3A44; margin:0 0 20px; }
    .gestion-sites .form-section-title {
      font-size:14px; font-weight:bold; color:#5A6B7A;
      margin:20px 0 10px; padding-bottom:4px;
      border-bottom:1px solid #E3E7EB;
    }
    .gestion-sites .form-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:14px; margin-bottom:4px; }
    .gestion-sites .form-group { display:flex; flex-direction:column; gap:4px; }
    .gestion-sites .form-group label { font-size:12px; font-weight:bold; color:#444; }
    .gestion-sites .form-group input, .gestion-sites .form-group select { padding:7px 10px; border:1px solid #ccc; border-radius:4px; font-size:13px; font-family:inherit; }
    .gestion-sites .form-group input:focus, .gestion-sites .form-group select:focus { outline:none; border-color:#5A6B7A; }

    /* Intervenants suggérés */
.gestion-sites .interv-section { margin-top:20px; }
    .gestion-sites .interv-role-group { margin-bottom:16px; }
    .gestion-sites .interv-role-label { font-size:13px; font-weight:bold; color:#2F3A44; margin-bottom:8px; }
    .gestion-sites .interv-chips { display:flex; flex-wrap:wrap; gap:8px; }
    .gestion-sites .interv-chip-form { display:inline-flex; align-items:center; gap:5px; background:#e8f4fd; border:1px solid #bee5fb; border-radius:12px; padding:4px 12px; font-size:12px; }
    .gestion-sites .interv-chip-form input[type="checkbox"] { accent-color:#27ae60; cursor:pointer; }
    .gestion-sites .interv-no { font-size:12px; color:#999; font-style:italic; }
    .gestion-sites .interv-custom { display:flex; align-items:center; gap:6px; margin-top:6px; }
    .gestion-sites .interv-custom input { padding:5px 9px; border:1px solid #ccc; border-radius:4px; font-size:12px; width:220px; }
    .gestion-sites .btn-add-interv-small { background:#5A6B7A; color:#fff; border:none; padding:5px 12px; border-radius:4px; font-size:12px; cursor:pointer; white-space:nowrap; }

    .gestion-sites .form-actions { display:flex; gap:10px; margin-top:20px; }

    /* Messages */
.gestion-sites .alert-ok { background:#d4edda; color:#155724; padding:10px 16px; border-radius:4px; margin-bottom:16px; font-weight:bold; }
    .gestion-sites .alert-err { background:#f8d7da; color:#721c24; padding:10px 16px; border-radius:4px; margin-bottom:16px; font-weight:bold; }
  

/* styles inline portés en classes */
.gestion-sites .gs1 { margin-bottom:0; }
.gestion-sites .gs2 { text-transform:uppercase; }
.gestion-sites .gs3 { background:#f8f9fa; color:#888; }
.gestion-sites .gs4 { grid-column:1/-1; }
.gestion-sites .gs5 { flex:2; }
.gestion-sites .gs6 { font-size:11px; color:#999; font-weight:normal; }
.gestion-sites .gs7 { padding:5px 9px; border:1px solid #ccc; border-radius:4px; font-size:12px; width:260px; }
.gestion-sites .gs8 { width:340px; }
.gestion-sites .gs9 { margin-left:auto; font-size:13px; color:#777; }
.gestion-sites .gs10 { width:60px; text-align:center; }
.gestion-sites .gs11 { font-family:monospace; font-size:12px; }
.gestion-sites .gs12 { font-size:11px; color:#666; }
.gestion-sites .gs13 { display:inline; }
.gestion-sites .gs14 { text-align:center; }

/* ================================================================
   VUE PUI (view.php) — migration CSP
   ================================================================ */

.view-page .table-annexes {
  width: 750px;
  margin: 25px auto;
  border-collapse: collapse;
}

/* Titre du tableau centré */
.view-page .table-annexes thead th {
  text-align: center;
  font-weight: bold;
  padding: 8px;
}

/* Le contenu du tableau aligné à gauche avec marge interne */
.view-page .table-annexes tbody td {
  text-align: left !important;   /* ← forcé pour casser le centrage hérité */
  padding-left: 37px;             /* ≈ 1 cm */
}

/* Optionnel : bordures et style identiques au reste du site */
.view-page .table-annexes td, .view-page .table-annexes th {
  border: 1px solid #ccc;
  font-size: 13px;
}


/* ===== Pagination à l'impression ===== */
@media print {
/* Masquer les éléments d'interface */
.view-page .fab-stack, .view-page .btn-back, .view-page button[data-action="print"], .view-page .burger-wrap, .view-page .profile-wrap, .view-page .urgences-bar { display: none !important; }
/* Neutraliser le cadre du conteneur (supprime la ligne verticale à gauche)
     et utiliser toute la largeur de la feuille */
.view-page { margin: 0 !important; padding: 0 !important; background: #fff !important; }
.view-page .pui-form, .view-page .contact-box {
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: #fff !important;
  }
.view-page .pui-form { padding: 0 !important; }
/* Tableaux : tenir dans la largeur de la feuille (plus de partie droite coupée) */
.view-page table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
  }
.view-page table th, .view-page table td {
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-size: 10.5px !important;
    padding: 3px 4px !important;
  }
/* Éviter qu'une ligne de tableau soit coupée entre deux pages */
.view-page tr { break-inside: avoid; page-break-inside: avoid; }
/* Titres : annuler les décalages négatifs hérités du style écran,
     sinon le numéro (2., 3., 4., 4.1…) sort de la zone imprimable à gauche */
.view-page h1, .view-page h2, .view-page h3, .view-page h4, .view-page .titre-n1, .view-page .titre-n2, .view-page .titre-n3, .view-page .titre-n4 {
    margin-left: 0 !important;
    padding-left: 0 !important;
    text-indent: 0 !important;
    left: 0 !important;
    overflow: visible !important;
  }
.view-page .pui-form, .view-page .contact-box { overflow: visible !important; }
/* Page 4 : supprimer les espaces d'une ligne sous le titre 2,
     au-dessus et en dessous du titre 3, pour que les sections 2 et 3
     tiennent ensemble sur la même feuille */
.view-page #objectifs { margin-bottom: 0 !important; }
.view-page #objectifs + * { margin-top: 0 !important; }
.view-page #objectifs + * > p:first-child { margin-top: 0 !important; }
.view-page #objectifs + .contact-box { margin-bottom: 0 !important; }
.view-page #objectifs + .contact-box > p:last-child { margin-bottom: 0 !important; }
.view-page #baselegale { margin-top: 0 !important; margin-bottom: 0 !important; }
.view-page #baselegale + * { margin-top: 0 !important; }
.view-page #baselegale + * > p:first-child { margin-top: 0 !important; }
/* Images : jamais plus larges que la feuille */
.view-page img { max-width: 100% !important; height: auto !important; }
/* Débuts de page forcés :
     p.1  : page de garde (avant le titre 1)
     p.2-3: 1. Table des matières + Annexes
     p.4  : 2. Objectifs + 3. Base légale
     puis : 4 → 4.3.1 | 4.3.2 | 4.3.3 → 4.3.7 | 4.4 → 4.6
            5 → 5.4 | 5.5 → 6.3 | 7-8-9 | 9.1 → 10 | 11 */
.view-page #sommaire, .view-page #objectifs, .view-page #infosgenerales, .view-page #tableau_descriptif, .view-page #produits_dangereux, .view-page #ressources, .view-page #donneesgenerales, .view-page #pmr, .view-page #numeros_urgence, .view-page #equipements_medicaux, .view-page #inventaire_risques {
    break-before: page;
    page-break-before: always;
  }
}


/* styles inline portés en classes */
.view-page .vw1 { display:flex; gap:10px; align-items:center; margin-bottom:20px; }
.view-page .view-urgences { margin-left: auto; }   /* logos + burger + profil poussés à droite */
.view-page .view-burger { margin-left: 6px; }
.view-page .view-profile { position: relative; margin-left: 6px; }
.view-page .vw2 { margin-bottom:0; }
.view-page .vw3 { margin-bottom:0; background:#2F3A44; color:#fff; }
.view-page .vw4 { margin-bottom:0; background:#5A6B7A; color:#fff; border:none; cursor:pointer; }
.view-page .vw5 { margin-bottom:30px; }
.view-page .vw6 { margin-top:0; }
.view-page .vw7 { margin-bottom:6px; font-size:15px; font-weight:bold; }
.view-page .vw8 { margin:0; }
.view-page .vw9 { text-align:center; margin:25px 0; }
.view-page .vw10 { max-width:900px; border:1px solid #ccc; }
.view-page .vw11 { width:90%; max-width:900px; height:220px; border:2px dashed #ccc; margin:auto; display:flex; align-items:center; justify-content:center; color:#aaa; }
.view-page .vw12 { text-align:center; margin-top:20px; }
.view-page .vw13 { font-weight:bold; font-size:16px; }
.view-page .vw14 { text-align:justify; line-height:1.6; }
.view-page .vw15 { text-align:center; margin:20px 0; }
.view-page .vw16 { width:90%; max-width:900px; height:220px; border:2px dashed #ccc; margin:auto; display:flex; align-items:center; justify-content:center; color:#aaa; }
.view-page .vw17 { margin:0; line-height:1.6; }
.view-page .vw18 { line-height:1.6; text-align:justify; }
.view-page .vw19 { color:#777; }
.view-page .vw20 { table-layout:fixed; width:100%; }
.view-page .vw21 { text-align:center; }
.view-page .vw22 { text-align:center; color:#777; }
.view-page .vw23 { width:100%; }
.view-page .vw24 { width:55%; }
.view-page .vw25 { width:40%; }
.view-page .vw26 { margin-left:10px; }
.view-page .vw27 { margin-left:10px; color:#777; }
.view-page .vw28 { margin-left:10px; font-style:italic; }
.view-page .vw29 { width:15%; }
.view-page .vw30 { width:20%; }
.view-page .vw31 { width:10%; }
.view-page .vw32 { line-height:1.6; text-align:justify; }
.view-page .vw33 { line-height:1.6; }
.view-page .vw34 { width:300px; }
.view-page .vw35 { color:#777; margin-left:10px; }
.view-page .vw36 { flex-wrap:wrap; gap:20px; margin-top:10px; }
.view-page .vw37 { max-width:900px; border:1px solid #ccc; margin-top:6px; }
.view-page .vw38 { width:750px; margin:20px auto; border-collapse:collapse; }
.view-page .vw39 { width:60%; text-align:left; }
.view-page .vw40 { width:40%; text-align:left; }
.view-page .vw41 { width:600px; margin:15px auto; border-collapse:collapse; }
.view-page .vw42 { background:#eef5ff; font-weight:bold; color:#0055cc; }
.view-page .vw43 { width:750px; margin:15px auto; border-collapse:collapse; }
.view-page .vw44 { width:100%; border-collapse:collapse; }
.view-page .vw45 { width:500px; max-width:100%; border:1px solid #ccc; margin-top:6px; }
.view-page .vw46 { color:#999; }
.view-page .vw47 { margin-top:60px; }
.view-page .vw48 { text-align:justify; line-height:1.6; }
.view-page .vw49 { line-height:1.7; }
.view-page .vw50 { font-size:18px; }
.view-page .vw51 { width:100%; border-collapse:collapse; margin-bottom:15px; }
.view-page .vw52 { margin-top:25px; }
.view-page .vw53 { width:35%; }
.view-page .vw54 { width:13%; text-align:center; }
.view-page .vw55 { width:42%; }
.view-page .vw56 { width:10%; text-align:center; }
.view-page .vw57 { background:#fff; border:2px solid #cfcfcf; cursor:pointer; }

/* ================================================================
   ÉDITION PUI (edit.php) — migration CSP
   ================================================================ */
.edit-page input[type="date"] {width:160px;}
.edit-page input[type="number"] {text-align:right;}
.edit-page .btn-save-mini {
  background: #5A6B7A;
  border: none;
  color: #fff;
  padding: 8px 20px;
  font-weight: bold;
  font-size: 13px;
  border-radius: 4px;
  margin: 12px 0 20px auto;
  display: block;
  cursor: pointer;
  transition: background 0.2s;
}
.edit-page .btn-save-mini:hover { background: #3d4f5a; }
/* Mise en page globale edit.php */
.edit-page {
  overflow-x: auto;
}
.edit-page {
  min-width: 1210px;
  overflow-x: auto;
}
/* Conteneur principal */
.edit-page .pui-form {
  width: 1150px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  overflow: visible !important;
}
/* Bouton upload fichier */
.edit-page .btn-upload-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #5A6B7A;
  color: #fff;
  padding: 5px 14px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 4px;
}
.edit-page .btn-upload-label:hover { background: #3d4f5a; }
/* Toast de confirmation */
.edit-page .save-toast {
  position: fixed;
  top: 12px;
  right: calc((100vw - 1150px) / 2 + 30px);
  background: #27ae60;
  color: #fff;
  padding: 6px 14px 6px 10px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: bold;
  display: none;
  align-items: center;
  gap: 6px;
  z-index: 9999;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  white-space: nowrap;
}
.edit-page .save-toast.show { display: inline-flex; }
/* ── Barre navigation edit.php ── */
.edit-page .top-bar { display:flex; align-items:center; justify-content:space-between; margin-bottom:24px; }
.edit-page .top-bar-right { display:flex; align-items:center; gap:8px; }
.edit-page .urgences-bar { display:flex; align-items:center; gap:8px; margin-right:4px; }
.edit-page .urgences-bar img { height:44px; width:auto; opacity:.20; }
.edit-page .burger-btn { width:34px; height:34px; background:#fff; border:1px solid #bbb; border-radius:6px; cursor:pointer; display:flex; flex-direction:column; justify-content:center; align-items:center; gap:5px; padding:0; }
.edit-page .burger-btn span { display:block; width:18px; height:2px; background:#999; border-radius:2px; }
.edit-page .burger-btn:hover { border-color:#777; }
.edit-page .burger-btn:hover span { background:#444; }
.edit-page .burger-menu { display:none; position:absolute; right:0; top:calc(100% + 6px); background:#fff; border:1px solid #ddd; border-radius:6px; min-width:200px; box-shadow:0 4px 16px rgba(0,0,0,.12); z-index:2000; overflow:hidden; }
.edit-page .burger-menu.open { display:block; }
.edit-page .burger-menu a { display:block; padding:11px 18px; font-size:13px; color:#2F3A44; text-decoration:none; border-bottom:1px solid #f0f0f0; font-weight:500; }
.edit-page .burger-menu a:last-child { border-bottom:none; }
.edit-page .burger-menu a:hover { background:#f4f7f6; }
.edit-page .profile-btn { width:34px; height:34px; background:#fff; border:1px solid #bbb; border-radius:50%; cursor:pointer; display:flex; align-items:center; justify-content:center; color:#999; font-size:17px; padding:0; }
.edit-page .profile-btn:hover { border-color:#777; color:#444; }
.edit-page .profile-menu { display:none; position:absolute; right:0; top:calc(100% + 6px); background:#fff; border:1px solid #ddd; border-radius:6px; min-width:200px; box-shadow:0 4px 16px rgba(0,0,0,.12); z-index:2000; overflow:hidden; }
.edit-page .profile-menu.open { display:block; }
.edit-page .profile-menu .profile-name { display:block; padding:12px 18px 8px; font-size:13px; font-weight:700; color:#2F3A44; border-bottom:1px solid #f0f0f0; cursor:default; }
.edit-page .profile-menu a { display:block; padding:10px 18px; font-size:13px; color:#c0392b; text-decoration:none; font-weight:600; }
.edit-page .profile-menu a:hover { background:#fdf0ee; }

/* styles inline portés en classes */
.edit-page .ed1 { position:fixed; top:0; left:0; right:0; z-index:10000; background:#e74c3c; color:#fff; padding:10px 20px; font-size:13px; }
.edit-page .ed2 { margin-top:6px; font-size:12px; opacity:0.85; }
.edit-page .ed3 { position:absolute; top:8px; right:12px; background:rgba(255,255,255,0.2); border:none; color:#fff; padding:2px 8px; cursor:pointer; border-radius:3px; }
.edit-page .ed4 { background:#fff; color:#27ae60; border-radius:50%; width:18px; height:18px; display:inline-flex; align-items:center; justify-content:center; font-size:11px; font-weight:bold; flex-shrink:0; }
.edit-page .ed5 { margin-bottom:0; }
.edit-page .ed6 { position:relative; }
.edit-page .ed7 { position:relative; margin-left:6px; }
.edit-page .ed8 { margin:0; }
.edit-page .ed9 { font-size:13px; font-weight:normal; color:#555; margin-left:12px; }
.edit-page .ed10 { margin:10px 0 0 0; }
.edit-page .ed11 { display:flex; align-items:center; gap:12px; flex-wrap:nowrap; padding:8px 0; font-size:14px; }
.edit-page .ed12 { white-space:nowrap; }
.edit-page .ed13 { width:55px; }
.edit-page .ed14 { background:#2F3A44; color:#fff; border:none; border-radius:4px; padding:5px 10px; font-size:16px; cursor:pointer; flex-shrink:0; }
.edit-page .ed15 { margin:25px 0; }
.edit-page .ed16 { max-width:900px; border:1px solid #ccc; display:block; margin:0 auto 10px auto; }
.edit-page .ed17 { width:90%; max-width:900px; height:220px; border:2px dashed #ccc; margin:0 auto 10px auto; display:flex; align-items:center; justify-content:center; color:#aaa; }
.edit-page .ed18 { display:none; }
.edit-page .ed19 { max-width:900px; margin:0 auto; }
.edit-page .ed20 { display:flex; align-items:center; justify-content:flex-end; gap:8px; }
.edit-page .ed21 { background:#e74c3c; color:#fff; border:none; border-radius:50%; width:26px; height:26px; font-size:15px; line-height:26px; text-align:center; cursor:pointer; flex-shrink:0; }
.edit-page .ed22 { background:#5A6B7A; color:#fff; padding:6px 16px; border-radius:4px; font-size:13px; font-weight:bold; cursor:pointer; display:inline-flex; align-items:center; gap:6px; }
.edit-page .ed23 { font-size:12px; color:#777; }
.edit-page .ed24 { font-weight:bold; }
.edit-page .ed25 { width:100%; resize:vertical; }
.edit-page .ed26 { table-layout:fixed; }
.edit-page .ed27 { width:160px; }
.edit-page .ed28 { width:120px; }
.edit-page .ed29 { width:1fr; }
.edit-page .ed30 { width:110px; }
.edit-page .ed31 { text-align:center; }
.edit-page .ed32 { text-align:center; white-space:nowrap; }
.edit-page .ed33 { margin-right:5px; }
.edit-page .ed34 { width:100%; text-align:center; }
.edit-page .ed35 { width:50%; }
.edit-page .ed36 { width:45%; }
.edit-page .ed37 { width:5%; text-align:center; }
.edit-page .ed38 { margin-left:10px; }
.edit-page .ed39 { margin-bottom:10px; }
.edit-page .ed40 { list-style:none; padding:0; margin:0 0 10px 0; }
.edit-page .ed41 { display:flex; align-items:center; gap:8px; padding:3px 0; }
.edit-page .ed42 { background:#e74c3c; color:#fff; border:none; border-radius:50%; width:20px; height:20px; font-size:13px; line-height:20px; text-align:center; cursor:pointer; flex-shrink:0; }
.edit-page .ed43 { font-size:13px; color:#2F3A44; text-decoration:underline; }
.edit-page .ed44 { font-size:11px; color:#999; }
.edit-page .ed45 { width:11%; }
.edit-page .ed46 { width:55%; }
.edit-page .ed47 { width:15%; }
.edit-page .ed48 { width:9%; }
.edit-page .ed49 { width:5%; }
.edit-page .ed50 { width:50px; text-align:center; }
.edit-page .ed51 { width:100%; }
.edit-page .ed52 { display:flex; align-items:center; gap:5px; }
.edit-page .ed53 { width:60px; text-align:center; }
.edit-page .ed54 { margin-left:5px; }
.edit-page .ed55 { margin-left:20px; }
.edit-page .ed56 { display:none; margin-top:10px; border-left:3px solid #2F3A44; padding-left:15px; }
.edit-page .ed57 { width:180px; }
.edit-page .ed58 { width:80px; }
.edit-page .ed59 { width:100%; resize:vertical; min-height:80px; }
.edit-page .ed60 { flex-wrap:wrap; gap:20px; }
.edit-page .ed61 { width:200px; }
.edit-page .ed62 { width:90px; }
.edit-page .ed63 { width:220px; }
.edit-page .ed64 { width:40%; }
.edit-page .ed65 { margin-left:10px; color:#777; font-size:13px; }
.edit-page .ed66 { width:300px; }
.edit-page .ed67 { margin-left:16px; }
.edit-page .ed68 { width:100%; max-width:500px; }
.edit-page .ed69 { margin-bottom:8px; }
.edit-page .ed70 { width:90%; }
.edit-page .ed71 { width:130px; }
.edit-page .ed72 { max-width:400px; }
.edit-page .ed73 { align-items:flex-start; gap:30px; flex-wrap:wrap; }
.edit-page .ed74 { display:flex; flex-direction:column; gap:4px; }
.edit-page .ed75 { display:inline-block; }
.edit-page .ed76 { display:flex; align-items:center; gap:6px; margin-top:2px; }
.edit-page .ed77 { background:#e74c3c; color:#fff; border:none; border-radius:50%; width:20px; height:20px; font-size:13px; line-height:20px; text-align:center; cursor:pointer; }
.edit-page .ed78 { width:500px; max-width:100%; border:1px solid #ccc; margin-top:6px; }
.edit-page .ed79 { text-align:center; margin-top:3px; }
.edit-page .ed80 { width:10px; height:10px; background:#e74c3c; border-radius:50%; display:inline-block; }
.edit-page .ed81 { display:none; background:#e74c3c; color:#fff; border:none; border-radius:50%; width:20px; height:20px; font-size:13px; line-height:20px; text-align:center; cursor:pointer; }
.edit-page .ed82 { max-width:250px; }
.edit-page .ed83 { margin-top:60px; }
.edit-page .ed84 { flex-wrap:wrap; justify-content:space-between; gap:15px; margin-bottom:20px; }
.edit-page .ed85 { display:flex; align-items:center; gap:10px; }
.edit-page .ed86 { width:150px; }
.edit-page .ed87 { width:240px; }
.edit-page .ed88 { background:#eef5ff; font-weight:bold; color:#0055cc; }
.edit-page .ed89 { margin-top:12px; }
.edit-page .ed90 { width:100px; }
.edit-page .ed91 { width:140px; }
.edit-page .ed92 { width:1%; white-space:nowrap; }
.edit-page .ed93 { width:1%; }
.edit-page .ed94 { width:115px; }
.edit-page .ed95 { font-weight:bold; display:block; margin-top:12px; }
.edit-page .ed96 { align-items:flex-start; gap:30px; flex-wrap:wrap; margin-top:14px; }
.edit-page .ed97 { display:flex; align-items:center; gap:6px; margin-top:4px; }
.edit-page .ed98 { display:flex; align-items:flex-start; gap:30px; flex-wrap:wrap; margin:10px 0; }
.edit-page .ed99 { display:flex; flex-direction:column; gap:6px; }
.edit-page .ed100 { display:flex; align-items:center; gap:8px; }
.edit-page .ed101 { max-width:900px; border:1px solid #ccc; margin-top:6px; }
.edit-page .ed102 { margin-top:4px; }
.edit-page .ed103 { font-size:18px; }
.edit-page .ed104 { margin-top:15px; }
.edit-page .ed105 { flex-wrap:wrap; }
.edit-page .ed106 { width:350px; }
.edit-page .ed107 { width:300px; display:inline-block; }
.edit-page .ed108 { width:300px; display:none; }
.edit-page .ed109 { padding:20px; }
.edit-page .ed110 { max-width:900px; border:1px solid #ccc; margin-top:10px; display:block; }
.edit-page .ed111 { display:flex; align-items:center; gap:6px; margin-top:8px; }
.edit-page .ed112 { width:32%; }
.edit-page .ed113 { width:13%; text-align:center; }
.edit-page .ed114 { width:10%; text-align:center; }
.edit-page .ed115 { margin-right:6px; }
.edit-page .ed116 { text-align:center; padding:4px; }
.edit-page .ed117 { width:45px; text-align:center; margin:0; }
.edit-page .ed118 { width:100%; max-width:600px; }

/* Masquage conditionnel (rendu serveur) — le JS reprend la main ensuite */
.est-masque { display: none; }
.edit-page .ed-bloc-wrap { flex-wrap: wrap; gap: 20px; margin-top: 10px; }
.edit-page .ed-mt15 { margin-top: 15px; }
