/* ================= Factures fournisseurs ================= */
#devis-fournisseurs .chapeau { margin-top: 0; }
.ach-chiffres { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.ach-chiffres > div { background: var(--papier); border-radius: var(--r-l); padding: 12px 14px; box-shadow: 0 1px 2px rgba(15, 27, 45, .05), inset 0 0 0 1px rgba(15, 27, 45, .06); display: grid; gap: 2px; min-width: 0; }
.ach-chiffres span { font-size: 12.5px; color: var(--encre-3); }
.ach-chiffres strong { font-size: 20px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ach-chiffres small { font-size: 12px; color: var(--rouge); }
.ach-chiffres .alerte { box-shadow: inset 0 0 0 1.5px var(--rouge); }
.ach-chiffres .alerte strong { color: var(--rouge); }
.ach-barre { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.ach-barre input[type="search"] { flex: 1 1 240px; min-width: 0; height: 36px; border-radius: 10px; border: 1px solid var(--trait-fort); padding: 0 12px; font: inherit; background: var(--papier); }
.ach-deposer { cursor: pointer; }
.ach-corps { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 14px; align-items: start; }
.ach-liste { display: grid; gap: 10px; max-height: 72vh; overflow: auto; padding: 2px; }
.ach-groupe { background: var(--papier); border-radius: var(--r-l); box-shadow: inset 0 0 0 1px rgba(15, 27, 45, .07); overflow: hidden; }
.ach-groupe-tete { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: baseline; gap: 8px; padding: 10px 12px; cursor: pointer; }
.ach-groupe-tete:hover { background: var(--papier-2); }
.ach-groupe-tete:focus-visible { outline: 2px solid var(--stylo); outline-offset: -2px; }
.ach-groupe-tete::before { content: ""; width: 7px; height: 7px; border-right: 1.5px solid var(--encre-3); border-bottom: 1.5px solid var(--encre-3); transform: translateY(-2px) rotate(45deg); flex: none; transition: transform 160ms cubic-bezier(.23, 1, .32, 1); }
.ach-groupe.ferme .ach-groupe-tete::before { transform: rotate(-45deg); }
.ach-nom { font-weight: 650; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ach-du { margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--ambre); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ach-du.ok { color: var(--vert); }
.ach-groupe ul { list-style: none; margin: 0; padding: 0 6px 6px; display: grid; gap: 4px; }
.ach-groupe li { border-radius: var(--r-m); padding: 8px 10px; cursor: pointer; display: grid; gap: 4px; background: var(--papier-2); }
.ach-groupe li:hover { box-shadow: inset 0 0 0 1px var(--stylo-doux); }
.ach-groupe li.ouvert { box-shadow: inset 0 0 0 2px var(--stylo); background: var(--papier); }
.ach-l1, .ach-l2 { display: flex; justify-content: space-between; gap: 8px; align-items: center; min-width: 0; }
.ach-l1 strong { font-size: 13.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ach-montant { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ach-groupe li .btn.mini { justify-self: start; }
.ach-statut { font-size: 11.5px; padding: 2px 8px; border-radius: 99px; white-space: nowrap; font-weight: 550; }
.ach-statut.payee { background: var(--vert-doux); color: var(--vert); }
.ach-statut.a-payer { background: var(--ambre-doux); color: var(--ambre); }
.ach-statut.retard { background: var(--rouge-doux); color: var(--rouge); }
.ach-statut.livraison { background: var(--bureau); color: var(--encre-2); }
.ach-paye { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--bureau); margin: 0 0 12px; }
.ach-paye label { position: relative; padding: 6px 14px; border-radius: 9px; cursor: pointer; font-size: 13.5px; color: var(--encre-2); }
.ach-paye input { position: absolute; opacity: 0; pointer-events: none; }
.ach-paye label:has(input:checked) { background: var(--papier); color: var(--encre); box-shadow: 0 1px 3px rgba(20, 24, 60, .1); font-weight: 600; }
.ach-paye label:has(input[value="payee"]:checked) { color: var(--vert); }
.ach-paye label:has(input:focus-visible) { outline: 2px solid var(--stylo); }
.ach-categories { margin-top: 16px; display: grid; gap: 8px; }
.ach-categories h3 { margin: 0 0 4px; }
.ach-cat { display: grid; grid-template-columns: minmax(120px, 220px) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13.5px; }
.ach-cat > div { height: 10px; border-radius: 99px; background: var(--bureau); overflow: hidden; }
.ach-cat i { display: block; height: 100%; border-radius: 99px; background: var(--stylo); }
.ach-cat strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
#contenu-achats.ach-survol { outline: 2px dashed var(--stylo); outline-offset: 6px; border-radius: var(--r-l); }
@media (max-width: 1100px) { .ach-corps { grid-template-columns: minmax(0, 1fr); } .ach-liste { max-height: none; } }
@media (max-width: 760px) { .ach-chiffres { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Mise en page des PDF (réglages des devis) */
.pdf-modeles { display: flex; flex-wrap: wrap; gap: 8px; }
.pdf-modeles label { display: flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 10px; background: var(--bureau); cursor: pointer; font-size: 13.5px; }
.pdf-modeles label:has(input:checked) { background: var(--stylo-doux); color: var(--stylo-fonce); font-weight: 600; }
.pdf-couleurs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pdf-couleurs label { width: 26px; height: 26px; border-radius: 50%; cursor: pointer; position: relative; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); }
.pdf-couleurs input { position: absolute; opacity: 0; }
.pdf-couleurs label:has(input:checked) { box-shadow: 0 0 0 2px var(--papier), 0 0 0 4px var(--encre); }
.pdf-couleurs label:has(input:focus-visible) { outline: 2px solid var(--stylo); outline-offset: 4px; }
.pdf-logo { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pdf-logo img { max-height: 44px; max-width: 160px; border-radius: 6px; background: #fff; box-shadow: inset 0 0 0 1px var(--trait); padding: 3px; }

/* Documents du mois */
.pastille-mois { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 99px; background: var(--rouge); color: #fff; font-size: 11px; font-weight: 700; }
.mois-reglages { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-bottom: 12px; }
.mois-reglages .champ.large { flex: 1 1 100%; margin: 0; }
.mois-jour { display: flex; gap: 6px; align-items: center; font-size: 13.5px; }
.mois-jour select { height: 32px; border-radius: 9px; border: 1px solid var(--trait-fort); padding: 0 8px; font: inherit; background: var(--papier); }
.mois-prochaine { margin-left: auto; }
.mois-liste li[data-mois-ouvrir] { background: var(--papier); border-radius: var(--r-m); padding: 10px 12px; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(15, 27, 45, .07); display: grid; gap: 2px; }
.mois-liste li[data-mois-ouvrir]:hover { box-shadow: inset 0 0 0 1px var(--stylo-doux); }
.mois-liste li.ouvert { box-shadow: inset 0 0 0 2px var(--stylo); }
.mois-liste li > div:first-child { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.mois-apercu { width: 100%; height: 68vh; min-height: 420px; border: 0; border-radius: var(--r-m); background: #fff; box-shadow: inset 0 0 0 1px var(--trait); margin-top: 12px; }
#mois-lettre .champ { margin-bottom: 10px; }
.mois-section { display: grid; gap: 6px; padding: 10px; border-radius: var(--r-m); background: var(--papier-2); margin-bottom: 8px; }
.mois-section input, .mois-section textarea { width: 100%; font: inherit; padding: 7px 9px; border-radius: 9px; border: 1px solid var(--trait); background: #fff; }
.mois-section input { font-weight: 600; flex: 1; }
.mois-section textarea { resize: vertical; }
.mois-deux { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 12px; }
.ach-alerte { color: var(--ambre); background: var(--ambre-doux); padding: 8px 12px; border-radius: var(--r-m); margin: 0 0 10px; }
.ach-alerte.rouge { color: var(--rouge); background: var(--rouge-doux); }
