/* Gestion 2026 en ligne — feuille de style commune */
:root {
  --fond: #f3f6fa;
  --carte: #ffffff;
  --texte: #1d2733;
  --discret: #5c6b7a;
  --bord: #d8e0ea;
  --bleu: #1f5fa8;
  --bleu-fonce: #174a84;
  --bleu-clair: #e6effa;
  --vert: #e5f4e4;
  --vert-texte: #22612a;
  --rouge: #fbebeb;
  --rouge-texte: #9b1c1c;
  --rayon: 8px;
  /* thèmes (assets/themes.css) : nuances de l'accent, surfaces et barre du haut */
  --accent-survol: #e8f1fb;      /* survol des boutons du ruban, des menus */
  --accent-survol-bord: #c5dbf3;
  --accent-choisi: #d5e6f8;      /* ligne choisie, bouton actif */
  --accent-choisi-bord: #9fc3ea;
  --accent-focus: #bcd6f3;
  --accent-pale: #e8f0fb;        /* pieds de tableau, groupes */
  --accent-leger: #f3f8fe;       /* survol des lignes */
  --entete-texte: #0e2a4a;       /* texte des en-têtes de tableau */
  --surface: #fff;               /* fonds blancs : cartes, tableaux, champs, menus */
  --barre-fond: var(--bleu);     /* barre du haut et onglets du ruban */
  --barre-texte: #fff;
  --barre-survol: rgba(255, 255, 255, .14);
  --onglet-actif-fond: #fff;
  --onglet-actif-texte: var(--bleu-fonce);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 15px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: var(--texte);
  background: var(--fond);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--bleu); }
h1 { font-size: 1.5rem; margin: 0 0 .25rem; }
h2.groupe { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--discret); margin: 1.75rem 0 .6rem; }

