/* ==========================================================
   Cabinet — feuille de style unique
   Inspiration Material Design 3, coins légèrement arrondis.
   ========================================================== */

/* ---------- Jetons de design ------------------------------ */
:root {
  /* Palette (bleu ardoise juridique) */
  /* La barre du haut garde son identité sombre dans les deux thèmes */
  --topbar-bg:          #1b3a5c;
  --on-topbar:          #ffffff;

  --primary:            #1b3a5c;
  --primary-hover:      #16304d;
  --primary-container:  #dce7f3;
  --on-primary:         #ffffff;
  --on-primary-container:#0d2338;

  --accent:             #a8712a;
  --accent-container:   #f7ead8;

  --surface:            #ffffff;
  --surface-1:          #f8f9fb;
  --surface-2:          #f1f3f6;
  --surface-3:          #e8ebf0;
  --background:         #f6f7f9;
  --outline:            #d5d9e0;
  --outline-strong:     #b6bcc6;

  --text:               #16202b;
  --text-muted:         #5b6572;
  --text-faint:         #8b95a1;

  --success:            #1f7a4d;
  --success-container:  #dcf1e6;
  --warning:            #a86a00;
  --warning-container:  #fbeed3;
  --danger:             #b3261e;
  --danger-container:   #fbe4e2;
  --info:               #1c5fa8;
  --info-container:     #dde9f8;

  /* Rayons — à peine arrondis : l'angle reste lisible */
  --r-xs: 2px;
  --r-sm: 4px;
  --r-md: 6px;   /* cartes, boutons, champs */
  --r-lg: 8px;   /* fenêtres modales */
  --r-pill: 999px;

  /* Élévations discrètes */
  --e1: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .04);
  --e2: 0 2px 6px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --e3: 0 8px 24px rgba(16, 24, 40, .12), 0 2px 6px rgba(16, 24, 40, .06);

  /* Gabarit */
  --topbar-h: 56px;
  --rail-w: 68px;
  --sidebar-w: 264px;

  --font: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --transition: 180ms cubic-bezier(.2, 0, 0, 1);
}

/* ---------- Thème sombre --------------------------------- */
@media (prefers-color-scheme: dark) {
  body.theme-auto {
    --topbar-bg:          #14202c;
    --on-topbar:          #e6eaf0;
    --primary:            #9dc2e8;
    --primary-hover:      #b3d1f0;
    --primary-container:  #23405c;
    --on-primary:         #0b1e30;
    --on-primary-container:#d6e6f7;
    --accent:             #e3b177;
    --accent-container:   #4a361e;
    --surface:            #171c22;
    --surface-1:          #1c222a;
    --surface-2:          #222932;
    --surface-3:          #2a323c;
    --background:         #11151a;
    --outline:            #333c47;
    --outline-strong:     #4a5562;
    --text:               #e6eaf0;
    --text-muted:         #a3adba;
    --text-faint:         #7b8695;
    --success-container:  #163527;
    --warning-container:  #3b2c0d;
    --danger-container:   #40201d;
    --info-container:     #16293d;
    --e1: 0 1px 2px rgba(0,0,0,.4);
    --e2: 0 2px 8px rgba(0,0,0,.45);
    --e3: 0 10px 28px rgba(0,0,0,.55);
  }
}
body.theme-dark {
  --topbar-bg: #14202c; --on-topbar: #e6eaf0;
  --primary: #9dc2e8; --primary-hover: #b3d1f0; --primary-container: #23405c;
  --on-primary: #0b1e30; --on-primary-container: #d6e6f7;
  --accent: #e3b177; --accent-container: #4a361e;
  --surface: #171c22; --surface-1: #1c222a; --surface-2: #222932; --surface-3: #2a323c;
  --background: #11151a; --outline: #333c47; --outline-strong: #4a5562;
  --text: #e6eaf0; --text-muted: #a3adba; --text-faint: #7b8695;
  --success-container: #163527; --warning-container: #3b2c0d;
  --danger-container: #40201d; --info-container: #16293d;
  --e1: 0 1px 2px rgba(0,0,0,.4); --e2: 0 2px 8px rgba(0,0,0,.45); --e3: 0 10px 28px rgba(0,0,0,.55);
}

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

/* `hidden` doit toujours l'emporter sur un display défini par une classe
   (sans quoi l'écran de démarrage continue de capter les clics). */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

h1, h2, h3, h4 { margin: 0; font-weight: 500; line-height: 1.3; }
p { margin: 0 0 .75em; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--outline-strong); border-radius: var(--r-pill); border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* Material Symbols */
.mi {
  font-family: "Material Symbols Outlined";
  font-weight: normal; font-style: normal;
  font-size: 20px; line-height: 1;
  letter-spacing: normal; text-transform: none;
  display: inline-block; white-space: nowrap; direction: ltr;
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 20;
  user-select: none; flex: none;
}
.mi.filled { font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 20; }
.mi.sm { font-size: 18px; }
.mi.lg { font-size: 24px; }
.mi.xl { font-size: 40px; font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 0, "opsz" 40; }

