/* Facturelle — feuille de style unique.
   Couleurs de la marque : encre #1F1A3A, vert #2E9E5B.
   Vert foncé pour le texte et les boutons (contraste), rouge = sortie. */
:root {
  --encre: #1f1a3a;
  --encre-2: #4a4566;
  --encre-3: #6e6987;
  --papier: #f6f6f9;
  --blanc: #ffffff;
  --trait: #dddbe6;
  --trait-fort: #bfbccf;
  --entree: #237a47;
  --vert-marque: #2e9e5b;
  --entree-fond: #e7f4ec;
  --sortie: #b23a3a;
  --sortie-fond: #f8e9e8;
  --attention: #9a6a12;
  --attention-fond: #fbf1dc;
  --focus: #2f6fb0;
  --rayon: 6px;
  --police: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { font-size: 15px; }
body {
  margin: 0; font-family: var(--police); color: var(--encre); background: var(--papier);
  font-variant-numeric: tabular-nums; line-height: 1.45;
}
a { color: var(--focus); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.1rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
small, .discret { color: var(--encre-3); }

/* --- Disposition ------------------------------------------------------ */
.app { display: grid; grid-template-columns: 228px 1fr; min-height: 100vh; }
.nav {
  background: var(--encre); color: #dcd9e8; padding: 20px 14px; position: sticky; top: 0;
  height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 18px;
}
.nav .marque { display: block; padding: 2px 8px 0; }
.nav .marque img { display: block; height: 34px; width: auto; }
.nav .societe-nom { font-size: .85rem; color: #a9a4c0; padding: 0 8px; margin-top: -10px; }
.nav .groupe { display: flex; flex-direction: column; gap: 1px; }
.nav .groupe-titre { font-size: .8rem; color: #9893b0; padding: 6px 8px 4px; }
.nav a { color: #dcd9e8; padding: 6px 8px; border-radius: 4px; display: block; }
.nav a:hover { background: rgba(255,255,255,.07); text-decoration: none; }
.nav a.actif { background: rgba(255,255,255,.13); color: #fff; font-weight: 600; }
.nav .pied { margin-top: auto; font-size: .9rem; padding: 0 8px; color: #a9a4c0; }
.nav .pied button { background: none; border: 0; color: #dcd9e8; padding: 0; cursor: pointer; font: inherit; }
.nav .pied button:hover { text-decoration: underline; }

main { padding: 28px 36px 64px; width: 100%; min-width: 0; }
.entete { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.entete p { margin: 4px 0 0; color: var(--encre-2); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* --- Boutons ---------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: var(--rayon);
  border: 1px solid var(--trait-fort); background: var(--blanc); color: var(--encre); font: inherit;
  font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--encre-2); text-decoration: none; }
.btn-principal { background: var(--encre); border-color: var(--encre); color: #fff; }
.btn-principal:hover { background: var(--encre-2); }
.btn-valider { background: var(--entree); border-color: var(--entree); color: #fff; }
.btn-valider:hover { background: #1c6339; }
.btn-danger { color: var(--sortie); border-color: #e0b9b7; }
.btn-danger:hover { border-color: var(--sortie); }
.btn-lien { border: 0; background: none; padding: 0; color: var(--focus); font-weight: 400; }
.btn-petit { padding: 3px 9px; font-size: .9rem; }

/* --- Panneaux et tableaux --------------------------------------------- */
.panneau { background: var(--blanc); border: 1px solid var(--trait); border-radius: 8px; }
.panneau + .panneau, .panneau + .grille, .grille + .panneau { margin-top: 20px; }
.panneau-tete { padding: 14px 18px; border-bottom: 1px solid var(--trait); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.panneau-corps { padding: 18px; }
.grille > .panneau { margin-top: 0; }
.grille { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

table.donnees { width: 100%; border-collapse: collapse; }
.donnees th, .donnees td { padding: 8px 12px; border-bottom: 1px solid var(--trait); text-align: left; vertical-align: middle; }
.donnees th { font-size: .85rem; font-weight: 600; color: var(--encre-3); background: #fafbfb; position: sticky; top: 0; }
.donnees tbody tr:hover { background: #f8fafb; }
.donnees tfoot td { font-weight: 700; border-bottom: 0; border-top: 2px solid var(--trait-fort); }
.donnees .num { text-align: right; white-space: nowrap; }
.donnees .code { white-space: nowrap; font-weight: 600; }
.donnees tr.sous-total td { background: #f3f6f7; font-weight: 650; }
.vide { padding: 36px 18px; text-align: center; color: var(--encre-2); }
.vide p { margin: 0 0 12px; }

.plus { color: var(--entree); }
.moins { color: var(--sortie); }

/* --- Pastilles d'état et de sens -------------------------------------- */
.pastille { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .82rem; font-weight: 600; border: 1px solid transparent; }
.etat-BROUILLON { background: var(--attention-fond); color: var(--attention); }
.etat-VALIDE { background: var(--entree-fond); color: var(--entree); }
.etat-ANNULE { background: #eceff1; color: var(--encre-3); text-decoration: line-through; }
.sens-entree { color: var(--entree); border-color: #b9dccd; }
.sens-sortie { color: var(--sortie); border-color: #e6c0be; }
.sens-neutre { color: var(--encre-2); border-color: var(--trait-fort); }

/* --- Chiffres du tableau de bord -------------------------------------- */
.chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0; background: var(--blanc); border: 1px solid var(--trait); border-radius: 8px; margin-bottom: 20px; }
.chiffre { padding: 16px 20px; border-right: 1px solid var(--trait); }
.chiffre:last-child { border-right: 0; }
.chiffre strong { display: block; font-size: 1.55rem; font-weight: 700; }
.chiffre span { color: var(--encre-2); font-size: .92rem; }
.chiffre.alerte strong { color: var(--sortie); }

/* --- Nouveau bon : choix du type -------------------------------------- */
.types-bons { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 8px; }
.types-bons a { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--trait); border-left-width: 4px; border-radius: var(--rayon); color: var(--encre); background: var(--blanc); }
.types-bons a:hover { border-color: var(--encre-2); text-decoration: none; }
.types-bons a strong { font-size: 1rem; }
.types-bons a span { font-size: .85rem; color: var(--encre-3); }
.types-bons .t-entree { border-left-color: var(--entree); }
.types-bons .t-sortie { border-left-color: var(--sortie); }
.types-bons .t-neutre { border-left-color: var(--encre-3); }

/* --- Formulaires ------------------------------------------------------ */
.champs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 18px; }
.champ { display: flex; flex-direction: column; gap: 4px; }
.champ.large { grid-column: 1 / -1; }
.champ label { font-weight: 600; font-size: .92rem; }
.champ .aide { font-size: .84rem; color: var(--encre-3); }
.champ .erreur { font-size: .88rem; color: var(--sortie); }
.champ-case { flex-direction: row; align-items: flex-start; gap: 8px; }
.champ-case label { font-weight: 400; }
input[type=text], input[type=number], input[type=date], input[type=email], input[type=password], input[type=search], input[type=url], select, textarea {
  font: inherit; color: var(--encre); background: var(--blanc); border: 1px solid var(--trait-fort);
  border-radius: var(--rayon); padding: 7px 10px; width: 100%; min-width: 0;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: -1px; border-color: var(--focus); }
.filtres { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin-bottom: 16px; }
.filtres .champ { min-width: 160px; }
.filtres input[type=search] { min-width: 260px; }
.pied-form { display: flex; gap: 10px; justify-content: flex-end; padding-top: 18px; margin-top: 18px; border-top: 1px solid var(--trait); flex-wrap: wrap; }

/* --- Messages --------------------------------------------------------- */
.messages { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-direction: column; gap: 6px; }
.messages li { padding: 9px 14px; border-radius: var(--rayon); border: 1px solid; }
.messages .success { background: var(--entree-fond); border-color: #b9dccd; color: #145440; }
.messages .error { background: var(--sortie-fond); border-color: #e6c0be; color: #842a2a; }
.messages .warning, .messages .info { background: var(--attention-fond); border-color: #ecd6a5; color: #6e4b0c; }

/* --- Saisie d'un bon : la barre de scan ------------------------------- */
.scan {
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center;
  background: var(--encre); color: #fff; border-radius: 8px; padding: 14px 16px; margin: 20px 0 0;
}
.scan svg { opacity: .9; }
.scan input {
  font-size: 1.35rem; font-weight: 600; letter-spacing: .02em; padding: 10px 14px;
  border: 2px solid transparent; background: #fff; color: var(--encre);
}
.scan input:focus { border-color: #7fb3e3; outline: none; }
.scan .aide-scan { font-size: .85rem; color: #c3bfd6; max-width: 230px; }
.scan.ok input { border-color: var(--vert-marque); }
.scan.ko input { border-color: #f08a84; animation: secousse .25s; }
@keyframes secousse { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { .scan.ko input { animation: none; } }
.retour-scan { min-height: 22px; margin: 8px 2px 0; font-size: .95rem; }
.retour-scan.ko { color: var(--sortie); }
.retour-scan.ok { color: var(--entree); }

.recherche { position: relative; }
.suggestions { position: absolute; z-index: 10; left: 0; right: 0; top: 100%; margin: 2px 0 0; padding: 4px 0; list-style: none; background: #fff; border: 1px solid var(--trait-fort); border-radius: var(--rayon); box-shadow: 0 6px 18px rgba(31,26,58,.12); max-height: 320px; overflow-y: auto; }
.suggestions { color: var(--encre); }
.suggestions li small, .suggestions li .discret { color: var(--encre-3); }
.suggestions li { padding: 6px 12px; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; }
.suggestions li[aria-selected=true], .suggestions li:hover { background: #eef3f7; }

table.lignes input { padding: 5px 8px; text-align: right; max-width: 130px; }
table.lignes tr.flash td { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: #fff3c4; } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { table.lignes tr.flash td { animation: none; background: #fff8dc; } }
table.lignes tr.manque td { background: var(--sortie-fond); }
table.lignes .retirer { color: var(--encre-3); border: 0; background: none; cursor: pointer; font-size: 1.2rem; line-height: 1; padding: 2px 6px; }
table.lignes .retirer:hover { color: var(--sortie); }
.totaux { display: flex; gap: 28px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--trait); }
.totaux div { text-align: right; }
.totaux span { display: block; font-size: .85rem; color: var(--encre-3); }
.totaux strong { font-size: 1.15rem; }

.barre-actions {
  position: sticky; bottom: 0; background: rgba(246,246,249,.96); backdrop-filter: blur(4px);
  border-top: 1px solid var(--trait); margin: 20px -36px 0; padding: 12px 36px; display: flex; gap: 10px; justify-content: flex-end;
}

/* --- Détail d'un document --------------------------------------------- */
.meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px 20px; margin: 0; }
.meta dt { font-size: .85rem; color: var(--encre-3); }
.meta dd { margin: 0; font-weight: 600; }
details.annulation summary { cursor: pointer; color: var(--sortie); font-weight: 600; }
details.annulation form { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; max-width: 480px; }

.arbre-1 { padding-left: 28px !important; }
.arbre-2 { padding-left: 48px !important; }
.arbre-3 { padding-left: 68px !important; }

.pagination { display: flex; gap: 10px; align-items: center; justify-content: flex-end; padding: 12px 18px; }

/* --- Connexion -------------------------------------------------------- */
.connexion { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.connexion .panneau { width: 100%; max-width: 380px; }
.connexion .marque-connexion { display: flex; justify-content: center; margin: 4px 0 22px; }
.connexion { gap: 18px; align-content: center; }
.logo-page { display: block; height: 40px; width: auto; justify-self: center; }

/* --- Petits écrans ---------------------------------------------------- */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .nav { position: static; height: auto; flex-direction: row; flex-wrap: wrap; gap: 8px; padding: 12px; }
  .nav .groupe { flex-direction: row; flex-wrap: wrap; }
  .nav .groupe-titre, .nav .societe-nom { display: none; }
  .nav .pied { margin-top: 0; }
  main { padding: 20px 16px 48px; }
  .barre-actions { margin: 20px -16px 0; padding: 12px 16px; }
  .scan { grid-template-columns: 1fr; }
  .scan svg, .scan .aide-scan { display: none; }
  .tableau-defile { overflow-x: auto; }
  .grille-bas { grid-template-columns: 1fr; }
  table.lignes-vente { min-width: 900px; }
}

@media print {
  .nav, .barre-actions, .actions, .filtres { display: none !important; }
  .app { display: block; }
  main { padding: 0; }
}

/* --- Saisie des ventes ------------------------------------------------- */
table.lignes-vente td { vertical-align: top; padding: 6px 6px; }
table.lignes-vente input, table.lignes-vente select, table.lignes-vente textarea { padding: 5px 7px; max-width: none; }
table.lignes-vente input.txt { text-align: left; }
table.lignes-vente textarea { resize: none; overflow: hidden; min-height: 32px; line-height: 1.35; }
table.lignes-vente td[data-montant] { padding-top: 12px; font-weight: 600; }
table.lignes-vente .info-stock { display: block; color: var(--encre-3); font-size: .8rem; margin-top: 2px; }
table.lignes-vente tr.ligne-section td { background: #eef3f7; }
table.lignes-vente input.titre-lot { font-weight: 700; }
table.lignes-vente tr.ligne-texte textarea { font-style: italic; }
.ordre button { border: 0; background: none; color: var(--encre-3); cursor: pointer; padding: 6px 4px; font-size: 1rem; }
.ordre button:hover { color: var(--encre); }
.ajouts { display: flex; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--trait); }
.grille-bas { grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr); margin-top: 20px; }
.totaux-vente { padding: 14px 18px; }
.totaux-vente dl { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.totaux-vente dl > div, .totaux-vente .detail-tva > div { display: flex; justify-content: space-between; gap: 16px; }
.totaux-vente .detail-tva { display: flex; flex-direction: column; gap: 6px; }
.totaux-vente dt { color: var(--encre-2); }
.totaux-vente dd { margin: 0; font-weight: 600; white-space: nowrap; }
.totaux-vente .net { border-top: 2px solid var(--encre); padding-top: 8px; margin-top: 4px; font-size: 1.2rem; }
.totaux-vente .net dt { color: var(--encre); font-weight: 700; }
.totaux-vente .mention { margin: 10px 0 0; font-size: .88rem; color: var(--attention); }
.totaux-vente .mention:empty { display: none; }
[hidden] { display: none !important; }

/* --- Détail d'un document de vente ------------------------------------- */
.etapes { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: .92rem; }
.etapes a, .etapes span { padding: 2px 10px; border-radius: 999px; border: 1px solid var(--trait-fort); color: var(--encre-2); }
.etapes .courant { background: var(--encre); color: #fff; border-color: var(--encre); }
.etapes .sep { border: 0; padding: 0; color: var(--encre-3); }
.jauge { height: 8px; background: #e7ecef; border-radius: 4px; overflow: hidden; margin-top: 6px; }
.jauge span { display: block; height: 100%; background: var(--entree); }
.paiement-regle { background: var(--entree-fond); color: var(--entree); }
.paiement-retard, .paiement-expire { background: var(--sortie-fond); color: var(--sortie); }
.paiement-partiel, .paiement-du { background: var(--attention-fond); color: var(--attention); }
.onglets { display: flex; gap: 4px; border-bottom: 1px solid var(--trait); margin-bottom: 16px; flex-wrap: wrap; }
.onglets a { padding: 8px 14px; color: var(--encre-2); border-bottom: 3px solid transparent; margin-bottom: -1px; font-weight: 600; }
.onglets a.actif { color: var(--encre); border-bottom-color: var(--encre); }
.onglets a:hover { text-decoration: none; color: var(--encre); }
.menu-impression { display: inline-flex; gap: 0; }
.menu-impression select { width: auto; border-radius: var(--rayon) 0 0 var(--rayon); }
.menu-impression .btn { border-radius: 0 var(--rayon) var(--rayon) 0; margin-left: -1px; }
.barre-graph { display: flex; align-items: center; gap: 10px; }
.barre-graph .barre { height: 14px; background: var(--encre-2); border-radius: 2px; min-width: 2px; }

/* --- Histogramme mensuel : une série, une teinte --------------------- */
.histogramme { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; height: 220px; align-items: end; padding-top: 22px; }
.histogramme .colonne { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-end; height: 100%; position: relative; outline: none; }
.histogramme .zone { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; position: relative; }
.histogramme .barre { position: relative; background: var(--encre-2); border-radius: 4px 4px 0 0; min-height: 2px; }
.histogramme .colonne:hover .barre, .histogramme .colonne:focus-visible .barre { background: var(--encre); }
.histogramme .valeur { position: absolute; bottom: calc(100% + 2px);  left: 50%; transform: translateX(-50%); font-size: .8rem; font-weight: 600; white-space: nowrap; color: var(--encre); }
.histogramme .colonne:hover .valeur:empty::after, .histogramme .colonne:focus-visible .valeur:empty::after { content: attr(data-v); }
.histogramme .mois { font-size: .78rem; color: var(--encre-3); text-align: center; margin-top: 4px; border-top: 1px solid var(--trait-fort); padding-top: 4px; white-space: nowrap; }

/* --- Icônes et menu repliable ------------------------------------------ */
.icone { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.nav-tete { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.nav .marque .logo-court { display: none; height: 30px; width: 30px; }
.nav .replier button { background: none; border: 0; color: #a9a4c0; cursor: pointer; padding: 6px; border-radius: 4px; display: flex; }
.nav .replier button:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav .groupe a, .nav .pied a, .nav .pied button { display: flex; align-items: center; gap: 10px; }
.nav .pied { display: flex; flex-direction: column; gap: 4px; padding: 0; }
.nav .pied a { padding: 6px 8px; }
.nav .pied button { padding: 6px 8px; width: 100%; text-align: left; border-radius: 4px; }
.nav .badge { margin-left: auto; background: var(--vert-marque); color: #fff; font-size: .75rem; border-radius: 999px; padding: 0 7px; font-weight: 700; }
.nav .essai { display: inline-block; font-size: .75rem; background: rgba(46,158,91,.25); color: #bfe8cf; border-radius: 999px; padding: 0 7px; margin-left: 4px; }
.app.menu-replie { grid-template-columns: 64px 1fr; }
.menu-replie .nav { padding: 16px 8px; align-items: center; }
.menu-replie .nav-tete { flex-direction: column; }
.menu-replie .nav .logo-long, .menu-replie .nav .societe-nom, .menu-replie .nav .groupe-titre, .menu-replie .nav a span, .menu-replie .nav .pied button span { display: none; }
.menu-replie .nav .marque .logo-court { display: block; }
.menu-replie .nav .groupe { border-top: 1px solid rgba(255,255,255,.08); padding-top: 8px; }
.menu-replie .nav a, .menu-replie .nav .pied button { justify-content: center; padding: 8px; position: relative; }
.menu-replie .nav .badge { position: absolute; top: 0; right: -2px; }
.bandeau-essai { background: var(--attention-fond); color: #6e4b0c; border: 1px solid #ecd6a5; border-radius: var(--rayon); padding: 8px 14px; margin-bottom: 16px; }

/* --- Listes : outils, colonnes, sélection ------------------------------ */
.tableau-outils { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--trait); flex-wrap: wrap; }
details.menu-deroulant { position: relative; }
details.menu-deroulant > summary { list-style: none; }
details.menu-deroulant > summary::-webkit-details-marker { display: none; }
.panneau-flottant { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; background: var(--blanc); border: 1px solid var(--trait-fort); border-radius: 8px; box-shadow: 0 8px 24px rgba(31,26,58,.15); padding: 12px 14px; min-width: 240px; color: var(--encre); }
.liste-cases { display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow-y: auto; }
.liste-cases label { display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.donnees .case { width: 34px; text-align: center; }
.actions-groupees { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 14px; background: #eef3f7; border-bottom: 1px solid var(--trait); }
.actions-groupees select, .actions-groupees input { width: auto; }
.pagination .par-page a { padding: 2px 7px; border-radius: 4px; margin-left: 2px; }
.pagination .par-page a.actif { background: var(--encre); color: #fff; }
.filtres select[multiple] { min-height: 38px; height: auto; }
.cases-filtre { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.cases-filtre label { display: inline-flex; gap: 5px; align-items: center; font-weight: 400; font-size: .92rem; white-space: nowrap; }

/* --- Fenêtre (famille depuis l'article…) ---------------------------------- */
dialog.fenetre { border: 0; border-radius: 10px; padding: 0; width: min(640px, 94vw); box-shadow: 0 20px 50px rgba(31,26,58,.3); color: var(--encre); }
dialog.fenetre::backdrop { background: rgba(31,26,58,.45); }
dialog.fenetre .panneau-tete button { background: none; border: 0; font-size: 1.4rem; cursor: pointer; color: var(--encre-3); }
.champ-avec-bouton { display: flex; gap: 6px; }
.champ-avec-bouton select { flex: 1; }

/* --- Fil d'historique ---------------------------------------------------- */
.fil { margin-top: 20px; }
.fil-saisie { padding: 14px 18px; border-bottom: 1px solid var(--trait); display: flex; flex-direction: column; gap: 8px; }
.fil-saisie textarea { min-height: 60px; }
.fil-saisie .ligne { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.fil ol { list-style: none; margin: 0; padding: 0; }
.fil li.msg { padding: 12px 18px; border-bottom: 1px solid var(--trait); display: grid; grid-template-columns: 34px 1fr; gap: 10px; }
.fil li.msg:last-child { border-bottom: 0; }
.fil .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--encre-2); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.fil .msg-EVENT .avatar, .fil .msg-MODIF .avatar { background: #e7e5ef; color: var(--encre-2); }
.fil .qui { font-weight: 600; }
.fil .quand { color: var(--encre-3); font-size: .85rem; margin-left: 6px; }
.fil .texte { margin-top: 3px; white-space: pre-wrap; }
.fil .mention { background: #e5eefa; color: var(--focus); border-radius: 3px; padding: 0 3px; }
.fil ul.changements { margin: 4px 0 0; padding-left: 18px; font-size: .92rem; color: var(--encre-2); }
.fil .ancien { text-decoration: line-through; color: var(--encre-3); }
.fil .pieces { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.fil .pieces a { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--trait); border-radius: 4px; padding: 2px 8px; font-size: .9rem; }
.trace { display: flex; gap: 18px; flex-wrap: wrap; font-size: .85rem; color: var(--encre-3); margin-top: 14px; }

/* --- Rôles : grille des niveaux ----------------------------------------- */
table.droits td, table.droits th { text-align: center; }
table.droits td:first-child, table.droits th:first-child { text-align: left; }
.etapes-demarrage { list-style: none; margin: 0; padding: 0; }
.etapes-demarrage li { display: flex; gap: 14px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--trait); }
.etapes-demarrage li:last-child { border-bottom: 0; }
.etapes-demarrage .coche { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--trait-fort); display: grid; place-items: center; flex: none; font-weight: 700; }
.etapes-demarrage .fait .coche { background: var(--entree); border-color: var(--entree); color: #fff; }
.etapes-demarrage .fait strong { color: var(--encre-3); text-decoration: line-through; }
.tarifs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.tarif { border: 1px solid var(--trait); border-radius: 8px; padding: 16px; background: var(--blanc); }
.tarif.actif { border-color: var(--entree); box-shadow: inset 0 0 0 1px var(--entree); }
.tarif strong { font-size: 1.3rem; display: block; margin: 6px 0; }
.zone-danger { border-color: #e6c0be; }
.zone-danger .panneau-tete h2 { color: var(--sortie); }
@media (max-width: 860px) {
  .app.menu-replie { grid-template-columns: 1fr; }
  .nav .replier { display: none; }
  .nav a span { display: none; }
}
.sans-tva .col-tva { display: none; }
.connexion .panneau.panneau-large { max-width: 640px; }
