/* ---------------------------------------------------------------------------
   Habillage « centre d'administration Microsoft 365 ».

   Chargé en dernier : il redéfinit les couleurs de `styles.css` et de
   `tableau-de-bord.css` et adopte la mise en page de la console Microsoft —
   barre noire en haut, navigation à gauche avec groupes repliables, fil
   d'Ariane, grand titre, barre de commandes et liste en tableau.

   Deux thèmes, clair et sombre. Par défaut, celui du système ; le bouton
   soleil de la barre du haut en force un, via `data-theme` sur <html>.

   Toujours aucun style en ligne : la CSP l'interdit. Les couleurs des
   graphiques passent par des classes (g-*), jamais par l'attribut `style`.
   --------------------------------------------------------------------------- */

/* --- Thème clair ---------------------------------------------------------- */

:root {
  color-scheme: light;

  --fond: #faf9f8;
  --surface: #ffffff;
  --surface-2: #f5f5f5;
  --surface-douce: #f7f7f7;
  --bordure: #e0e0e0;
  --bordure-forte: #c7c7c7;
  --ligne: #edebe9;
  --survol: #f0f0f0;
  --selection: #ebf3fc;
  --texte: #242424;
  --texte-discret: #616161;

  --accent: #0f6cbd;
  --accent-fonce: #115ea3;
  --accent-plein: #0f6cbd;
  --accent-plein-survol: #115ea3;
  --accent-icone: #0f6cbd;

  --ok: #107c10;
  --ok-fond: #f1faf1;
  --bord-ok: #9fd89f;
  --echec: #c50f1f;
  --echec-fond: #fdf3f4;
  --bord-echec: #eeacb2;
  --attente: #8a5300;
  --attente-texte: #6b4100;
  --attente-fond: #fff9f5;
  --bord-attente: #f4bf75;
  --manuel: #5b5fc7;
  --manuel-fond: #f1f1fb;
  --bord-manuel: #c5c7f0;
  --info-fond: #ebf3fc;
  --info-texte: #0f548c;
  --info-bord: #b4d6fa;

  --barre-haute: #1f1f1f;
  --barre-haute-texte: #ffffff;
  --nav-fond: #f0f0f0;
  --nav-texte: #242424;
  --nav-survol: #e3e3e3;
  --nav-actif: #e0e0e0;

  --rayon: 6px;
  --ombre: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* --- Thème sombre ---------------------------------------------------------- *
   Deux sélecteurs pour un même jeu de valeurs : le thème du système quand
   rien n'est forcé, et le thème forcé par le bouton.                       */

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="clair"]) {
    color-scheme: dark;

    --fond: #1b1b1b;
    --surface: #262626;
    --surface-2: #2e2e2e;
    --surface-douce: #2b2b2b;
    --bordure: #3d3d3d;
    --bordure-forte: #5c5c5c;
    --ligne: #333333;
    --survol: #333333;
    --selection: #1e3550;
    --texte: #f5f5f5;
    --texte-discret: #b8b8b8;

    --accent: #479ef5;
    --accent-fonce: #62abf5;
    --accent-plein: #0f6cbd;
    --accent-plein-survol: #1f7ad6;
    --accent-icone: #479ef5;

    --ok: #6ccb5f;
    --ok-fond: #1c2b1a;
    --bord-ok: #2f5a29;
    --echec: #f1707b;
    --echec-fond: #3a1f22;
    --bord-echec: #6e2b31;
    --attente: #f2b05e;
    --attente-texte: #f6c98f;
    --attente-fond: #342817;
    --bord-attente: #6a4a1c;
    --manuel: #a9a7f7;
    --manuel-fond: #26253f;
    --bord-manuel: #45437a;
    --info-fond: #18304a;
    --info-texte: #8cc4fa;
    --info-bord: #26517d;

    --barre-haute: #0a0a0a;
    --nav-fond: #262626;
    --nav-texte: #f5f5f5;
    --nav-survol: #333333;
    --nav-actif: #383838;

    --ombre: none;
  }
}