/* ---------- Écran de démarrage --------------------------- */
.boot {
  /* Sous les fenêtres modales (80) et les notifications (90) : la porte de
     version peut s'ouvrir pendant que l'écran de démarrage sert de fond. */
  position: fixed; inset: 0; z-index: 40;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: var(--background); color: var(--text);
}
.boot-logo {
  width: 64px; height: 64px; border-radius: var(--r-lg);
  display: grid; place-items: center;
  background: var(--primary); color: var(--on-primary);
}
.boot-logo .mi { font-size: 34px; }
.boot-title { font-size: 18px; font-weight: 500; }
.boot-msg { font-size: 13px; color: var(--text-muted); max-width: 30rem; text-align: center; padding: 0 1rem; }
.boot-spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--outline); border-top-color: var(--primary);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Gabarit général ------------------------------ */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas: "brand topbar" "sidebar main";
  height: 100dvh;
  transition: grid-template-columns var(--transition);
}
.layout.collapsed { grid-template-columns: var(--rail-w) 1fr; }

/* ---------- Barre du haut -------------------------------- */
.brand {
  grid-area: brand;
  display: flex; align-items: center; gap: 8px;
  padding: 0 8px 0 10px;
  background: var(--topbar-bg); color: var(--on-topbar);
  overflow: hidden;
}
.brand-mark {
  width: 32px; height: 32px; flex: none; border-radius: var(--r-sm);
  display: grid; place-items: center;
  background: rgba(255,255,255,.16);
}
.brand-name {
  font-size: 15px; font-weight: 500; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.layout.collapsed .brand-name { display: none; }

.topbar {
  grid-area: topbar;
  display: flex; align-items: center; gap: 6px;
  padding: 0 10px 0 6px;
  background: var(--topbar-bg); color: var(--on-topbar);
  box-shadow: var(--e1);
}
.topbar .spacer { flex: 1; }
.topbar .show-sm { display: none; }
.topbar .divider { width: 1px; height: 24px; background: rgba(255,255,255,.2); margin: 0 4px; }

.icon-btn {
  appearance: none; border: 0; background: transparent; color: inherit;
  width: 38px; height: 38px; flex: none;
  border-radius: var(--r-sm);
  display: grid; place-items: center; cursor: pointer;
  transition: background var(--transition);
  position: relative;
}
.icon-btn:hover { background: rgba(255,255,255,.14); }
.icon-btn:active { background: rgba(255,255,255,.22); }
.icon-btn.on { background: rgba(255,255,255,.22); }
.icon-btn[disabled] { opacity: .45; cursor: default; }
.icon-btn .badge {
  position: absolute; top: 4px; right: 4px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: var(--r-pill);
  background: var(--accent); color: #1a1206;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
}

/* Recherche rapide dans la barre du haut */
.quick-search {
  display: flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 10px;
  min-width: 180px; max-width: 420px; flex: 1 1 260px;
  border-radius: var(--r-md);
  background: rgba(255,255,255,.14);
  color: var(--on-topbar);
  transition: background var(--transition);
}
.quick-search:focus-within { background: rgba(255,255,255,.24); }
.quick-search input {
  flex: 1; min-width: 0;
  border: 0; background: transparent; outline: none;
  color: inherit; font: inherit;
}
.quick-search input::placeholder { color: rgba(255,255,255,.7); }

.net-chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 26px; padding: 0 9px;
  border-radius: var(--r-pill);
  font-size: 12px; font-weight: 500; white-space: nowrap;
  background: rgba(255,255,255,.16);
}
.net-chip .mi { font-size: 15px; }
.net-chip.offline { background: var(--warning); color: #1e1503; }
.net-chip.syncing .mi { animation: spin 1s linear infinite; }

.avatar {
  width: 32px; height: 32px; flex: none; border-radius: var(--r-pill);
  display: grid; place-items: center; cursor: pointer;
  background: var(--accent); color: #1a1206;
  font-size: 12px; font-weight: 700; letter-spacing: .3px;
  border: 0;
}
/* ------------------------------------------------------------
   Initiales de trois ou quatre caractères
   ------------------------------------------------------------
   Le cercle garde son diamètre — il est aligné sur les autres
   éléments de la barre — c'est donc la police qui se resserre.
   data-len est posé par ui.js (initiales / pastille). */
.avatar[data-len="3"] { font-size: 10.5px; letter-spacing: 0; }
.avatar[data-len="4"] { font-size:  9px;   letter-spacing: -.2px; }

/* ---------- Barre latérale ------------------------------- */
.sidebar {
  grid-area: sidebar;
  background: var(--surface);
  border-right: 1px solid var(--outline);
  overflow-y: auto; overflow-x: hidden;
  padding: 8px 8px 20px;
  display: flex; flex-direction: column; gap: 2px;
}
.nav-group { margin-top: 10px; }
.nav-group:first-child { margin-top: 2px; }
.nav-label {
  font-size: 11px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase;
  color: var(--text-faint); padding: 6px 12px 4px;
  white-space: nowrap; overflow: hidden;
}
.layout.collapsed .nav-label {
  height: 1px; padding: 0; margin: 8px 12px; overflow: hidden;
  color: transparent; background: var(--outline);
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  height: 40px; padding: 0 12px; margin-bottom: 1px;
  border: 0; width: 100%;
  border-radius: var(--r-md);
  background: transparent; color: var(--text);
  font: inherit; font-weight: 500; text-align: left;
  cursor: pointer; white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}
.nav-item:hover { background: var(--surface-2); text-decoration: none; }
.nav-item.active { background: var(--primary-container); color: var(--on-primary-container); }
.nav-item.active .mi { font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 20; }
.nav-item .mi { flex: none; color: var(--text-muted); }
.nav-item.active .mi { color: inherit; }
.nav-item .label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav-item .count {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  background: var(--surface-2); border-radius: var(--r-pill); padding: 1px 7px;
}
.nav-item.active .count { background: rgba(0,0,0,.08); color: inherit; }
.layout.collapsed .nav-item { justify-content: center; padding: 0; }
.layout.collapsed .nav-item .label,
.layout.collapsed .nav-item .count { display: none; }

.sidebar-foot {
  margin-top: auto; padding: 10px 12px 0;
  border-top: 1px solid var(--outline);
  font-size: 11px; color: var(--text-faint); white-space: nowrap; overflow: hidden;
}
.layout.collapsed .sidebar-foot { text-align: center; padding: 10px 0 0; }
.layout.collapsed .sidebar-foot .long { display: none; }

/* ---------- Zone principale ------------------------------ */
.main { grid-area: main; overflow-y: auto; padding: 16px; }
.page { max-width: 1240px; margin: 0 auto; }
.page-head {
  display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.page-head h1 { font-size: 20px; }
.page-head .sub { font-size: 13px; color: var(--text-muted); }
.page-head .spacer { flex: 1; }

/* ---------- Boutons ------------------------------------- */
.btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 16px;
  border-radius: var(--r-md); border: 1px solid transparent;
  font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.btn .mi { font-size: 19px; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-tonal { background: var(--primary-container); color: var(--on-primary-container); }
.topbar .btn-tonal { background: rgba(255,255,255,.16); color: var(--on-topbar); }
.topbar .btn-tonal:hover { background: rgba(255,255,255,.26); filter: none; }
.btn-tonal:hover { filter: brightness(.96); }
.btn-outline { background: var(--surface); color: var(--text); border-color: var(--outline-strong); }
.btn-outline:hover { background: var(--surface-2); }
.btn-text { background: transparent; color: var(--primary); padding: 0 10px; }
.btn-text:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.94); }
.btn[disabled] { opacity: .5; cursor: default; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.block { width: 100%; }

/* ---------- Champs -------------------------------------- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field > label { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.field .hint { font-size: 11.5px; color: var(--text-faint); }
.field .err { font-size: 12px; color: var(--danger); }

input[type=text], input[type=email], input[type=password], input[type=date],
input[type=number], input[type=search], select, textarea {
  width: 100%; min-width: 0;
  height: 38px; padding: 0 11px;
  font: inherit; color: var(--text);
  background: var(--surface);
  border: 1px solid var(--outline-strong);
  border-radius: var(--r-md);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
textarea { height: auto; min-height: 96px; padding: 9px 11px; resize: vertical; line-height: 1.55; }
select { appearance: none; padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%235b6572'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 7px center; background-size: 18px; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
input[readonly] { background: var(--surface-2); color: var(--text-muted); }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0 14px; }

/* Numéro de dossier à gauche, intitulé à droite : le numéro n'a pas besoin
   de la moitié de la largeur, l'intitulé si. */
.grid-num { display: grid; grid-template-columns: 190px 1fr; gap: 0 14px; }
@media (max-width: 620px) { .grid-num { grid-template-columns: 1fr; } }
.champ-numero {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-weight: 600; letter-spacing: .4px;
}
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 14px; }
/* Numérotation : rappel des jetons et aperçu du gabarit. */
.jetons { display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin: 0 0 14px; font-size: .86rem; color: var(--txt-muted); }
.jeton { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  background: var(--surface-2); border: 1px solid var(--outline);
  border-radius: var(--r-sm); padding: 2px 7px; cursor: help; }
.apercu-num code { font-weight: 600; letter-spacing: .4px; }

/* Couleur de l'interface : pastille, code, aperçu clair/sombre. */
.ligne-teinte { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.champ-teinte {
  width: 48px; height: 34px; padding: 2px; flex: none;
  border: 1px solid var(--outline-strong); border-radius: var(--r-md);
  background: var(--surface); cursor: pointer;
}
.apercu-theme { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.at-bloc {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 62px; padding: 5px 9px; border-radius: var(--r-md);
  font-size: 12px; font-weight: 500; border: 1px solid var(--outline);
}

/* Notes du dossier */
.notes-liste { display: flex; flex-direction: column; gap: 0; }
.note-item { padding: 10px 14px; border-top: 1px solid var(--outline); }
.note-item:first-child { border-top: 0; }
.note-item.epingle { background: var(--warning-container); }
.note-tete { display: flex; align-items: baseline; gap: 8px; }
.note-tete h3 { margin: 0; font-size: 13.5px; font-weight: 600; }
.note-corps { margin: 5px 0 0; white-space: pre-wrap; font-size: 13.5px; line-height: 1.45; }
.note-meta { margin-top: 5px; font-size: 11.5px; color: var(--text-faint); }

/* Pièces jointes */
.cell-fichier { display: flex; flex-direction: column; gap: 1px; max-width: 220px; }
.lien-fichier {
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: 0; padding: 0; margin: 0;
  color: var(--primary); font: inherit; font-weight: 500;
  cursor: pointer; text-align: left; min-width: 0;
}
.lien-fichier:hover .nf, .lien-fichier:focus-visible .nf { text-decoration: underline; }
.lien-fichier .nf { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.barre-progres {
  height: 6px; margin-top: 8px; border-radius: var(--r-pill);
  background: var(--surface-3); overflow: hidden;
}
.bp-remplissage {
  height: 100%; width: 0; border-radius: var(--r-pill);
  background: var(--primary); transition: width 120ms linear;
}

.visionneuse { min-height: 240px; }
.ligne-secours {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin: 0 0 8px; font-size: 12.5px; color: var(--text-muted);
}
.apercu-pdf { width: 100%; height: min(66vh, 720px); border: 1px solid var(--outline);
  border-radius: var(--r-sm); background: var(--surface-2); }
.apercu-image { display: block; max-width: 100%; max-height: min(72vh, 760px);
  margin: 0 auto; border-radius: var(--r-sm); }
.apercu-texte {
  margin: 0; padding: 12px; max-height: min(64vh, 640px); overflow: auto;
  background: var(--surface-2); border: 1px solid var(--outline);
  border-radius: var(--r-sm); font-size: 12.5px; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word;
}

/* À faire */
.taches-liste { list-style: none; margin: 0; padding: 0; }
.tache-item {
  display: grid; grid-template-columns: 22px 1fr auto; gap: 10px;
  align-items: start; padding: 8px 14px; border-top: 1px solid var(--outline);
}
.tache-item:first-child { border-top: 0; }
.tache-item input[type="checkbox"] { margin-top: 2px; width: 17px; height: 17px; cursor: pointer; }
.tache-libelle { font-size: 13.5px; font-weight: 500; }
.tache-item.faite .tache-libelle { text-decoration: line-through; color: var(--text-faint); font-weight: 400; }
.tache-detail { font-size: 12.5px; color: var(--text-muted); white-space: pre-wrap; margin-top: 2px; }
.tache-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 3px; font-size: 12px; color: var(--text-muted); }
.tache-ech { display: inline-flex; align-items: center; gap: 3px; }
.tache-ech.retard { color: var(--danger); font-weight: 600; }
.tache-ech.proche { color: var(--warning); font-weight: 600; }


.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-weight: 500; }
.switch input { appearance: none; width: 40px; height: 22px; margin: 0; flex: none;
  background: var(--outline-strong); border-radius: var(--r-pill); position: relative;
  transition: background var(--transition); cursor: pointer; border: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  transition: transform var(--transition); }
.switch input:checked { background: var(--primary); }
.switch input:checked::after { transform: translateX(18px); }

/* ---------- Cartes ------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--r-md);
  box-shadow: var(--e1);
}
.card + .card { margin-top: 14px; }
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--outline);
}
.card-head h2 { font-size: 15px; }
.card-head .spacer { flex: 1; }
.card-body { padding: 16px; }
.card-foot { padding: 12px 16px; border-top: 1px solid var(--outline);
  display: flex; gap: 8px; justify-content: flex-end; background: var(--surface-1);
  border-radius: 0 0 var(--r-md) var(--r-md); }

/* ---------- Barre de filtres --------------------------- */
.filters {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 12px; margin-bottom: 12px;
  background: var(--surface); border: 1px solid var(--outline); border-radius: var(--r-md);
}
.filters select, .filters input { height: 34px; width: auto; min-width: 130px; }
.filters .spacer { flex: 1; }

/* ---------- Pagination de liste -------------------------- */
.pager {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin-top: 12px; font-size: 13px;
}

/* Ligne de tableau cliquable (liste des clients). */
table.data tr.clic { cursor: pointer; }
table.data tr.clic:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }

/* ---------- Page de gestion d'un dossier -----------------
   Les actions à gauche, les informations et les pièces à droite. En
   dessous de 1100 px la grille se replie en une colonne : les pièces
   passent alors sous les actions, ce qui reste l'ordre de lecture. */
/* Page dossier : le travail à gauche (large), le journal des actions à
   droite (étroit). La largeur du journal est réglable à la souris et
   mémorisée dans les préférences — c'est la colonne dont on a besoin
   large un jour et repliée le lendemain. */
.dossier-grid {
  display: grid;
  grid-template-columns: minmax(0, var(--dg-travail, 74fr)) 8px minmax(0, var(--dg-actions, 26fr));
  gap: 0;
  align-items: start;
}
.dg-travail, .dg-actions { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.dg-travail { padding-right: 7px; }
.dg-actions { padding-left: 7px; }

/* Poignée de redimensionnement : discrète au repos, franche au survol. */
.dg-poignee {
  align-self: stretch;
  min-height: 120px;
  border: 0; padding: 0; margin: 0;
  background: transparent;
  cursor: col-resize;
  position: relative;
  border-radius: var(--r-pill);
  touch-action: none;
}
.dg-poignee::before {
  content: ""; position: absolute; inset: 6px 3px;
  border-radius: var(--r-pill); background: var(--outline);
  opacity: .55; transition: opacity var(--transition), background var(--transition);
}
.dg-poignee:hover::before, .dg-poignee:focus-visible::before,
.dossier-grid.redim .dg-poignee::before { opacity: 1; background: var(--primary); }
.dg-poignee:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.dossier-grid.redim { user-select: none; }

@media (max-width: 1100px) {
  /* En colonne unique, le travail passe devant : le journal se lit
     ensuite, il ne commande pas la lecture du dossier. */
  .dossier-grid { grid-template-columns: minmax(0, 1fr); }
  .dg-poignee { display: none; }
  .dg-travail { padding-right: 0; order: 1; }
  .dg-actions { padding-left: 0; order: 2; margin-top: 14px; }
}

.titre-dossier { display: flex; align-items: center; gap: 8px; min-width: 0; }
.titre-dossier .pastille-couleur { flex: none; }

/* Journal des actions, en frise verticale. */
.timeline { list-style: none; margin: 0; padding: 6px 14px 12px; }
.tl-item {
  position: relative;
  display: grid; grid-template-columns: 16px 1fr; gap: 10px;
  padding: 7px 0;
}
.tl-item:not(:last-child)::before {
  content: ''; position: absolute; left: 7px; top: 20px; bottom: -7px;
  width: 1px; background: var(--outline);
}
.tl-point {
  width: 9px; height: 9px; margin: 6px 0 0 3px; border-radius: var(--r-pill);
  background: var(--primary-container);
  box-shadow: inset 0 0 0 1px var(--outline-strong);
}
.tl-titre  { font-size: 13.5px; font-weight: 500; }
.tl-detail { font-size: 12.5px; color: var(--text-muted); }
.tl-meta   { font-size: 11.5px; color: var(--text-faint); }

/* Bandeau de totaux des débours. */
.debours-bandeau {
  display: flex; gap: 22px; flex-wrap: wrap;
  padding: 9px 14px;
  background: var(--surface-1);
  border-top: 1px solid var(--outline);
  border-bottom: 1px solid var(--outline);
  font-size: 13px; font-variant-numeric: tabular-nums;
}

.bloc-debours {
  margin: 8px 0 4px;
  padding: 12px 12px 4px;
  background: var(--surface-1);
  border: 1px solid var(--outline);
  border-radius: var(--r-md);
}

/* ---------- Couleurs de pochette -------------------------
   Une pastille pleine cerclée d'un liseré sombre translucide : la teinte
   reste identifiable sur fond clair comme sur fond sombre, y compris pour
   l'ivoire et le noir, qui sinon disparaissent l'un après l'autre. */
.pastille-couleur {
  display: inline-block; flex: none; vertical-align: -1px;
  width: 12px; height: 12px; border-radius: var(--r-pill);
  background: var(--pc, var(--outline-strong));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25);
}

.choix-couleur { display: flex; flex-wrap: wrap; gap: 7px; }
.cc-pastille {
  width: 30px; height: 30px; flex: none; padding: 0;
  border-radius: var(--r-md);
  border: 1px solid rgba(0, 0, 0, .22);
  background: var(--pc, transparent);
  cursor: pointer; position: relative;
  display: grid; place-items: center;
  color: var(--text-faint);
}
.cc-pastille.cc-aucune {
  background: var(--surface-2);
  border-style: dashed; border-color: var(--outline-strong);
}
.cc-pastille:hover { transform: scale(1.06); }
.cc-pastille.on {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary);
}

