/* Gestion commerciale — interface */
:root {
    /* couleurs du drapeau du Niger : orange, blanc, vert */
    --primaire: #0A8F3C; --primaire-f: #06702D; --primaire-c: #E2F6E8; --primaire-cc: #F1FBF4;
    --orange-n: #E05206; --orange-nf: #B84305; --orange-nc: #FDEBDD; --vert-n: #0DB02B;
    --nuit: #0B2E1A; --nuit-2: #124227; --encre: #1B2733; --gris: #4F5D6B; --doux: #7A8794; --ligne: #E2E7EC; --ligne-f: #CDD5DD; --fond: #F3F5F8;
    --bleu: #2563EB; --bleu-c: #E7EEFD; --orange: #E05206; --orange-c: #FDEBDD; --rouge: #DC2626; --rouge-c: #FDECEC; --violet: #7C3AED; --violet-c: #F1EAFE;
    --r: 12px; --ombre: 0 1px 2px rgba(15, 34, 50, .06), 0 8px 24px -16px rgba(15, 34, 50, .25);
    --police: 'Jakarta', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; --titres: 'Sora', 'Jakarta', sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.5 var(--police); color: var(--encre); background: var(--fond); }
a { color: var(--primaire); text-decoration: none; }
a:hover { color: var(--primaire-f); }
h1, h2, h3, h4 { font-family: var(--titres); margin: 0 0 .5em; line-height: 1.2; color: var(--nuit); }
h1 { font-size: 1.55rem; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 1.1rem; font-weight: 700; }
h3 { font-size: .98rem; font-weight: 700; }
p { margin: 0 0 1em; }
.ico { width: 18px; height: 18px; flex: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--primaire); outline-offset: 2px; }
.doux { color: var(--doux); }
.droite { text-align: right; }
.centre { text-align: center; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 18px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- barre latérale ---------- */
.side { position: fixed; inset: 0 auto 0 0; z-index: 40; width: 250px; display: flex; flex-direction: column; background: linear-gradient(180deg, var(--nuit), #0B1A27); color: #C9D4DE; overflow-y: auto; }
.side-marque { display: flex; align-items: center; gap: 11px; padding: 18px 18px 16px; color: #fff; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.side-marque:hover { color: #fff; }
.side-marque img { width: 38px; height: 38px; object-fit: contain; border-radius: 10px; background: #fff; padding: 3px; }
.side-logo { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(135deg, #10B981, var(--primaire)); font: 800 1.1rem var(--titres); color: #fff; }
.side-marque b { display: block; font-size: .95rem; line-height: 1.2; }
.side-marque small { color: #7FA0B8; font-size: .75rem; }
.side-nav { padding: 10px 10px 30px; }
.side-groupe { margin: 16px 10px 6px; font-size: .68rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #5F7E95; }
.side-lien { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: #C9D4DE; font-weight: 600; font-size: .88rem; }
.side-lien .ico { width: 17px; height: 17px; color: #7FA0B8; }
.side-lien:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-lien.actif { background: var(--primaire); color: #fff; box-shadow: 0 6px 16px -8px rgba(10, 143, 60, .9); }
.side-lien.actif .ico { color: #fff; }
.voile { display: none; }

/* ---------- page et barre du haut ---------- */
.page { margin-left: 250px; min-height: 100vh; display: flex; flex-direction: column; }
.barre { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; height: 62px; padding: 0 24px; background: rgba(255, 255, 255, .95); border-bottom: 1px solid var(--ligne); backdrop-filter: blur(8px); }
.burger { display: none; border: 0; background: none; padding: 6px; cursor: pointer; }
.recherche { flex: 1; max-width: 460px; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 10px; background: var(--fond); border: 1px solid var(--ligne); }
.recherche input { flex: 1; border: 0; background: none; outline: none; min-width: 0; }
.recherche .ico { color: var(--doux); }
.barre-droite { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.menu-deroulant { position: relative; }
.deroulant { position: absolute; top: calc(100% + 8px); left: 0; z-index: 50; min-width: 230px; padding: 6px; border-radius: 12px; background: #fff; border: 1px solid var(--ligne); box-shadow: 0 20px 40px -20px rgba(15, 34, 50, .4); display: none; }
.deroulant.ouvert { display: block; }
.deroulant-droite { left: auto; right: 0; }
.deroulant a, .deroulant button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--encre); font-weight: 600; text-align: left; cursor: pointer; }
.deroulant a:hover, .deroulant button:hover { background: var(--primaire-cc); color: var(--primaire-f); }
.deroulant .ico { color: var(--doux); width: 16px; height: 16px; }
.deroulant form { margin: 0; }
.utilisateur { display: flex; align-items: center; gap: 9px; padding: 4px 8px 4px 4px; border: 1px solid var(--ligne); border-radius: 999px; background: #fff; cursor: pointer; }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--nuit-2); color: #fff; font-weight: 800; }
.u-nom { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.u-nom small { color: var(--doux); font-size: .72rem; }
.contenu { padding: 24px; flex: 1; }

/* ---------- boutons, alertes, cartes ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 0 15px; border: 1px solid var(--ligne-f); border-radius: 9px; background: #fff; color: var(--encre); font-weight: 700; font-size: .88rem; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, box-shadow .15s; }
.btn:hover { border-color: var(--primaire); color: var(--primaire-f); }
.btn .ico { width: 16px; height: 16px; }
.btn-primaire { background: var(--primaire); border-color: var(--primaire); color: #fff; box-shadow: 0 6px 14px -8px rgba(10, 143, 60, .8); }
.btn-primaire:hover { background: var(--primaire-f); border-color: var(--primaire-f); color: #fff; }
.btn-sombre { background: var(--nuit-2); border-color: var(--nuit-2); color: #fff; }
.btn-sombre:hover { background: var(--nuit); color: #fff; }
.btn-danger { color: var(--rouge); }
.btn-danger:hover { border-color: var(--rouge); background: var(--rouge-c); color: var(--rouge); }
.btn-petit { min-height: 32px; padding: 0 11px; font-size: .82rem; }
.btn-large { min-height: 46px; width: 100%; font-size: .95rem; }
.btn-icone { width: 32px; min-height: 32px; padding: 0; }
.alerte { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; font-weight: 600; }
.alerte-ok { background: var(--primaire-c); color: var(--primaire-f); }
.alerte-erreur { background: var(--rouge-c); color: #A11; }
.alerte-info { background: var(--bleu-c); color: #1D4ED8; }
.carte { background: #fff; border: 1px solid var(--ligne); border-radius: var(--r); box-shadow: var(--ombre); }
.carte-corps { padding: 18px 20px; }
.carte-tete { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--ligne); }
.carte-tete h2, .carte-tete h3 { margin: 0; }
.entete-page { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.entete-page h1 { margin: 0; }
.entete-page .fil { font-size: .8rem; color: var(--doux); margin-bottom: 4px; }
.entete-page .fil a { color: var(--doux); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.grille { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

/* ---------- indicateurs ---------- */
.kpi { position: relative; overflow: hidden; padding: 16px 18px; }
.kpi small { display: block; color: var(--doux); font-weight: 700; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; }
.kpi b { display: block; margin-top: 6px; font: 800 1.45rem var(--titres); color: var(--nuit); letter-spacing: -.02em; }
.kpi span { font-size: .8rem; color: var(--doux); }
.kpi .kpi-ico { position: absolute; right: 14px; top: 14px; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--primaire-c); color: var(--primaire); }
.kpi.bleu .kpi-ico { background: var(--bleu-c); color: var(--bleu); }
.kpi.orange .kpi-ico { background: var(--orange-c); color: var(--orange); }
.kpi.rouge .kpi-ico { background: var(--rouge-c); color: var(--rouge); }
.kpi.violet .kpi-ico { background: var(--violet-c); color: var(--violet); }

/* ---------- tableaux ---------- */
.tableau-boite { overflow-x: auto; }
.tableau { width: 100%; border-collapse: collapse; font-size: .86rem; }
.tableau th { padding: 10px 12px; background: #F7F9FB; border-bottom: 1px solid var(--ligne); color: var(--gris); font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; text-align: left; white-space: nowrap; }
.tableau td { padding: 9px 12px; border-bottom: 1px solid #EEF1F4; vertical-align: middle; }
.tableau tbody tr:hover { background: #FAFCFD; }
.tableau .num, .tableau th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tableau tfoot td { font-weight: 800; background: #F7F9FB; border-top: 2px solid var(--ligne-f); }
.tableau .lien-ligne { font-weight: 700; color: var(--nuit); }
.tableau .lien-ligne:hover { color: var(--primaire); }
.tableau small { display: block; color: var(--doux); }
.ligne-annulee td { color: var(--doux); text-decoration: line-through; }
.vide { padding: 40px 20px; text-align: center; color: var(--doux); }
.vide .ico { width: 34px; height: 34px; margin-bottom: 6px; color: var(--ligne-f); }

/* ---------- pastilles ---------- */
.pastille { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 800; white-space: nowrap; background: #EEF1F4; color: var(--gris); }
.pastille.vert { background: var(--primaire-c); color: var(--primaire-f); }
.pastille.bleu { background: var(--bleu-c); color: #1D4ED8; }
.pastille.orange { background: var(--orange-c); color: #B45309; }
.pastille.rouge { background: var(--rouge-c); color: #B91C1C; }
.pastille.violet { background: var(--violet-c); color: #6D28D9; }

/* ---------- filtres ---------- */
.filtres { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; padding: 14px 16px; }
.filtres .champ { margin: 0; min-width: 140px; }
.filtres .champ-large { flex: 1 1 220px; }
.totaux-liste { display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 10px 16px; border-top: 1px solid var(--ligne); font-size: .84rem; color: var(--gris); }
.totaux-liste b { color: var(--nuit); }

/* ---------- formulaires ---------- */
.champ { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.champ > span, .champ > label { font-weight: 700; font-size: .78rem; color: var(--gris); }
.champ input, .champ select, .champ textarea, .saisie { width: 100%; min-height: 38px; padding: 7px 11px; border: 1px solid var(--ligne-f); border-radius: 9px; background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
.champ textarea { min-height: 76px; resize: vertical; }
.champ input:focus, .champ select:focus, .champ textarea:focus, .saisie:focus { border-color: var(--primaire); box-shadow: 0 0 0 3px rgba(10, 143, 60, .14); }
.champ .aide { font-weight: 500; color: var(--doux); font-size: .76rem; }
.req { color: var(--rouge); }
.case { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.case input { width: 17px; height: 17px; accent-color: var(--primaire); }
.form-grille { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 14px; }
.form-grille .s2 { grid-column: span 2; }
.form-grille .s4 { grid-column: 1 / -1; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--ligne); background: #FAFBFC; border-radius: 0 0 var(--r) var(--r); }
.mdp { position: relative; display: flex; }
.mdp input { padding-right: 42px; }
.mdp button { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: none; padding: 6px; color: var(--doux); cursor: pointer; }

/* ---------- saisie des lignes de document ---------- */
.lignes-doc { width: 100%; border-collapse: collapse; font-size: .86rem; }
.lignes-doc th { padding: 9px 8px; background: var(--nuit-2); color: #fff; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; text-align: left; }
.lignes-doc th:first-child { border-radius: 8px 0 0 0; }
.lignes-doc th:last-child { border-radius: 0 8px 0 0; }
.lignes-doc td { padding: 5px 4px; border-bottom: 1px solid #EEF1F4; vertical-align: top; }
.lignes-doc .saisie { min-height: 34px; padding: 5px 8px; border-radius: 7px; }
.lignes-doc .num, .lignes-doc input.num { text-align: right; }
.lignes-doc .montant { padding: 12px 8px 0; font-weight: 800; text-align: right; white-space: nowrap; }
.lignes-doc .stock-info { display: block; font-size: .72rem; color: var(--doux); padding: 2px 4px 0; }
.lignes-doc .stock-info.bas { color: var(--rouge); font-weight: 700; }
.choix-article { position: relative; }
.suggestions { position: absolute; left: 0; top: calc(100% + 2px); z-index: 20; width: min(520px, 80vw); max-height: 300px; overflow-y: auto; background: #fff; border: 1px solid var(--ligne-f); border-radius: 10px; box-shadow: 0 20px 40px -18px rgba(15, 34, 50, .45); display: none; }
.suggestions.ouvert { display: block; }
.suggestions button { display: flex; justify-content: space-between; gap: 10px; width: 100%; padding: 8px 11px; border: 0; border-bottom: 1px solid #F1F3F5; background: none; text-align: left; cursor: pointer; }
.suggestions button:hover, .suggestions button.actif { background: var(--primaire-cc); }
.suggestions b { color: var(--nuit); }
.suggestions small { color: var(--doux); }
.totaux-doc { width: 100%; max-width: 360px; margin-left: auto; border-collapse: collapse; }
.totaux-doc td { padding: 6px 10px; }
.totaux-doc td:last-child { text-align: right; font-weight: 700; white-space: nowrap; }
.totaux-doc tr.net td { font: 800 1.1rem var(--titres); color: #fff; background: var(--primaire); }
.totaux-doc tr.net td:first-child { border-radius: 8px 0 0 8px; }
.totaux-doc tr.net td:last-child { border-radius: 0 8px 8px 0; }

/* ---------- fiche ---------- */
.infos { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: .88rem; }
.infos dt { color: var(--doux); font-weight: 600; }
.infos dd { margin: 0; font-weight: 600; }
.flux { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.flux .etape { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: #EEF1F4; font-weight: 700; font-size: .8rem; color: var(--gris); }
.flux .etape.courant { background: var(--primaire); color: #fff; }
.flux .ico { width: 14px; height: 14px; color: var(--doux); }
.onglets { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--ligne); margin-bottom: 16px; }
.onglets a { padding: 9px 14px; border-bottom: 2px solid transparent; color: var(--gris); font-weight: 700; margin-bottom: -1px; }
.onglets a.actif { color: var(--primaire-f); border-color: var(--primaire); }

/* ---------- tableau de bord ---------- */
.graphe { display: flex; align-items: flex-end; gap: 8px; height: 330px; padding: 10px 6px 0; }
.graphe .barre-g { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.graphe .barre-g i { display: block; width: 100%; max-width: 38px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, #34D399, var(--primaire)); min-height: 2px; transition: height .6s; }
.graphe .barre-g:last-child i { background: linear-gradient(180deg, #60A5FA, var(--bleu)); }
.graphe .barre-g span { font-size: .7rem; color: var(--doux); white-space: nowrap; }
.liste-simple { list-style: none; margin: 0; padding: 0; }
.liste-simple li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 20px; border-bottom: 1px solid #F0F2F5; }
.liste-simple li:last-child { border: 0; }

/* ---------- états ---------- */
.etats-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.etat { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; }
.etat h3 { display: flex; align-items: center; gap: 8px; margin: 0; }
.etat h3 .ico { color: var(--primaire); }
.etat p { margin: 0; color: var(--doux); font-size: .84rem; }
.etat form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-top: auto; }
.etat .champ { margin: 0; flex: 1 1 130px; }
.etat .champ input, .etat .champ select { min-height: 34px; padding: 5px 9px; }
.groupe-etats { margin: 6px 0 12px; font-size: .78rem; font-weight: 800; color: var(--doux); text-transform: uppercase; letter-spacing: .1em; }

/* ---------- pagination ---------- */
.pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 12px 16px; }
.pagination-info { margin-right: auto; color: var(--doux); font-size: .82rem; }
.pg { display: grid; place-items: center; min-width: 32px; height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--ligne); background: #fff; color: var(--encre); font-weight: 700; font-size: .84rem; }
.pg.actif { background: var(--primaire); border-color: var(--primaire); color: #fff; }
.pg.desactive { opacity: .45; }
.pg .ico { width: 14px; height: 14px; }

/* ---------- connexion ---------- */
.page-connexion { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(800px 500px at 0% 0%, #D9F2E6, transparent 60%), radial-gradient(700px 500px at 100% 100%, #DCE7F5, transparent 60%), var(--fond); }
.connexion { width: min(920px, 100%); display: grid; grid-template-columns: 1.1fr 1fr; background: #fff; border-radius: 20px; overflow: hidden; box-shadow: 0 40px 80px -40px rgba(15, 34, 50, .5); }
.connexion-visuel { padding: 40px; background: linear-gradient(160deg, var(--nuit), #0B3B2E); color: #C9D4DE; }
.connexion-visuel h1 { color: #fff; font-size: 1.7rem; margin: 18px 0 10px; }
.connexion-visuel ul { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 12px; }
.connexion-visuel li { display: flex; gap: 10px; align-items: center; font-weight: 600; }
.connexion-visuel li .ico { color: #34D399; }
.cv-logo img { width: 64px; height: 64px; object-fit: contain; background: #fff; border-radius: 14px; padding: 6px; }
.cv-logo .side-logo { width: 56px; height: 56px; font-size: 1.5rem; }
.connexion-form { padding: 44px 40px; }
.connexion-form h2 { font-size: 1.4rem; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
    .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .g3, .g-2-1 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .side { transform: translateX(-100%); transition: transform .25s; }
    .side.ouvert { transform: none; }
    .voile.ouvert { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(15, 34, 50, .45); }
    .page { margin-left: 0; }
    .burger { display: grid; }
    .u-nom { display: none; }
    .contenu { padding: 16px; }
    .form-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .g2 { grid-template-columns: 1fr; }
    .connexion { grid-template-columns: 1fr; }
    .connexion-visuel { padding: 28px; }
    .connexion-visuel ul { display: none; }
}
@media (max-width: 560px) {
    .g4, .form-grille { grid-template-columns: 1fr; }
    .form-grille .s2 { grid-column: auto; }
    .recherche { display: none; }
}
.grille > *, .page, .contenu { min-width: 0; }
.carte-tete { flex-wrap: wrap; }
.lignes-doc { min-width: 860px; }
@media (max-width: 700px) {
    .graphe { gap: 3px; height: 220px; overflow: hidden; }
    .graphe .barre-g span { font-size: .58rem; writing-mode: vertical-rl; transform: rotate(180deg); }
    .entete-page .actions { width: 100%; }
}

/* =====================================================================
   Habillage aux couleurs du drapeau du Niger
   ===================================================================== */
.tricolore { height: 4px; background: linear-gradient(90deg, var(--orange-n) 0 33.33%, #fff 33.33% 66.66%, var(--vert-n) 66.66%); }
.side { background: linear-gradient(180deg, #0B2E1A 0%, #082313 100%); width: 262px; }
.side::before { content: ''; position: sticky; top: 0; z-index: 2; display: block; height: 5px; flex: none; background: linear-gradient(90deg, var(--orange-n) 0 33.33%, #fff 33.33% 66.66%, var(--vert-n) 66.66%); }
.side-marque { border-bottom-color: rgba(255, 255, 255, .08); }
.side-logo { background: radial-gradient(circle at 50% 62%, var(--orange-n) 0 26%, transparent 27%), linear-gradient(180deg, var(--orange-n) 0 33%, #fff 33% 66%, var(--vert-n) 66%); color: transparent; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3); }
.side-marque small { color: #8FBF9F; }
.side-groupe { color: #6FA382; }
.side-lien { color: #CFE3D5; }
.side-lien .ico { color: #82B595; }
.side-lien:hover { background: rgba(255, 255, 255, .07); }
.side-lien.actif { background: linear-gradient(90deg, var(--primaire), #0B9E43); box-shadow: inset 4px 0 0 var(--orange-n), 0 6px 16px -8px rgba(10, 143, 60, .9); }
.page { margin-left: 262px; }
.barre { border-bottom: 0; box-shadow: 0 1px 0 var(--ligne); }
.barre::after { content: ''; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px; background: linear-gradient(90deg, var(--orange-n) 0 33.33%, #fff 33.33% 66.66%, var(--vert-n) 66.66%); opacity: .9; }
.btn-primaire { background: var(--primaire); border-color: var(--primaire); }
.btn-orange { background: var(--orange-n); border-color: var(--orange-n); color: #fff; box-shadow: 0 6px 14px -8px rgba(224, 82, 6, .8); }
.btn-orange:hover { background: var(--orange-nf); border-color: var(--orange-nf); color: #fff; }
.avatar { background: linear-gradient(135deg, var(--orange-n), #F07A2E); }
.kpi { border-top: 3px solid var(--primaire); }
.kpi.orange, .kpi.rouge { border-top-color: var(--orange-n); }
.kpi.bleu { border-top-color: #4B8BF5; }
.kpi.violet { border-top-color: #8B5CF6; }
.kpi .kpi-ico { background: var(--primaire-c); color: var(--primaire); }
.kpi.orange .kpi-ico { background: var(--orange-nc); color: var(--orange-n); }
.graphe .barre-g i { background: linear-gradient(180deg, #3CCB6A, var(--primaire)); }
.graphe .barre-g:last-child i { background: linear-gradient(180deg, #F59A5C, var(--orange-n)); }
.totaux-doc tr.net td { background: var(--primaire); }
.lignes-doc th { background: var(--nuit-2); }
.lignes-doc thead tr { box-shadow: inset 0 -3px 0 var(--orange-n); }
.pastille.orange { background: var(--orange-nc); color: var(--orange-nf); }

/* ---------- entête des pages (listes et formulaires) ---------- */
.entete { position: relative; overflow: hidden; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; margin: -4px 0 18px; padding: 18px 22px; border-radius: 14px; background: linear-gradient(120deg, #0B2E1A 0%, #124227 55%, #0A8F3C 130%); color: #fff; box-shadow: 0 16px 34px -24px rgba(11, 46, 26, .8); }
.entete::before { content: ''; position: absolute; right: -70px; top: -90px; width: 230px; height: 230px; border-radius: 50%; background: radial-gradient(circle, rgba(224, 82, 6, .28) 0 28%, transparent 29%), radial-gradient(circle, rgba(255, 255, 255, .05) 0 60%, transparent 61%); pointer-events: none; }
.entete .actions .btn:not(.btn-primaire):not(.btn-orange):not(.btn-danger) { backdrop-filter: blur(4px); background: rgba(11, 46, 26, .55); }
.entete::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: linear-gradient(90deg, var(--orange-n) 0 33.33%, #fff 33.33% 66.66%, var(--vert-n) 66.66%); }
.entete-ico { position: relative; display: grid; place-items: center; width: 50px; height: 50px; flex: none; border-radius: 14px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18); }
.entete-ico .ico { width: 24px; height: 24px; color: #fff; }
.entete-texte { position: relative; flex: 1 1 320px; min-width: 0; }
.entete-fil { font-size: .78rem; color: #A9D3B6; margin-bottom: 2px; }
.entete-fil a { color: #CDEBD6; }
.entete-fil a:hover { color: #fff; }
.entete h1 { margin: 0; color: #fff; font-size: 1.45rem; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.entete p { margin: 3px 0 0; color: #CFE6D7; font-size: .86rem; }
.entete .actions { position: relative; }
.entete .btn:not(.btn-primaire):not(.btn-orange):not(.btn-danger) { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .25); color: #fff; }
.entete .btn:not(.btn-primaire):not(.btn-orange):not(.btn-danger):hover { background: #fff; color: var(--nuit); }
.entete .btn-primaire { background: var(--orange-n); border-color: var(--orange-n); box-shadow: 0 8px 18px -10px rgba(224, 82, 6, .9); }
.entete .btn-primaire:hover { background: var(--orange-nf); border-color: var(--orange-nf); }
.entete .btn-danger { background: rgba(255, 255, 255, .95); }
.entete .pastille { font-size: .72rem; }
.entete .deroulant a, .entete .deroulant button { color: var(--encre); }

/* entêtes des cartes (titres des blocs de formulaire) */
.carte-tete { background: linear-gradient(180deg, #FAFCFA, #F4F8F5); border-radius: var(--r) var(--r) 0 0; }
.carte-tete h2, .carte-tete h3 { display: flex; align-items: center; gap: 8px; }
.carte-tete h2::before, .carte-tete h3::before { content: ''; width: 4px; height: 18px; border-radius: 2px; background: linear-gradient(180deg, var(--orange-n) 0 50%, var(--vert-n) 50%); }
.titre-bloc { display: flex; align-items: center; gap: 10px; margin: 4px 0 14px; padding-bottom: 8px; border-bottom: 1px dashed var(--ligne-f); font-size: .95rem; color: var(--nuit); }
.titre-bloc .ico { width: 18px; height: 18px; color: var(--orange-n); }
.titre-bloc + .form-grille { margin-bottom: 8px; }

/* tableaux : colonne N°, en-têtes, colonnes larges */
.tableau thead th { background: #EEF5F0; color: #234A33; border-bottom: 2px solid #CFE3D5; }
.tableau .col-n { width: 46px; text-align: center; color: var(--doux); font-weight: 700; font-variant-numeric: tabular-nums; }
.tableau .col-large { min-width: 260px; }
.tableau .col-moyenne { min-width: 170px; }
.tableau .auteur { white-space: nowrap; font-size: .78rem; color: var(--doux); }
.tableau .auteur b { color: var(--gris); font-weight: 700; }
.tableau tbody tr:nth-child(even) td { background: #FBFDFB; }
.tableau tbody tr:hover td { background: #F1FBF4; }
.tableau tfoot td { background: #EEF5F0; }
.saisie-large { min-width: 280px; }
.auteurs-fiche { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--ligne); font-size: .78rem; color: var(--doux); }
.auteurs-fiche b { color: var(--gris); }

/* ---------- Select2 ---------- */
.select2-container { width: 100% !important; font-size: .88rem; }
.select2-container--default .select2-selection--single { height: 38px; border: 1px solid var(--ligne-f); border-radius: 9px; background: #fff; }
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 36px; padding-left: 11px; padding-right: 30px; color: var(--encre); }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 36px; right: 6px; }
.select2-container--default .select2-selection--single .select2-selection__placeholder { color: var(--doux); }
.select2-container--default .select2-selection--single .select2-selection__clear { margin-right: 6px; color: var(--doux); font-size: 1.1rem; }
.select2-container--default.select2-container--focus .select2-selection--single, .select2-container--default.select2-container--open .select2-selection--single { border-color: var(--primaire); box-shadow: 0 0 0 3px rgba(10, 143, 60, .14); }
.select2-dropdown { border: 1px solid var(--ligne-f); border-radius: 10px; overflow: hidden; box-shadow: 0 18px 40px -18px rgba(11, 46, 26, .45); z-index: 60; }
.select2-search--dropdown { padding: 8px; }
.select2-container--default .select2-search--dropdown .select2-search__field { border: 1px solid var(--ligne-f); border-radius: 8px; padding: 7px 10px; outline: none; }
.select2-container--default .select2-search--dropdown .select2-search__field:focus { border-color: var(--primaire); }
.select2-results__option { padding: 7px 11px; }
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable { background: var(--primaire); color: #fff; }
.select2-container--default .select2-results__option--selected { background: var(--primaire-c); color: var(--primaire-f); font-weight: 700; }
.select2-results__group { color: var(--orange-n) !important; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; }
.filtres .select2-container, .etat .select2-container { min-width: 160px; }
.etat .select2-container--default .select2-selection--single { height: 34px; }
.etat .select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 32px; }
.etat .select2-container--default .select2-selection--single .select2-selection__arrow { height: 32px; }
.tableau .select2-container { min-width: 150px; }

/* ---------- matrice des permissions ---------- */
.matrice { width: 100%; border-collapse: collapse; font-size: .86rem; }
.matrice th, .matrice td { padding: 8px 10px; border-bottom: 1px solid var(--ligne); }
.matrice thead th { background: #EEF5F0; color: #234A33; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; text-align: center; }
.matrice thead th:first-child { text-align: left; }
.matrice td { text-align: center; }
.matrice td:first-child { text-align: left; }
.matrice .groupe td { background: var(--nuit-2); color: #fff; font-weight: 800; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; text-align: left; }
.matrice input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--primaire); cursor: pointer; }
.matrice .na { color: var(--ligne-f); }
.role-carte { scroll-margin-top: 90px; }
.role-carte:target { box-shadow: 0 0 0 3px var(--orange-n); }

/* ---------- journal ---------- */
.diff { width: 100%; border-collapse: collapse; font-size: .84rem; }
.diff td, .diff th { padding: 6px 10px; border-bottom: 1px solid var(--ligne); text-align: left; vertical-align: top; }
.diff .avant { color: #B91C1C; text-decoration: line-through; }
.diff .apres { color: var(--primaire-f); font-weight: 700; }
.chrono { list-style: none; margin: 0; padding: 0; }
.chrono li { position: relative; padding: 0 0 14px 22px; }
.chrono li::before { content: ''; position: absolute; left: 5px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--primaire); box-shadow: 0 0 0 3px var(--primaire-c); }
.chrono li::after { content: ''; position: absolute; left: 9px; top: 18px; bottom: 0; width: 1px; background: var(--ligne-f); }
.chrono li:last-child::after { display: none; }
.chrono small { color: var(--doux); }

/* connexion aux couleurs du drapeau */
.connexion-visuel { background: linear-gradient(165deg, #0B2E1A 0%, #0A5A28 100%); position: relative; }
.connexion-visuel::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: linear-gradient(90deg, var(--orange-n) 0 33.33%, #fff 33.33% 66.66%, var(--vert-n) 66.66%); }
.connexion-visuel li .ico { color: #F59A5C; }
.page-connexion { background: radial-gradient(800px 500px at 0% 0%, #FDE3CF, transparent 60%), radial-gradient(700px 500px at 100% 100%, #D4F2DD, transparent 60%), var(--fond); }

@media (max-width: 900px) {
    .page { margin-left: 0; }
    .entete { padding: 16px; }
    .entete-ico { display: none; }
}

/* ===== Textes sur fond foncé : blanc franc et plus épais ===== */
.side-marque b, .side-lien, .side-lien:hover { color: #fff; }
.side-lien { font-weight: 700; }
.side-lien .ico { color: #fff; opacity: .95; }
.side-marque small { color: #fff; opacity: .9; font-weight: 600; }
.side-groupe { color: #fff; opacity: .75; }
.entete h1, .entete p, .entete-fil, .entete-fil a { color: #fff; }
.entete p { font-weight: 600; opacity: 1; }
.entete-fil { font-weight: 700; opacity: .9; }
.connexion-visuel, .connexion-visuel p, .connexion-visuel li { color: #fff; font-weight: 600; }
.lignes-doc th, .matrice .groupe td { color: #fff; }

/* ===== Écritures des tableaux plus nettes ===== */
.tableau { font-size: .9rem; color: #0E1A14; }
.tableau td { color: #0E1A14; font-weight: 500; border-bottom-color: #E6EBEF; }
.tableau th { color: #0B2E1A; font-weight: 800; background: #EEF5F0; border-bottom: 2px solid #CFE3D6; }
.tableau small, .tableau .doux { color: #46535F; font-weight: 500; }
.tableau b, .tableau .lien-ligne { color: #08251A; font-weight: 800; }
.tableau .num { font-weight: 600; }
.tableau .col-n { color: #3B4A56; font-weight: 700; }
.tableau .auteur b { color: #0E1A14; }
.tableau tbody tr:nth-child(even) { background: #FBFCFD; }
.tableau tbody tr:hover { background: #F0F8F3; }
.ligne-annulee td, .ligne-annulee td b { color: #8A96A2; }
.tableau, .infos, .liste-simple { -webkit-font-smoothing: auto; text-rendering: optimizeLegibility; }

/* ===== Actions dans les lignes ===== */
.actions-ligne { white-space: nowrap; }
.actions-ligne form { display: inline; }
.actions-ligne .btn-icone { margin-left: 2px; }

/* ===== Photos des utilisateurs ===== */
.avatar { flex: none; overflow: hidden; }
.avatar-photo { display: block; border-radius: 50%; object-fit: cover; background: #E2E7EC; box-shadow: 0 0 0 2px #fff, 0 0 0 3px #CFE3D6; }
.qui { display: inline-flex; align-items: center; gap: 8px; }
.qui > span { display: flex; flex-direction: column; line-height: 1.25; }
.tableau .auteur .qui > span { font-size: .8rem; color: #33414D; }
.deroulant-profil { display: flex; align-items: center; gap: 10px; padding: 10px 12px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--ligne); }
.deroulant-profil span { display: flex; flex-direction: column; line-height: 1.3; }
.deroulant-profil small { color: var(--doux); font-size: .74rem; }
.photo-choix { display: flex; align-items: center; gap: 18px; padding: 14px; border: 1px dashed var(--ligne-f); border-radius: 12px; background: var(--primaire-cc); }
.photo-choix > div { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.photo-choix .aide { font-size: .76rem; color: var(--doux); }
.photo-apercu .avatar { font-size: 30px !important; }

/* ===== Espace profil ===== */
.profil-tete { display: flex; align-items: center; gap: 24px; padding: 22px 24px; position: relative; overflow: hidden; }
.profil-tete::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: linear-gradient(90deg, var(--orange-n) 0 33.3%, #fff 33.3% 66.6%, var(--vert-n) 66.6%); }
.profil-photo { position: relative; flex: none; }
.profil-photo .avatar:not(.avatar-photo) { background: linear-gradient(135deg, var(--primaire), var(--nuit)); font-size: 38px !important; box-shadow: 0 0 0 4px #fff, 0 0 0 6px #CFE3D6; }
.profil-photo .avatar-photo { box-shadow: 0 0 0 4px #fff, 0 0 0 6px #CFE3D6; }
.profil-photo-btn { position: absolute; right: 0; bottom: 4px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--orange-n); color: #fff; border: 3px solid #fff; }
.profil-photo-btn:hover { color: #fff; background: var(--orange-nf); }
.profil-photo-btn .ico { width: 16px; height: 16px; }
.profil-id { flex: 1; min-width: 0; }
.profil-id h2 { margin: 0; font-size: 1.45rem; }
.profil-id p { margin: 2px 0 10px; color: var(--gris); font-weight: 600; }
.profil-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.profil-badges .pastille { display: inline-flex; align-items: center; gap: 5px; }
.profil-badges .ico { width: 14px; height: 14px; }
.profil-chiffres { display: grid; grid-template-columns: repeat(2, minmax(110px, 1fr)); gap: 10px; }
.profil-chiffres div { padding: 10px 14px; border-radius: 10px; background: var(--primaire-cc); border: 1px solid #D7EDDF; text-align: center; }
.profil-chiffres b { display: block; font: 800 1.35rem var(--titres); color: var(--nuit); }
.profil-chiffres span { font-size: .74rem; font-weight: 700; color: var(--gris); text-transform: uppercase; letter-spacing: .04em; }
.carte-tete h2 .ico { vertical-align: -3px; color: var(--primaire); }
.droits li { flex-direction: column; align-items: flex-start !important; gap: 2px; }
.droits li span { font-weight: 700; color: var(--encre); }
.droits li small { color: var(--primaire-f); font-weight: 600; }
@media (max-width: 900px) {
    .profil-tete { flex-direction: column; text-align: center; }
    .profil-badges { justify-content: center; }
    .profil-chiffres { width: 100%; grid-template-columns: repeat(2, 1fr); }
}

/* ===== Filtre du tableau de bord ===== */
.filtre-tdb { padding: 14px 18px 4px; }
.filtre-tdb-tete { display: flex; align-items: center; gap: 8px; color: var(--nuit); margin-bottom: 10px; }
.filtre-tdb-tete .ico { color: var(--primaire); }
.filtre-tdb-tete a { margin-left: auto; font-size: .82rem; font-weight: 700; color: var(--orange-n); }
.periodes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.periodes a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--ligne-f); background: #fff; color: var(--gris); font-weight: 700; font-size: .82rem; }
.periodes a:hover { border-color: var(--primaire); color: var(--primaire-f); }
.periodes a.actif { background: var(--primaire); border-color: var(--primaire); color: #fff; box-shadow: 0 6px 14px -8px rgba(10, 143, 60, .8); }
.filtres-tdb { padding: 10px 0 !important; border: 0 !important; }
.kpi em { font-style: normal; font-weight: 800; padding: 1px 6px; border-radius: 6px; }
.kpi em.hausse { color: #06702D; background: var(--primaire-c); }
.kpi em.baisse { color: #B91C1C; background: var(--rouge-c); }
.graphe-dense { gap: 3px; }
.graphe-dense .barre-g span { font-size: .6rem; writing-mode: vertical-rl; transform: rotate(180deg); }
.liste-simple .ico { vertical-align: -4px; color: var(--primaire); width: 17px; height: 17px; }

/* ===== Corbeille et journal ===== */
.onglets-carte { padding: 6px 12px 0; margin-bottom: 0; }
.onglets-carte a { display: inline-flex; align-items: center; gap: 6px; }
.onglets-carte .ico { width: 16px; height: 16px; }
small.annulee { display: block; margin-top: 3px; color: var(--orange-nf) !important; font-weight: 700; }
.tableau th, .tableau td { padding-left: 9px; padding-right: 9px; }
.tableau .auteur .qui { gap: 6px; }
.tableau .auteur .qui > span { font-size: .76rem; white-space: nowrap; }
.tableau .auteur .avatar { width: 24px !important; height: 24px !important; font-size: 10px !important; }
.actions-ligne .btn-icone { width: 30px; height: 30px; padding: 0; }
.tableau .col-large { min-width: 210px; }
.tableau .col-moyenne { min-width: 140px; }
.tableau th { letter-spacing: .02em; font-size: .72rem; }
.actions-ligne { width: 1%; }
.actions-ligne .btn-icone { width: 28px; height: 28px; margin-left: 1px; }
.actions-ligne .btn-icone .ico { width: 15px; height: 15px; }
.grille.g-structure { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 1680px) { .grille.g-structure { grid-template-columns: 2fr 1fr; align-items: start; } }
.tableau td small { font-size: .76rem; }
.tableau-boite .tableau td:has(> small) { min-width: 0; }
/* boutons d'action en 2 × 2 pour garder les tableaux dans la largeur de l'écran */
.tableau td.actions-ligne { white-space: normal; width: 74px; min-width: 74px; max-width: 74px; line-height: 0; padding-left: 4px; padding-right: 8px; text-align: right; }
.tableau td.actions-ligne > a, .tableau td.actions-ligne > form { display: inline-block; margin: 1px; vertical-align: top; }
.tableau td.actions-ligne .btn-icone { margin: 0; }
.tableau th, .tableau td { padding-left: 8px; padding-right: 8px; }
.tableau .col-large { min-width: 180px; }
.tableau .auteur .qui > span { font-size: .74rem; }
.tableau td.actions-ligne { width: 70px; min-width: 70px; max-width: 70px; padding-right: 6px; }
.tableau .col-n { padding-right: 4px; }
.tableau td.actions-ligne { font-size: 0; }
.tableau td.actions-ligne .btn-icone { display: inline-grid; place-items: center; padding: 0 !important; gap: 0; min-width: 0; width: 28px; height: 28px; }
.tableau td.actions-ligne { max-width: 72px; width: 72px; min-width: 72px; padding-right: 6px; }

/* =====================================================================
   Débordements : web et mobile
   ===================================================================== */
/* Les champs ne s'élargissent jamais au-delà de leur colonne (noms de clients longs, dates) */
.champ, .form-grille > *, .carte-corps, .carte { min-width: 0; }
.champ input, .champ select, .champ textarea, .saisie { max-width: 100%; min-width: 0; }
input[type=date], input[type=month], input[type=time] { min-width: 0; max-width: 100%; }
.select2-container { max-width: 100%; }
.select2-container .select2-selection__rendered { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.champ .aide { overflow-wrap: anywhere; }
.select2-dropdown { max-width: calc(100vw - 24px); }
.select2-results__option { overflow-wrap: anywhere; }

/* Entêtes de pages : les menus déroulants (Imprimer, Transformer en…) ne sont plus coupés */
.entete { overflow: visible; background:
    radial-gradient(circle at calc(100% - 45px) 25px, rgba(224, 82, 6, .28) 0 64px, transparent 65px),
    radial-gradient(circle at calc(100% - 45px) 25px, rgba(255, 255, 255, .05) 0 138px, transparent 139px),
    linear-gradient(120deg, #0B2E1A 0%, #124227 55%, #0A8F3C 130%); }
.entete::before { display: none; }
.entete::after { border-radius: 0 0 14px 14px; }
.entete .actions { z-index: 5; }
.entete .deroulant { z-index: 80; }
.deroulant { max-width: calc(100vw - 24px); }
.entete-texte h1 { overflow-wrap: anywhere; }

/* Tableaux : défilement horizontal propre plutôt qu'un débordement de la page */
.tableau-boite { -webkit-overflow-scrolling: touch; max-width: 100%; }
.tableau td { overflow-wrap: break-word; }
.tableau td.col-n, .tableau th.col-n { white-space: nowrap; }
/* colonne Actions toujours visible quand un tableau large défile */
@media (min-width: 641px) {
    .tableau th.col-actions, .tableau td.col-actions { position: sticky; right: 0; z-index: 1; background: #fff; box-shadow: -12px 0 14px -14px rgba(11, 46, 26, .45); }
    .tableau thead th.col-actions { background: #EEF5F0; z-index: 2; }
    .tableau tbody tr:nth-child(even) td.col-actions { background: #FBFDFB; }
    .tableau tbody tr:hover td.col-actions { background: #F1FBF4; }
}

@media (max-width: 900px) {
    body { overflow-x: hidden; }
    .entete { flex-direction: column; align-items: stretch; }
    .entete .actions { display: flex; flex-wrap: wrap; gap: 8px; }
    .entete .actions > * { flex: 1 1 auto; }
    .entete .actions .btn { justify-content: center; }
    .entete .actions .menu-deroulant .deroulant { left: 0; right: auto; }
    .entete .actions .menu-deroulant:last-child .deroulant, .entete .actions .deroulant-droite { left: auto; right: 0; }
    .entete h1 { font-size: 1.25rem; }
    .totaux-doc { width: 100%; }
}

/* Lignes de document : cartes empilées sur téléphone (plus de colonnes coupées) */
@media (max-width: 760px) {
    .tableau-boite:has(> .lignes-doc) { padding: 10px 12px 0 !important; overflow: visible; }
    .lignes-doc { min-width: 0; display: block; }
    .lignes-doc thead { display: none; }
    .lignes-doc tbody { display: grid; gap: 12px; }
    .lignes-doc tbody tr { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; padding: 12px 12px 10px; border: 1px solid var(--ligne); border-left: 4px solid var(--primaire); border-radius: 12px; background: #fff; box-shadow: 0 6px 16px -14px rgba(11, 46, 26, .5); }
    .lignes-doc td { display: flex; flex-direction: column; gap: 3px; padding: 0; border: 0; min-width: 0; }
    .lignes-doc td::before { content: attr(data-label); font-size: .68rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--doux); }
    .lignes-doc td.col-n { position: absolute; top: 10px; left: 12px; padding: 0 !important; display: block; font-size: .8rem; }
    .lignes-doc td.col-n::before { content: 'Ligne '; display: inline; font-size: .8rem; letter-spacing: 0; text-transform: none; }
    .lignes-doc td.choix-article, .lignes-doc td.cell-designation { grid-column: 1 / -1; }
    .lignes-doc td.choix-article { margin-top: 18px; position: relative; }
    .lignes-doc td.montant { padding: 0; text-align: left; font-size: 1rem; color: var(--nuit); }
    .lignes-doc td.cell-supprimer { position: absolute; top: 8px; right: 8px; }
    .lignes-doc td.cell-supprimer::before { display: none; }
    .lignes-doc .suggestions { width: 100%; }
}
@media (max-width: 900px) {
    .entete-texte { flex: 0 0 auto; }
    .entete .actions { width: 100%; }
    .entete .actions > .btn-icone, .entete .actions > .menu-deroulant:has(> .btn-icone) { flex: 0 0 auto; }
}

/* Tableaux de listes : cartes empilées sur téléphone (plus de colonnes cachées hors de l'écran) */
@media (max-width: 640px) {
    .tableau-boite:has(> table.cartes-mobile) { overflow: visible; padding: 10px 12px; }
    table.cartes-mobile, table.cartes-mobile tbody, table.cartes-mobile tfoot { display: block; min-width: 0 !important; width: 100%; }
    table.cartes-mobile thead { display: none; }
    table.cartes-mobile tbody { display: grid; gap: 10px; }
    table.cartes-mobile tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; padding: 12px 14px; border: 1px solid var(--ligne); border-left: 4px solid var(--primaire); border-radius: 12px; background: #fff !important; box-shadow: 0 6px 16px -14px rgba(11, 46, 26, .5); }
    table.cartes-mobile tr td { display: block; padding: 0 !important; border: 0 !important; background: none !important; text-align: left !important; min-width: 0 !important; white-space: normal !important; overflow-wrap: anywhere; }
    table.cartes-mobile td::before { content: attr(data-label); display: block; margin-bottom: 1px; font-size: .66rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--doux); }
    table.cartes-mobile td:not([data-label])::before, table.cartes-mobile td[data-label=""]::before, table.cartes-mobile td.cellule-pleine::before { display: none; }
    table.cartes-mobile td.col-n { grid-column: 1 / -1; font-weight: 800; color: var(--doux); font-size: .78rem; }
    table.cartes-mobile td.col-n::before { display: inline; content: 'N° '; font-size: .78rem; letter-spacing: 0; }
    table.cartes-mobile td.col-large, table.cartes-mobile td.cellule-pleine, table.cartes-mobile td.cellule-sans-titre { grid-column: 1 / -1; }
    table.cartes-mobile td.cellule-sans-titre:last-child { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; padding-top: 6px !important; border-top: 1px dashed var(--ligne) !important; }
    table.cartes-mobile tfoot tr { margin-top: 10px; border-left-color: var(--orange-n); background: #F4F8F5 !important; }
}
@media (max-width: 640px) {
    table.cartes-mobile td.col-actions, table.cartes-mobile td.actions-ligne { grid-column: 1 / -1; width: auto !important; max-width: none !important; min-width: 0 !important; display: flex !important; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; font-size: inherit; line-height: normal; padding-top: 8px !important; border-top: 1px dashed var(--ligne) !important; }
    table.cartes-mobile td.col-actions::before, table.cartes-mobile td.actions-ligne::before { margin-right: auto; margin-bottom: 0; }
    table.cartes-mobile td.actions-ligne .btn-icone { width: 34px; height: 34px; margin: 0; }
    table.cartes-mobile td.actions-ligne br { display: none; }
}
