/* Le Loquet — outil gratuit « modèle de facture ménage » (modele-facture-menage.php, 23/11/2026). Chargé APRÈS assets/outils.css (hub, formulaire, aperçu).
   Ordre : formulaire (lignes de ménages, contrôle des mentions) · textes · FACTURE A4 (sobre, noir et vert de la charte :
   une facture se lit, elle ne se décore pas) · impression (seule la facture, A4, sur autant de pages qu'il faut, titres du tableau répétés). */

/* ---------- formulaire ---------- */
.fm-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 12px; }
.fm-lignes { display: grid; gap: 10px; }
.fm-ligne { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 44px; gap: 6px 8px; padding: 12px; border: 1px solid #dde3dc; border-radius: 12px; background: #fbfcfa; }
.fm-ligne label { display: flex; flex-direction: column; gap: 3px; margin: 0 !important; font: 600 12.5px IN, system-ui, sans-serif !important; color: var(--mut) !important; min-width: 0; }
.fm-ligne input { width: 100%; font: 500 15px IN, system-ui, sans-serif; color: var(--ink); background: #fff; border: 1px solid #cdd4cc; border-radius: 9px; padding: 8px 10px; min-height: 42px; }
.fm-ligne input[type=date] { padding: 8px 6px; font-size: 14.5px; }
.fm-ligne input:focus { outline: 2px solid var(--pri); outline-offset: 1px; border-color: var(--pri); }
/* une ligne = 3 rangs : date | logement · prestation · qté | prix | × */
.fm-l-date { grid-column: 1; grid-row: 1; }
.fm-l-log { grid-column: 2 / 4; grid-row: 1; }
.fm-l-des { grid-column: 1 / 4; grid-row: 2; }
.fm-l-q { grid-column: 1; grid-row: 3; }
.fm-l-pu { grid-column: 2; grid-row: 3; }
.fm-ligne .fb-x { grid-column: 3; grid-row: 3; align-self: end; height: 42px; }
.fm-ajouts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.fm-manque { margin: 0 0 12px; padding: 10px 14px; border-radius: 12px; background: #fff3c4; color: var(--ink); font-size: 14.5px; line-height: 1.45; }
.fm-manque.fm-ok { background: var(--acc); color: var(--deep2); }
.fm-cadre .fm-a4 { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
@media (max-width: 899px) { .fm-ajouts { grid-template-columns: minmax(0, 1fr); } }

/* ---------- textes sous l'outil ---------- */
.fm-src { font-size: 14px; margin-top: 10px !important; }
.fm-src a { color: var(--pri); }

/* ---------- FACTURE A4 ---------- */
.fm-a4 { width: 210mm; min-height: 296mm; background: #fff; color: #1d2421; font: 500 13px/1.45 IN, system-ui, sans-serif; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.fa-in { padding: 16mm 15mm 14mm; display: flex; flex-direction: column; gap: 18px; min-height: 296mm; }
.fm-a4 p { margin: 0; }
.fa-vide { color: #a3aca7; }
.fa-tete { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; padding-bottom: 16px; border-bottom: 2px solid #2f5d50; }
.fa-vendeur p { color: #3b4440; }
.fa-nom { font: 700 19px/1.25 SG, system-ui, sans-serif; color: #14231e !important; margin-bottom: 4px !important; }
.fa-ei { font: 700 13px IN, system-ui, sans-serif; letter-spacing: 0.06em; color: #2f5d50; }
.fa-titre { text-align: right; flex: none; }
.fa-mot { font: 700 30px/1 SG, system-ui, sans-serif; letter-spacing: 0.02em; text-transform: uppercase; color: #2f5d50; }
.fa-num { font: 700 15px IN, system-ui, sans-serif; margin: 6px 0 8px !important; }
.fa-client { align-self: flex-end; width: 46%; border: 1px solid #d8ddd8; border-radius: 8px; padding: 12px 14px; }
.fa-et { font: 600 10.5px IN, system-ui, sans-serif; letter-spacing: 0.14em; text-transform: uppercase; color: #5b6863; margin-bottom: 4px !important; }
.fa-cnom { font-weight: 700; font-size: 14px; }
.fa-objet { color: #3b4440; }
.fa-tab { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.fa-tab thead { display: table-header-group; }
.fa-tab th { text-align: left; font: 600 10.5px IN, system-ui, sans-serif; letter-spacing: 0.08em; text-transform: uppercase; color: #fff; background: #2f5d50; padding: 7px 8px; }
.fa-tab td { padding: 7px 8px; border-bottom: 1px solid #e3e7e3; vertical-align: top; }
.fa-tab tr { break-inside: avoid; page-break-inside: avoid; }
.fa-tab tbody tr:nth-child(even) td { background: #f6f8f6; }
.fa-tab .fa-n { text-align: right; white-space: nowrap; }
.fa-tab .fa-d { white-space: nowrap; width: 1%; }
.fa-vide-l td { color: #8a948f; text-align: center; padding: 22px 8px; font-style: italic; }
.fa-bas { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; break-inside: avoid; page-break-inside: avoid; }
.fa-mentions { display: grid; gap: 6px; max-width: 58%; }
.fa-293 b { font-weight: 700; }
.fa-iban { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; white-space: nowrap; }
.fa-tot { border-collapse: collapse; min-width: 230px; font-size: 13.5px; }
.fa-tot td { padding: 6px 10px; border-bottom: 1px solid #e3e7e3; }
.fa-tot td:last-child { text-align: right; white-space: nowrap; font-weight: 600; }
.fa-ttc td { background: #2f5d50; color: #fff; font: 700 15px IN, system-ui, sans-serif !important; border: 0; }
.fa-pied { margin-top: auto; padding-top: 12px; border-top: 1px solid #d8ddd8; display: grid; gap: 4px; font-size: 10.5px; line-height: 1.4; color: #4b5550; break-inside: avoid; page-break-inside: avoid; }
.fa-mention { color: #8a948f; text-align: right; margin-top: 2px !important; }

/* ---------- impression : seule la facture, A4, autant de pages qu'il faut ---------- */
#fm-impr { position: absolute; left: -10000px; top: 0; visibility: hidden; pointer-events: none; }
@page { size: A4; margin: 10mm 0; @bottom-right { content: counter(page) ' / ' counter(pages); font: 9px system-ui, sans-serif; color: #8a948f; margin-right: 15mm; } }   /* marges : une 2e page ne commence pas au ras du papier ; numéro de page */
@media print {
  html, body.site { background: #fff !important; margin: 0 !important; padding: 0 !important; }
  body.site > *:not(#fm-impr) { display: none !important; }
  #fm-impr { display: block !important; position: static; visibility: visible; }
  #fm-impr .fm-a4 { transform: none !important; min-height: 0; }
  #fm-impr .fa-in { min-height: 276mm; padding: 6mm 15mm 4mm; }
}
