/* Plateforme EFFISAFE · charte EFFISAFE (presentation du 09/08/2026)
   Palette relevee sur le logo lui-meme, qui ne contient que trois couleurs :
     gris nuit #353F49 · bleu #246394 · beige dore #D1B58B
   Typographie Poppins (citee dans la charte, libre, vendorisee).
   Motifs repris de la charte : la ligne biseautee (issue du A / F / E) structure
   les titres ; le cercle et la barre du PHI marquent l'element actif.
   Systeme d'encarts repris de CPSA.Suite : card, kpi, table, statline, chips. */

:root {
  /* Marque */
  --nuit:      #353F49;
  --nuit-fonce:#2B333B;
  --nuit-clair:#414D5A;
  --bleu:      #246394;
  --bleu-vif:  #2E7AB5;
  --bleu-sombre:#1B4C73;
  --beige:     #D1B58B;
  --beige-pale:#E8DCC7;

  /* Surfaces de travail */
  --paper:   #F5F6F7;
  --surface: #FFFFFF;
  --sunk:    #EEF0F2;
  --ink:     #1B2026;
  --muted:   #5C6570;
  --muted2:  #3D454E;
  --line:    #E3E5E8;

  /* Etats metier : reserves, jamais decoratifs */
  --ok:   #27703D;  --ok-bg:   #E7F1EA;
  --warn: #875C17;  --warn-bg: #F6EEDF;
  --bad:  #C0392B;  --bad-bg:  #F7E7E4;

  --shadow: 0 1px 2px rgba(27,32,38,.05);
  --radius: 8px;
  --gap: 8px;
  --sidebar-w: 236px;
  --sidebar-w-min: 62px;
  --font: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--paper); color: var(--ink);
  font-family: var(--font); font-size: 13px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; overflow: hidden;
}
button, input, select, textarea { font-family: var(--font); }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* ===================================================================
   Coque
   =================================================================== */
.shell { display: flex; height: 100vh; }

/* ---------- Barre laterale, gris nuit ---------- */
.sidebar {
  flex: 0 0 var(--sidebar-w); width: var(--sidebar-w);
  background: var(--nuit); color: #DDE2E7;
  display: flex; flex-direction: column;
  transition: flex-basis .18s ease, width .18s ease;
  position: relative; z-index: 20;
}
.shell.is-reduit .sidebar { flex-basis: var(--sidebar-w-min); width: var(--sidebar-w-min); }

/* La charte impose une largeur minimale de 150 px en numerique : le logo est
   dimensionne en largeur, jamais en hauteur, et 150 px est le plancher exact.
   Centre dans la barre, verticalement et horizontalement. */
.sidebar__brand {
  height: 78px; flex: none; display: flex; align-items: center; justify-content: center;
  padding: 0 12px; border-bottom: 1px solid rgba(255,255,255,.09);
}
.brand__logo { width: 150px; height: auto; display: block; }
.brand__marque { width: 34px; height: auto; display: none; margin: 0 auto; }
.shell.is-reduit .brand__logo { display: none; }
.shell.is-reduit .brand__marque { display: block; }
.shell.is-reduit .sidebar__brand { padding: 0 8px; }

.sidebar__scroll { flex: 1; overflow-y: auto; padding: 16px 10px 8px; }
.sidebar__scroll::-webkit-scrollbar { width: 6px; }
.sidebar__scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 3px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__grouptitle {
  display: flex; align-items: center; gap: 8px;
  margin: 18px 10px 6px;
  font-size: 9.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: rgba(221,226,231,.5); white-space: nowrap;
}
.nav__grouptitle:first-child { margin-top: 0; }
/* La ligne biseautee de la charte, en filet de groupe */
.nav__grouptitle::after {
  content: ''; flex: 1; height: 1px; background: rgba(255,255,255,.12);
}
.shell.is-reduit .nav__grouptitle {
  margin: 14px 6px 6px; justify-content: center; font-size: 0; gap: 0;
}
.shell.is-reduit .nav__grouptitle::after { flex: none; width: 22px; }