:root[data-theme="sombre"] {
  color-scheme: dark;

  --fond: #1b1b1b;
  --surface: #262626;
  --surface-2: #2e2e2e;
  --surface-douce: #2b2b2b;
  --bordure: #3d3d3d;
  --bordure-forte: #5c5c5c;
  --ligne: #333333;
  --survol: #333333;
  --selection: #1e3550;
  --texte: #f5f5f5;
  --texte-discret: #b8b8b8;

  --accent: #479ef5;
  --accent-fonce: #62abf5;
  --accent-plein: #0f6cbd;
  --accent-plein-survol: #1f7ad6;
  --accent-icone: #479ef5;

  --ok: #6ccb5f;
  --ok-fond: #1c2b1a;
  --bord-ok: #2f5a29;
  --echec: #f1707b;
  --echec-fond: #3a1f22;
  --bord-echec: #6e2b31;
  --attente: #f2b05e;
  --attente-texte: #f6c98f;
  --attente-fond: #342817;
  --bord-attente: #6a4a1c;
  --manuel: #a9a7f7;
  --manuel-fond: #26253f;
  --bord-manuel: #45437a;
  --info-fond: #18304a;
  --info-texte: #8cc4fa;
  --info-bord: #26517d;

  --barre-haute: #0a0a0a;
  --nav-fond: #262626;
  --nav-texte: #f5f5f5;
  --nav-survol: #333333;
  --nav-actif: #383838;

  --ombre: none;
}

body {
  background: var(--fond);
  color: var(--texte);
  font-family: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
}