/* Barre du haut */
.barre {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .6rem 1.25rem; background: var(--barre-fond); color: var(--barre-texte);
}
.barre a, .barre .lien { color: var(--barre-texte); text-decoration: none; }
.marque { display: flex; align-items: center; gap: .6rem; font-weight: 600; }
.barre-droite { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.barre-droite form { margin: 0; }
.qui { opacity: .95; }
.badge { background: rgba(255,255,255,.2); border-radius: 999px; padding: .05rem .5rem; font-size: .75rem; margin-left: .3rem; }
.logo {
  display: inline-grid; place-items: center; width: 2.1rem; height: 2.1rem;
  border-radius: 6px; background: var(--surface); color: var(--bleu); font-weight: 800; font-size: .8rem; letter-spacing: .02em;
}
.logo-grand { width: 3rem; height: 3rem; font-size: 1rem; background: var(--bleu); color: #fff; }

/* Mise en page */
.page { width: 100%; max-width: 1100px; margin: 0 auto; padding: 1.5rem 1.25rem 2rem; flex: 1; }
.page-seule { flex: 1; display: grid; place-items: center; padding: 2rem 1rem; }
.pied { text-align: center; color: var(--discret); font-size: .8rem; padding: 1rem; }
.discret { color: var(--discret); margin: 0 0 1rem; }
.centre { text-align: center; }
.fil { color: var(--discret); font-size: .9rem; margin: 0 0 .5rem; }

/* Cartes et formulaires */
.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 1.5rem; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.carte-connexion { width: 100%; max-width: 380px; }
.carte-etroite { max-width: 460px; }
.carte-titre { display: flex; gap: .9rem; align-items: center; margin-bottom: 1.25rem; }
.carte-titre .discret { margin: 0; }
form label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .9rem; }
input[type=text], input[type=password], input[type=datetime-local], input[type=time], select {
  display: block; width: 100%; margin-top: .3rem; padding: .55rem .7rem;
  font: inherit; font-weight: 400; color: var(--texte);
  border: 1px solid var(--bord); border-radius: 6px; background: var(--surface);
}
input:focus, select:focus { outline: 2px solid var(--bleu-clair); border-color: var(--bleu); }
.bouton {
  width: 100%; padding: .65rem; font: inherit; font-weight: 600; color: #fff;
  background: var(--bleu); border: 0; border-radius: 6px; cursor: pointer;
}
.bouton:hover { background: var(--bleu-fonce); }
.lien { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.lien:hover, .barre a:hover { text-decoration: underline; }

/* Messages */
.alerte { border-radius: 6px; padding: .7rem .9rem; margin: 0 0 1rem; border: 1px solid transparent; }
.alerte-info { background: var(--bleu-clair); border-color: #c8daf1; }
.alerte-succes { background: var(--vert); color: var(--vert-texte); border-color: #c4e3c1; }
.alerte-erreur { background: var(--rouge); color: var(--rouge-texte); border-color: #f1c9c9; }

/* Tuiles du menu */
.tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .9rem; }
.tuile {
  display: flex; flex-direction: column; gap: .25rem; padding: 1rem 1.1rem;
  background: var(--carte); border: 1px solid var(--bord); border-left: 4px solid var(--bleu);
  border-radius: var(--rayon); color: var(--texte); text-decoration: none;
  transition: box-shadow .15s, transform .15s;
}
.tuile span { color: var(--discret); font-size: .88rem; }
.tuile:hover, .tuile:focus-visible { box-shadow: 0 4px 14px rgba(31,95,168,.15); transform: translateY(-1px); }

@media (max-width: 600px) {
  .barre { flex-direction: column; align-items: flex-start; }
  .page { padding: 1rem; }
}

/* ---------------------------------------------------------------- listes (Stock…) */
.titre-ligne { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.titre-ligne .discret { margin: 0; }
.filtres { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; margin-bottom: 1rem; }
.filtres label { margin: 0; font-size: .85rem; }
.filtres .filtre-texte { flex: 1 1 320px; }
.filtres select { min-width: 180px; }
input[type=search] {
  display: block; width: 100%; margin-top: .3rem; padding: .55rem .7rem; font: inherit; font-weight: 400;
  border: 1px solid var(--bord); border-radius: 6px; background: var(--surface); color: var(--texte);
}
.bouton-auto { width: auto; padding: .58rem 1.2rem; }
.effacer { align-self: center; font-size: .9rem; }
.page:has(.tableau) { max-width: 1400px; }

.tableau-cadre { overflow-x: auto; background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); }
.tableau { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tableau th, .tableau td { padding: .45rem .65rem; border-bottom: 1px solid #edf1f6; text-align: left; vertical-align: top; }
.tableau th {
  position: sticky; top: 0; background: var(--bleu-clair); color: var(--entete-texte); font-weight: 700;
  white-space: nowrap; border-bottom: 1px solid #c8daf1;
}
.tableau th a { color: inherit; text-decoration: none; }
.tableau th a:hover { text-decoration: underline; }
.tableau th a.trie-asc::after { content: " ▲"; font-size: .7em; }
.tableau th a.trie-desc::after { content: " ▼"; font-size: .7em; }
.tableau .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tableau tbody tr:hover { background: #f6f9fd; }
.tableau tr.ligne-epuise td { color: var(--rouge-texte); }
.tableau tr.ligne-alerte td { background: #fff8e6; }
.tableau td.vide { text-align: center; color: var(--discret); padding: 2rem; }

.bas-tableau { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: .75rem; }
.totaux { display: flex; gap: 1.25rem; flex-wrap: wrap; color: var(--discret); font-size: .9rem; }
.totaux strong { color: var(--texte); }
.legende { display: inline-flex; align-items: center; gap: .35rem; }
.pastille { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; border: 1px solid var(--bord); }
.pastille.p-epuise { background: var(--rouge); border-color: #f1c9c9; }
.pastille.p-alerte { background: #fff8e6; border-color: #f3dfae; margin-left: .5rem; }
.pages { display: flex; gap: 1rem; align-items: center; font-size: .9rem; }

/* ---------------------------------------------------------------- fiche article */
.tableau td a { color: var(--texte); text-decoration: none; font-weight: 600; }
.tableau td a:hover { color: var(--bleu); text-decoration: underline; }
.bouton-titre { margin-left: auto; text-decoration: none; padding: .45rem 1rem; font-size: .9rem; }
.badge-ref { background: var(--bleu-clair); color: var(--bleu-fonce); border-radius: 999px; padding: .1rem .7rem; font-size: .85rem; font-weight: 600; }
.carte + .carte, .carte + details, details + details { margin-top: 1rem; }
.quantites { display: flex; flex-wrap: wrap; gap: .5rem 2rem; align-items: flex-end; margin-bottom: 1rem; }
.quantites div { display: flex; flex-direction: column; }
.quantites span { font-size: .8rem; color: var(--discret); text-transform: uppercase; letter-spacing: .04em; }
.quantites strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.quantites .rouge { color: var(--rouge-texte); }
.quantites .note { flex-basis: 100%; margin: 0; font-size: .85rem; }
.fiche fieldset { border: 0; border-top: 1px solid var(--bord); margin: 0 0 1rem; padding: .9rem 0 0; }
.fiche fieldset:first-of-type { border-top: 0; padding-top: 0; }
.fiche legend { font-weight: 700; color: var(--bleu-fonce); padding: 0 .4rem 0 0; }
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 1rem; }
.grille .large { grid-column: span 2; }
.grille label { font-size: .85rem; }
input.num { text-align: right; font-variant-numeric: tabular-nums; }
.valeur { display: block; margin-top: .3rem; padding: .55rem .7rem; border-radius: 6px; background: #f3f5f8; font-weight: 400; min-height: 2.45rem; }
.valeur.num { text-align: right; font-variant-numeric: tabular-nums; }
label.case { display: flex; align-items: center; gap: .5rem; font-weight: 400; margin: .25rem 0 .75rem; }
.actions { display: flex; align-items: center; gap: 1rem; grid-column: 1 / -1; }
.section-repliable summary { cursor: pointer; font-weight: 700; color: var(--bleu-fonce); }
.section-repliable[open] summary { margin-bottom: .5rem; }
.section-repliable.danger summary { color: var(--rouge-texte); }
.bouton-danger { background: #b42318; }
.bouton-danger:hover { background: #912018; }
@media (max-width: 600px) { .grille .large { grid-column: auto; } }

/* ---------------------------------------------------------------- mouvement de l'article */
input[type=date] { display: block; margin-top: .3rem; padding: .5rem .6rem; font: inherit; font-weight: 400; border: 1px solid var(--bord); border-radius: 6px; background: var(--surface); color: var(--texte); }
.resume { display: flex; flex-wrap: wrap; gap: .5rem 2rem; align-items: flex-end; margin-bottom: 1rem; }
.resume div { display: flex; flex-direction: column; }
.resume span { font-size: .8rem; color: var(--discret); text-transform: uppercase; letter-spacing: .04em; }
.resume strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.resume .note { flex-basis: 100%; margin: 0; }
.deux-colonnes { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; align-items: start; }
.deux-colonnes h2.groupe { margin-top: .5rem; }
.tableau-achat thead th { background: #e3f4ef; border-bottom-color: #bfe3d8; }
.tableau-vente thead th { background: #fbf0e1; border-bottom-color: #f0dcbd; }
.tableau tfoot td { font-weight: 700; background: #f6f8fb; border-top: 1px solid var(--bord); }
@media (max-width: 1000px) { .deux-colonnes { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- inventaire */
.bouton-secondaire { background: var(--surface); color: var(--bleu); border: 1px solid var(--bleu); }
.bouton-secondaire:hover { background: var(--bleu-clair); }
.avancement { flex-basis: 100%; width: 100%; height: 8px; border: 0; border-radius: 999px; overflow: hidden; background: #e6ebf2; appearance: none; }
.avancement::-webkit-progress-bar { background: #e6ebf2; }
.avancement::-webkit-progress-value { background: #2e7d4f; }
.avancement::-moz-progress-bar { background: #2e7d4f; }
.resume .rouge { color: var(--rouge-texte); }
.lecteur { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; margin-bottom: 1rem; }
.lecteur label { margin: 0; font-size: .85rem; }
.lecteur .lecteur-code { flex: 1 1 280px; }
.lecteur input.num { width: 7rem; }
.lecteur .note { flex-basis: 100%; margin: 0; font-size: .85rem; }
.tableau-inventaire td { vertical-align: middle; }
.tableau-inventaire input.saisie { width: 6.5rem; margin: 0; padding: .35rem .5rem; }
.tableau tr.ligne-comptee td { background: #ecfdf3; }
.ecart-neg { color: #b91c1c; font-weight: 700; }
.ecart-pos { color: #1d4ed8; font-weight: 700; }
.petit { font-size: .82rem; color: var(--discret); }
button.lien.petit { color: var(--rouge-texte); }

/* ---------------------------------------------------------------- ruban (à la manière du RibbonControl) */
.barre { padding-bottom: .35rem; }
.ruban { position: relative; z-index: 20; background: var(--barre-fond); box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }
/* PC : les onglets et le ruban restent visibles pendant le défilement ; --haut-entete (ruban.js) = sa hauteur ;
   ruban.js redescend sous le ruban un champ ou une ligne qui passerait dessous */
@media screen and (min-width: 900px) {
  .ruban { position: sticky; top: 0; }
}
.ruban-onglets { display: flex; align-items: flex-end; gap: 2px; padding: 0 1rem; overflow-x: auto; scrollbar-width: none; }
.ruban-onglets::-webkit-scrollbar { display: none; }
.ruban-onglet {
  padding: .45rem 1rem .5rem; border: 0; border-radius: 4px 4px 0 0; background: transparent; color: var(--barre-texte);
  font: inherit; font-size: .9rem; cursor: pointer; white-space: nowrap;
}
.ruban-onglet:hover { background: var(--barre-survol); }
.ruban-onglet[aria-selected="true"] { background: var(--onglet-actif-fond); color: var(--onglet-actif-texte); font-weight: 600; }
.ruban-onglet.contextuel { color: #ffe08a; font-weight: 600; box-shadow: inset 0 3px 0 #f5b301; }
.ruban-onglet.contextuel[aria-selected="true"] { color: #8a5a00; background: #fff8e1; }
.ruban-onglet:focus-visible, .ruban-reduire:focus-visible, .ruban-bouton:focus-visible { outline: 2px solid #ffe08a; outline-offset: -2px; }
.ruban-reduire { margin-left: auto; align-self: center; width: 2rem; height: 1.8rem; border: 0; border-radius: 4px; background: transparent; cursor: pointer; }
.ruban-reduire svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: var(--barre-texte); stroke-width: 2; transition: transform .15s; }
.ruban-reduire:hover { background: var(--barre-survol); }
.ruban.reduit .ruban-reduire svg { transform: rotate(180deg); }
.ruban-video { margin-left: auto; align-self: center; display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .6rem; border-radius: 4px;
  color: var(--barre-texte); font-size: .85rem; text-decoration: none; white-space: nowrap; }
.ruban-video svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: #ffe08a; stroke-width: 2; }
.ruban-video:hover { background: var(--barre-survol); color: var(--barre-texte); }
.ruban-video:focus-visible { outline: 2px solid #ffe08a; outline-offset: -2px; }
.ruban-video + .ruban-reduire { margin-left: 0; }
.ruban-video[hidden] { display: none; }
.ruban-video[hidden] + .ruban-reduire { margin-left: auto; }
/* page Vidéos d'aide */
.videos-cadre { display: grid; grid-template-columns: minmax(0, 1fr) 18rem; gap: 1.25rem; align-items: start; }
.videos-lecteur video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #0f172a; border-radius: 6px; }
.videos-sous-titre { font-size: 1rem; margin: 1rem 0 .3rem; }
.videos-chapitres { margin: .4rem 0 0; padding: 0; list-style: none; columns: 2 16rem; column-gap: 1.5rem; }
.videos-chapitres li { break-inside: avoid; }
.videos-chapitres button { display: block; width: 100%; padding: .3rem .4rem; border-radius: 4px; text-align: start; text-decoration: none; }
.videos-chapitres button:hover { background: #eef4ff; }
.videos-chapitres button.actif { background: #dbeafe; font-weight: 600; }
.videos-temps { display: inline-block; min-width: 2.8rem; color: var(--discret); font-variant-numeric: tabular-nums; }
.videos-liste { border: 1px solid #dbe3ef; border-radius: 6px; padding: .2rem .9rem .8rem; background: var(--surface); }
.videos-liste .videos-sous-titre { margin-top: .6rem; }
.videos-liste h3 { font-size: .9rem; margin: .8rem 0 .2rem; color: #1e3a8a; }
.videos-liste ul { margin: 0; padding: 0; list-style: none; }
.videos-liste li { padding: .2rem 0; }
.videos-liste li.actif a { font-weight: 600; }
.videos-liste li .discret, .titre-ligne .discret { white-space: nowrap; }
@media (max-width: 900px) { .videos-cadre { grid-template-columns: 1fr; } }

.ruban-panneau { display: flex; align-items: stretch; min-height: 104px; padding: .35rem .75rem 0; background: var(--surface); border-bottom: 1px solid var(--bord); overflow-x: auto; }
.ruban-panneau[hidden] { display: none; }
.ruban.reduit .ruban-panneau { display: none; }
.ruban.reduit.deplie .ruban-panneau:not([hidden]) {
  display: flex; position: absolute; left: 0; right: 0; top: 100%; box-shadow: 0 8px 18px rgba(16, 24, 40, .18);
}
.ruban-groupe { display: flex; flex-direction: column; padding: 0 .35rem; border-right: 1px solid #e3e8ef; }
.ruban-groupe:last-child { border-right: 0; }
.ruban-boutons { display: flex; gap: .15rem; flex: 1; }
.ruban-bouton {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: .3rem;
  width: auto; min-width: 4.4rem; max-width: 5.6rem; padding: .4rem .3rem; border: 1px solid transparent; border-radius: 4px;
  color: var(--texte); text-decoration: none; font-size: .8rem; line-height: 1.15; text-align: center;
}
.ruban-bouton:hover { background: var(--accent-survol); border-color: var(--accent-survol-bord); }
.ruban-bouton.actif { background: var(--accent-choisi); border-color: var(--accent-choisi-bord); }
.ruban-groupe-titre { padding: .25rem 0 .3rem; font-size: .72rem; color: var(--discret); text-align: center; white-space: nowrap; }
.ico { width: 2rem; height: 2rem; flex: none; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ico-bleu { stroke: #1f6fd1; }
.ico-vert { stroke: #1e8a4c; }
.ico-orange { stroke: #d9730d; }
.ico-violet { stroke: #7a4cc2; }
.ico-rouge { stroke: #c0392b; }
.ruban-bouton.inactif { opacity: .42; cursor: default; }
.ruban-bouton.inactif:hover { background: transparent; border-color: transparent; }

@media (max-width: 600px) {
  .ruban-panneau { min-height: 88px; }
  .ruban-bouton { width: 4.6rem; font-size: .72rem; }
  .ico { width: 1.6rem; height: 1.6rem; }
}

.tableau-inventaire td.num .indice { display: block; margin-top: .15rem; font-size: .72rem; color: var(--discret); font-weight: 400; }
.tableau-inventaire th, .tableau-inventaire td { padding-left: .5rem; padding-right: .5rem; }

button.lien.petit-bleu { color: var(--bleu); font-size: .85rem; font-weight: 600; }
.filtres input.num { width: 7rem; display: block; margin-top: .3rem; padding: .55rem .7rem; border: 1px solid var(--bord); border-radius: 6px; font: inherit; font-weight: 400; }
.filtres label.case { align-self: center; margin: 0; }

/* --- Étape 5 : clients et factures --- */
.etiquette { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: .1rem .45rem; border-radius: 999px; vertical-align: middle; background: #eef2f7; color: var(--discret); }
.etiquette.rouge { background: var(--rouge); color: var(--rouge-texte); }
.etiquette.vert { background: #e7f6ec; color: #166534; }
.etiquette.etiquette-achat, .etiquette.etiquette-vente { background: #fff3e0; color: #9a4b00; }
.tableau tr.ligne-achat td, .tableau tr.ligne-vente td { background: #fffaf3; }
.coordonnees { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .6rem 1.5rem; margin: 0; }
.coordonnees div { min-width: 0; }
.coordonnees dt { font-size: .78rem; color: var(--discret); text-transform: uppercase; letter-spacing: .04em; }
.coordonnees dd { margin: .1rem 0 0; overflow-wrap: anywhere; }
.client-nom { font-size: 1.15rem; font-weight: 700; margin: 0 0 .75rem; }
.tableau tr.ligne-report td { background: #f6f8fb; font-style: italic; }
.totaux-facture { margin-top: 1rem; justify-content: flex-end; }
.carte > h2.groupe:first-child { margin-top: 0; }
.deux-colonnes > .carte + .carte { margin-top: 0; }
label.choix-mode { align-items: flex-start; }
label.choix-mode input { margin-top: .25rem; }
.mdp-mode { max-width: 520px; margin-top: .5rem; }

/* Boutons à menu déroulant du ruban (BarSubItem) */
.ruban-menu { position: relative; }
.ruban details.ruban-menu { margin: 0; }
.ruban-menu > summary { list-style: none; cursor: pointer; }
.ruban-menu > summary::-webkit-details-marker { display: none; }
.ruban-menu > summary .fleche { font-size: .7rem; color: var(--discret); }
.ruban-menu[open] > summary { background: var(--accent-survol); border-color: var(--accent-survol-bord); }
.ruban-menu-liste {
  position: fixed; z-index: 50; min-width: 250px; max-height: 70vh; overflow-y: auto; padding: .35rem 0;
  background: var(--surface); border: 1px solid var(--bord); border-radius: 6px; box-shadow: 0 10px 24px rgba(16, 24, 40, .18);
}
.ruban-menu-titre { padding: .45rem .9rem .2rem; font-size: .7rem; font-weight: 700; color: var(--discret); text-transform: uppercase; letter-spacing: .05em; }
.ruban-menu-titre:not(:first-child) { margin-top: .25rem; border-top: 1px solid #edf0f5; padding-top: .6rem; }
.ruban-menu-choix { display: flex; align-items: center; gap: .6rem; padding: .4rem .9rem; color: var(--texte); text-decoration: none; font-size: .88rem; white-space: nowrap; }
.ruban-menu-choix .ico { width: 1.25rem; height: 1.25rem; }
a.ruban-menu-choix:hover, a.ruban-menu-choix:focus-visible { background: var(--accent-survol); outline: none; }
.ruban-menu-choix.actif { background: var(--accent-choisi); font-weight: 600; }
.ruban-menu-choix.inactif { opacity: .45; cursor: default; }
.avis-mode { margin: .6rem 0 0; max-width: 520px; }

/* Petits boutons empilés (colonne de trois, comme les petits boutons DevExpress) */
.ruban-colonne { display: flex; flex-direction: column; gap: 1px; padding: .1rem 0; }
.ruban-bouton.petit { flex-direction: row; align-items: center; width: auto; min-width: 0; max-width: none; gap: .4rem; padding: .22rem .45rem; font-size: .78rem; white-space: nowrap; text-align: left; }
.ruban-bouton.petit .ico { width: 1.15rem; height: 1.15rem; }
.ruban-colonne .ruban-menu > summary.petit { width: auto; }
.ruban-groupe, .ruban-boutons > *, .ruban-colonne > * { flex: none; }

/* --- Étape 5c : saisie de vente --- */
.vente-haut { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1rem; align-items: start; }
.vente-haut .carte + .carte { margin-top: 0; }
.vente-grille { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.vente-entete .cases { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.vente-entete input:disabled { background: #f3f5f8; color: var(--discret); }
.vente-total .vente-montant { font-size: 2rem; font-weight: 700; text-align: center; margin: .25rem 0 1rem; font-variant-numeric: tabular-nums; }
.vente-total dl { margin: 0; }
.vente-total dl div { display: flex; justify-content: space-between; gap: 1rem; padding: .3rem 0; border-top: 1px solid #edf0f5; }
.vente-total dt { color: var(--discret); }
.vente-total dd { margin: 0; font-variant-numeric: tabular-nums; }
.vente-total .fort dd { font-weight: 700; }
.vente-total .rouge { color: var(--rouge-texte); }
.tableau-saisie input.saisie, .ajout-ligne input.saisie { width: 5.5rem; padding: .35rem .45rem; border: 1px solid var(--bord); border-radius: 5px; font: inherit; }
.tableau-saisie input.saisie-prix { width: 7.5rem; }
/* saisie d'achat : plus de colonnes, page plus large et champs plus étroits */
.page:has(.tableau-achat) { max-width: 1580px; }
.tableau-achat th, .tableau-achat td { padding: .4rem .35rem; }
.tableau-achat input.saisie { width: 4.6rem; }
.tableau-achat input.saisie-prix { width: 5.6rem; }
.tableau-achat input.saisie-taux { width: 3.6rem; }
.tableau-achat input.saisie-texte { width: 7rem; }
.tableau-achat input.saisie-lot { width: 6rem; }
.tableau-achat input.saisie-date { width: 8.6rem; }
.nouvel-article { margin-top: 1rem; align-items: flex-end; }
.nouvel-article h2 { flex-basis: 100%; margin: 0; }
.nouvel-article p { flex-basis: 100%; margin: 0; }
.pastille-alerte { display: inline-block; margin-left: .5rem; padding: 0 .4rem; border-radius: 999px; background: #fdecc8; color: #8a5a00; font-size: .72rem; font-weight: 600; }
.lien-suppr { border: 0; background: transparent; color: #b42318; font-size: 1rem; cursor: pointer; padding: .2rem .4rem; border-radius: 4px; }
.lien-suppr:hover { background: var(--rouge); }
.ajout-ligne { display: flex; gap: .4rem; justify-content: flex-end; align-items: center; margin: 0; }
.bouton-petit { padding: .35rem .8rem; font-size: .85rem; }
.vente-actions { display: flex; gap: .75rem; flex-wrap: wrap; align-items: flex-start; margin: 1rem 0; }
.vente-actions .alerte { flex-basis: 100%; margin: 0; }
.vente-actions .alerte p { margin: .2rem 0; }
@media (max-width: 1000px) { .vente-haut { grid-template-columns: 1fr; } }
.vente-entete h2.groupe { margin-top: 0; }
.tableau-saisie td, .tableau-saisie th { vertical-align: middle; }
.tableau-saisie tr.ligne-nouvelle td { background: #f7faff; }
.tableau-saisie #saisie-article { width: 100%; padding: .45rem .6rem; border: 1px dashed var(--accent-choisi-bord); border-radius: 5px; font: inherit; background: var(--surface); }
.tableau-saisie #saisie-article:focus { border-style: solid; outline: 2px solid var(--bleu-clair); }
.grille-stock { max-height: 420px; min-height: 18rem; overflow-y: auto; }   /* au moins 6 lignes, même avec peu d'articles trouvés */
.grille-stock thead th { position: sticky; top: 0; z-index: 1; }
.grille-stock tbody tr[data-id] { cursor: pointer; }
.grille-stock tbody tr[data-id]:hover td { background: var(--accent-leger); }
.grille-stock tbody tr.choisie td { background: var(--accent-choisi); }
.lien-ajout { border: 1px solid var(--accent-choisi-bord); background: var(--surface); color: var(--bleu); font-weight: 700; width: 1.8rem; height: 1.6rem; border-radius: 4px; cursor: pointer; line-height: 1; }
.lien-ajout:hover { background: var(--bleu); color: #fff; }
#stock .petit { text-transform: none; letter-spacing: 0; font-weight: 400; }
.vente-boutons { margin-left: auto; display: flex; gap: .6rem; }
.vente-actions { display: block; margin: 0; }
.vente-actions .alerte { margin: 0 0 1rem; }
.bouton-rouge { color: #b42318; border-color: #b42318; }
.bouton-rouge:hover { background: var(--rouge); }
.confirmer-suppression p { margin: 0 0 .75rem; }
.confirmer-suppression .bouton { margin-right: .5rem; }
.vente-boutons .bouton { text-decoration: none; }

/* Versement client (5e-1) */
.grille input[type=date] { width: 100%; }
.vente-haut + .confirmer-suppression { margin-top: 1rem; }

/* Échéances (5e-2) */
.onglets-page { display: flex; gap: .25rem; border-bottom: 1px solid var(--bord); margin: 0 0 1rem; flex-wrap: wrap; }
.onglets-page a { padding: .5rem .9rem; text-decoration: none; color: var(--discret); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.onglets-page a:hover { color: var(--bleu-fonce); }
.onglets-page a.actif { color: var(--bleu-fonce); border-bottom-color: var(--bleu); }
.tableau .rouge, .discret .rouge, td.rouge { color: var(--rouge-texte); }
.rouge.vente-montant { color: var(--rouge-texte); }
.resume small { font-size: .8rem; }
.grille input[type=number] { display: block; width: 100%; margin-top: .3rem; padding: .55rem .7rem; font: inherit; font-weight: 400; border: 1px solid var(--bord); border-radius: 6px; background: var(--surface); }
.tableau tr.ligne-groupe td { background: var(--accent-pale); color: var(--bleu-fonce); }
.tableau tr.impute td { background: #eefaf1; }
.tableau td.imputation { color: #166534; font-weight: 700; }
.etiquette.statut-payee { background: #e7f6ec; color: #166534; }
.etiquette.statut-retard { background: var(--rouge); color: var(--rouge-texte); }
.etiquette.statut-partielle { background: #fdf3dc; color: #8a5a00; }
.etiquette.statut-avenir { background: var(--bleu-clair); color: var(--bleu-fonce); }
.tableau-apercu { font-size: .9rem; }
.vente-total .tableau-apercu td, .vente-total .tableau-apercu th { padding: .3rem .5rem; }
.titre-ligne h2.groupe { margin-bottom: .6rem; }
a.bouton-titre.petit { padding: 0; font-size: .85rem; }
.resume.resume-haut { align-items: flex-start; }
.tableau tr.ligne-groupe .lien-suppr { font-weight: 400; font-size: .85rem; }

/* Fiches clients (lot A) */
textarea { display: block; width: 100%; margin-top: .3rem; padding: .55rem .7rem; font: inherit; font-weight: 400; color: var(--texte); border: 1px solid var(--bord); border-radius: 6px; background: var(--surface); resize: vertical; }
.actions-titre { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }
.actions-titre .bouton { text-decoration: none; padding: .45rem 1rem; font-size: .9rem; }
.carte.fiche + .carte.fiche { margin-top: 1rem; }
.carte > input[type=hidden] + h2.groupe { margin-top: 0; }

/* Entête et logos (lot B) */
.tuiles-logos { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.tuiles-logos .carte { margin: 0; }
.tuiles-logos h3 { margin: 0 0 .6rem; font-size: 1rem; }
.apercu-logo { height: 110px; display: flex; align-items: center; justify-content: center; background: #f6f8fb; border: 1px dashed var(--bord); border-radius: 6px; margin-bottom: .75rem; }
.apercu-logo img { max-height: 100px; max-width: 100%; object-fit: contain; }
.tuiles-logos input[type=file] { display: block; margin: .3rem 0 .6rem; font: inherit; font-weight: 400; }
.tuiles-logos form + form { margin-top: .5rem; }

/* grilles réglables (grilles.js) : déplacer une colonne par son en-tête, élargir en tirant le bord droit */
.grille-reglable thead th { user-select: none; }   /* déjà position: sticky (repère du séparateur) */
.grille-reglable thead th::before { content: ""; position: absolute; top: 20%; right: 0; bottom: 20%; width: 1px; background: #c9d6e6; }
.grille-reglable thead th:last-child::before { display: none; }
.grille-reglable thead th.grille-bord { cursor: col-resize; }
.grille-reglable thead th.grille-deplace { opacity: .45; }
body.grille-redim, body.grille-redim * { cursor: col-resize !important; user-select: none; }
body.grille-glisse, body.grille-glisse * { cursor: grabbing !important; user-select: none; }
.grille-repere { position: absolute; width: 3px; margin-left: -1px; background: var(--bleu); border-radius: 2px; z-index: 60; pointer-events: none; }
.grille-menu { position: absolute; z-index: 100; background: var(--surface); border: 1px solid var(--bord); border-radius: 6px; box-shadow: 0 6px 20px rgba(15, 40, 80, .18); padding: .25rem; }
.grille-menu button { display: block; width: 100%; padding: .45rem .8rem; border: 0; background: none; font: inherit; text-align: left; border-radius: 4px; cursor: pointer; white-space: nowrap; }
.grille-menu button:hover, .grille-menu button:focus { background: var(--bleu-clair); outline: none; }

/* Utilisateurs (FrmCollabo) : liste des comptes à gauche, fiche et 4 cartes de droits à droite */
.util-page { display: grid; grid-template-columns: 260px 1fr; gap: 1rem; align-items: start; }
@media (max-width: 900px) { .util-page { grid-template-columns: 1fr; } }
.util-liste { padding: .75rem; position: sticky; top: calc(var(--haut-entete, 0px) + .5rem); }
.util-liste input[type=search] { width: 100%; padding: .5rem .6rem; border: 1px solid var(--bord); border-radius: 6px; font: inherit; margin-bottom: .5rem; }
.util-liste nav { display: flex; flex-direction: column; max-height: 60vh; overflow-y: auto; }
.util-liste nav a { display: flex; justify-content: space-between; gap: .5rem; padding: .5rem .6rem; border-radius: 6px; color: var(--texte); text-decoration: none; font-weight: 600; }
.util-liste nav a small { color: var(--discret); font-weight: 400; }
.util-liste nav a:hover { background: var(--accent-leger); }
.util-liste nav a.actif { background: var(--bleu-clair); color: var(--bleu); }
.util-admin { margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--bord); }
.util-admin label { font-size: .85rem; }
.util-admin select { width: 100%; margin: .3rem 0 .5rem; }
.util-titre h2 { margin: 0; }
.util-barre { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin: 1rem 0 .75rem; }
.util-barre input[type=search] { flex: 1 1 260px; padding: .5rem .6rem; border: 1px solid var(--bord); border-radius: 6px; font: inherit; }
.droits-cartes { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 1rem; }
.droits-carte { padding: .75rem .9rem; }
.droits-carte header { display: flex; align-items: center; gap: .6rem; border-bottom: 1px solid var(--bord); padding-bottom: .45rem; margin-bottom: .35rem; }
.droits-carte h3 { margin: 0; font-size: 1rem; flex: 1; }
.droits-carte header .lien { font-size: .8rem; color: var(--bleu); font-weight: 600; }
.droits-liste { display: flex; flex-direction: column; }
label.droit { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; padding: .32rem .35rem; border-radius: 5px; font-weight: 400; cursor: pointer; }
label.droit:hover { background: var(--accent-leger); }
label.droit input[type=checkbox] { width: 1.05rem; height: 1.05rem; accent-color: var(--bleu); }
label.droit:has(input:checked) span { font-weight: 600; color: var(--entete-texte); }
label.droit-admin { background: #fff4e5; }
label.droit-verrou { opacity: .5; cursor: not-allowed; }
label.droit input[type=date] { margin-left: auto; padding: .2rem .35rem; border: 1px solid var(--bord); border-radius: 5px; font: inherit; font-size: .85rem; }
.droit-avert { flex-basis: 100%; margin-left: 1.6rem; color: #b45309; }

.ruban-vide { margin: 0; padding: 1.6rem 1rem; color: var(--discret); font-size: .85rem; }
.util-page [hidden] { display: none !important; }
.page:has(.util-page) { max-width: 1580px; }
.droits-cartes { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.droits-carte header { align-items: baseline; }
.droits-carte header > * { margin: 0; }
.droits-carte { margin: 0; }
label.droit { display: grid; grid-template-columns: auto 1fr auto; align-items: center; margin: 0; }
label.droit > span { min-width: 0; }
label.droit .droit-avert { grid-column: 2 / -1; margin-left: 0; }
.droits-cartes > .carte { margin: 0; }
label.droit input[type=date] { grid-column: 2 / -1; justify-self: start; margin: .2rem 0 0; }

/* navigateur de factures (BindingNavigator) et totaux en haut de la facture */
.navigateur { display: inline-flex; align-items: center; gap: .2rem; margin-left: auto; padding: .15rem .3rem; background: var(--carte); border: 1px solid var(--bord); border-radius: 8px; align-self: center; }
.navigateur .nav-bouton { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: 6px; color: var(--bleu); text-decoration: none; font-size: .95rem; }
.navigateur a.nav-bouton:hover { background: var(--bleu-clair); }
.navigateur .nav-bouton.inactif { color: #b9c4d2; }
.navigateur input[name=pos] { width: 4.2rem; padding: .3rem .4rem; border: 1px solid var(--bord); border-radius: 5px; font: inherit; text-align: center; }
.navigateur span { color: var(--discret); font-size: .9rem; padding: 0 .3rem 0 .1rem; white-space: nowrap; }
.navigateur + .vente-boutons { margin-left: 0; }
.totaux-facture.totaux-haut { margin: 0 0 1rem; justify-content: flex-start; }

/* zones de la ligne choisie dans la liste du stock (Commentaire, Emplacement, Code-barres) */
.filtres .filtre-court input { width: 10.5rem; background: #f5f8fc; color: var(--entete-texte); font-weight: 600; }
.tableau-stock tbody tr[data-id] { cursor: pointer; }
.tableau-stock tbody tr.choisie td { background: var(--accent-choisi); }
#ligne-loc[data-modifiable] { background: var(--surface); border-color: var(--accent-choisi-bord); }
#ligne-loc.enregistre { border-color: #16a34a; box-shadow: 0 0 0 2px #bbf7d0; }
#ligne-loc.erreur-saisie { border-color: #dc2626; box-shadow: 0 0 0 2px #fecaca; }

/* onglet sans boutons relié à une page (Accueil) : pas de bandeau vide */
.ruban-panneau.ruban-panneau-vide { min-height: 0; padding: 0; border-bottom: 0; }

/* fermeture du site */
.fermeture-plage { max-width: 560px; margin: 0 0 .75rem 1.6rem; }
.fiche label.large { display: block; margin: .5rem 0; }

/* utilisateurs connectés et localisation */
.gps-reglage { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.gps-reglage label.case { margin: 0; flex: 1 1 520px; }
.tableau tr.ligne-inactive td { color: var(--discret); }
.petit-bouton { padding: .3rem .7rem; font-size: .82rem; }
.localisation .actions { margin: .75rem 0; }
.loc-deconnexion { margin-top: .5rem; text-align: right; }
.loc-deconnexion .lien { color: var(--bleu); text-decoration: underline; }

/* validation d'un PC par le téléphone (QR code) */
.qr-etapes { margin: .5rem 0 1rem 1.2rem; padding: 0; line-height: 1.5; }
.qr-cadre { display: flex; justify-content: center; margin: .5rem 0 1rem; }
.qr-cadre canvas { width: 264px; height: 264px; border: 1px solid var(--bord, #d0d7e2); border-radius: 8px; image-rendering: pixelated; }
.qr-cadre canvas.qr-expire { opacity: .15; }
.validation-qr .actions, .telephone-validation .actions { margin: .75rem 0; }
.etiquette.bleu { background: #e3edff; color: #1d4ed8; }
.qr-delai { margin: 0; white-space: nowrap; }
.qr-delai input { width: 5.5rem; margin: 0 .3rem; }

/* zones autorisées */
.zones { margin-bottom: 1rem; }
.zones > summary { cursor: pointer; margin-bottom: .25rem; }
.zones[open] > summary { margin-bottom: .75rem; }
.zones-table input { width: 100%; min-width: 0; }
.zones-table input[type=checkbox] { width: auto; }
.zones-table input[name=rayon] { width: 6.5rem; }
.zones-table .zone-centre { width: 13rem; }
.zones-table td { vertical-align: middle; }
.zone-actions { white-space: nowrap; }
.zone-actions form { display: inline-block; margin-right: .3rem; }
.zone-nouvelle td { background: #f8fafc; }
#zone-ma-position { margin-top: .3rem; }
.tableau td .etiquette { white-space: nowrap; }

/* modification du stock (grille modifiable en place) */
.modif-infos { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; margin: .25rem 0 .4rem; font-size: .9rem; }
.modif-etat { margin: 0 0 .5rem; padding: .45rem .75rem; border-radius: 6px; background: #f1f5f9; color: var(--discret); font-size: .9rem; min-height: 1.2rem; }
.modif-etat.succes { background: #e7f6ec; color: #166534; }
.modif-etat.erreur { background: var(--rouge); color: var(--rouge-texte); }
.tableau-modif td { white-space: nowrap; cursor: default; }
.tableau-modif td.des { white-space: normal; min-width: 14rem; font-weight: 600; }
.tableau-modif td.m { background-image: linear-gradient(#fff, #fff); }
.tableau-modif tbody tr td:not(.m):not(.des) { background-color: #f5f7fa; }
.tableau-modif th .crayon { color: var(--bleu); font-weight: 400; font-size: .8rem; }
.tableau-modif tbody tr.choisie td { box-shadow: inset 0 1px 0 #93c5fd, inset 0 -1px 0 #93c5fd; }
.tableau-modif td.active { outline: 2px solid var(--bleu); outline-offset: -2px; }
.tableau-modif td.en-saisie { padding: 0; }
.tableau-modif .cellule-saisie { width: 100%; min-width: 6rem; box-sizing: border-box; border: 2px solid var(--bleu); border-radius: 0; padding: .35rem .45rem; font: inherit; }
.tableau-modif .cellule-saisie.num { text-align: right; }
.tableau-modif td.en-cours { color: var(--discret); font-style: italic; }
.tableau-modif td.enregistre { background-color: #bbf7d0 !important; transition: background-color .3s; }
.tableau-modif td.refuse { background-color: #fecaca !important; }
.tableau-modif tr.ligne-epuise td[data-champ=stock] { background-color: #ffeb9c; color: #785a00; }
.tableau-modif tr.ligne-epuise td { font-style: italic; }
.tableau-modif tr.ligne-alerte td[data-champ=stock] { background-color: #ffc7be; color: #961e14; }
.tableau-modif tr.ligne-inventaire td.des { color: #c0392b; }
.tableau-modif tr.ligne-ecart td.depot { color: #c0392b; font-weight: 700; }
.pastille.p-inventaire { background: #c0392b; }
.pastille.p-ecart { background: var(--surface); border: 2px solid #c0392b; }
.modif-infos .pastille.p-epuise { background: #ffeb9c; border-color: #e8d27a; }
.modif-infos .pastille.p-alerte { background: #ffc7be; border-color: #f0a093; }
/* désignation figée à gauche pendant le défilement horizontal, comme la colonne figée de FrmModifierStock */
.tableau-modif td.des, .tableau-modif th[data-col=designation] { position: sticky; left: 0; z-index: 2; background: var(--surface); box-shadow: inset -1px 0 0 var(--bord); }
.tableau-modif th[data-col=designation] { z-index: 3; background: var(--bleu-clair); }
.tableau-modif tr.choisie td.des { background: var(--accent-pale); }

/* renommer l'article */
.renommer { max-width: 900px; }
.renommer-actuel { margin-bottom: 1rem; }
.renommer-aide { font-size: .85rem; margin: .5rem 0 0; }
#ren-longueur { font-weight: 600; }
#ren-longueur.trop-long { color: #c0392b; }
#ren-nom, #ren-ref { text-transform: uppercase; }

/* statistiques du stock */
.stats-criteres input[type=number] { display: block; margin-top: .3rem; padding: .5rem .6rem; font: inherit; font-weight: 400; border: 1px solid var(--bord); border-radius: 6px; background: var(--surface); color: var(--texte); }
.stats-criteres .stats-annee { width: 6.5rem; }
.stats-criteres .stats-article { flex: 0 1 22rem; }
.stats-criteres .stats-article input { width: 100%; }
.stats-resume { margin: .25rem 0 .5rem; }
.stats-table td { white-space: nowrap; }
.stats-table td.stats-des { white-space: normal; min-width: 12rem; font-weight: 600; }
.stats-table tbody tr:nth-child(even) td { background: #f8fafc; }
.stats-table td.stats-rouge { background: #dc2626 !important; color: #fff; font-weight: 700; }
.stats-table tfoot td { font-weight: 700; background: var(--accent-pale); border-top: 2px solid var(--bleu); white-space: nowrap; }
.stats-plus { width: 2rem; text-align: center; }
.stats-deplier { width: 1.6rem; height: 1.6rem; border: 1px solid var(--bord); border-radius: 4px; background: var(--surface); cursor: pointer; font-weight: 700; line-height: 1; }
.stats-detail td { background: #f1f5f9 !important; }
.stats-sous-table { border-collapse: collapse; margin: .25rem 0 .5rem; font-size: .9rem; }
.stats-sous-table th, .stats-sous-table td { padding: .25rem .75rem; border-bottom: 1px solid var(--bord); text-align: left; }
.stats-sous-table .num { text-align: right; }
.stats-carte-graphe { margin-bottom: 1rem; }
.stats-titre-graphe { margin: 0 0 .5rem; font-size: 1.15rem; }
.stats-graphe { width: 100%; height: auto; display: block; }
.stats-sous-titre { text-align: center; color: var(--discret); margin: .25rem 0 0; }
.stats-mois td, .stats-mois th { padding-left: .5rem; padding-right: .5rem; }
@media print {
  .barre, .ruban, .fil, .stats-criteres, .vente-boutons, .pied, .stats-plus { display: none !important; }
  .page { padding: 0; max-width: none; }
  .tableau-cadre { overflow: visible; border: 0; }
  .stats-table { font-size: 9pt; }
  .stats-detail[hidden] { display: none !important; }
}

/* équivalents */
.tableau-eq td.eq-case, .tableau-eq th.eq-case { width: 3.2rem; text-align: center; }
.tableau-eq td.eq-case input { width: 1.15rem; height: 1.15rem; cursor: pointer; }
.tableau-eq tr.eq-membre td { background: #c8f0c8 !important; }
.tableau-eq tr.eq-autre td { background: #cde1fa; }
.tableau-eq tr.eq-depart td.stats-des::after { content: " ◂ article de départ"; font-weight: 400; color: var(--discret); font-size: .85rem; }
html[lang="ar"] .tableau-eq tr.eq-depart td.stats-des::after { content: " ▸ السلعة الأصلية"; }
html[lang="en"] .tableau-eq tr.eq-depart td.stats-des::after { content: " ◂ starting item"; }
.tableau-eq tbody tr.choisie td { box-shadow: inset 0 2px 0 var(--bleu), inset 0 -2px 0 var(--bleu); }
.eq-nettoyer { border-color: #f3dfae; background: #fffbeb; }

/* impression du stock (états A4) */
.impr-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin: .25rem 0 1rem; }
.impr-actions .alerte { margin: 0; flex: 1 1 420px; }
.impr-feuille { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 1.5rem 1.75rem; }
.impr-entete { display: flex; justify-content: space-between; gap: 1rem; font-size: .9rem; border-bottom: 2px solid #1e3a5f; padding-bottom: .6rem; }
.impr-societe { font-size: 1.15rem; }
.impr-date { text-align: right; color: var(--discret); }
.impr-titre { font-size: 1.25rem; margin: .9rem 0 .2rem; text-align: center; }
.impr-criteres { text-align: center; color: var(--discret); margin: 0 0 .8rem; font-size: .9rem; }
.impr-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.impr-table th { background: #dce8f7; color: #000; font-weight: 700; text-align: left; padding: .35rem .5rem; border: 1px solid #b6c6dc; }
.impr-table td { padding: .28rem .5rem; border: 1px solid #d5dde8; vertical-align: top; }
.impr-table .num { text-align: right; white-space: nowrap; }
.impr-table .impr-n { width: 2.6rem; text-align: right; color: var(--discret); }
.impr-table tbody tr:nth-child(even) td { background: #f8fafc; }
.impr-table tr.impr-groupe td { background: var(--accent-pale) !important; font-weight: 700; font-size: .95rem; }
.impr-table tr.impr-sous-total td { background: var(--surface) !important; font-weight: 600; text-align: right; border-bottom: 2px solid #94a3b8; }
.impr-totaux { margin: .8rem 0 0; text-align: right; }
@media print {
  @page { size: A4; margin: 12mm; }
  .impr-ecran { display: none !important; }
  .impr-feuille { border: 0; padding: 0; border-radius: 0; }
  .impr-table { font-size: 8.5pt; }
  .impr-table thead { display: table-header-group; }
  .impr-table tr { page-break-inside: avoid; }
}

/* codes-barres de l'article */
.cb-grille { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
@media (max-width: 900px) { .cb-grille { grid-template-columns: 1fr; } }
.cb-grille h2, .cb-titre-liste { font-size: 1.05rem; margin: 0 0 .6rem; }
.cb-titre-liste { margin-top: .5rem; }
.cb-ajout, .cb-fardeau { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; }
.cb-ajout label { flex: 1 1 260px; margin: 0; }
.cb-fardeau label { flex: 1 1 160px; margin: 0; }
.cb-generer { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; margin-top: .75rem; }
.cb-actif { border-color: var(--bleu); box-shadow: 0 0 0 2px var(--bleu-clair); }
.cb-apercu { width: 190px; height: 48px; margin-top: .3rem; }
.cb-apercu .cb-svg { width: 100%; height: 100%; display: block; }
tr.cb-affiche td { background: #f0fdf4; }
.cb-tout-supprimer { color: #b91c1c; }

/* étiquettes : rouleau (une étiquette par page au format exact) ou planche A4 */
.etiq-criteres .etiq-petit { width: 7rem; }
.etiq-criteres input[type=number] { display: block; margin-top: .3rem; padding: .5rem .6rem; font: inherit; border: 1px solid var(--bord); border-radius: 6px; }
.etiq-liste { flex: 1 1 100%; max-height: 22rem; overflow: auto; }
.etiq-planche { display: flex; flex-wrap: wrap; gap: 3mm; margin-top: 1rem; }
.etiq { box-sizing: border-box; background: var(--surface); color: #000; border: 1px dashed #94a3b8; padding: 1.2mm 1.6mm; overflow: hidden;
        display: flex; flex-direction: column; align-items: center; justify-content: space-between; text-align: center; font-family: Arial, Helvetica, sans-serif; line-height: 1.1; }
.etiq span { display: block; max-width: 100%; }
.etiq-societe { font-size: 6.5pt; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.etiq-des { font-size: 8pt; font-weight: 700; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.etiq-cb { width: 100%; flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; }
.etiq-cb .cb-svg { width: 92%; height: 100%; max-height: 16mm; }
.etiq-sans { font-size: 6pt; color: #777; }
.etiq-bas { width: 100%; display: flex; justify-content: space-between; align-items: baseline; gap: 1mm; }
.etiq-achat { font-size: 6.5pt; text-align: left; white-space: nowrap; overflow: hidden; }
.etiq-prix { font-size: 11pt; font-weight: 700; white-space: nowrap; }
.etiq-code { font-size: 6.5pt; }
/* tailles (largeur × hauteur) */
.etiq-m-cb_35x45, .etiq-m-qr_35x45 { width: 45mm; height: 35mm; }
.etiq-m-cb_20x40, .etiq-m-qr_20x40 { width: 40mm; height: 20mm; padding: .6mm 1mm; }
.etiq-m-cb_45x58, .etiq-m-qr_45x58, .etiq-m-cb_etagere_auto { width: 58mm; height: 45mm; }
.etiq-m-cb_etagere, .etiq-m-plusieurs { width: 70mm; height: 38mm; }
.etiq-m-cb_prix { width: 50mm; height: 30mm; }
.etiq-m-cb_20x40 .etiq-societe { display: none; }
.etiq-m-cb_20x40 .etiq-des { font-size: 6.5pt; -webkit-line-clamp: 1; }
.etiq-m-cb_20x40 .etiq-prix { font-size: 8pt; }
.etiq-m-cb_20x40 .etiq-cb .cb-svg { max-height: 10mm; }
.etiq-m-cb_45x58 .etiq-des { font-size: 10pt; }
.etiq-m-cb_45x58 .etiq-prix { font-size: 14pt; }
.etiq-m-cb_45x58 .etiq-cb .cb-svg { max-height: 20mm; }
/* QR : code à gauche, texte à droite */
.etiq-g-qr { flex-direction: row; align-items: center; gap: 1.5mm; text-align: left; }
.etiq-qr { flex: 0 0 auto; height: 100%; aspect-ratio: 1; display: flex; align-items: center; }
.etiq-qr img { width: 100%; height: auto; image-rendering: pixelated; }
.etiq-texte { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; height: 100%; }
.etiq-m-qr_20x40 .etiq-des { font-size: 6pt; }
.etiq-m-qr_20x40 .etiq-prix { font-size: 8pt; }
.etiq-m-qr_20x40 .etiq-code { display: none; }
.etiq-m-qr_45x58 .etiq-des { font-size: 10pt; -webkit-line-clamp: 3; }
.etiq-m-qr_45x58 .etiq-prix { font-size: 14pt; }
/* étagère et prix : prix en grand */
.etiq-g-etagere .etiq-des { font-size: 10pt; }
.etiq-g-etagere .etiq-prix { font-size: 20pt; }
.etiq-g-etagere .etiq-cb .cb-svg { max-height: 10mm; width: 70%; }
.etiq-g-prix .etiq-des { font-size: 9pt; }
.etiq-g-prix .etiq-prix { font-size: 18pt; }
@page etq45x35 { size: 45mm 35mm; margin: 0; }
@page etq40x20 { size: 40mm 20mm; margin: 0; }
@page etq58x45 { size: 58mm 45mm; margin: 0; }
@page etq70x38 { size: 70mm 38mm; margin: 0; }
@page etq50x30 { size: 50mm 30mm; margin: 0; }
@media print {
  .etiq-planche { margin: 0; }
  .etiq { border: 0; }
  .etiq-a4 .etiq { border: .2mm dashed #bbb; }
  .etiq-rouleau { display: block; gap: 0; }
  .etiq-rouleau .etiq { break-after: page; margin: 0; }
  .etiq-rouleau .etiq-m-cb_35x45, .etiq-rouleau .etiq-m-qr_35x45 { page: etq45x35; }
  .etiq-rouleau .etiq-m-cb_20x40, .etiq-rouleau .etiq-m-qr_20x40 { page: etq40x20; }
  .etiq-rouleau .etiq-m-cb_45x58, .etiq-rouleau .etiq-m-qr_45x58, .etiq-rouleau .etiq-m-cb_etagere_auto { page: etq58x45; }
  .etiq-rouleau .etiq-m-cb_etagere, .etiq-rouleau .etiq-m-plusieurs { page: etq70x38; }
  .etiq-rouleau .etiq-m-cb_prix { page: etq50x30; }
  body:has(.etiq-planche) .page { padding: 0; margin: 0; max-width: none; }
  body:has(.etiq-planche) .pied { display: none; }
}
.etiq-cbtexte { font-size: 6.5pt; letter-spacing: .04em; margin-top: .4mm; flex: 0 0 auto; }
.etiq-m-cb_20x40 .etiq-cbtexte { font-size: 5.5pt; }
.etiq-liste input[type=number] { margin: 0; padding: .2rem .4rem; width: 5rem; }
.etiq-liste td { vertical-align: middle; }
.etiq-cb { flex-direction: column; }
.etiq-cb .cb-svg { flex: 1 1 auto; min-height: 0; }
.etiq-g-qr .etiq-qr { width: 46%; height: auto; max-height: 100%; aspect-ratio: auto; }
.etiq-g-qr .etiq-qr img { width: 100%; max-height: 100%; object-fit: contain; }
.etiq-m-qr_20x40 .etiq-qr { width: 42%; }

/* paramètres du stock : réglages à bascule */
.fiche h2 { font-size: 1.05rem; margin: 0 0 .5rem; }
.po-reglage { display: flex; align-items: flex-end; gap: .75rem 1rem; flex-wrap: wrap; padding: .75rem 0; border-top: 1px solid var(--bord); }
.po-reglage:first-of-type { border-top: 0; }
.po-titre { flex: 1 1 360px; }
.po-titre p { margin: .2rem 0 0; }
.po-mdp { margin: 0; width: 14rem; }
.po-choix { display: flex; gap: 1rem; flex-wrap: wrap; }
.po-choix .case, .po-reglage > .case { margin: 0; }
.po-requis { margin: 0; }

/* borne lecteur de prix */
body:has(.borne) { background: #0f2a4a; }
body:has(.borne) .page-seule { max-width: none; padding: 0; }
body:has(.borne) .pied { display: none; }
.borne { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; text-align: center; padding: 2rem; box-sizing: border-box; position: relative; }
.borne-entete { position: absolute; top: 1rem; left: 1.5rem; right: 1.5rem; display: flex; align-items: center; gap: .75rem; font-size: 1.2rem; font-weight: 600; }
.borne-entete .logo { background: var(--surface); color: #0f2a4a; }
.borne-quitter { margin-left: auto; color: #93c5fd; font-size: .9rem; font-weight: 400; }
.borne-invite { font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 700; margin: 0; }
.borne-petit { font-size: 1.3rem; color: #bfdbfe; margin: .5rem 0 0; }
.borne-nom { font-size: clamp(1.8rem, 4.5vw, 3.5rem); font-weight: 700; margin: 0 0 .3rem; }
.borne-ref { font-size: 1.3rem; color: #bfdbfe; margin: 0; }
.borne-libelle { font-size: 1.4rem; margin: 2rem 0 0; color: #fde68a; }
.borne-prix { font-size: clamp(4rem, 13vw, 10rem); font-weight: 800; margin: 0; line-height: 1.05; }
.borne-inconnu { font-size: 2rem; color: #fecaca; font-weight: 700; }
.borne-saisie { position: absolute; bottom: 1rem; opacity: .35; }
.borne-saisie input { width: 16rem; background: transparent; color: #fff; border: 1px solid #335; }
.af-liste { max-height: 24rem; overflow: auto; margin-bottom: .5rem; }

/* ---------- Dépôts, transferts, péremption, maintenance des articles (0.35.0) */
.en-ligne { display: inline; }
.alerte-avertissement { background: #fff4e0; color: #7a4a00; border-color: #f3d6a4; }
.tableau tbody tr.trf-depasse td { background: #fff1dc; }
.trf-fleche { align-self: flex-end; font-size: 1.4rem; padding-bottom: .35rem; color: var(--discret); }
.trf-actions { white-space: nowrap; display: flex; gap: .35rem; align-items: center; }
.trf-ajout { display: inline-flex; gap: .35rem; align-items: center; justify-content: flex-end; margin: 0; }
.trf-ajout input { width: 5.5rem; text-align: right; }
#trf-bon input[name^="qte["] { width: 6rem; text-align: right; }
.trf-resultats { max-height: 22rem; overflow: auto; }
.trf-signatures { display: flex; justify-content: space-between; gap: 2rem; margin-top: 2.5rem; }
.trf-signatures div { flex: 1; border-top: 1px solid #999; padding-top: .35rem; min-height: 4rem; font-size: .9rem; }
.dep-ecart { font-weight: 600; color: var(--rouge-texte); }
.per-resume { display: flex; gap: .75rem; flex-wrap: wrap; margin: .5rem 0 1rem; }
.per-case { border: 1px solid var(--bord); border-radius: var(--rayon); padding: .55rem .9rem; min-width: 9rem; background: var(--surface); }
.per-case strong { font-size: 1.35rem; }
.per-p1 { border-left: 5px solid #d9534f; } .per-p2 { border-left: 5px solid #f0ad4e; } .per-p3 { border-left: 5px solid #e6c84a; } .per-p4 { border-left: 5px solid #5cb85c; }
.per-legende { display: flex; gap: .5rem; flex-wrap: wrap; margin: .5rem 0 1rem; }
.per-legende span { padding: .2rem .6rem; border-radius: 999px; font-size: .9rem; }
.per-table tbody tr.per-perime td, .per-legende .per-perime { background: #f8d4d4; }
.per-table tbody tr.per-proche td, .per-legende .per-proche { background: #fde2bf; }
.per-table tbody tr.per-bientot td, .per-legende .per-bientot { background: #fbf1b9; }
.per-table tbody tr.per-ok td, .per-legende .per-ok { background: #d8efd3; }
.nz-texte { white-space: pre-wrap; font-family: ui-monospace, Consolas, monospace; font-size: .88rem; }
@media print {
  tr.per-perime td, tr.per-proche td, tr.per-bientot td, tr.per-ok td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Choix rapide d'un client dans le ruban (onglet Clients) */
.ruban-combo { display: flex; flex-direction: column; justify-content: center; gap: .25rem; padding: .25rem .3rem; width: 10rem; }
.ruban-combo-libelle { display: flex; align-items: center; gap: .4rem; font-size: .78rem; font-weight: 600; }
.ruban-combo-libelle .ico { width: 1.15rem; height: 1.15rem; }
.ruban-combo-champ { display: flex; border: 1px solid var(--bord); border-radius: 4px; background: var(--surface); }
.ruban-combo-champ:focus-within { border-color: var(--bleu); box-shadow: 0 0 0 2px var(--accent-survol-bord); }
.ruban-combo-champ input { flex: 1; min-width: 0; border: 0; padding: .3rem .45rem; font: inherit; font-size: .82rem; background: transparent; outline: none; }
.ruban-combo-ouvrir { border: 0; border-left: 1px solid var(--bord); background: #f3f6fa; padding: 0 .5rem; cursor: pointer; color: var(--discret); font-size: .75rem; }
.ruban-combo-ouvrir:hover { background: var(--accent-survol); }
.ruban-combo-info { font-size: .7rem; color: var(--discret); white-space: nowrap; }
.ruban-combo-liste {
  position: fixed; z-index: 50; max-width: 26rem; max-height: 60vh; overflow-y: auto; margin: 0; padding: .25rem 0; list-style: none;
  background: var(--surface); border: 1px solid var(--bord); border-radius: 6px; box-shadow: 0 10px 24px rgba(16, 24, 40, .18);
}
.ruban-combo-liste [role=option] { padding: .35rem .75rem; font-size: .86rem; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ruban-combo-liste [role=option]:hover, .ruban-combo-liste [aria-selected=true] { background: var(--accent-choisi); }
.ruban-combo-note { padding: .35rem .75rem; font-size: .75rem; color: var(--discret); border-top: 1px solid #edf0f5; }

/* Appareils fixés par le vendeur (0.36.0) */
.carte-appareil { max-width: 460px; }
.appareil-bloc { border-top: 1px solid var(--bord); margin-top: 1rem; padding-top: .9rem; }
.appareil-bloc h2 { font-size: 1rem; margin: 0 0 .6rem; }
.appareil-code { font-family: ui-monospace, Consolas, monospace; font-size: 1.25rem; letter-spacing: .12em; text-transform: uppercase; }
body:has(.vendeur-haut) .page-seule { place-items: start center; align-content: start; }
body:has(.vendeur-haut) .page-seule > * { width: 100%; max-width: 1200px; box-sizing: border-box; }
.vendeur-haut { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.vendeur-haut h1 { margin: 0; font-size: 1.4rem; }
.vendeur-haut h1 a { color: inherit; text-decoration: none; }
.vendeur-carte { max-width: 720px; margin: 0 auto; }
.vendeur-code { background: #f3f6fa; border: 1px solid var(--bord); border-radius: 6px; padding: .7rem .9rem; overflow-x: auto; font-size: .85rem; white-space: pre; }
.vendeur-form { display: grid; gap: .75rem; max-width: 360px; }
.vendeur-actif { background: var(--vert); color: var(--vert-texte); }
.vendeur-attente { color: #b45309; }
.vendeur-ligne { margin: 0; }
.vendeur-ligne input { width: 100%; min-width: 11rem; padding: .3rem .45rem; border: 1px solid var(--bord); border-radius: 4px; font: inherit; }
.vendeur-nouveau-code { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; padding: .9rem 1.1rem; margin-bottom: 1rem;
  background: #fff8e1; border: 1px solid #f3d6a4; border-radius: var(--rayon); }
.vendeur-nouveau-code strong { font-family: ui-monospace, Consolas, monospace; font-size: 1.6rem; letter-spacing: .15em; }
.vendeur-lien { display: inline-flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.vendeur-lien code { background: #f3f6fa; border: 1px solid var(--bord); border-radius: 4px; padding: .2rem .45rem; font-size: .85rem; }
.vendeur-suspendu { background: var(--rouge); color: var(--rouge-texte); }
.vendeur-carte-suspendue { border-color: #f1c9c9; background: #fff8f8; }
.rapport-table td.rapport-date { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Statistiques des ventes (0.38.2) */
.sv-table tfoot th { background: var(--accent-pale); font-weight: 700; }
.sv-classe { display: inline-block; min-width: 1.6rem; text-align: center; border-radius: 4px; font-weight: 700; padding: .05rem .35rem; }
.sv-a { background: #d8efd3; color: #22612a; } .sv-b { background: #fbf1b9; color: #7a5b00; } .sv-c { background: #f1f3f6; color: #5c6b7a; }
.sv-resume { display: flex; flex-wrap: wrap; gap: .6rem; margin: .5rem 0 1rem; }
.sv-case { border: 1px solid var(--bord); border-radius: var(--rayon); padding: .45rem .8rem; background: var(--surface); }
.sv-marque { font-size: 1.05rem; margin: 1.4rem 0 .4rem; }
@media print { .sv-classe { -webkit-print-color-adjust: exact; print-color-adjust: exact; } .sv-marque { break-after: avoid; } }
.sv-table { font-size: .84rem; }
.sv-table th, .sv-table td { padding: .32rem .45rem; }
.sv-table td:first-child { min-width: 11rem; }
.sv-table td.num:first-child, .sv-table th.num:first-child { min-width: 0; width: 3.5rem; }
@media screen { .impr-feuille:has(.sv-table) { overflow-x: auto; } body:has(.sv-table) main.page { max-width: 1500px; } }

/* Tournées de livraison (0.39.0) */
body:has(.trn-table) main.page, body:has(.trn-feuille) main.page { max-width: 1560px; }
.trn-entete { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: .6rem .9rem; }
.trn-entete label { display: flex; flex-direction: column; gap: .25rem; font-weight: 600; font-size: .85rem; }
.trn-entete input, .trn-entete select { padding: .45rem .55rem; border: 1px solid var(--bord); border-radius: 6px; font: inherit; font-weight: 400; }
.trn-entete .trn-obs { grid-column: span 2; }
.trn-actions { margin: .6rem 0; }
.trn-cadre { overflow-x: auto; }
.trn-table { font-size: .84rem; }
.trn-table th, .trn-table td { padding: .3rem .35rem; vertical-align: middle; }
.trn-table input, .trn-table select { font: inherit; padding: .25rem .3rem; border: 1px solid var(--bord); border-radius: 4px; background: var(--surface); }
.trn-table .trn-ordre { width: 3.6rem; text-align: right; }
.trn-table .trn-montant { width: 6.5rem; text-align: right; }
.trn-table .trn-facture { width: 8rem; }
.trn-table .trn-obs-ligne { width: 11rem; }
.trn-table td.trn-client { min-width: 11rem; }
.trn-table tfoot th { background: var(--accent-pale); }
.trn-ecart { color: #c2410c; font-weight: 700; }
.trn-statut { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .82rem; background: var(--accent-pale); }
.trn-statut-1 { background: #fff4e0; color: #7a4a00; } .trn-statut-2 { background: var(--vert); color: var(--vert-texte); } .trn-statut-3 { background: var(--rouge); color: var(--rouge-texte); }
.trn-ajouts { display: flex; flex-wrap: wrap; gap: .8rem; align-items: flex-start; margin: 1rem 0; }
.trn-ajouts details { margin: 0; padding: .5rem .8rem; }
.trn-ajouts summary { cursor: pointer; font-weight: 600; }
.trn-feuille-entete { display: flex; flex-wrap: wrap; gap: .3rem 1.6rem; margin: 0 0 .8rem; }
.trn-table-impr { font-size: .8rem; }
.trn-table-impr td.trn-case { min-width: 5rem; }
@page paysage { size: A4 landscape; margin: 10mm; }
@media print { .trn-feuille { page: paysage; } }
.trn-table select[data-etat] { min-width: 9.5rem; }
.trn-table input[type=time] { width: 6.6rem; }
.trn-table input[type=date] { width: 8.6rem; }

/* ---------- Édition livraison (frmEditionbis) */
.liv-groupes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .8rem; }
.liv-groupes > .liv-groupe { display: flex; flex-direction: column; gap: .45rem; margin: 0; }
.liv-groupe h2 { margin: 0 0 .2rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: #1e3a5f; border-bottom: 1px solid var(--bord); padding-bottom: .25rem; }
.liv-groupe label, .liv-obs, .liv-etats-form label { display: flex; flex-direction: column; gap: .2rem; font-weight: 600; font-size: .85rem; }
.liv-groupe input, .liv-groupe select, .liv-obs textarea, .liv-etats-form textarea { padding: .4rem .5rem; border: 1px solid var(--bord); border-radius: 6px; font: inherit; font-weight: 400; }
.liv-obs { margin: .8rem 0 0; }
.liv-etats-form textarea { min-height: 14rem; font-size: 1rem; }
.liv-l { display: flex; justify-content: space-between; gap: .8rem; font-size: .9rem; }
.liv-l > span { color: #6b7280; white-space: nowrap; }
.liv-l > b { text-align: right; }
.liv-actions { margin: .7rem 0; align-items: center; }
.liv-table td, .liv-table th { vertical-align: middle; }
.liv-table input, .liv-table select { font: inherit; padding: .25rem .3rem; border: 1px solid var(--bord); border-radius: 4px; background: var(--surface); }
.liv-table select { min-width: 13rem; }
.liv-txt-ok { color: #166534; font-weight: 700; }
.liv-txt-ko { color: #b42318; font-weight: 700; }
.liv-badge { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 700; background: #e0e7ff; color: #1e3a8a; }
.liv-badge.liv-ok { background: #dcfce7; color: #166534; } .liv-badge.liv-ko { background: #fee2e2; color: #991b1b; }
/* couleurs par état (mêmes teintes que les statistiques du logiciel) */
table tbody tr.liv-livree td, table tbody tr.liv-livree:nth-child(even) td, .liv-badge.liv-livree { background: #a9d08e; color: #000; }
table tbody tr.liv-non td, table tbody tr.liv-non:nth-child(even) td, .liv-badge.liv-non { background: #ffc7ce; color: #000; }
table tbody tr.liv-deja td, table tbody tr.liv-deja:nth-child(even) td, .liv-badge.liv-deja { background: #c6efce; color: #000; }
table tbody tr.liv-prep td, table tbody tr.liv-prep:nth-child(even) td, .liv-badge.liv-prep { background: #fff2cc; color: #000; }
table tbody tr.liv-attente td, table tbody tr.liv-attente:nth-child(even) td, .liv-badge.liv-attente { background: #ffd966; color: #000; }
table tbody tr.liv-transport td, table tbody tr.liv-transport:nth-child(even) td, .liv-badge.liv-transport { background: #bdd7ee; color: #000; }
table tbody tr.liv-ecom td, table tbody tr.liv-ecom:nth-child(even) td, .liv-badge.liv-ecom { background: #e1ccf0; color: #000; }
.liv-table-stats { font-size: .8rem; }
.liv-table-stats tbody tr.liv-groupe-ligne td, .liv-table-stats tbody tr.liv-groupe-ligne:nth-child(even) td { background: #e5e7eb; font-weight: 700; }
.liv-lien-bon { color: #005ac8; font-weight: 700; text-decoration: underline; }
body:has(.liv-table-stats) main.page { max-width: 1560px; }
/* bon de livraison A4 */
.liv-bon { font-size: .82rem; color: #1f2937; }
.liv-bon-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; border-bottom: 3px solid #1e3a5f; padding-bottom: .6rem; margin-bottom: .9rem; }
.liv-bon-societe { display: flex; gap: .7rem; align-items: center; }
.liv-bon-logo { max-height: 60px; max-width: 160px; }
.liv-bon-num { display: flex; flex-direction: column; align-items: flex-end; gap: .1rem; }
.liv-bon-num h1 { margin: 0 0 .2rem; font-size: 1.4rem; letter-spacing: .05em; color: #1e3a5f; }
.liv-bon-num b { font-size: 1.1rem; color: #1e3a5f; }
.liv-bon-num span { color: #6b7280; }
.liv-bon-cartes, .liv-bon-bas { display: flex; gap: .8rem; margin-bottom: .9rem; align-items: flex-start; }
.liv-bon-carte { flex: 1; border: 1px solid #d6dce5; border-radius: 6px; padding: .5rem .65rem; }
.liv-bon-carte h2, .liv-bon-obs-titre { font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: #1e3a5f; margin: 0 0 .35rem; border-bottom: 1px solid #e5e7eb; padding-bottom: .2rem; }
.liv-bon-obs-titre { margin-top: .6rem; }
.liv-bon-obs { white-space: pre-wrap; }
.liv-bon-table { margin-bottom: .9rem; }
.liv-bon-totaux { width: 18rem; border: 1px solid #d6dce5; border-radius: 6px; overflow: hidden; }
.liv-bon-totaux .liv-l { padding: .3rem .6rem; border-bottom: 1px solid #eef0f3; }
.liv-bon-totaux .liv-reste { background: #1e3a5f; font-size: 1rem; border-bottom: 0; }
.liv-bon-totaux .liv-reste span, .liv-bon-totaux .liv-reste b { color: #fff; }
.liv-signatures { display: flex; gap: .8rem; margin-top: 1.4rem; }
.liv-signatures div { flex: 1; border: 1px dashed #9ca3af; border-radius: 6px; height: 70px; padding: .35rem .5rem; font-weight: 700; color: #374151; }
@media print { .liv-bon * { -webkit-print-color-adjust: exact; print-color-adjust: exact; } tr.liv-livree td, tr.liv-non td, tr.liv-deja td, tr.liv-prep td, tr.liv-attente td, tr.liv-transport td, tr.liv-ecom td { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* ---------- États Déclaration / Consommation */
.ef-menus { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }
.ef-menus > .carte { margin: 0; }
.ef-menus ul { margin: .4rem 0 0; padding-left: 1.2rem; line-height: 1.9; }
.ef-cadre { overflow-x: auto; }
.ef-table { font-size: .8rem; }
.ef-table th.ef-groupe { text-align: center; }
.ef-feuille[dir="rtl"] .num { text-align: left; }
.ef-feuille[dir="rtl"] .impr-table th { text-align: right; }
.ef-resume { margin: .8rem 0 0 auto; width: 22rem; max-width: 100%; border: 1px solid var(--bord); border-radius: 6px; padding: .4rem .7rem; }
.ef-feuille[dir="rtl"] .ef-resume { margin: .8rem auto 0 0; }
body:has(.ef-table) main.page { max-width: 1560px; }
@media print { .ef-cadre { overflow: visible; } }

/* ---------- Ordonner la facture : entêtes cliquables */
.th-tri { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: inherit; cursor: pointer; text-decoration: underline dotted; }
.th-tri:hover { color: #1f6feb; }
.ordonner-confirmer { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }

/* ---------- Divers (onglet Ventes) */
.dv-form { display: flex; flex-direction: column; gap: .7rem; max-width: 46rem; }
.dv-form label { display: flex; flex-direction: column; gap: .25rem; font-weight: 600; }
.dv-form input, .dv-form textarea { padding: .45rem .55rem; border: 1px solid var(--bord); border-radius: 6px; font: inherit; font-weight: 400; }
.dv-nouveau { font-size: 1.2rem; color: #1e3a5f; }
.dv-total { margin: .7rem 0; align-items: center; }
.champ-court { width: 7rem; }
.bilan-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.bilan-grille > .carte { margin: 0; }
.bilan-grille h2 { margin: 0 0 .5rem; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: #1e3a5f; }
.bilan-grille .liv-l { padding: .2rem 0; border-bottom: 1px dashed #e5e7eb; }
.commentaire-bon { white-space: pre-wrap; margin: .6rem 0 0; font-size: .85em; text-align: center; }
.grille-masquee { display: none !important; }
.grille-menu-titre { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: #6b7280; padding: .35rem .7rem .2rem; }
.grille-menu-case { display: flex; align-items: center; gap: .4rem; padding: .2rem .7rem; font-size: .88rem; cursor: pointer; white-space: nowrap; }
.grille-menu-case:hover { background: var(--accent-pale); }
.grille-menu { max-height: 70vh; overflow-y: auto; }

/* ---------- Lettres aux clients */
.ci-lettre { margin-bottom: 1.5rem; }
.ci-destinataire { margin: 1.2rem 0 1.4rem auto; width: 18rem; max-width: 100%; border: 1px solid var(--bord); border-radius: 6px; padding: .6rem .8rem; }
.ci-corps { white-space: pre-wrap; font-size: 1rem; line-height: 1.7; margin-top: 1rem; min-height: 14rem; }
@media print { .ci-lettre { break-after: page; margin: 0; } .ci-lettre:last-of-type { break-after: auto; } }
/* ---------- Statistiques clients */
.sc-vues { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 .9rem; }
.sc-vues a { padding: .3rem .7rem; border: 1px solid var(--bord); border-radius: 999px; font-size: .85rem; text-decoration: none; background: var(--surface); }
.sc-vues a.actif { background: #1e3a8a; border-color: #1e3a8a; color: #fff; }
.impr-table tbody tr.sc-alerte td, .impr-table tbody tr.sc-alerte:nth-child(even) td { background: #fdecea; }
.sc-bases { max-width: 40rem; }
/* ---------- Choix rapide du fournisseur (facture d'achat) ou du client (facture de vente) */
.resume .facture-combo { width: 20rem; max-width: 100%; margin-left: auto; padding: 0; }
.facture-combo-seul { justify-content: flex-end; }
.resume .facture-combo .ruban-combo-champ { flex-direction: row; }
.resume .facture-combo .ruban-combo-libelle { flex-direction: row; }
.resume .facture-combo .ruban-combo-libelle span { font-size: .78rem; color: inherit; text-transform: none; letter-spacing: 0; }
.resume .facture-combo .ruban-combo-champ input { font-size: .95rem; padding: .4rem .55rem; }
@media print { .facture-combo { display: none !important; } }
/* ---------- Facture d'achat : ligne choisie (commandes « article sélectionné » du menu Codes-barres) */
.tableau-achat tbody tr[data-id] { cursor: pointer; }
.tableau-achat tbody tr.choisie td, .tableau-achat tbody tr.choisie:nth-child(even) td { background: var(--accent-choisi); }
.achat-aide-ligne { margin: -.3rem 0 .4rem; }
.etiq-sans-code { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.achat-aligner { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.achat-aligner-liste { flex-basis: 100%; margin: .2rem 0 0; padding-left: 1.2rem; font-size: .88rem; columns: 2 22rem; }
/* ---------- Fiche d'un nouveau fournisseur */
.fo-fiche { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .7rem 1rem; max-width: 62rem; }
.fo-fiche label { display: flex; flex-direction: column; gap: .25rem; }
.fo-fiche .fo-large { grid-column: 1 / -1; }
/* ---------- Compte du fournisseur et opérations */
.fo-resume { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.fo-resume .fo-info { font-size: .95rem; font-weight: 600; }
.fo-actions { white-space: nowrap; }
.fo-actions a + a { margin-left: .5rem; }
.fo-entete-op { display: flex; flex-wrap: wrap; gap: 1.5rem; }

/* ---------- onglet Caisse (caisse.php, caisse_operation.php, caisse_gestion.php) */
.ca-barre { align-items: flex-end; }
.ca-barre .ca-court { width: 6.5rem; }
.ca-tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr)); gap: .6rem; margin: .4rem 0 1rem; }
.ca-tuile { display: flex; flex-direction: column; gap: .15rem; padding: .6rem .8rem; background: var(--surface); border: 1px solid var(--bordure, #d9dee7); border-left: 5px solid var(--ca-accent); border-radius: 6px; min-width: 0; }
.ca-tuile span { font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #616161; }
.ca-tuile strong { font-size: 1.35rem; color: var(--ca-accent); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ca-tuile small { font-size: .78rem; color: #616161; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ca-bleu { --ca-accent: #1565c0; background: #e8f0fe; } .ca-vert { --ca-accent: #2e7d32; } .ca-rouge { --ca-accent: #c62828; }
.ca-orange { --ca-accent: #e66c00; } .ca-ardoise { --ca-accent: #455a64; } .ca-brun { --ca-accent: #795548; }
.ca-tuile strong.ca-neg, .ca-neg { color: #c62828; } .ca-tuile strong.ca-pos, .ca-pos { color: #2e7d32; }
.ca-periode { align-items: flex-end; }
.ca-note { margin: .4rem 0 .8rem; }
.ca-titre { align-items: baseline; flex-wrap: wrap; gap: .3rem 1rem; }
.ca-titre h2 { margin: 0; }
.ca-statut { font-size: .9rem; color: #424242; }
.ca-table td { vertical-align: top; }
.ca-intitule small { display: block; font-size: .78rem; color: #616161; max-width: 22rem; white-space: normal; }
.ca-op { display: inline-block; padding: .05rem .4rem; border-radius: 4px; font-weight: 700; font-size: .82rem; white-space: nowrap; }
.ca-op-credit { background: #e8f5e9; color: #2e7d32; } .ca-op-debit { background: #ffebee; color: #c62828; }
.ca-etat { display: inline-block; padding: .05rem .4rem; border-radius: 4px; font-weight: 700; font-size: .82rem; background: #eceff1; color: #455a64; }
.ca-etat-charge { background: #ffecd9; color: #e66c00; } .ca-etat-modifier { background: #e8f5e9; color: #2e7d32; }
.ca-etat-balance { background: #e3f2fd; color: #1565c0; } .ca-etat-pret, .ca-etat-emprunt { background: #f3e5f5; color: #6a1b9a; }
.ca-etat-don { background: #fce4ec; color: #d81b60; }
.ca-clos { text-align: center; }
.ca-types { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .8rem; }
.ca-type { padding: .35rem .8rem; border: 1px solid #cfd8dc; border-radius: 6px; text-decoration: none; color: #37474f; background: var(--surface); font-weight: 600; }
.ca-type.actif { color: #fff; }
.ca-type-credit.actif { background: #2e7d32; border-color: #2e7d32; } .ca-type-debit.actif { background: #c62828; border-color: #c62828; }
.ca-type-transfert.actif { background: #1565c0; border-color: #1565c0; } .ca-type-charge.actif { background: #c87800; border-color: #c87800; }
.ca-type-pret.actif { background: #643ca0; border-color: #643ca0; } .ca-type-don.actif { background: #c83c78; border-color: #c83c78; }
.ca-type-emprunt.actif { background: #3c8282; border-color: #3c8282; }
.ca-montant { font-size: 1.15rem; font-weight: 700; text-align: right; }
.ca-montant-credit { color: #2e7d32; } .ca-montant-debit { color: #c62828; }
.ca-reglement { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; border: 0; padding: 0; margin: 0; }
.ca-reglement legend { font-weight: 600; margin-bottom: .2rem; }
.ca-reglement label.case { margin: 0; }
.ca-ligne { margin-bottom: .8rem; }
.fo-fiche .ca-reglement label.case, .fo-fiche label.case { flex-direction: row; align-items: center; gap: .4rem; }

/* ---------- onglet Arrivage (arrivage.php, arrivage_saisie.php, arrivage_diffuser.php) */
.ar-barre { align-items: flex-end; }
.ar-barre input[type=search] { min-width: 22rem; }
.ar-nav { display: flex; gap: .3rem; }
.ar-nav .inactif { opacity: .4; pointer-events: none; }
.ar-titre { align-items: center; flex-wrap: wrap; gap: .4rem 1rem; margin: .6rem 0; }
.ar-titre h1 { margin: 0; }
.ar-statut { color: #424242; }
.ar-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-left: auto; }
.ar-date { display: flex; align-items: center; gap: .4rem; font-weight: 600; }
.ar-confirmer { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.ar-grille input { width: 100%; min-width: 0; padding: .25rem .4rem; border: 1px solid #cfd8dc; border-radius: 4px; font: inherit; background: var(--surface); }
.ar-grille .ar-des { min-width: 16rem; } .ar-grille .ar-ref { min-width: 9rem; } .ar-grille .ar-marque { min-width: 7rem; }
.ar-grille .ar-nombre { width: 7rem; text-align: right; }
.ar-grille tr.ar-focus td { background: #fff8e1; }
.ar-grille .lien-bouton { border: 0; background: none; color: #c62828; font-weight: 700; cursor: pointer; padding: .2rem .4rem; }
.ar-stock, .ar-imports { margin-top: 1rem; }
.ar-stock .tableau-cadre { max-height: 26rem; overflow: auto; }
.ar-libre { margin-top: .6rem; align-items: flex-end; }
.ar-imports-grille { display: grid; gap: .6rem; }
.ar-imports-grille form { align-items: flex-end; padding: .5rem 0; border-top: 1px solid #eceff1; }
.ar-diffusion { display: grid; grid-template-columns: minmax(20rem, 1fr) minmax(24rem, 1.3fr); gap: 1rem; align-items: start; }
@media (max-width: 1000px) { .ar-diffusion { grid-template-columns: 1fr; } }
.ar-clients { max-height: 22rem; overflow: auto; margin: .5rem 0; }
.ar-large { display: flex; flex-direction: column; gap: .2rem; margin: .4rem 0; font-weight: 600; }
.ar-large input, .ar-large textarea, #envoi textarea { width: 100%; font: inherit; padding: .35rem .5rem; border: 1px solid #cfd8dc; border-radius: 4px; }
.ar-diffusion > .carte { margin-top: 0; }
.vente-haut .ar-imports { margin-top: 0; }
.vente-haut .ar-imports form { align-items: flex-end; padding: .35rem 0; border-top: 1px solid #eceff1; flex-wrap: wrap; }
.vente-haut .ar-imports form:first-of-type { border-top: 0; }
.vente-haut .ar-imports select[name=numero] { max-width: 22rem; }
.vente-haut.ar-haut { grid-template-columns: 280px minmax(0, 1fr); }
@media (max-width: 1000px) { .vente-haut.ar-haut { grid-template-columns: 1fr; } }
.vente-haut.ar-haut .carte { margin-top: 0; }
/* saisie (vente, achat, arrivage) : remplacer l'article d'une ligne */
.actions-ligne { white-space: nowrap; }
.lien-remplacer { border: 0; background: transparent; color: var(--bleu); font-size: 1rem; cursor: pointer; padding: .2rem .4rem; border-radius: 4px; }
.lien-remplacer:hover { background: #e3eefb; }
.tableau-saisie tr.ligne-remplacee td { background: #e3eefb; box-shadow: inset 0 2px 0 var(--accent-choisi-bord), inset 0 -2px 0 var(--accent-choisi-bord); }
.tableau-saisie tr.mode-remplacement td { background: #fff4d6; }
.tableau-saisie tr.mode-remplacement #saisie-article { border-color: #e0a100; }

/* ---------- réglages du dossier (reglages.php) */
.rg-groupe { margin-bottom: 1rem; }
.rg-ligne { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: .5rem 1.5rem; align-items: center; padding: .6rem 0; border-top: 1px solid #eceff1; }
.rg-ligne:first-of-type { border-top: 0; }
.rg-ligne label small { display: block; font-weight: normal; color: #616161; margin-top: .2rem; max-width: 52rem; }
.rg-ligne select, .rg-ligne input { width: 100%; font: inherit; padding: .4rem .5rem; border: 1px solid #cfd8dc; border-radius: 4px; }
@media (max-width: 900px) { .rg-ligne { grid-template-columns: 1fr; } }

/* entête : mot de passe d'application (écriture seule) */
.mdp-champ { display: flex; gap: .35rem; align-items: stretch; }
.mdp-champ input { flex: 1 1 auto; min-width: 0; }
.mdp-oeil { border: 1px solid var(--bord); background: var(--surface); border-radius: var(--rayon); padding: 0 .55rem; cursor: pointer; }
.mdp-etat { display: flex; flex-direction: column; justify-content: flex-end; gap: .35rem; padding-bottom: .3rem; }
.mdp-badge { display: inline-block; align-self: flex-start; padding: .15rem .6rem; border-radius: 999px; background: #eef2f7; color: #4a5568; font-size: .82rem; font-weight: 600; }
.mdp-badge.mdp-vert { background: #dcf3e3; color: #1d6b39; }
.mdp-badge.mdp-rouge { background: #fde2e2; color: #9b1c1c; }

/* serveurs SMTP */
.smtp-table td.smtp-actif { font-weight: 700; color: #1d6b39; }
.smtp-ajout { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; }
.smtp-ajout label { flex: 1 1 180px; margin: 0; }
.smtp-ajout label.court { flex: 0 1 110px; }
.smtp-boutons { display: flex; gap: .4rem; justify-content: flex-end; margin: 0; }

/* envoi par e-mail (assets/email.js) */
.email-dialogue { border: 0; border-radius: 10px; padding: 0; width: min(560px, 94vw); overflow: auto; box-shadow: 0 12px 40px rgba(15,23,42,.35); color: #1d2433; font: 14px/1.45 "Segoe UI", Roboto, Arial, sans-serif; }
.email-dialogue::backdrop { background: rgba(15,23,42,.45); }
.email-form { padding: 1.1rem 1.25rem 1rem; display: flex; flex-direction: column; gap: .6rem; }
.email-form h2 { margin: 0 0 .2rem; font-size: 1.15rem; }
.email-ligne { display: flex; flex-direction: column; gap: .2rem; font-weight: 600; font-size: .9rem; }
.email-ligne input, .email-ligne textarea { font: inherit; font-weight: 400; padding: .45rem .55rem; border: 1px solid #c5cfdc; border-radius: 6px; width: 100%; box-sizing: border-box; }
.email-ligne textarea { resize: vertical; }
.email-case { font-size: .88rem; display: flex; align-items: center; gap: .35rem; }
.email-etat { margin: .2rem 0 0; min-height: 1.3em; font-size: .9rem; color: #4a5568; }
.email-etat.email-erreur { color: #9b1c1c; font-weight: 600; }
.email-etat.email-succes { color: #1d6b39; font-weight: 600; }
.email-actions { display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; }
.email-actions button { font: inherit; padding: .5rem 1.1rem; border-radius: 6px; border: 1px solid #1e3a5f; cursor: pointer; }
.email-envoyer { background: #1e3a5f; color: #fff; }
.email-envoyer:disabled { opacity: .55; cursor: wait; }
.email-annuler { background: var(--surface); color: #1e3a5f; }
@media print { .gsa-email-bouton, .email-dialogue { display: none !important; } }
.email-tous { align-self: flex-start; font: inherit; font-size: .85rem; padding: .3rem .7rem; border: 1px dashed #1e3a5f; border-radius: 6px; background: #f4f8fd; color: #1e3a5f; cursor: pointer; }
.email-dialogue label { margin: 0; }
.email-actions .email-lien { display: inline-flex; align-items: center; font: inherit; padding: .5rem 1.1rem; border-radius: 6px; border: 1px solid #1e3a5f; background: #1e3a5f; color: #fff; text-decoration: none; cursor: pointer; }
.email-actions .email-lien.email-lien-sec { background: var(--surface); color: #1e3a5f; }
.email-actions [hidden] { display: none !important; }
.gsa-whatsapp { color: #12804a !important; border-color: #12804a !important; }
.gsa-viber { color: #6b3fa8 !important; border-color: #6b3fa8 !important; }
@media print { .gsa-partage-bouton { display: none !important; } }

/* ===== Accueil : bandeau « entrepôt » (rayonnages qui se remplissent au chargement) + modules par famille ===== */
.page:has(.acc-hero) { max-width: 1240px; }
.acc-hero {
  --nuit: #0c2748; --kraft: #c9965e; --kraft-ombre: #9f733f; --trait: rgba(160, 196, 238, .38);
  position: relative; overflow: hidden; isolation: isolate;
  min-height: 300px; padding: 2.4rem 2.6rem 2.2rem; margin: 0 0 2.2rem;
  border-radius: 18px; color: #fff;
  background:
    radial-gradient(120% 140% at 100% 0%, #1d5aa3 0%, rgba(29, 90, 163, 0) 55%),
    linear-gradient(160deg, #123a68 0%, var(--nuit) 70%);
  box-shadow: 0 18px 40px -22px rgba(12, 39, 72, .75);
}
.acc-rayon { position: absolute; right: -10px; bottom: 0; width: min(54%, 660px); height: 100%; z-index: -1; }
.acc-hero::after {   /* fondu pour garder le texte lisible devant les rayonnages */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, var(--nuit) 0%, rgba(12, 39, 72, .92) 42%, rgba(12, 39, 72, .2) 68%, rgba(12, 39, 72, 0) 100%);
}
.ray-ligne { fill: none; stroke: var(--trait); stroke-width: 2.2; stroke-linecap: round; }
.ray-sol { stroke-width: 1.2; }
.ray-boite { fill: var(--kraft); stroke: var(--kraft-ombre); stroke-width: 1; }
.ray-scotch { stroke: #e7c99a; stroke-width: 3; }
.ray-etiq { fill: #fdfaf4; }
.ray-code { stroke: #23303f; stroke-width: 1.1; }
.ray-carton:nth-child(3n) .ray-boite { fill: #bf8a51; }
.ray-carton:nth-child(4n+1) .ray-boite { fill: #d3a46d; }

.acc-texte { position: relative; max-width: 37rem; }
.acc-date { margin: 0 0 .35rem; color: #a9c6ea; font-size: .95rem; }
.acc-salut { margin: 0; font-size: clamp(2rem, 4.2vw, 3.1rem); line-height: 1.05; font-weight: 700; letter-spacing: -.025em; }
.acc-nom { color: #f3d3a5; }
.acc-lieu { display: flex; flex-wrap: wrap; gap: .45rem; margin: .9rem 0 0; }
.acc-pastille { padding: .22rem .7rem; border-radius: 999px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); font-size: .85rem; color: #dbe8f8; }
.acc-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.6rem; }
.acc-action {
  display: inline-flex; align-items: center; gap: .5rem; padding: .62rem 1rem .62rem .8rem;
  border-radius: 10px; color: #fff; text-decoration: none; font-weight: 600; font-size: .95rem;
  background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .2);
  backdrop-filter: blur(6px); transition: background .15s, transform .15s, border-color .15s;
}
.acc-action .ico { width: 1.35rem; height: 1.35rem; stroke: currentColor; }
.acc-action:hover { background: rgba(255, 255, 255, .17); border-color: rgba(255, 255, 255, .38); transform: translateY(-1px); }
.acc-action:focus-visible { outline: 3px solid #f3d3a5; outline-offset: 2px; }
.acc-action.acc-principal { background: var(--kraft); border-color: var(--kraft); color: #2a1a08; }
.acc-action.acc-principal:hover { background: #d6a56d; }

.acc-modules { display: grid; grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); gap: 1.6rem 1.4rem; align-items: start; }
.acc-groupe h2 { margin: 0 0 .5rem; padding-bottom: .45rem; font-size: 1.05rem; color: var(--texte); border-bottom: 2px solid var(--bord); }
.acc-groupe ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .15rem; }
.acc-module { display: flex; align-items: center; gap: .75rem; padding: .55rem .6rem; margin: 0 -.6rem; border-radius: 10px; color: var(--texte); text-decoration: none; transition: background .15s; }
.acc-module .ico { width: 2.3rem; height: 2.3rem; padding: .42rem; border-radius: 10px; background: var(--surface); border: 1px solid var(--bord); transition: transform .2s; }
.acc-module-texte { display: flex; flex-direction: column; min-width: 0; }
.acc-module-texte strong { font-size: .98rem; }
.acc-module-texte small { color: var(--discret); font-size: .83rem; line-height: 1.35; }
.acc-module:hover { background: var(--surface); box-shadow: 0 1px 0 var(--bord); }
.acc-module:hover .ico { transform: scale(1.08) rotate(-4deg); }
.acc-module:focus-visible { outline: 3px solid var(--bleu); outline-offset: 1px; }

/* un seul moment animé : les montants se tracent, puis les cartons se posent étage par étage */
@media (prefers-reduced-motion: no-preference) {
  .ray-ligne { stroke-dasharray: 700; stroke-dashoffset: 700; animation: acc-trace 1.1s cubic-bezier(.3, .7, .3, 1) forwards; }
  .ray-carton { opacity: 0; transform: translateY(-34px); animation: acc-pose .55s cubic-bezier(.2, 1.35, .4, 1) forwards; animation-delay: .7s; }
  .ray-carton.d1 { animation-delay: .76s; } .ray-carton.d2 { animation-delay: .82s; } .ray-carton.d3 { animation-delay: .88s; }
  .ray-carton.d4 { animation-delay: .94s; } .ray-carton.d5 { animation-delay: 1s; } .ray-carton.d6 { animation-delay: 1.06s; }
  .ray-carton.d7 { animation-delay: 1.12s; } .ray-carton.d8 { animation-delay: 1.18s; } .ray-carton.d9 { animation-delay: 1.24s; }
  .ray-carton.d10 { animation-delay: 1.3s; } .ray-carton.d11 { animation-delay: 1.36s; }
  .acc-texte { animation: acc-entree .7s .15s ease-out both; }
}
@keyframes acc-trace { to { stroke-dashoffset: 0; } }
@keyframes acc-pose { 0% { opacity: 0; transform: translateY(-34px); } 60% { opacity: 1; } 100% { opacity: 1; transform: translateY(0); } }
@keyframes acc-entree { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 720px) {
  .acc-hero { padding: 1.6rem 1.3rem 1.5rem; min-height: 0; border-radius: 14px; }
  .acc-rayon { width: 100%; opacity: .35; }
  .acc-hero::after { background: linear-gradient(180deg, rgba(12, 39, 72, .55), var(--nuit)); }
  .acc-action { flex: 1 1 calc(50% - .6rem); justify-content: center; }
}

/* fond choisi par le client (Paramètres › Langue › Fond d'écran) : photo plein cadre, voile pour la lisibilité */
.acc-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.acc-avec-photo::after { background: linear-gradient(90deg, rgba(12, 39, 72, .9) 0%, rgba(12, 39, 72, .72) 45%, rgba(12, 39, 72, .25) 80%, rgba(12, 39, 72, .1) 100%); }
@media (prefers-reduced-motion: no-preference) {
  .acc-photo { animation: acc-zoom 14s ease-out both; }
}
@keyframes acc-zoom { from { transform: scale(1.08); } to { transform: none; } }
@media (max-width: 720px) {
  .acc-avec-photo::after { background: linear-gradient(180deg, rgba(12, 39, 72, .55), rgba(12, 39, 72, .92)); }
}

/* ===== Restauration de la base (administrateur) ===== */
.rs-carte { max-width: 1000px; }
.rs-intro { line-height: 1.55; }
.rs-liste-titre { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: 1rem 0 .4rem; }
.rs-liste-titre h2 { margin: 0; }
.rs-liste-titre form { margin-inline-start: auto; }
.rs-boutons { display: flex; flex-wrap: wrap; gap: .5rem; }
.rs-table td:first-child { width: 2rem; }
.rs-table label { margin: 0; font-weight: normal; cursor: pointer; }
.rs-table tr:has(input:checked) td { background: var(--bleu-clair); }
.rs-confirmer { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .8rem 1.2rem; margin-top: 1rem; padding: .9rem 1rem; border: 1px solid #f3c2c2; border-radius: 10px; background: #fff6f6; }
.rs-confirmer label { display: flex; flex-direction: column; gap: .3rem; margin: 0; }
.rs-confirmer input[name=mot] { text-transform: uppercase; }
.rs-suivi, .rs-maintenance { max-width: 640px; margin: 3rem auto; padding: 1.5rem 1.8rem; background: var(--surface); border: 1px solid var(--bord); border-radius: 14px; box-shadow: 0 10px 30px rgba(12, 39, 72, .08); }
.rs-etapes { list-style: none; margin: 1.2rem 0; padding: 0; counter-reset: rs; }
.rs-etapes li { position: relative; padding: .55rem 0 .55rem 2.4rem; color: var(--discret); counter-increment: rs; }
.rs-etapes li::before { content: counter(rs); position: absolute; left: 0; top: .4rem; width: 1.7rem; height: 1.7rem; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; background: #eef2f7; color: var(--discret); }
.rs-etapes li.fait { color: inherit; }
.rs-etapes li.fait::before { content: "✓"; background: var(--vert); color: var(--vert-texte); }
.rs-etapes li.encours { color: inherit; font-weight: 600; }
.rs-etapes li.encours::before { background: var(--bleu); color: #fff; animation: rs-pulse 1.2s ease-in-out infinite; }
.rs-etapes li.echec::before { content: "✕"; background: #d9534f; color: #fff; }
@keyframes rs-pulse { 50% { box-shadow: 0 0 0 6px rgba(37, 99, 235, .18); } }
@media (prefers-reduced-motion: reduce) { .rs-etapes li.encours::before { animation: none; } }
[dir="rtl"] .rs-etapes li { padding: .55rem 2.4rem .55rem 0; }
[dir="rtl"] .rs-etapes li::before { left: auto; right: 0; }
.rs-message { min-height: 1.4em; }

/* ===== Changer de magasin (dossiers d'un même client) ===== */
.barre-changer { font-weight: 600; }
.cm-carte { max-width: 560px; }
.cm-form { display: flex; flex-direction: column; gap: .8rem; }
.cm-magasins { display: flex; flex-direction: column; gap: .5rem; margin: 0; padding: 0; border: 0; }
.cm-magasins legend { margin-bottom: .4rem; font-weight: 600; }
.cm-magasin { display: flex; align-items: center; gap: .7rem; margin: 0; padding: .6rem .8rem; border: 2px solid var(--bord); border-radius: 10px; background: var(--surface); cursor: pointer; font-weight: 600; }
.cm-magasin:has(input:checked) { border-color: var(--bleu); box-shadow: 0 0 0 3px rgba(37, 99, 235, .18); }
.cm-magasin .logo { flex: none; }
.cm-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.cm-actions .bouton { width: auto; }

/* ===== Paramètres › Langue (langue de l'interface, fond d'écran) ===== */
.barre-droite form { display: inline; }
.barre-langues { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: 999px; background: rgba(255, 255, 255, .12); }
.barre .barre-langue { min-width: 2.1em; padding: .15rem .45rem; border-radius: 999px; font-weight: 600; font-size: .85em; text-align: center; text-decoration: none; opacity: .8; }
.barre .barre-langue:hover { opacity: 1; background: rgba(255, 255, 255, .15); }
.barre .barre-langue.actif { opacity: 1; background: var(--surface); color: var(--bleu, #1d5fa8); }
.barre-langue:lang(ar) { font-family: Tahoma, "Segoe UI", "Noto Naskh Arabic", Arial, sans-serif; font-size: .95em; }
.ap-carte { max-width: 980px; }
.ap-carte h2 { margin-top: 0; }
.ap-carte .bouton { width: auto; }
.ap-langues { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.4rem; padding: .7rem 0; border-top: 1px solid var(--bord); }
.ap-titre { flex: 1 0 100%; margin: 0; font-weight: 600; }
.ap-choix { display: inline-flex; align-items: center; gap: .4rem; margin: 0; font-weight: normal; }
.ap-arabe { font-family: Tahoma, "Segoe UI", "Noto Naskh Arabic", Arial, sans-serif; font-size: 1.1em; }
.ap-fonds { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .9rem; margin: .6rem 0 1rem; }
.ap-fond { position: relative; display: flex; flex-direction: column; gap: .35rem; margin: 0; padding: .4rem; border: 2px solid var(--bord); border-radius: 12px; background: var(--surface); cursor: pointer; font-weight: normal; transition: border-color .15s, box-shadow .15s; }
.ap-fond input { position: absolute; opacity: 0; pointer-events: none; }
.ap-fond img, .ap-rayon { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; background: #0c2748; overflow: hidden; }
.ap-rayon { --nuit: #0c2748; --kraft: #c9965e; --kraft-ombre: #9f733f; --trait: rgba(160, 196, 238, .38); }
.ap-rayon .acc-rayon { position: static; width: 100%; height: 100%; }
.ap-nom { font-size: .9rem; text-align: center; }
.ap-fond:hover { border-color: #9cb8dc; }
.ap-fond.ap-actif { border-color: var(--bleu); box-shadow: 0 0 0 3px rgba(37, 99, 235, .18); }
.ap-fond:has(input:focus-visible) { outline: 3px solid var(--bleu); outline-offset: 2px; }
.ap-envoi { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; padding-top: .9rem; margin-top: .6rem; border-top: 1px solid var(--bord); }
.ap-envoi .ap-titre, .ap-envoi .discret { flex: 1 0 100%; margin: 0; }

/* ===== Onglet Commande ===== */
.co-cartes { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .7rem; margin: .4rem 0 1rem; }
.co-carte { display: flex; flex-direction: column; gap: .1rem; padding: .7rem .9rem; background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); }
.co-carte span { font-size: .8rem; color: var(--discret); }
.co-carte strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.co-carte small { color: var(--discret); font-size: .8rem; min-height: 1em; }
.co-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .5rem 1.2rem; margin: 0 0 1rem; padding: .8rem 1rem; }
.co-details div { display: flex; flex-direction: column; }
.co-details dt { font-size: .78rem; color: var(--discret); }
.co-details dd { margin: 0; font-weight: 600; }
.co-vues { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; margin: 0 0 .6rem; }
.co-vues a { padding: .32rem .75rem; border-radius: 999px; border: 1px solid var(--bord); background: var(--surface); color: var(--texte); text-decoration: none; font-size: .88rem; }
.co-vues a.actif { background: var(--bleu); border-color: var(--bleu); color: #fff; }
.co-vues a.co-details-lien { margin-left: auto; border-style: dashed; }
.co-table tr.co-recu td { color: var(--vert-texte); background: #f2faf1; }
.co-action { margin-bottom: 1rem; }
.co-action .filtres { margin: 0; }
.co-entete { margin-bottom: 1rem; }
.co-grille { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.co-import { margin-top: .9rem; border-top: 1px solid var(--bord); padding-top: .6rem; }
.co-import summary { cursor: pointer; font-weight: 600; color: var(--bleu-fonce); padding: .2rem 0; }
.co-import[open] summary { margin-bottom: .6rem; }
.co-calcul { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.4rem; margin-top: .8rem; }
.co-outils { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin: 0 0 .5rem; }
.co-outils .filtres { margin: 0; }
.co-saisie input.saisie { width: 6.5rem; }
.co-saisie input.co-qte { width: 5rem; font-weight: 700; }
.co-saisie input.co-pv { color: var(--vert-texte); font-weight: 700; }
.co-saisie td.co-montant { white-space: nowrap; font-variant-numeric: tabular-nums; }
.co-aide { margin: .3rem 0 1.2rem; }
.co-barre { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: flex-end; }
.co-barre .ar-barre { margin: 0 0 .6rem; }
.co-qte-liste { width: 6rem; font-weight: 700; }
.co-fiche-commandes { margin: .4rem 0 .6rem; }

.rs-confirmer input[hidden] { display: none; }
input.recherche-en-cours { background-image: linear-gradient(90deg, transparent 0, #dbeafe 50%, transparent 100%); background-size: 200% 100%; animation: recherche-defile 1s linear infinite; }
@keyframes recherche-defile { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* Photos des articles : page Stock › Photo, et vignette de l'article sélectionné pendant la saisie d'une vente */
.photos-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; margin: 1rem 0; }
.photos-grille .carte + .carte { margin-top: 0; }
.photo-case { padding: 1rem; display: flex; flex-direction: column; gap: .6rem; }
.photo-cadre { display: flex; align-items: center; justify-content: center; aspect-ratio: 1 / 1; background: #f4f6fa; border: 1px solid var(--bord); border-radius: var(--rayon); overflow: hidden; }
.photo-cadre img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.photo-vide { color: #8a94a6; font-size: .85rem; border-style: dashed; }
.photo-envoi { display: flex; flex-direction: column; gap: .4rem; }
.photo-envoi input[type=file] { max-width: 100%; font-size: .8rem; }
.photo-article { position: fixed; right: 16px; bottom: 16px; z-index: 40; width: 168px; height: 168px; padding: 4px; background: var(--surface); border: 1px solid var(--bord);
  border-radius: var(--rayon); box-shadow: 0 6px 20px rgba(16, 24, 40, .22); display: flex; align-items: center; justify-content: center; }
.photo-article[hidden] { display: none; }
.photo-article img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
@media (max-width: 700px) { .photo-article { width: 104px; height: 104px; right: 8px; bottom: 8px; } }
@media print { .photo-article { display: none; } }
/* Journal de vente : versements isolés mélangés aux factures */
.tableau tr.ligne-versement td { background: #f3faf5; }
.bas-tableau .resume-journal { flex-wrap: wrap; row-gap: .3rem; }
/* Page facture compacte : pleine largeur, espaces réduits ; boutons, choix du client et navigateur sur une seule ligne */
main.page:has(.facture-tete), main.page:has(.client-tete), main.page:has(.achat-tete) { max-width: none; padding: .6rem 1rem 1rem; }
.page:is(:has(.facture-tete), :has(.client-tete), :has(.achat-tete)) .fil { margin-bottom: .2rem; }
.titre-ligne:is(.facture-tete, .client-tete, .achat-tete) { margin-bottom: .4rem; gap: .2rem .8rem; align-items: center; }
.titre-ligne:is(.facture-tete, .client-tete, .achat-tete) h1 { margin: 0; }
.facture-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .6rem; margin-bottom: .55rem; }
.facture-actions .vente-boutons { margin-left: 0; gap: .4rem; flex-wrap: wrap; }
.facture-actions .vente-boutons .bouton { padding: .4rem .75rem; font-size: .92rem; }
:is(.facture-actions, .client-tete, .achat-tete) .facture-combo { display: flex; flex-direction: row; align-items: center; gap: .4rem; width: auto; padding: 0; position: relative; }
:is(.facture-actions, .client-tete, .achat-tete) .facture-combo .ruban-combo-libelle { flex-direction: row; font-size: .78rem; white-space: nowrap; }
:is(.facture-actions, .client-tete, .achat-tete) .facture-combo .ruban-combo-champ { flex-direction: row; width: 12rem; }
:is(.facture-actions, .client-tete, .achat-tete) .facture-combo .ruban-combo-champ input { font-size: .92rem; padding: .32rem .5rem; }
:is(.facture-actions, .client-tete, .achat-tete) .facture-combo .ruban-combo-info { display: none; }
.facture-actions .navigateur { margin-left: auto; }
.page:is(:has(.facture-tete), :has(.achat-tete)) .resume-client { margin-right: .4rem; max-width: 22rem; }
.resume .resume-client small { color: var(--discret); }
.resume .resume-texte strong { font-size: 1rem; font-weight: 600; }
.page:has(.facture-tete) .totaux-haut, .page:has(.client-tete) .resume, .page:has(.achat-tete) .totaux-haut { padding: .65rem 1rem; gap: .3rem 1.5rem; margin-bottom: .6rem; }
.page:has(.facture-tete) .totaux-haut strong, .page:has(.client-tete) .resume strong, .page:has(.achat-tete) .totaux-haut strong { font-size: 1.15rem; }
.page:has(.facture-tete) .totaux-haut .resume-texte strong, .page:has(.client-tete) .resume .resume-texte strong, .page:has(.achat-tete) .totaux-haut .resume-texte strong { font-size: .98rem; }
.page:is(:has(.facture-tete), :has(.client-tete), :has(.achat-tete)) h2.groupe { margin: .2rem 0 .35rem; }
.page:is(:has(.facture-tete), :has(.client-tete), :has(.achat-tete)) .tableau td, .page:is(:has(.facture-tete), :has(.client-tete), :has(.achat-tete)) .tableau th { padding-top: .4rem; padding-bottom: .4rem; }
.titre-ligne.client-tete .actions-titre .bouton { padding: .4rem .75rem; font-size: .92rem; }
.page:has(.client-tete) .filtres { margin-bottom: .5rem; gap: .4rem .6rem; }
@media print { .facture-actions { display: none !important; } }
.titre-ligne .vente-boutons { display: flex; flex-wrap: wrap; gap: .5rem; max-width: 100%; }
@media (max-width: 600px) { .titre-ligne .vente-boutons .bouton { flex: 1 1 calc(50% - .5rem); } }
@media (max-width: 600px) { :is(.facture-actions, .client-tete, .achat-tete) .facture-combo { width: 100%; } :is(.facture-actions, .client-tete, .achat-tete) .facture-combo .ruban-combo-champ { flex: 1; width: auto; min-width: 0; } :is(.facture-actions, .client-tete, .achat-tete) .facture-combo .ruban-combo-champ input { min-width: 0; width: 100%; } }
@media print { :is(.client-tete, .achat-tete) .facture-combo { display: none !important; } }
.tableau[data-journal] tbody tr[data-numero] { cursor: pointer; }
.tableau[data-journal] tbody tr.choisie td { background: var(--accent-choisi); }
.grille-stock:focus-visible { outline: 2px solid var(--bleu); outline-offset: -2px; }
.grille-stock:focus tbody tr.choisie td { background: var(--accent-focus); }
.titre-ligne.achat-tete .navigateur { margin-left: auto; }
.titre-ligne.achat-tete .vente-boutons .bouton { padding: .4rem .75rem; font-size: .92rem; }
:is(.titre-ligne, .facture-actions) .filtre-nav { text-decoration: none; white-space: nowrap; }
:is(.titre-ligne, .facture-actions) .filtre-nav:hover { filter: brightness(.95); }
.titre-ligne.achat-tete .facture-combo .ruban-combo-champ { width: 11.5rem; }
.titre-ligne.achat-tete { column-gap: .6rem; }
/* grille de stock des saisies : tri par clic sur un en-tête */
.grille-stock thead th[data-col] { cursor: pointer; user-select: none; }
.grille-stock thead th[data-col]:hover { text-decoration: underline; }
.grille-stock thead th.grille-tri-asc::after { content: " ▲"; font-size: .7em; }
.grille-stock thead th.grille-tri-desc::after { content: " ▼"; font-size: .7em; }
/* tableaux triables sur la page (mouvement client, mouvement fournisseur) */
.tableau thead th.tri-local { cursor: pointer; user-select: none; }
.tableau thead th.tri-local:hover { text-decoration: underline; }
.tableau thead th.tri-local-asc::after { content: " ▲"; font-size: .7em; }
.tableau thead th.tri-local-desc::after { content: " ▼"; font-size: .7em; }
/* saisie d'achat : rayonnage (enregistré en majuscules dans la fiche de l'article) */
.tableau-achat input.saisie-loc { width: 6rem; text-transform: uppercase; }
/* saisie d'achat : nouvel article absent du stock, saisi dans la grille */
.ligne-nouvelle .bouton-nouvel-article { margin-inline-start: .5rem; padding: .3rem .7rem; font-size: .85rem; white-space: nowrap; }
.ligne-nouvelle-saisie { display: flex; align-items: center; }
.ligne-nouvelle-saisie #saisie-article { flex: 1; min-width: 0; }
.ligne-nouvel-article td { background: #f3f8ff; }
.nouvel-article-champs { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; }
.nouvel-article-champs label { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; }
.nouvel-article-champs input[name="nom"] { width: 18rem; }
.nouvel-article-champs input[name="ref"] { width: 9rem; }
.nouvel-article-champs input[name="qte"] { width: 5rem; }
/* saisies : recherche parmi les articles déjà saisis */
.titre-lignes { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem 1rem; }
.titre-lignes h2.groupe { margin-inline-end: auto; }
.titre-lignes #filtre-lignes { flex: 0 1 28rem; min-width: 14rem; padding: .35rem .6rem; border: 1px solid var(--bordure, #c9d3e2); border-radius: 6px; font: inherit; }
.titre-lignes #filtre-lignes.filtre-sans-resultat { border-color: #d64545; background: #fff5f5; }
.tableau-saisie tr[hidden] { display: none; }
/* divers.php : changer le numéro de la facture (plus petit libre ou numéro choisi) */
.dv-form h3.dv-choix { margin: 1rem 0 .3rem; font-size: 1rem; color: var(--bleu, #1e5aa8); }
/* benefice.php : bénéfice périodique */
.resume-benefice { display: flex; flex-wrap: wrap; gap: .6rem 2rem; }
.resume-benefice > div { display: flex; flex-direction: column; }
.resume-benefice span { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--discret, #6b7385); }
.resume-benefice strong { font-size: 1.25rem; }
.resume-benefice small { color: var(--discret, #6b7385); }
.resume-benefice .negatif, .tableau-benefice td.negatif { color: #c62828; }
.benefice-maj { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin: .3rem 0 .8rem; }
.filtres-rapides { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.filtres-rapides .droite { margin-inline-start: auto; display: inline-flex; gap: .4rem; }
/* facture.php : liste des factures du client affiché */
.factures-client { display: flex; align-items: center; gap: .4rem; }
.factures-client select { font-size: .92rem; padding: .32rem .4rem; width: 8.6rem; font-variant-numeric: tabular-nums; }
.factures-client select option { font-family: inherit; }
@media (max-width: 600px) { .factures-client { width: 100%; } .factures-client select { flex: 1; max-width: none; min-width: 0; } }
@media print { .factures-client { display: none !important; } }
.lecteur-seul { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* rapport.php : détail d'une opération (detail_rapport) */
.rapport-detail { margin-top: .25rem; }
.rapport-detail summary { cursor: pointer; color: var(--bleu); font-size: .85rem; width: max-content; }
.rapport-detail ol { margin: .3rem 0 .1rem; padding-inline-start: 1.6rem; font-size: .88rem; color: #3a4252; }
.rapport-detail li { padding: .08rem 0; font-variant-numeric: tabular-nums; }
.rapport-detail li::marker { color: #8a93a6; }
.case-filtre { display: inline-flex; align-items: center; gap: .35rem; align-self: end; padding-bottom: .5rem; white-space: nowrap; }
@media print { .rapport-detail summary { color: inherit; } .rapport-detail:not([open]) { display: none; } }
/* vente.php : ventes de l'article au client (F7) */
.bouton-histo { margin-inline-start: auto; font-size: .85rem; padding: .3rem .7rem; }
.bouton-histo kbd { font: 600 .72rem/1 inherit; padding: .12rem .3rem; border: 1px solid currentColor; border-radius: 3px; opacity: .75; margin-inline-start: .25rem; }
.histo-dialogue { border: 0; border-radius: 10px; padding: 0; width: min(760px, 95vw); max-height: 86vh; overflow: hidden; box-shadow: 0 12px 40px rgba(15,23,42,.35); }
.histo-dialogue[open] { display: flex; flex-direction: column; }
.histo-dialogue::backdrop { background: rgba(15,23,42,.45); }
.histo-tete { display: flex; align-items: center; justify-content: space-between; padding: .7rem 1rem; background: var(--bleu); color: #fff; }
.histo-tete h2 { margin: 0; font-size: 1.02rem; color: #fff; }
.histo-fermer { background: transparent; border: 0; color: #fff; font-size: 1.1rem; cursor: pointer; padding: .1rem .4rem; }
.histo-corps { padding: .9rem 1rem 1rem; overflow: auto; }
.histo-entete, .histo-resume { display: flex; flex-wrap: wrap; gap: .5rem 1.8rem; margin-bottom: .8rem; }
.histo-entete > div, .histo-resume > div { display: flex; flex-direction: column; }
.histo-entete span, .histo-resume span { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--discret, #6b7385); }
.histo-resume strong { font-size: 1.12rem; font-variant-numeric: tabular-nums; }
.histo-cadre { max-height: 50vh; overflow: auto; }
.histo-courante td { background: #fff7e0; }
/* vente.php : la référence de la grille du stock commande l'article (F11) */
#stock-lignes[data-commander] tr[data-id] > td:nth-child(2):not(:empty) { color: var(--bleu); text-decoration: underline; cursor: pointer; }
#stock-lignes[data-commander] tr.choisie[data-id] > td:nth-child(2):not(:empty) { color: inherit; }
/* factures_supprimees.php */
.tableau-supprimees td.nowrap { white-space: nowrap; }
.tableau-supprimees .actions-ligne form { display: flex; gap: .35rem; justify-content: flex-end; }
/* factures_attente.php : vente en cours à mettre en attente */
.attente-saisie { margin: .4rem 0 1rem; padding: .8rem 1rem; }
.attente-saisie h2 { margin: 0 0 .5rem; font-size: 1rem; }
.attente-saisie p { margin: 0; }
.attente-saisie-active { box-shadow: 0 0 0 2px var(--bleu); }
.attente-form { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
/* proforma.php : actions de la proforma */
.barre-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .2rem 0 1rem; }
.barre-actions form.en-ligne { display: inline; margin: 0; }
/* achats_importer.php : passage d'une liste à l'autre */
.onglets-liste { display: flex; gap: .3rem; flex-wrap: wrap; margin: 0 0 .8rem; border-bottom: 1px solid var(--bord, #d8deea); }
.onglets-liste a { padding: .45rem .9rem; border-radius: 6px 6px 0 0; text-decoration: none; color: inherit; border: 1px solid transparent; border-bottom: 0; margin-bottom: -1px; }
.onglets-liste a.actif { background: var(--surface); border-color: var(--bord, #d8deea); font-weight: 600; color: var(--bleu); }
/* mouvement.php : nom du client cliquable (statistiques du client) */
.lien-client { background: none; border: 0; padding: 0; font: inherit; color: var(--bleu); cursor: pointer; text-align: start; }
.lien-client:hover, .lien-client:focus-visible { text-decoration: underline; }
/* vente.php : suggestions du champ Client (nom, téléphone, e-mail) */
.suggestions-clients { position: absolute; z-index: 40; left: 0; right: 0; top: 100%; margin-top: 2px; max-height: 18rem; overflow: auto; background: var(--surface);
  border: 1px solid var(--bord, #cfd6e4); border-radius: 8px; box-shadow: 0 10px 28px rgba(15,23,42,.18); padding: .25rem; }
.suggestion-client { display: grid; grid-template-columns: 1fr auto; gap: 0 .5rem; padding: .4rem .55rem; border-radius: 5px; cursor: pointer; }
.suggestion-client strong { font-weight: 600; }
.suggestion-client small { grid-column: 1; color: #6b7385; font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggestion-client .par { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: .7rem; color: #1f5fa8; background: var(--accent-pale); border-radius: 4px; padding: .1rem .35rem; }
.suggestion-client:hover, .suggestion-client.actif { background: var(--accent-pale); }
/* facture.php : adresse, téléphone, e-mail du client dans le résumé */
.resume .resume-coord strong { font-size: 1rem; font-weight: 600; max-width: 22rem; overflow-wrap: anywhere; }
.resume .resume-coord a { color: inherit; text-decoration: none; }
.resume .resume-coord a:hover { text-decoration: underline; }
/* mouvement.php : modification d'une vente (Dispatching) */
.tableau .col-modif { width: 2.2rem; text-align: center; padding-left: .2rem; padding-right: .2rem; }
.col-modif .bouton-icone { border: 1px solid transparent; background: none; cursor: pointer; font-size: 1rem; line-height: 1; padding: .2rem .35rem; border-radius: 5px; color: #1f5fa8; }
.col-modif .bouton-icone:hover, .col-modif .bouton-icone:focus-visible { background: var(--accent-pale); border-color: #b9cdea; }
.modif-ligne .histo-entete small { display: block; color: var(--discret); font-size: .8rem; }
.modif-ligne-champs { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: flex-end; margin: .75rem 0; }
.modif-ligne-champs label { display: flex; flex-direction: column; gap: .2rem; font-size: .85rem; color: var(--discret); }
.modif-ligne-champs input { width: 9rem; text-align: right; font-size: 1rem; }
.modif-ligne-champs .note { flex-basis: 100%; margin: 0; }
.modif-ligne .actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .75rem; }
.modif-ligne-avert .alerte { margin: .5rem 0; }
/* mot_de_passe.php : nom d'utilisateur de l'administrateur */
#nom-utilisateur { margin-top: 1.25rem; }
input.majuscules { text-transform: uppercase; }
/* Accueil › Statistiques (module statistique) */
.tb-tete { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem 1.5rem; }
.tb-tete h1 { margin: 0; }
.tb-tete h1 small { font-size: .95rem; font-weight: 500; color: var(--discret); margin-left: .5rem; }
.tb-periode { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem .75rem; }
.tb-periode label { display: flex; flex-direction: column; font-size: .8rem; color: var(--discret); gap: .15rem; }
.tb-periode input[type=date] { padding: .3rem .4rem; }
h2.groupe small { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: .4rem; }
.tb-chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .8rem; }
.tb-chiffre { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); padding: .8rem 1rem; display: flex; flex-direction: column; gap: .2rem; }
.tb-chiffre > span { color: var(--discret); font-size: .82rem; }
.tb-chiffre > strong { font-size: 1.45rem; font-weight: 700; color: var(--texte); font-variant-numeric: tabular-nums; }
.tb-principal > strong { font-size: 1.7rem; }
.tb-chiffre small { font-size: .78rem; }
.tb-var { color: var(--discret); }
.tb-var span { color: var(--discret); font-weight: 400; }
.tb-bon { color: var(--vert-texte); font-weight: 600; }
.tb-mauvais { color: var(--rouge-texte); font-weight: 600; }
.tb-lien-chiffre { font-size: .8rem; margin-top: auto; padding-top: .3rem; }
.tb-graphe { margin-top: .9rem; }
.tb-graphe-tete { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem 1rem; }
.tb-graphe h3, .tb-classement h3 { margin: 0; font-size: 1rem; }
.tb-legende { list-style: none; display: flex; gap: 1.2rem; margin: 0; padding: 0; font-size: .85rem; color: var(--texte); }
.tb-legende li { display: flex; align-items: center; gap: .4rem; }
.tb-legende svg { width: 16px; height: 12px; }
.tb-dessin { position: relative; margin-top: .6rem; overflow-x: auto; }
.tb-dessin svg { display: block; width: 100%; min-width: 640px; height: auto; }      /* téléphone : défilement, textes lisibles */
.tb-s1 { fill: #2a78d6; }
.tb-s2 { fill: #eb6834; stroke: #fcfcfb; stroke-width: 2; }
.tb-s2-trait { fill: none; stroke: #eb6834; stroke-width: 2; stroke-linejoin: round; }
.tb-grille { stroke: #e7ebf0; stroke-width: 1; }
.tb-zero { stroke: #9aa5b1; stroke-width: 1; }
.tb-axe { fill: var(--discret); font-size: 11px; font-variant-numeric: tabular-nums; }
.tb-repere { stroke: #9aa5b1; stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.tb-cible { fill: transparent; cursor: crosshair; }
.tb-bulle { position: absolute; z-index: 5; background: var(--surface); border: 1px solid var(--bord); border-radius: 6px; box-shadow: 0 6px 18px rgba(15,23,42,.15);
  padding: .45rem .65rem; font-size: .82rem; pointer-events: none; white-space: nowrap; }
.tb-bulle strong { display: block; margin-bottom: .2rem; }
.tb-bulle b { font-variant-numeric: tabular-nums; }
.tb-marque { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.tb-marque.tb-s1 { background: #2a78d6; }
.tb-marque.tb-s2 { background: #eb6834; border-radius: 50%; }
.tb-chiffres-graphe { margin-top: .5rem; font-size: .9rem; }
.tb-chiffres-graphe table { margin-top: .5rem; max-width: 520px; }
.tb-lien { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin: .6rem 0 0; font-size: .88rem; }
.tb-classements { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); gap: .9rem; align-items: start; }
.tb-classement.carte { margin: 0; min-width: 0; }
.tb-defile { overflow-x: auto; }
.tb-periode .bouton { text-decoration: none; }
.tb-table { margin-top: .5rem; font-size: .88rem; }
.tb-table td { vertical-align: top; }
.tb-nom { display: block; }
.tb-nom small { color: var(--discret); }
.tb-part { display: block; width: 100%; height: 4px; margin-top: .25rem; }
.tb-part rect { fill: #2a78d6; }
/* vente.php : montant de la facture toujours visible pendant la saisie */
.vente-total-flottant { position: fixed; z-index: 45; right: 1rem; bottom: 1rem; display: flex; flex-direction: column; align-items: flex-end;   /* en bas à droite, prioritaire : passe devant la photo de l'article */
  background: var(--bleu-fonce); color: #fff; border-radius: 10px; padding: .45rem .9rem .5rem; box-shadow: 0 8px 24px rgba(15,23,42,.25); pointer-events: none; }
.vente-total-flottant span { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; opacity: .85; }
.vente-total-flottant strong { font-size: 1.45rem; font-variant-numeric: tabular-nums; line-height: 1.15; }
.vente-total-flottant small { font-size: .75rem; opacity: .85; }
.vente-total-flottant .vtf-client { font-style: normal; font-weight: 700; font-size: .9rem; max-width: 22rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding-bottom: .2rem; margin-bottom: .2rem; border-bottom: 1px solid rgba(255,255,255,.35); align-self: stretch; text-align: end; }
.vente-total-flottant.avoir { background: var(--rouge-texte); }
body:has(.vente-total-flottant) main.page { padding-bottom: 5.5rem; }
@media print { .vente-total-flottant { display: none; } }
/* vente.php : F2 — historique de l'article (achats à gauche, ventes à droite), panneau en bas de l'écran */
.vm-panneau { position: fixed; z-index: 35; left: 0; right: 0; bottom: 0; height: 46vh; display: flex; flex-direction: column;
  background: var(--surface); border-top: 3px solid var(--bleu-fonce); box-shadow: 0 -10px 30px rgba(15,23,42,.2); }
.vm-panneau[hidden] { display: none; }
.vm-barre { display: flex; align-items: center; gap: .8rem; padding: .35rem .9rem; background: var(--bleu-fonce); color: #fff; }
.vm-barre h2 { margin: 0; font-size: 1rem; }
.vm-barre .petit { color: #fff; opacity: .75; }
.vm-barre { min-height: 2.6rem; box-sizing: border-box; }
.vm-barre .histo-fermer { margin-left: auto; }
.vm-corps { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; padding: .5rem .9rem .6rem; }
.vm-tete { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1.4rem; margin-bottom: .4rem; }
.vm-article small { color: var(--discret); margin-left: .3rem; }
.vm-chiffres { display: flex; gap: 1rem; font-size: .9rem; color: var(--discret); }
.vm-chiffres b { color: var(--texte); font-variant-numeric: tabular-nums; }
.vm-tete a { margin-left: auto; font-size: .88rem; }
.vm-cotes { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.vm-cote { min-height: 0; display: flex; flex-direction: column; }
.vm-cote h3 { margin: 0 0 .3rem; font-size: .95rem; }
.vm-cadre { flex: 1; min-height: 0; overflow: auto; margin: 0; }
.vm-cadre .tableau { font-size: .86rem; }
.vm-cadre thead th { position: sticky; top: 0; z-index: 1; }
.vm-retour td { color: var(--rouge-texte); }
body.vm-ouvert main.page { padding-bottom: 48vh; }
/* panneau ouvert : le total de la facture passe dans la barre bleue du panneau (rien de caché dans la saisie) */
body.vm-ouvert .vente-total-flottant { z-index: 45; left: auto; right: 3.4rem; bottom: calc(46vh - 2.6rem); height: 2.6rem; box-sizing: border-box;
  flex-direction: row; align-items: center; gap: .6rem; padding: 0 .4rem; background: transparent; box-shadow: none; }
body.vm-ouvert .vente-total-flottant strong { font-size: 1.15rem; }
body.vm-ouvert .vente-total-flottant .vtf-client { border: 0; padding: 0; margin: 0; align-self: auto; max-width: 14rem; }
body.vm-ouvert .vente-total-flottant.avoir strong { color: #ffd2d2; }
body.vm-ouvert .photo-article { bottom: calc(46vh + 16px); }
@media (max-width: 760px) { .vm-panneau { height: 60vh; } .vm-cotes { grid-template-columns: 1fr; overflow: auto; } .vm-cote { min-height: 14rem; }
  body.vm-ouvert .vente-total-flottant { bottom: calc(60vh - 2.6rem); } body.vm-ouvert .vente-total-flottant small { display: none; } }
@media print { .vm-panneau { display: none !important; } }
/* article.php?commander=1 (F11) : page réduite au bloc de commande, qui reste ouvert */
.commande-seule > summary { pointer-events: none; list-style: none; }
.commande-seule > summary::-webkit-details-marker { display: none; }
/* achat_import.php : import d'une facture fournisseur (Excel / PDF) */
.ai-etapes { display: flex; flex-wrap: wrap; gap: .3rem; list-style: none; padding: 0; margin: 0 0 1rem; counter-reset: etape; }
.ai-etapes li { counter-increment: etape; padding: .3rem .8rem; border-radius: 999px; background: #eef2f7; color: var(--discret); font-size: .88rem; }
.ai-etapes li::before { content: counter(etape) ". "; }
.ai-etapes li.actif { background: var(--bleu-fonce); color: #fff; font-weight: 600; }
.ai-fichier { max-width: 720px; display: flex; flex-direction: column; gap: .8rem; }
.ai-fichier label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; }
.ai-fichier .actions, .ai-colonnes .actions, .ai-verifier .actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
.ai-etat { margin: 0; }
.ai-cadre { max-height: 62vh; overflow: auto; }
.ai-cadre thead th { position: sticky; top: 0; z-index: 1; }
.ai-apercu select { font-size: .85rem; max-width: 13rem; }
.ai-apercu td { white-space: nowrap; max-width: 22rem; overflow: hidden; text-overflow: ellipsis; font-size: .88rem; }
.ai-lignes td { vertical-align: top; font-size: .9rem; }
.ai-lignes input[type=text] { width: 100%; box-sizing: border-box; }
.ai-lignes td.num input { text-align: right; width: 7rem; }
.ai-ref { font-weight: 600; }
.ai-nouvel { display: grid; grid-template-columns: 2fr 1fr; gap: .3rem; margin-top: .3rem; }
.ai-forcer { display: block; font-size: .8rem; color: var(--discret); margin-top: .2rem; }
tr.ai-nouveau td { background: #fff8ec; }
.etiquette.orange { background: #fdebd3; color: #8a4b08; }
.ai-apercu select { min-width: 9.5rem; }
.ai-autres { display: block; color: var(--discret); font-size: .8rem; margin-top: .2rem; }

/* Regroupement des factures : clients regroupés (un ou plusieurs) et façon d'imprimer */
.rg-clients h2 { font-size: 1rem; margin: 0 0 .5rem; }
.rg-puces { list-style: none; margin: 0 0 .6rem; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.rg-puces li { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .35rem .25rem .7rem; border: 1px solid var(--bord); border-radius: 999px; background: var(--bleu-clair); }
.rg-retirer { display: inline-flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; color: var(--rouge-texte); text-decoration: none; }
.rg-retirer:hover, .rg-retirer:focus-visible { background: rgba(200, 30, 30, .1); }
.rg-ajout { margin-bottom: 0; }
.rg-ajout label { min-width: min(24rem, 100%); }
.rg-modele { border: 1px solid var(--bord); border-radius: .5rem; padding: .5rem .9rem .7rem; margin: 0 0 .8rem; display: grid; gap: .35rem; }
.rg-modele legend { font-weight: 700; padding: 0 .3rem; }
.rg-modele label { display: flex; align-items: baseline; gap: .45rem; flex-wrap: wrap; font-weight: 400; margin: 0; }

/* Thème de l'interface : choix rapide (palette de la barre du haut) et choix dans Paramètres › Thème */
.barre-theme { position: relative; }
.barre-theme > summary { list-style: none; display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: 999px; cursor: pointer; }
.barre-theme > summary::-webkit-details-marker { display: none; }
.barre-theme > summary:hover, .barre-theme[open] > summary { background: var(--barre-survol); }
.barre-theme > summary:focus-visible { outline: 2px solid currentColor; outline-offset: 1px; }
.barre-theme > summary svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.barre-theme > summary svg circle { fill: currentColor; stroke: none; }
.barre-theme-liste { position: absolute; right: 0; top: calc(100% + .4rem); z-index: 60; width: min(27rem, calc(100vw - 1.5rem)); max-height: calc(100vh - 5rem); overflow-y: auto; padding: .35rem; margin: 0;
  background: var(--surface); color: var(--texte); border: 1px solid var(--bord); border-radius: 10px; box-shadow: 0 12px 28px rgba(16, 24, 40, .22); }
.barre .barre-theme-choix { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .35rem .5rem; border: 0; border-radius: 6px;
  background: transparent; color: var(--texte); font: inherit; font-size: .9rem; text-align: start; cursor: pointer; }
.barre .barre-theme-choix:hover, .barre .barre-theme-choix:focus-visible { background: var(--accent-survol); outline: none; }
.barre .barre-theme-choix.actif { background: var(--accent-choisi); font-weight: 600; }
.barre-theme-choix .theme-apercu { width: 2.4rem; height: 1.6rem; flex: none; }
.barre-theme-groupe { margin: .35rem .5rem .15rem; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--discret); }
.barre-theme-grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .1rem; }
@media (max-width: 480px) { .barre-theme-grille { grid-template-columns: 1fr; } }
.barre .barre-theme-plus { display: block; margin-top: .25rem; padding: .35rem .5rem; border-top: 1px solid var(--bord); color: var(--bleu); font-size: .85rem; }
[dir="rtl"] .barre-theme-liste { right: auto; left: 0; }
.ap-themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; margin: .6rem 0 1rem; }
.ap-theme { position: relative; display: flex; flex-direction: column; align-items: center; gap: .4rem; margin: 0; padding: .55rem; border: 2px solid var(--bord);
  border-radius: 12px; background: var(--surface); cursor: pointer; font-weight: normal; }
.ap-theme input { position: absolute; opacity: 0; pointer-events: none; }
.ap-theme .theme-apercu { width: 100%; height: auto; aspect-ratio: 3 / 2; }
.ap-theme:hover { border-color: var(--accent-choisi-bord); }
.ap-theme:has(input:checked) { border-color: var(--bleu); box-shadow: 0 0 0 3px var(--accent-focus); }
.ap-theme:has(input:focus-visible) { outline: 3px solid var(--bleu); outline-offset: 2px; }

/* Fiche client › relevé : totaux de la période à droite des filtres */
.releve-totaux { display: flex; flex-wrap: wrap; gap: .35rem 1.4rem; margin-inline-start: auto; align-self: center; padding: .45rem .9rem;
  border: 1px solid var(--bord); border-radius: var(--rayon); background: var(--surface); }
.releve-totaux > div { display: flex; flex-direction: column; min-width: 7.5rem; }
.releve-totaux span { font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; color: var(--discret); }
.releve-totaux strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.releve-totaux small { font-size: .78rem; color: var(--discret); }

/* Journal des achats : crédit reçu des fournisseurs et comparaison avec la période précédente */
.impr-sous-titre { font-size: 1rem; margin: 1.2rem 0 .4rem; }
.la-credit { width: auto; min-width: min(40rem, 100%); }
.la-credit th small { font-weight: normal; color: var(--discret); }
@media print { .impr-sous-titre { font-size: 11pt; margin-top: 6mm; break-after: avoid; } .la-credit { break-inside: avoid; } }