.filtre-couleur {
  display: inline-flex; align-items: center; gap: 6px;
  padding-left: 8px;
  border: 1px solid var(--outline); border-radius: var(--r-md);
  background: var(--surface);
}
.filtre-couleur select { border: 0; background: transparent; height: 32px; }

/* Liseré de la carte de dossier : élargi quand une couleur est posée,
   pour qu'on la repère en balayant la liste du regard. */
.dossier-card.colore { grid-template-columns: 7px 1fr auto; }
@media (max-width: 860px) {
  .dossier-card.colore { grid-template-columns: 7px 1fr; }
}

/* ---------- Éditeur de palette --------------------------- */
.palette-editor .pe-liste { display: flex; flex-direction: column; gap: 6px; }
.pe-ligne {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 6px; border-radius: var(--r-sm);
}
.pe-ligne:hover { background: var(--surface-1); }
.pe-ligne input[type="text"] { max-width: 220px; }
.pe-teinte {
  width: 42px; height: 30px; flex: none; padding: 2px;
  border: 1px solid var(--outline-strong); border-radius: var(--r-sm);
  background: var(--surface); cursor: pointer;
}
.pe-cle { font-size: 11.5px; flex: 1; }
.pe-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* Réordonner la palette : poignée d'accrochage. */
.pe-poignee { cursor: grab; color: var(--text-faint); flex: none; touch-action: none; }
.pe-poignee:hover, .pe-poignee:focus-visible { color: var(--primary); }
.pe-ligne.pe-attrapee {
  background: var(--primary-container);
  box-shadow: var(--e2);
  position: relative; z-index: 2;
}
.pe-ligne.pe-attrapee .pe-poignee { cursor: grabbing; color: var(--primary); }
.pe-liste.pe-reordonne { user-select: none; }
.pe-liste.pe-reordonne .pe-ligne:not(.pe-attrapee) { opacity: .72; }