.nav__item {
  position: relative; display: flex; align-items: center; gap: 11px;
  width: 100%; text-align: left; cursor: pointer;
  background: transparent; border: 0; color: #C6CDD5;
  font-size: 12.5px; font-weight: 500;
  padding: 9px 11px; border-radius: 6px;
  transition: background .14s, color .14s;
}
.nav__item:hover { background: rgba(255,255,255,.07); color: #FFF; }
.nav__item.is-active { background: var(--nuit-clair); color: #FFF; font-weight: 600; }
/* Marqueur actif : la barre du PHI, en beige dore */
.nav__item.is-active::before {
  content: ''; position: absolute; left: 0; top: 7px; bottom: 7px;
  width: 3px; border-radius: 0 2px 2px 0; background: var(--beige);
}
.nav__ico { flex: 0 0 18px; width: 18px; height: 18px; display: inline-flex; }
.nav__ico svg { width: 18px; height: 18px; display: block; stroke-width: 1.7; }
.nav__lbl { white-space: nowrap; overflow: hidden; }
.nav__badge {
  margin-left: auto; min-width: 19px; height: 18px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--beige); color: var(--nuit);
  font-size: 10.5px; font-weight: 700; border-radius: 9px;
  font-variant-numeric: tabular-nums;
}
.nav__badge:empty { display: none; }
.nav__item--bientot { opacity: .5; cursor: default; }
.nav__item--bientot:hover { background: transparent; color: #C6CDD5; }

/* Etat replie : icones seules, libelle en infobulle */
.shell.is-reduit .nav__item { justify-content: center; padding: 10px 0; }
.shell.is-reduit .nav__lbl { display: none; }
.shell.is-reduit .nav__badge {
  position: absolute; top: 4px; right: 8px; min-width: 15px; height: 15px;
  padding: 0 4px; font-size: 9px;
}
.shell.is-reduit .nav__item::after {
  content: attr(data-lbl); position: absolute; left: calc(100% + 10px); top: 50%;
  transform: translateY(-50%); z-index: 40;
  background: var(--nuit-fonce); color: #FFF; font-size: 11.5px; font-weight: 500;
  padding: 5px 10px; border-radius: 5px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .12s;
  box-shadow: 0 3px 10px rgba(0,0,0,.22);
}
.shell.is-reduit .nav__item:hover::after { opacity: 1; }

.sidebar__foot {
  flex: none; padding: 10px; border-top: 1px solid rgba(255,255,255,.09);
  display: flex; flex-direction: column; gap: 8px;
}
.compte { display: flex; align-items: center; gap: 10px; padding: 2px 4px; min-width: 0; }
.compte__pastille {
  flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--bleu); color: #FFF;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
}
.compte__txt { min-width: 0; display: flex; flex-direction: column; }
.compte__nom { font-size: 12px; font-weight: 600; color: #FFF; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compte__mail { font-size: 10.5px; color: rgba(221,226,231,.55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shell.is-reduit .compte { justify-content: center; }
.shell.is-reduit .compte__txt { display: none; }

.sidebar__actions { display: flex; gap: 6px; }
.sbtn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: rgba(255,255,255,.06); border: 0; color: #C6CDD5;
  border-radius: 6px; padding: 7px 8px; cursor: pointer;
  font-size: 11.5px; font-weight: 500;
}
.sbtn:hover { background: rgba(255,255,255,.13); color: #FFF; }
.sbtn svg { width: 15px; height: 15px; stroke-width: 1.8; flex: none; }
.shell.is-reduit .sidebar__actions { flex-direction: column; }
.shell.is-reduit .sbtn span { display: none; }
.shell.is-reduit .sbtn__pli svg { transform: rotate(180deg); }

/* ---------- Zone principale ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  flex: none; height: 78px; display: flex; align-items: center; gap: 16px;
  padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.topbar__titre { display: flex; flex-direction: column; min-width: 0; }
.topbar__titre h1 { font-size: 15px; font-weight: 600; letter-spacing: -.005em; }
.topbar__titre .sous { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.vue { flex: 1; min-height: 0; overflow-y: auto; display: none; }
.vue.is-active { display: block; }
.content {
  padding: 20px 24px 48px; display: flex; flex-direction: column; gap: var(--gap);
  max-width: 1320px;
}

/* ===================================================================
   Composants
   =================================================================== */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px;
}
.card__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 12px; flex-wrap: wrap;
}
.card__head h2 {
  font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 9px;
}
/* Ligne biseautee de la charte, devant les titres d'encart */
.card__head h2::before {
  content: ''; width: 4px; height: 13px; flex: none; background: var(--beige);
  clip-path: polygon(0 0, 100% 22%, 100% 100%, 0 78%);
}
.card--accent { border-left: 3px solid var(--bleu); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); align-items: start; }