/* Icônes au trait, façon Fluent. */
.ic {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ic.plein { fill: currentColor; stroke: none; }

/* --- Coque ----------------------------------------------------------------- */

#application { display: flex; flex-direction: column; min-height: 100vh; }
.corps-app { display: flex; flex: 1; min-height: 0; }

.barre-haute {
  position: sticky;
  top: 0;
  z-index: 60;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: var(--barre-haute);
  color: var(--barre-haute-texte);
}

.bh-bouton {
  position: relative;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 4px;
  background: none;
  color: inherit;
  cursor: pointer;
}
.bh-bouton:hover { background: rgba(255, 255, 255, 0.1); }
.bh-bouton:focus-visible { outline: 2px solid #ffffff; outline-offset: -2px; }

.bh-gaufre { width: 36px; height: 36px; display: grid; place-items: center; }
.bh-gaufre .ic { width: 16px; height: 16px; }

.bh-titre { font-size: 16px; font-weight: 600; white-space: nowrap; }
.bh-titre-detail { font-weight: 400; opacity: 0.85; }

.barre-haute .recherche { flex: 1; max-width: 540px; margin: 0 auto; }
.barre-haute .recherche input {
  height: 32px;
  padding: 4px 12px 4px 36px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: #2e2e2e;
  color: #ffffff;
}
.barre-haute .recherche input::placeholder { color: #c8c8c8; }
.barre-haute .recherche input:focus { border-color: #ffffff; outline: none; }
.barre-haute .recherche-icone {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #c8c8c8;
}

.barre-haute .entete-actions { gap: 4px; }
.bh-avatar { width: 30px; height: 30px; margin-left: 6px; font-size: 11.5px; background: #0f6cbd; }

.badge { white-space: nowrap; }
.badge.simulation { border-color: var(--bord-attente); }
.badge.reel { border-color: var(--bord-echec); }
.badge-compteur { top: 2px; right: 1px; background: #c50f1f; }

/* --- Navigation latérale --------------------------------------------------- */

.barre-laterale {
  width: 232px;
  top: 48px;
  height: calc(100vh - 48px);
  background: var(--nav-fond);
  color: var(--nav-texte);
  border-right: 1px solid var(--bordure);
  transition: width 0.15s ease;
}

.nav-replier {
  width: 40px;
  height: 40px;
  margin: 4px 4px 0;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 4px;
  background: none;
  color: var(--nav-texte);
  cursor: pointer;
}
.nav-replier:hover { background: var(--nav-survol); }

.navigation { padding: 4px; gap: 0; }

.nav-item,
.nav-groupe {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: none;
  border-radius: 4px;
  background: none;
  color: var(--nav-texte);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.nav-item:hover,
.nav-groupe:hover { background: var(--nav-survol); color: var(--nav-texte); }
.nav-item:focus-visible,
.nav-groupe:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* L'élément actif : fond à peine plus clair et barre bleue à gauche, comme
   chez Microsoft. Plus de pavé bleu plein. */
.nav-item.actif { background: var(--nav-actif); color: var(--nav-texte); font-weight: 600; }
.nav-item.actif::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 2px;
  background: var(--accent);
}

.nav-icone { width: 20px; opacity: 1; }
.nav-texte { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item.sous { padding-left: 46px; }

.nav-groupe .chevron { width: 16px; height: 16px; transition: transform 0.15s ease; }
.nav-groupe[aria-expanded="false"] .chevron { transform: rotate(180deg); }

.nav-titre {
  margin: 14px 12px 4px;
  font-size: 12px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--texte-discret);
}

.pied-laterale { border-top: 1px solid var(--bordure); }
.pied-laterale .lien-secours { color: var(--texte-discret); border-bottom: none; }
.pied-laterale .lien-secours:hover { color: var(--texte); }
.pied-laterale .discret-bouton { color: var(--texte-discret); }
.pied-laterale .discret-bouton:hover { color: var(--texte); }
.carte-operateur { background: var(--nav-survol); }
.carte-operateur-texte strong { color: var(--nav-texte); }
.carte-operateur-texte .discret { color: var(--texte-discret); }
.avatar { background: #0f6cbd; color: #ffffff; }

/* Navigation réduite aux icônes (écran large seulement). */
@media (min-width: 1025px) {
  .nav-reduite .barre-laterale { width: 49px; }
  .nav-reduite .nav-texte,
  .nav-reduite .nav-titre,
  .nav-reduite .chevron,
  .nav-reduite .nav-sous,
  .nav-reduite .pied-laterale { display: none; }
  .nav-reduite .nav-item,
  .nav-reduite .nav-groupe { justify-content: center; padding: 0; }
}

/* --- En-tête de page -------------------------------------------------------- */

.entete-page { padding: 20px 32px 0; }
.entete-page h1 { margin: 10px 0 0; font-size: 28px; font-weight: 600; line-height: 1.25; }
.entete-page p { margin: 6px 0 0; }

.fil-ariane { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 14px; }
.fil-lien {
  padding: 0;
  border: none;
  background: none;
  color: var(--texte);
  font: inherit;
  cursor: pointer;
}
.fil-lien:hover { text-decoration: underline; }
.fil-sep { color: var(--texte-discret); }

/* Barre de commandes : des boutons texte avec icône bleue, sans cadre. */
.barre-commandes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  margin: 16px 32px 0;
  padding: 4px 0;
  border-top: 1px solid var(--bordure);
  border-bottom: 1px solid var(--bordure);
}
.commande {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: none;
  border-radius: 4px;
  background: none;
  color: var(--texte);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.commande .ic { color: var(--accent-icone); }
.commande:hover:not(:disabled) { background: var(--survol); }
.commande:disabled { opacity: 0.45; cursor: not-allowed; }
.commande:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Filtres en pastilles. */
.filtres {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 14px 32px 0;
}
.filtres-libelle { font-size: 14px; }
.filtres-compte { margin-left: auto; font-size: 13px; }
.pastille-filtre select {
  width: auto;
  padding: 4px 12px;
  border: 1px solid var(--bordure-forte);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--texte);
  font-size: 13px;
  cursor: pointer;
}

/* --- Liste « Utilisateurs actifs » ------------------------------------------ */

.vue-page { padding-bottom: 40px; }
.liste-m365 { margin: 12px 32px 0; }
.tableau-m365 { font-size: 14px; }
.tableau-m365 th {
  color: var(--texte);
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 1px solid var(--bordure);
  white-space: nowrap;
}
.tableau-m365 td { padding: 8px 12px; border-bottom: 1px solid var(--ligne); }
.tableau-m365 tbody tr[data-id] { cursor: pointer; }
.tableau-m365 tbody tr[data-id]:hover { background: var(--survol); }
.tableau-m365 tbody tr.choisie { background: var(--selection); }
.tableau-m365 .col-case { width: 44px; text-align: center; }
.tableau-m365 input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent-plein); cursor: pointer; }
.tableau-m365 .cellule-utilisateur strong { font-weight: 600; }
.tableau-m365 .avatar { width: 28px; height: 28px; font-size: 11px; }

/* --- Crayon et panneau « Modifier l'utilisateur » --------------------------- */

.tableau-m365 .col-crayon { width: 44px; text-align: center; }
.bouton-crayon {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: none;
  border-radius: 4px;
  background: none;
  color: var(--accent-icone);
  cursor: pointer;
}
.bouton-crayon:hover:not(:disabled) { background: var(--survol); }
.bouton-crayon:disabled { color: var(--texte-discret); opacity: 0.4; cursor: not-allowed; }
.bouton-crayon:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Panneau latéral à droite, comme les volets de gestion Microsoft 365. */
dialog.panneau-lateral {
  margin: 0 0 0 auto;
  width: min(520px, 100vw);
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  padding: 0;
  border: none;
  border-left: 1px solid var(--bordure);
  border-radius: 0;
  background: var(--surface);
  color: var(--texte);
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.25);
}
dialog.panneau-lateral::backdrop { background: rgba(0, 0, 0, 0.4); }
.panneau-lateral form { display: flex; flex-direction: column; height: 100%; }

.pl-entete {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px 12px;
  border-bottom: 1px solid var(--bordure);
}
.pl-entete h2 { margin: 0; font-size: 20px; font-weight: 600; }
.pl-entete p { margin: 4px 0 0; overflow-wrap: anywhere; }
.pl-fermer { color: var(--texte); flex: none; }
.pl-fermer:hover { background: var(--survol); }

.pl-corps { flex: 1; overflow-y: auto; padding: 8px 24px 20px; }
.pl-section {
  margin: 20px 0 10px;
  font-size: 15px;
  font-weight: 600;
}
.pl-cases {
  padding: 4px 12px;
  border: 1px solid var(--bordure);
  border-radius: 6px;
}
.pl-cases .discret { padding: 6px 0; font-size: 13px; }

.pl-pied {
  display: flex;
  gap: 10px;
  padding: 14px 24px;
  border-top: 1px solid var(--bordure);
  background: var(--surface);
}

#pm-resultat { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.message.succes-modif { background: var(--ok-fond); color: var(--texte); border: 1px solid var(--bord-ok); }
.message.succes-modif ul { margin: 6px 0 0; padding-left: 18px; }
.pl-manuel { grid-template-columns: 1fr; margin: 0; }

/* --- Bouton rouge : supprimer ----------------------------------------------- */

.commande.danger { color: var(--echec); }
.commande.danger .ic { color: var(--echec); }
.commande.danger:hover:not(:disabled) { background: var(--echec-fond); }

.bouton.rouge { background: #c50f1f; border-color: #c50f1f; color: #ffffff; }
.bouton.rouge:hover:not(:disabled) { background: #a80d1a; }
.dialogue-supprimer { max-width: 520px; }
.avertissement-rouge {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--echec-fond);
  border: 1px solid var(--bord-echec);
  color: var(--texte);
  font-size: 13px;
}
.dialogue-supprimer .case { margin-bottom: 12px; }
.etiquette.supprime { background: var(--echec-fond); color: var(--echec); }

/* --- Départ d'un utilisateur ------------------------------------------------ */

.grille-depart { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
.options-depart { margin-top: 4px; }
.options-depart legend { font-size: 13px; font-weight: 600; color: var(--texte); }
.options-depart .case input:disabled + span { color: var(--texte-discret); }
.options-depart textarea { font-family: inherit; font-size: 13px; }
.formulaire-depart, .resume-depart { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--bordure); }
.etiquette.depart_en_cours { background: var(--attente-fond); color: var(--attente); }
.etiquette.parti { background: var(--survol); color: var(--texte-discret); }

@media (max-width: 1100px) {
  .grille-depart { grid-template-columns: minmax(0, 1fr); }
}

/* --- Vues existantes, recalées sur les marges de la page ------------------- */

.vue-tableau { padding: 0 32px 40px; gap: 16px; }
.vue-tableau .entete-page { padding: 20px 0 0; }
.vue-tableau .barre-commandes { margin: 0; }
.vue-parametres { padding-top: 0; }
.vue-parametres .entete-page { margin-bottom: 16px; }
.panneau-large { margin: 0 32px 24px; }
.grille { padding: 16px 32px; }
#entete-journal { margin-bottom: 16px; }

/* Cartes : plates, comme dans la console Microsoft. */
.panneau,
.kpi,
.carte-connexion {
  background: var(--surface);
  border-color: var(--bordure);
  border-radius: 8px;
  box-shadow: var(--ombre);
}
.panneau h2 {
  font-size: 16px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--texte);
}

.kpi-icone.bleu { background: var(--info-fond); color: var(--accent); }
.kpi-icone.violet { background: var(--manuel-fond); color: var(--manuel); }

/* --- Contrôles ------------------------------------------------------------- */

input, select, textarea {
  background: var(--surface);
  color: var(--texte);
  border-color: var(--bordure-forte);
  border-radius: 4px;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input:disabled, select:disabled { background: var(--surface-douce); }

.bouton { border-radius: 4px; border-color: var(--bordure-forte); background: var(--surface); color: var(--texte); }
.bouton:hover:not(:disabled) { background: var(--survol); }
.bouton.principal { background: var(--accent-plein); border-color: var(--accent-plein); color: #ffffff; }
.bouton.principal:hover:not(:disabled) { background: var(--accent-plein-survol); }
.bouton.danger { color: var(--echec); border-color: var(--bord-echec); }
.bouton.danger:hover:not(:disabled) { background: var(--echec-fond); }

.bouton-etape { background: var(--surface); border-color: var(--bordure-forte); }
.bouton-etape:hover:not(:disabled) { background: var(--survol); }
.bouton-etape.confirmer { background: var(--accent-plein); border-color: var(--accent-plein); color: #ffffff; }
.bouton-etape.confirmer:hover:not(:disabled) { background: var(--accent-plein-survol); }

.relire, .reverifier, .recopier-bouton, .lien-inventaire {
  background: var(--surface);
  border-color: var(--bordure-forte);
}
.relire:hover, .reverifier:hover:not(:disabled), .recopier-bouton:hover,
.lien-inventaire.verif:hover:not(:disabled) { background: var(--survol); color: var(--texte); }
.lien-inventaire:hover:not(:disabled) { background: var(--info-fond); border-color: var(--info-bord); }

dialog { background: var(--surface); color: var(--texte); border-color: var(--bordure); }

/* --- Couleurs d'état, désormais portées par des variables ------------------ */

.puce-groupe { background: var(--survol); border-color: var(--bordure); }
.bandeau-creation { background: var(--surface-douce); border-color: var(--bordure); }
.marqueur { background: var(--survol); border-color: var(--bordure); }
.etape { background: var(--surface); border-color: var(--bordure); }
.etape[data-statut="ok"]      { background: var(--ok-fond);      border-color: var(--bord-ok); }
.etape[data-statut="echec"]   { background: var(--echec-fond);   border-color: var(--bord-echec); }
.etape[data-statut="attente"] { background: var(--attente-fond); border-color: var(--bord-attente); }
.etape[data-statut="manuel"]  { background: var(--manuel-fond);  border-color: var(--bord-manuel); }
.etape[data-statut="ok"] .marqueur,
.etape[data-statut="echec"] .marqueur,
.etape[data-statut="attente"] .marqueur,
.etape[data-statut="manuel"] .marqueur { color: var(--surface); }
.etape[data-statut="encours"] .marqueur { background: var(--accent-plein); border-color: var(--accent-plein); }

.recopier { background: var(--surface); border-color: var(--bordure); }
.recopier-ligne + .recopier-ligne { border-top-color: var(--ligne); }

.tableau th { border-bottom-color: var(--bordure); }
.tableau td { border-bottom-color: var(--ligne); }

.message.erreur { border-color: var(--bord-echec); }
.message.information { background: var(--info-fond); color: var(--info-texte); border-color: var(--info-bord); }
.avertissement,
.banniere { background: var(--attente-fond); border-color: var(--bord-attente); color: var(--attente-texte); }
.badge-tentative { border-color: var(--bord-attente); }

.etiquette.en_cours { background: var(--info-fond); color: var(--info-texte); }

.param-client { background: var(--surface-douce); border-color: var(--bordure); }
.param-modele { background: var(--surface); border-color: var(--bordure); }

.pastille-verif.vert   { border-color: var(--bord-ok); }
.pastille-verif.rouge  { border-color: var(--bord-echec); }
.pastille-verif.orange { border-color: var(--bord-attente); }
.pastille-verif.gris   { background: var(--survol); border-color: var(--bordure); }

.echeance { background: var(--surface); border-color: var(--bordure); }
.echeance.passee { border-color: var(--bord-echec); }
.echeance.proche { border-color: var(--bord-attente); }

.action:hover { background: var(--survol); }
.raccourci { background: var(--surface); border-color: var(--bordure); color: var(--texte); }
.raccourci:hover { background: var(--survol); border-color: var(--accent); }
.raccourci-icone { color: var(--accent); }

/* --- Graphiques ------------------------------------------------------------ */

.g-grille { stroke: var(--ligne); }
.g-texte { fill: var(--texte-discret); }
.g-total { fill: var(--texte); }
.g-fond { fill: var(--survol); }
.g-ok { fill: var(--ok); }
.g-cours { fill: var(--accent); }
.g-echec { fill: var(--echec); }
.jeton-ok::before { background: var(--ok); }
.jeton-cours::before { background: var(--accent); }
.jeton-echec::before { background: var(--echec); }

/* --- Écrans étroits -------------------------------------------------------- */

@media (max-width: 1024px) {
  .barre-laterale { top: 48px; z-index: 55; }
  .nav-replier { display: none; }
  .bouton-menu { display: grid; border: none; background: none; padding: 0; }
  .voile-laterale { top: 48px; }
}

@media (max-width: 720px) {
  .entete-page { padding: 16px 16px 0; }
  .entete-page h1 { font-size: 22px; }
  .barre-commandes, .filtres, .liste-m365 { margin-left: 16px; margin-right: 16px; }
  .vue-tableau { padding: 0 16px 32px; }
  .panneau-large { margin: 0 16px 20px; }
  .grille { padding: 16px; }
  .bh-titre-detail, .bh-gaufre { display: none; }
  .filtres-compte { margin-left: 0; flex-basis: 100%; }
}

@media (max-width: 560px) {
  /* La recherche reste dans la barre noire : la place gagnée vient du titre. */
  .barre-haute { gap: 4px; }
  .bh-titre { display: none; }
  .barre-haute .recherche { order: 0; flex-basis: auto; }
  .bh-avatar { display: none; }
}

/* Compteur Mailinblack lu en direct, au-dessus des cases */
.mib-reel { display: flex; flex-direction: column; gap: 2px; margin: 0 0 8px; }
.mib-reel .dispo { margin-left: 0; }

/* Environnement (Test / Altise), toujours visible dans l'en-tête */
.badge.environnement { background: #5b2c83; color: #fff; font-weight: 600; letter-spacing: .02em; }

/* Question posée dans la page (remplace confirm/prompt) */
#dialogue-question { max-width: 520px; }
#dialogue-question .dq-message { white-space: pre-line; margin: 0 0 12px; line-height: 1.45; }
#dialogue-question input { width: 100%; box-sizing: border-box; margin-bottom: 12px; }