/* ---------- Choix de l'icône du cabinet ------------------ */
.icon-choice { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-pick {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 92px; padding: 10px 6px;
  border: 1px solid var(--outline-strong); border-radius: var(--r-md);
  background: var(--surface); color: var(--text-muted);
  font: inherit; font-size: 11.5px; text-align: center; cursor: pointer;
}
.icon-pick:hover { background: var(--surface-1); }
.icon-pick.on {
  border-color: var(--primary); color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border: 1px solid var(--outline-strong); border-radius: var(--r-md);
  background: var(--surface); color: var(--text);
  font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.chip:hover { background: var(--surface-2); }
.chip.on { background: var(--primary-container); border-color: var(--primary-container); color: var(--on-primary-container); }
.chip .mi { font-size: 17px; }

/* ---------- Liste des dossiers ------------------------- */
.dossier-list { display: flex; flex-direction: column; gap: 8px; }

.dossier-card {
  display: grid;
  grid-template-columns: 4px 1fr auto;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--r-md);
  box-shadow: var(--e1);
  cursor: pointer; overflow: hidden;
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}
.dossier-card:hover { box-shadow: var(--e2); border-color: var(--outline-strong); }
.dossier-card:active { transform: scale(.998); }
.dossier-card .stripe { background: var(--outline); }
.dossier-card[data-priorite="1"] .stripe { background: var(--warning); }
.dossier-card[data-priorite="2"] .stripe { background: var(--danger); }
.dossier-card[data-statut="clos"] .stripe,
.dossier-card[data-statut="archive"] .stripe { background: var(--success); }
.dossier-card.pending { border-style: dashed; border-color: var(--warning); }

.dc-body { padding: 11px 14px; min-width: 0; }
.dc-line1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dc-ref {
  font-size: 12px; font-weight: 700; letter-spacing: .3px;
  color: var(--text-muted); font-variant-numeric: tabular-nums;
}
.dc-title {
  font-size: 15px; font-weight: 500; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}
.dc-line2 {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 3px; font-size: 12.5px; color: var(--text-muted);
}
.dc-line2 .sep { color: var(--outline-strong); }
.dc-meta { display: inline-flex; align-items: center; gap: 4px; }
.dc-meta .mi { font-size: 15px; color: var(--text-faint); }

.dc-side {
  display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 6px;
  padding: 11px 14px; border-left: 1px solid var(--outline); background: var(--surface-1);
  white-space: nowrap;
}
.dc-when { font-size: 11.5px; color: var(--text-faint); }
.resp-avatar {
  width: 26px; height: 26px; flex: none; border-radius: var(--r-pill);
  display: grid; place-items: center;
  background: var(--surface-3); color: var(--text-muted);
  font-size: 10.5px; font-weight: 700;
}
.resp-avatar[data-len="3"] { font-size: 9px;   letter-spacing: 0; }
.resp-avatar[data-len="4"] { font-size: 7.5px; letter-spacing: -.2px; }

.badge-statut {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px;
  border-radius: var(--r-sm);
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.st-ouvert  { background: var(--info-container);    color: var(--info); }
.st-en_cours{ background: var(--primary-container); color: var(--on-primary-container); }
.st-attente { background: var(--warning-container); color: var(--warning); }
.st-clos    { background: var(--success-container); color: var(--success); }
.st-archive { background: var(--surface-3);         color: var(--text-muted); }
.badge-echu { background: var(--danger-container); color: var(--danger); }

.tag {
  display: inline-block; padding: 1px 7px; border-radius: var(--r-xs);
  background: var(--accent-container); color: var(--accent);
  font-size: 11px; font-weight: 600;
}

/* ---------- Tableaux ---------------------------------- */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-muted); font-weight: 700;
  padding: 9px 12px; border-bottom: 1px solid var(--outline); background: var(--surface-1);
  white-space: nowrap;
}
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--outline); vertical-align: middle; }
table.data tbody tr:hover { background: var(--surface-1); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data td.actions { text-align: right; white-space: nowrap; }
table.data .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; }