.page-head h1 { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.page-head .lead { color: var(--muted); font-size: 13px; margin-top: 6px; max-width: 900px; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
.kpis--3 { grid-template-columns: repeat(3, 1fr); }
.kpis--5 { grid-template-columns: repeat(5, 1fr); }
.kpi {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow);
}
.kpi__lbl {
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); margin-bottom: 5px;
}
.kpi__val { font-size: 22px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi__val--txt { font-size: 15px; letter-spacing: 0; }
.kpi__sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.kpi--bleu  { border-top: 3px solid var(--bleu); }
.kpi--beige { border-top: 3px solid var(--beige); }
.kpi--nuit  { border-top: 3px solid var(--nuit); }

.statline {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  margin-top: 14px; font-size: 12.5px; color: var(--muted);
}
.statline .stat strong {
  font-size: 15px; font-weight: 600; color: var(--ink);
  font-variant-numeric: tabular-nums; margin-right: 4px;
}
.statline .stat__sep { color: var(--line); }
.statline .stat--vide { font-style: normal; color: var(--muted); }

.btn {
  font-size: 12.5px; font-weight: 600; cursor: pointer; border-radius: 6px;
  padding: 8px 14px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink);
  display: inline-flex; align-items: center; gap: 8px;
}
.btn svg { width: 15px; height: 15px; stroke-width: 1.8; }
.btn:hover { border-color: var(--bleu); color: var(--bleu); }
.btn--primary { background: var(--bleu); border-color: var(--bleu); color: #FFF; }
.btn--primary:hover { background: var(--bleu-sombre); border-color: var(--bleu-sombre); color: #FFF; }
.btn--sm { padding: 5px 10px; font-size: 11.5px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn:disabled:hover { border-color: var(--line); color: var(--ink); }

.pill {
  font-size: 11px; font-weight: 600; color: var(--muted);
  background: var(--sunk); padding: 3px 9px; border-radius: 4px;
  display: inline-block; white-space: nowrap; line-height: 1.45;   /* une pastille ne se coupe jamais en deux */
}
.pill--bleu  { background: rgba(36,99,148,.1);  color: var(--bleu); }
.pill--beige { background: rgba(209,181,139,.24); color: #8A6D3B; }
.pill--ok    { background: var(--ok-bg);   color: var(--ok); }
.pill--warn  { background: var(--warn-bg); color: var(--warn); }
.pill--bad   { background: var(--bad-bg);  color: var(--bad); }
.hint { font-size: 12px; color: var(--muted); }

input[type="text"], input[type="email"], input[type="search"],
input[type="password"], input[type="number"], select, textarea {
  font-size: 13px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 6px; padding: 8px 11px;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(36,99,148,.32); outline-offset: 0; border-color: var(--bleu);
}
textarea { width: 100%; resize: none; overflow: hidden; line-height: 1.6; min-height: 92px; }
.ctl { display: flex; flex-direction: column; gap: 4px; }
.ctl__lbl {
  font-size: 10px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em;
}

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: var(--sunk); color: var(--muted);
  cursor: pointer; font-size: 12px; border-radius: 6px; padding: 5px 11px;
}
.chip:hover { color: var(--bleu); border-color: var(--bleu); }
.chip.is-active { background: var(--bleu); border-color: var(--bleu); color: #FFF; }
.chip__n { font-size: 10.5px; opacity: .65; font-variant-numeric: tabular-nums; }

.table-wrap { overflow-x: auto; position: relative; }
/* Reperes de defilement : un fondu sur le bord ou des colonnes restent a voir, et une barre toujours visible
   (macOS la masque par defaut, ce qui cachait des colonnes entieres). */
.table-wrap.a-droite { box-shadow: inset -18px 0 14px -14px rgba(27,32,38,.28); }
.table-wrap.a-gauche { box-shadow: inset 18px 0 14px -14px rgba(27,32,38,.28); }
.table-wrap.a-droite.a-gauche { box-shadow: inset -18px 0 14px -14px rgba(27,32,38,.28), inset 18px 0 14px -14px rgba(27,32,38,.28); }
.table-wrap::-webkit-scrollbar { height: 8px; }
.table-wrap::-webkit-scrollbar-thumb { background: #C3C9D0; border-radius: 4px; }
.table-wrap::-webkit-scrollbar-track { background: transparent; }
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th {
  text-align: left; color: var(--muted); font-weight: 600; font-size: 10px;
  text-transform: uppercase; letter-spacing: .08em; padding: 8px 10px;
  border-bottom: 1px solid var(--line); vertical-align: bottom;   /* un intitule long passe a la ligne */
}
.table td { padding: 9px 10px; border-bottom: 1px solid var(--sunk); vertical-align: top; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tbody tr:hover { background: var(--sunk); }
.table .row-btn { cursor: pointer; }

.stackbar { display: flex; height: 24px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.stackbar > span { display: block; height: 100%; }
.legende { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 10px; font-size: 12px; color: var(--muted2); }
.legende__item { display: flex; align-items: center; gap: 7px; }
.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* Encart d'onglet non encore construit : etat clair, jamais un ecran vide */
.chantier {
  display: flex; flex-direction: column; align-items: flex-start; gap: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 28px 30px; max-width: 720px;
}
.chantier__ico {
  width: 40px; height: 40px; border-radius: 10px;
  background: rgba(209,181,139,.22); color: #8A6D3B;
  display: inline-flex; align-items: center; justify-content: center;
}
.chantier__ico svg { width: 21px; height: 21px; stroke-width: 1.6; }
.chantier h2 { font-size: 15px; font-weight: 600; }
.chantier p { font-size: 13px; color: var(--muted); max-width: 560px; }
.chantier ul { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.chantier li { font-size: 12.5px; color: var(--muted2); display: flex; align-items: flex-start; gap: 10px; }
/* Puce : le cercle et la barre du PHI, motif de la charte */
.chantier li::before {
  content: ''; flex: none; width: 9px; height: 9px; margin-top: 5px;
  border: 2px solid var(--beige); border-radius: 50%;
}

.foot { color: var(--muted); font-size: 11.5px; padding-top: 6px; }

/* ===================================================================
   Ecran d'acces
   =================================================================== */
.acces {
  /* hauteur fixee a l'ecran et defilement propre : la page entiere ne defile pas (body en overflow hidden),
     sans quoi les comptes sous le formulaire sont hors d'atteinte dans une fenetre basse ou etroite */
  height: 100vh; display: grid; grid-template-columns: 1fr 1fr; align-content: start;
  background: var(--paper); overflow-y: auto;
}
.acces__marque {
  background: var(--nuit); color: #DDE2E7;
  display: flex; flex-direction: column; justify-content: center; gap: 22px;
  padding: 56px 60px; position: relative; overflow: hidden;
}
/* Rappel du PHI, tres en retrait */
.acces__marque::after {
  content: ''; position: absolute; right: -110px; bottom: -130px;
  width: 420px; height: 420px; border-radius: 50%;
  border: 46px solid rgba(209,181,139,.07);
}
.acces__logo { width: 208px; height: auto; align-self: flex-start; position: relative; z-index: 2; }
.acces__phrase { font-size: 21px; font-weight: 300; line-height: 1.45; max-width: 420px; position: relative; z-index: 2; }
.acces__phrase strong { font-weight: 600; color: #FFF; }
.acces__note { font-size: 12px; color: rgba(221,226,231,.5); position: relative; z-index: 2; }

.acces__form { display: flex; align-items: center; justify-content: center; padding: 40px; }
.acces__boite { width: 100%; max-width: 372px; display: flex; flex-direction: column; gap: 16px; }
.acces__boite h1 { font-size: 19px; font-weight: 600; }
.acces__boite .lead { font-size: 13px; color: var(--muted); margin-top: 5px; }
.acces__champs { display: flex; flex-direction: column; gap: 12px; }
.acces__champs input { width: 100%; padding: 10px 12px; font-size: 13.5px; }
.acces__err {
  background: var(--bad-bg); color: var(--bad); border-radius: 6px;
  padding: 9px 12px; font-size: 12.5px; font-weight: 500;
}
.acces__submit { width: 100%; justify-content: center; padding: 11px 14px; font-size: 13px; }
.acces__pied { font-size: 11.5px; color: var(--muted); line-height: 1.6; }

@media (max-width: 900px) {
  .acces { grid-template-columns: 1fr; }
  .acces__marque { padding: 36px 32px; gap: 16px; }
  .acces__phrase { font-size: 18px; }
}

/* Desktop par defaut : repli leger seulement */
@media (max-width: 1080px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .kpis, .kpis--3, .kpis--5 { grid-template-columns: repeat(2, 1fr); }
}

/* ===================================================================
   Sous-navigation d'une vue (Veille, Documents)
   =================================================================== */
.sousnav {
  display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 4px; box-shadow: var(--shadow); align-self: flex-start;
  flex-wrap: wrap; max-width: 100%;   /* fenetre etroite : les onglets passent a la ligne, aucun n'est coupe */
}
.sousnav__item {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  font-size: 12.5px; font-weight: 600; padding: 7px 14px; border-radius: 6px;
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
}
.sousnav__item:hover { color: var(--ink); background: var(--sunk); }
.sousnav__item.is-active { background: var(--nuit); color: #FFF; }
.sousnav__badge {
  min-width: 18px; height: 17px; padding: 0 6px; border-radius: 9px;
  background: var(--beige); color: var(--nuit);
  font-size: 10.5px; font-weight: 700; display: inline-flex;
  align-items: center; justify-content: center; font-variant-numeric: tabular-nums;
}
.sousnav__badge:empty { display: none; }
.sousnav__item.is-active .sousnav__badge { background: var(--beige); color: var(--nuit); }

.ecran { display: none; flex-direction: column; gap: var(--gap); }
.ecran.is-active { display: flex; }

/* ---------- Barre de filtres ---------- */
.barre-filtres { display: flex; gap: 10px; flex-wrap: wrap; }
.barre-filtres input[type="search"] { flex: 1; min-width: 280px; }
.barre-filtres select { min-width: 172px; }

/* ---------- Carte de detection (le sas) ---------- */
.detect {
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--bleu);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 15px 18px;
  display: flex; flex-direction: column; gap: 11px;
}
.detect__tete { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.detect__id { font-size: 12.5px; font-weight: 600; color: var(--bleu); font-variant-numeric: tabular-nums; white-space: nowrap; }
.detect__nom { font-size: 13.5px; font-weight: 600; flex: 1; min-width: 240px; }
.detect__resume { font-size: 12.5px; color: var(--muted2); }
.detect__cmp { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.vcase {
  border: 1px solid var(--line); border-radius: 6px; padding: 8px 13px; min-width: 152px;
  background: var(--sunk);
}
.vcase__lbl { font-size: 9.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.vcase__v { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 2px; }
.vcase--apres { background: rgba(209,181,139,.16); border-color: var(--beige); }
.vcase--apres .vcase__v { color: #7A5B28; }
.detect__fleche { color: var(--beige); font-size: 19px; font-weight: 700; }
.detect__actions { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
/* Carte traitee : tout s'estompe SAUF le fil de suite, qui doit rester net */
.detect.is-traite { border-left-color: var(--ok); }
.detect.is-traite > :not(.detect__suite) { opacity: .5; }

/* La suite d'une acceptation : ce qui vient d'etre fait, et ou cliquer pour
   la suite. Le fil se suit sur place, sans chercher dans les onglets. */
.detect__suite {
  border-top: 1px solid var(--sunk); padding-top: 11px;
  display: flex; flex-direction: column; gap: 8px;
}
.suite__fait { font-size: 12.5px; font-weight: 600; color: var(--ok); }
.suite__actions { display: flex; gap: 9px; flex-wrap: wrap; }

/* ---------- Fiche (drill-down) ---------- */
.crumbs { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-size: 12px; }
.crumb { border: 0; background: none; padding: 0; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--bleu); }
.crumb:hover { text-decoration: underline; }
.crumb__sep, .crumb--ici { color: var(--muted); }
.fiche-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.fiche-head h1 { font-size: 16px; font-weight: 600; max-width: 780px; }
.fiche-head .meta { color: var(--muted); font-size: 12.5px; margin-top: 5px; }
.champs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 26px; }
.champ { display: flex; gap: 12px; font-size: 12.5px; padding: 7px 0; border-bottom: 1px solid var(--sunk); }
.champ__l { color: var(--muted); flex: 0 0 152px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; padding-top: 2px; }
.champ__v { font-weight: 500; min-width: 0; word-break: break-word; }

/* ---------- Etiquettes de taxonomie ---------- */
.tags { display: flex; gap: 7px; flex-wrap: wrap; }
.tag {
  border: 1px solid var(--line); background: var(--surface); color: var(--muted2);
  font-size: 11.5px; border-radius: 14px; padding: 4px 11px; cursor: pointer;
}
.tag:hover { border-color: var(--bleu); color: var(--bleu); }
.tag.is-on { background: var(--bleu); border-color: var(--bleu); color: #FFF; font-weight: 500; }
.tag--fige { cursor: default; background: var(--sunk); }
.tag--fige:hover { border-color: var(--line); color: var(--muted2); }

/* ---------- Sections de trame ---------- */
.sect { display: flex; align-items: flex-start; gap: 12px; padding: 8px 10px; border-bottom: 1px solid var(--sunk); font-size: 12.5px; }
.sect:hover { background: var(--sunk); }
.sect__niv { flex: 0 0 26px; font-size: 10px; font-weight: 700; color: var(--muted); padding-top: 2px; }
.sect__t { flex: 1; min-width: 0; }
.sect__chemin { font-size: 11px; color: var(--muted); margin-top: 2px; }
.sect__risques { font-size: 11px; color: var(--bleu); margin-top: 3px; }
.sect--n1 .sect__t { font-weight: 600; }
.sect--n1 { background: rgba(53,63,73,.035); }
.sect--reviser { border-left: 3px solid var(--beige); background: rgba(209,181,139,.1); }
.sect[data-deplie], .sect[data-rev-ligne] { cursor: pointer; }
.sect__motif { display: block; font-size: 11.5px; color: var(--bleu-sombre); font-weight: 600; margin-top: 3px; }
.sect__note { font-size: 11.5px; color: var(--muted); margin: 0 0 8px; }
.sect__detail {
  padding: 12px 16px 14px 48px; border-bottom: 1px solid var(--sunk);
  border-left: 3px solid var(--beige-pale); background: #FDFCF9;
}
.sect__detail .sect__motif { margin: 0 0 8px; }
.sect__contenu {
  font-size: 12.5px; line-height: 1.65; color: var(--nuit);
  white-space: pre-wrap; max-width: 900px;
}
.sect__contenu mark {
  background: var(--beige-pale); color: var(--nuit); font-weight: 600;
  padding: 0 3px; border-radius: 3px;
}
/* ---------- Proposition de mise a jour (IA, 18/08) ---------- */
.propose {
  margin-top: 12px; padding: 12px 14px; border-radius: 6px;
  border: 1px solid var(--beige); background: rgba(209,181,139,.08);
  display: flex; flex-direction: column; gap: 7px; max-width: 900px;
}
.propose__verdict { font-size: 12.5px; font-weight: 600; color: var(--bleu-sombre); }
.propose__verdict--ok { color: var(--ok); }
.propose__expl { font-size: 12.5px; line-height: 1.6; color: var(--muted2); }
.propose__texte {
  font-size: 12.5px; line-height: 1.65; color: var(--nuit);
  white-space: pre-wrap; background: #FFF; border: 1px solid var(--line);
  border-radius: 6px; padding: 10px 12px;
}

/* Long contenu replie par defaut : la page reste legere, un clic deplie tout */
.sect__contenu--clamp {
  max-height: 220px; overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 72%, transparent);
  mask-image: linear-gradient(#000 72%, transparent);
}
.sect__editeur {
  width: 100%; max-width: 900px; box-sizing: border-box;
  font: inherit; font-size: 12.5px; line-height: 1.65; color: var(--nuit);
  border: 1px solid var(--beige); border-radius: 6px; background: #FFF;
  padding: 10px 12px; resize: none; overflow: hidden; min-height: 90px;
}
.sect__editeur:focus { outline: 2px solid var(--bleu); outline-offset: 1px; }
.btn--lien { border-color: transparent; background: transparent; color: var(--muted); }
.btn--lien:hover { color: var(--nuit); text-decoration: underline; background: transparent; }

/* ---------- Editeur de tableaux (Appliquer a la trame, 18/08) ----------
   Chaque cellule du tableau Word devient une case editable. Les cases
   s'etendent avec leur contenu, jamais de defilement interne. */
.edtab-wrap { overflow-x: auto; margin-top: 10px; max-width: 1100px; }
.edtab { border-collapse: collapse; width: 100%; background: #FFF; }
.edtab td { border: 1px solid var(--line); padding: 0; vertical-align: top; min-width: 88px; }
.edtab td textarea {
  width: 100%; border: 0; border-radius: 0; background: transparent;
  font-size: 12px; line-height: 1.5; padding: 6px 8px;
  min-height: 0; display: block; resize: none; overflow: hidden;
}
.edtab td textarea:focus { outline: 2px solid var(--bleu); outline-offset: -2px; background: #FFF; }
.edtab tr:first-child td { background: rgba(53,63,73,.05); }
.edtab tr:first-child td textarea { font-weight: 600; }
.detect__niveau { font-size: 11.5px; color: var(--muted); margin: 4px 0 0; font-style: italic; }

.vide { padding: 26px 4px; text-align: center; color: var(--muted); font-size: 13px; }
.charge { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12.5px; }

/* Rattachement propose par la regle deterministe, pas encore confirme par un humain :
   il se voit, mais il ne se confond pas avec un lien valide. */
.tag.is-propose {
  background: rgba(209,181,139,.26); border-color: var(--beige);
  color: #7A5B28; font-weight: 500;
  border-style: dashed;
}
.tag.is-propose:hover { border-color: #B99B6B; color: #6B4F22; }

/* ---------- Acces directs (confort de construction) ---------- */
.acces__directs { display: flex; flex-direction: column; gap: 8px; }
.direct {
  display: flex; align-items: center; gap: 12px; width: 100%; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: 11px 14px; text-align: left; color: var(--ink);
  transition: border-color .14s, box-shadow .14s;
}
.direct:hover { border-color: var(--bleu); box-shadow: 0 1px 4px rgba(36,99,148,.14); }
.direct:disabled { opacity: .5; cursor: default; }
.direct__past {
  flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%;
  background: var(--nuit); color: #FFF; font-size: 11.5px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}
.direct__txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.direct__nom { font-size: 13px; font-weight: 600; }
.direct__role { font-size: 11px; color: var(--muted); }
.direct svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.direct:hover svg { color: var(--bleu); }

.acces__ou { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 11px; }
.acces__ou::before, .acces__ou::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.acces__ou span { text-transform: uppercase; letter-spacing: .08em; font-weight: 600; white-space: nowrap; }

/* Jauge d'avancement d'un passage de veille */
.jauge {
  height: 6px; border-radius: 3px; background: var(--sunk);
  overflow: hidden; margin-top: 4px;
}
.jauge > span {
  display: block; height: 100%; background: var(--bleu); border-radius: 3px;
  transition: width .4s ease;
}

/* ---------- Diff article par article, dans le sas ---------- */
.detect__diff {
  border-top: 1px solid var(--sunk); padding-top: 11px;
  display: flex; flex-direction: column; gap: 9px;
}
.diffhead { font-size: 12.5px; color: var(--muted2); }
.diffart {
  border: 1px solid var(--line); border-left: 3px solid var(--beige);
  border-radius: 6px; padding: 10px 13px;
  display: flex; flex-direction: column; gap: 7px; background: var(--surface);
}
.diffart--ajout  { border-left-color: var(--ok); }
.diffart--abroge { border-left-color: var(--bad); }
.diffart__tete { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.diffart__txt { font-size: 12px; line-height: 1.55; color: var(--muted2); }
.diffart__txt--avant { color: var(--muted); }
.diffart__txt--apres { background: rgba(46,125,70,.07); border-radius: 4px; padding: 6px 9px; color: var(--ink); }

/* Mots modifies dans une comparaison : le retire est barre, l'ajoute ressort.
   C'est LE moment ou le changement doit sauter aux yeux. */
.dmot--del {
  background: rgba(192,57,43,.1); border-radius: 3px; padding: 0 1px;
  text-decoration: line-through; text-decoration-color: rgba(192,57,43,.55);
}
.dmot--add {
  background: rgba(46,125,70,.18); border-radius: 3px; padding: 0 1px;
  font-weight: 600; color: var(--ink);
}
.diffplier summary {
  cursor: pointer; font-size: 12px; font-weight: 600; color: var(--muted);
  padding: 4px 0; list-style: none;
}
.diffplier summary::before { content: '› '; color: var(--beige); font-weight: 700; }
.diffplier[open] summary::before { content: '⌄ '; }
.diffplier > .diffart { margin-top: 8px; opacity: .75; }

/* ---------- Liens section <-> texte dans la fiche de trame ---------- */
.sect__textes { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 4px; }
.lientexte {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 600; color: var(--bleu);
  background: rgba(36,99,148,.08); border-radius: 4px; padding: 2px 7px;
  font-variant-numeric: tabular-nums;
}
.lientexte--prop {
  color: #7A5B28; background: rgba(209,181,139,.18);
  border: 1px dashed var(--beige); font-weight: 500;
}
.lientexte__ok, .lientexte__non {
  border: 0; background: none; cursor: pointer; font-size: 11px;
  padding: 0 2px; color: inherit; opacity: .75;
}
.lientexte__ok:hover { color: var(--ok); opacity: 1; }
.lientexte__non:hover { color: var(--bad); opacity: 1; }

/* ---------- Nouveau projet ---------- */
.dossier-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; background: var(--sunk); border-radius: 4px; padding: 2px 7px;
}
.dossier-code--grand { font-size: 14px; padding: 8px 12px; }
.projfait__nom { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }

/* ===================================================================
   Fenetre etroite (moins de 1180 px : double ecran, petit portable)
   Le menu se replie de lui-meme (commun.js). Les tableaux se resserrent ; une adresse ou un identifiant
   trop long passe a la ligne au lieu d'elargir la colonne ; les boutons ne se coupent pas en deux.
   =================================================================== */
@media (max-width: 1440px) {   /* tableaux resserres jusqu au portable 14 pouces ; le menu, lui, se replie sous 1 180 px */
  .table { font-size: 12px; }
  .table th, .table td { padding-left: 6px; padding-right: 6px; }
  .table td { overflow-wrap: anywhere; }
  .table td .pill, .table td .btn, .table td .nowrap, .table td.nowrap { overflow-wrap: normal; }
  .table th { letter-spacing: .04em; }
  .table td .pill { font-size: 10.5px; padding: 2px 6px; }
  .table td .btn { padding-left: 8px; padding-right: 8px; }
  .table td.nowrap, .table td .nowrap { white-space: normal; }
  .table td button, .table td .btn--lien, .table td.insecable, .table td .insecable { overflow-wrap: normal; white-space: nowrap; }
  .btn { white-space: nowrap; }
  .form__pied, .card__head { flex-wrap: wrap; row-gap: 8px; }
}

/* Fenetre etroite : le menu reste une colonne d'icones ; deplie, il passe par-dessus le contenu (commun.js) */
.shell.is-etroite { padding-left: var(--sidebar-w-min); }
.shell.is-etroite .sidebar { position: fixed; top: 0; bottom: 0; left: 0; z-index: 60; }
.shell.is-etroite:not(.is-reduit) .sidebar { box-shadow: 0 0 0 100vmax rgba(27, 32, 38, .35); }