/* ---------- États vides / chargement ------------------ */
.empty {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 56px 20px; text-align: center; color: var(--text-muted);
}
.empty .mi { font-size: 46px; color: var(--outline-strong); }
.empty h3 { font-size: 16px; color: var(--text); }

.skeleton {
  height: 66px; border-radius: var(--r-md);
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ---------- Notifications ----------------------------- */
.toasts {
  position: fixed; z-index: 90; bottom: 18px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none; padding: 0 12px; max-width: 100%;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 8px 16px; max-width: min(560px, 92vw);
  border-radius: var(--r-md); box-shadow: var(--e3);
  background: #262d36; color: #f2f5f8; font-size: 13.5px;
  pointer-events: auto; animation: toast-in 200ms cubic-bezier(.2,0,0,1);
}
.toast.ok    { background: #17563a; }
.toast.warn  { background: #6b4708; }
.toast.error { background: #7d201a; }
.toast .mi { font-size: 19px; flex: none; }
.toast button {
  border: 0; background: transparent; color: inherit; font: inherit; font-weight: 600;
  cursor: pointer; padding: 4px 8px; border-radius: var(--r-sm); text-transform: uppercase; font-size: 12px;
}
.toast button:hover { background: rgba(255,255,255,.15); }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px); } }

/* ---------- Fenêtres modales -------------------------- */
.modals:empty { display: none; }
.scrim {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center; padding: 16px;
  background: rgba(12, 17, 23, .48);
  animation: fade 150ms ease-out;
}
@keyframes fade { from { opacity: 0; } }
.dialog {
  width: 100%; max-width: 560px; max-height: 88dvh;
  display: flex; flex-direction: column;
  background: var(--surface); color: var(--text);
  border-radius: var(--r-lg); box-shadow: var(--e3);
  animation: pop 180ms cubic-bezier(.2,0,0,1);
}
.dialog.wide { max-width: 860px; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.99); } }
.dialog-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--outline);
}
.dialog-head h2 { font-size: 16px; flex: 1; }
.dialog-head .icon-btn { color: var(--text-muted); }
.dialog-head .icon-btn:hover { background: var(--surface-2); }
.dialog-body { padding: 18px; overflow-y: auto; }
.dialog-foot {
  display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap;
  padding: 12px 18px; border-top: 1px solid var(--outline);
  background: var(--surface-1); border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.dialog-foot .spacer { flex: 1; }

/* ---------- Menu contextuel --------------------------- */
.menu {
  position: fixed; z-index: 85; min-width: 216px; padding: 6px;
  background: var(--surface); border: 1px solid var(--outline);
  border-radius: var(--r-md); box-shadow: var(--e3);
}
.menu-head { padding: 8px 12px 10px; border-bottom: 1px solid var(--outline); margin-bottom: 6px; }
.menu-head .n { font-weight: 500; }
.menu-head .e { font-size: 12px; color: var(--text-muted); word-break: break-all; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  height: 36px; padding: 0 10px; border: 0;
  border-radius: var(--r-sm); background: transparent; color: var(--text);
  font: inherit; text-align: left; cursor: pointer;
}
.menu-item:hover { background: var(--surface-2); text-decoration: none; }
.menu-item.danger { color: var(--danger); }
.menu-item .mi { font-size: 19px; color: var(--text-muted); }
.menu-item.danger .mi { color: var(--danger); }
.menu-sep { height: 1px; background: var(--outline); margin: 6px 0; }

/* ---------- Écran de connexion ------------------------ */
.login-wrap {
  min-height: 100dvh; display: grid; place-items: center; padding: 20px;
  background: linear-gradient(160deg, var(--topbar-bg) 0%, #0f2438 100%);
}
.login-card {
  width: 100%; max-width: 420px; padding: 28px;
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--e3);
}
.login-logo {
  width: 52px; height: 52px; border-radius: var(--r-md); margin: 0 auto 14px;
  display: grid; place-items: center; background: var(--primary-container); color: var(--on-primary-container);
}
.login-card h1 { font-size: 19px; text-align: center; margin-bottom: 4px; }
.login-card .sub { font-size: 13px; color: var(--text-muted); text-align: center; margin-bottom: 22px; }
.login-foot { margin-top: 18px; text-align: center; font-size: 11.5px; color: var(--text-faint); }

/* ---------- Bandeau (mise à jour / installation) ------ */
.banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; margin-bottom: 14px;
  border: 1px solid var(--outline); border-left: 4px solid var(--info);
  border-radius: var(--r-md); background: var(--info-container); color: var(--text);
}
.banner.warn { border-left-color: var(--warning); background: var(--warning-container); }
.banner.danger { border-left-color: var(--danger); background: var(--danger-container); }
.banner .mi { color: var(--info); }
.banner .txt { flex: 1; min-width: 200px; font-size: 13.5px; }
.banner .txt strong { font-weight: 700; }

/* ---------- Divers ----------------------------------- */
.kv { display: grid; grid-template-columns: minmax(140px, auto) 1fr; gap: 7px 16px; font-size: 13.5px; }
/* Cadre d'informations : serré. Une fiche de renseignements est faite
   pour être lue d'un coup d'œil, pas pour respirer. */
.card.compacte > .card-head { padding: 8px 14px; }
.card.compacte > .card-body { padding: 9px 14px 10px; }
.card.compacte > .card-body + .card-body { padding-top: 9px; }
.card.compacte .kv { gap: 4px 16px; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; font-weight: 500; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.muted { color: var(--text-muted); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Mobile ---------------------------------- */
@media (max-width: 860px) {
  .layout, .layout.collapsed {
    grid-template-columns: 1fr;
    grid-template-areas: "topbar" "main";
  }
  .brand { display: none; }
  .sidebar {
    position: fixed; z-index: 70; top: 0; bottom: 0; left: 0;
    width: min(86vw, var(--sidebar-w));
    transform: translateX(-102%);
    transition: transform var(--transition);
    box-shadow: var(--e3); padding-top: 12px;
  }
  .layout.drawer-open .sidebar { transform: none; }
  .layout.drawer-open::after {
    content: ""; position: fixed; inset: 0; z-index: 60; background: rgba(12,17,23,.45);
  }
  .layout.collapsed .nav-item { justify-content: flex-start; padding: 0 12px; }
  .layout.collapsed .nav-item .label,
  .layout.collapsed .nav-item .count { display: revert; }
  .layout.collapsed .nav-label { height: auto; padding: 6px 12px 4px; margin: 0; color: var(--text-faint); background: none; }
  .main { padding: 12px; }
  .quick-search { min-width: 0; flex: 1 1 auto; }
  .dossier-card { grid-template-columns: 4px 1fr; }
  .dc-side {
    grid-column: 2; border-left: 0; border-top: 1px solid var(--outline);
    flex-direction: row; align-items: center; justify-content: flex-start; padding: 8px 14px;
  }
  .topbar .hide-sm { display: none; }
  .topbar .show-sm { display: grid; }
}
@media (max-width: 520px) {
  .topbar .hide-xs { display: none; }
  .page-head h1 { font-size: 18px; }
}

@media print {
  .topbar, .sidebar, .brand, .filters, .toasts { display: none !important; }
  .layout { display: block; height: auto; }
  .main { overflow: visible; padding: 0; }
}

/* ==========================================================
   Sécurité et confidentialité
   ========================================================== */

/* ---------- Jauge de robustesse du mot de passe ---------- */
.jauge {
  height: 4px; border-radius: var(--r-pill);
  background: var(--surface-3); overflow: hidden;
}
.jauge > span {
  display: block; height: 100%; width: 0;
  border-radius: var(--r-pill);
  background: var(--danger);
  transition: width var(--transition), background var(--transition);
}
.jauge[data-score="1"] > span { background: #c9631c; }
.jauge[data-score="2"] > span { background: var(--warning); }
.jauge[data-score="3"] > span { background: #4d8b3f; }
.jauge[data-score="4"] > span { background: var(--success); }

/* ---------- Étapes numérotées (activation 2FA) ----------- */
.etape {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 0; border-top: 1px solid var(--outline);
}
.etape:first-of-type { border-top: 0; }
.etape-num {
  width: 26px; height: 26px; flex: none; border-radius: var(--r-pill);
  display: grid; place-items: center;
  background: var(--primary-container); color: var(--on-primary-container);
  font-size: 13px; font-weight: 700;
}

/* ---------- Secret et codes de secours ------------------ */
.secret-box {
  padding: 12px; border-radius: var(--r-md);
  border: 1px solid var(--outline); background: var(--surface-1);
}
.secret-val {
  font-size: 16px; letter-spacing: 1.5px; word-break: break-all;
  font-weight: 500; color: var(--text);
}
.codes-secours {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px;
  padding: 14px; border-radius: var(--r-md);
  border: 1px solid var(--outline); background: var(--surface-1);
}
.codes-secours > div {
  padding: 7px 9px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--outline);
  text-align: center; font-size: 13.5px; letter-spacing: .5px;
}

/* ---------- Liste des contrôles de sécurité ------------- */
.controle {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 16px; border-bottom: 1px solid var(--outline);
}
.controle:last-child { border-bottom: 0; }
.controle > .badge-statut { margin-top: 1px; min-width: 96px; justify-content: center; }

/* ---------- Bloc de code (clés à recopier) -------------- */
.bloc-code {
  margin: 0 0 12px; padding: 12px 14px;
  border-radius: var(--r-md); border: 1px solid var(--outline);
  background: var(--surface-2); color: var(--text);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12.5px; line-height: 1.6;
  overflow-x: auto; white-space: pre;
  user-select: all;
}

/* Un interrupteur désactivé doit se voir. */
.switch input:disabled { opacity: .45; cursor: not-allowed; }
.switch:has(input:disabled) { color: var(--text-faint); cursor: not-allowed; }

/* ---------- Champ masqué avec bascule d'affichage -------- */
.pwd-wrap { position: relative; display: block; }
.pwd-wrap > input { padding-right: 40px; }
.pwd-oeil {
  position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--text-muted);
  cursor: pointer; padding: 0;
  overflow: hidden;   /* si la police d'icônes manque, rien ne déborde */
  transition: background var(--transition), color var(--transition);
}
.pwd-oeil:hover { background: var(--surface-2); color: var(--text); }
.pwd-oeil:active { background: var(--surface-3); }
.pwd-oeil:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.pwd-wrap > input:focus ~ .pwd-oeil { color: var(--text); }

/* ---------- Message d'erreur dans une fenêtre modale ----- */
.err-boite {
  display: flex; gap: 9px; align-items: flex-start;
  margin: 0 0 14px; padding: 10px 12px;
  border: 1px solid var(--danger); border-left-width: 3px;
  border-radius: var(--r-md);
  background: var(--danger-container); color: var(--text);
  font-size: 13.5px;
}
.err-boite .mi { color: var(--danger); margin-top: 1px; }
.err-motifs { margin: 6px 0 0; padding-left: 18px; }
.err-motifs li { margin-bottom: 2px; }

/* Icône en attente pendant une action de fenêtre */
.mi.tourne { animation: spin .9s linear infinite; }
