/* =============================================================================
   impulsestation.org — Facture et QR-facture suisse
   Chargée après styles.css. Les dimensions de la section de paiement sont
   imposées par les Swiss Implementation Guidelines de SIX : elles sont écrites
   en millimètres et ne doivent jamais être exprimées en pixels ni en pourcentage.
   ============================================================================= */

/* ---------- Éditeur ---------- */
.fac-lignes{ width:100%; border-collapse:collapse; font-size:13px; }
.fac-lignes th{
  font-family:var(--mono); font-size:10px; text-transform:uppercase; letter-spacing:0.06em;
  color:var(--muted); text-align:left; padding:0 6px 6px 0; font-weight:700;
}
.fac-lignes td{ padding:0 6px 8px 0; vertical-align:top; }
.fac-lignes input, .fac-lignes select{
  width:100%; font-family:var(--sans); font-size:13px; color:var(--ink);
  border:1.5px solid var(--border); border-radius:8px; padding:8px 9px; background:var(--card);
}
.fac-lignes input:focus, .fac-lignes select:focus{ outline:none; border-color:var(--stamp); }
.fac-lignes .fac-col-nombre input{ text-align:right; }
.fac-lignes-conteneur{ overflow-x:auto; }
.fac-totaux{ margin-top:16px; display:flex; justify-content:flex-end; }
.fac-totaux table{ border-collapse:collapse; font-size:13.5px; min-width:260px; }
.fac-totaux td{ padding:5px 0 5px 18px; }
.fac-totaux td:last-child{ text-align:right; font-family:var(--mono); font-weight:700; color:var(--ink); }
.fac-totaux tr.fac-total-final td{
  border-top:1.5px solid var(--border); padding-top:9px; font-size:15px; font-weight:700; color:var(--ink);
}

/* ---------- Page A4 ---------- */
.fac-page{
  width:210mm; min-height:297mm; background:#ffffff; color:#1a1a1a;
  box-sizing:border-box; box-shadow:0 2px 14px rgba(0,0,0,0.18);
  font-family:Arial, 'Helvetica Neue', Helvetica, 'Liberation Sans', sans-serif;
  font-size:10pt; line-height:1.4; position:relative;
}
.fac-page *{ box-sizing:border-box; }
.fac-page, .fac-page *{ -webkit-print-color-adjust:exact; print-color-adjust:exact; }
/* styles.css impose « h1 { font-family: var(--h1-font) } » à toute la page :
   le document doit y échapper, sans quoi il changerait de police avec le thème. */
.fac-page h1, .fac-page h2, .fac-page h3, .fac-page p, .fac-page table{
  font-family:inherit; margin:0; letter-spacing:normal;
}
.fac-corps{ padding:16mm 15mm 0; }
.fac-entete{ display:flex; justify-content:space-between; gap:10mm; }
.fac-titre{ font-size:20pt; font-weight:bold; }
.fac-bloc-adresse{ font-size:10pt; line-height:1.45; }
.fac-meta{ margin-top:8mm; font-size:9.5pt; }
.fac-meta span{ display:inline-block; min-width:38mm; color:#555555; }
.fac-table-lignes{ width:100%; border-collapse:collapse; margin-top:8mm; font-size:9.5pt; }
.fac-table-lignes th{
  text-align:left; border-bottom:0.6mm solid currentColor; padding:0 2mm 1.5mm 0;
  font-size:8.5pt; text-transform:uppercase; letter-spacing:0.04em;
}
.fac-table-lignes td{ padding:1.5mm 2mm 1.5mm 0; border-bottom:0.2mm solid #dddddd; vertical-align:top; }
.fac-table-lignes .fac-nombre{ text-align:right; white-space:nowrap; }
.fac-recap{ margin-top:6mm; display:flex; justify-content:flex-end; }
.fac-recap table{ border-collapse:collapse; font-size:9.5pt; min-width:70mm; }
.fac-recap td{ padding:1mm 0 1mm 6mm; }
.fac-recap td:last-child{ text-align:right; white-space:nowrap; }
.fac-recap tr.fac-du td{ border-top:0.5mm solid currentColor; font-weight:bold; font-size:11pt; padding-top:2mm; }
.fac-conditions{ margin-top:8mm; font-size:9pt; color:#444444; }

/* ---------- Section de paiement (dimensions imposées par SIX) ---------- */
.fac-paiement{
  position:absolute; left:0; bottom:0; width:210mm; height:105mm;
  display:flex; color:#000000; background:#ffffff;
  border-top:0.3mm dashed #000000;
}
.fac-ciseaux{
  position:absolute; left:0; top:-3.4mm; width:210mm; text-align:center;
  font-size:8pt; line-height:1; color:#000000;
}
.fac-recepisse{ width:62mm; height:105mm; padding:5mm; border-right:0.3mm dashed #000000; position:relative; }
.fac-section{ width:148mm; height:105mm; padding:5mm 5mm 5mm 5mm; display:flex; gap:5mm; }
.fac-colonne-qr{ width:51mm; }
.fac-colonne-infos{ width:87mm; }

/* Tailles de police imposées : récépissé 6 pt / 8 pt, section paiement 8 pt / 10 pt,
   titres 11 pt gras. */
.fac-recepisse .fac-titre-part{ font-size:11pt; font-weight:bold; }
.fac-recepisse .fac-rubrique{ font-size:6pt; font-weight:bold; line-height:1.15; margin-top:2.5mm; }
.fac-recepisse .fac-valeur{ font-size:8pt; line-height:1.2; }
.fac-section .fac-titre-part{ font-size:11pt; font-weight:bold; }
.fac-section .fac-rubrique{ font-size:8pt; font-weight:bold; line-height:1.15; margin-top:3mm; }
.fac-section .fac-valeur{ font-size:10pt; line-height:1.25; }
.fac-montant-ligne{ display:flex; gap:4mm; }
.fac-recepisse .fac-bas{ position:absolute; left:5mm; right:5mm; bottom:5mm; }
.fac-acceptation{ font-size:6pt; font-weight:bold; text-align:right; margin-top:4mm; }

/* Le QR doit mesurer exactement 46 × 46 mm, croix suisse de 7 × 7 mm au centre. */
.fac-qr{ position:relative; width:46mm; height:46mm; margin:5mm 0 0; }
.fac-qr canvas, .fac-qr img{ width:46mm; height:46mm; display:block; image-rendering:pixelated; }
.fac-qr-croix{
  position:absolute; left:50%; top:50%; width:7mm; height:7mm; transform:translate(-50%,-50%);
  background:#000000; border:0.4mm solid #ffffff;
}
.fac-qr-croix::before, .fac-qr-croix::after{
  content:""; position:absolute; background:#ffffff; left:50%; top:50%;
}
.fac-qr-croix::before{ width:1.3mm; height:4.1mm; transform:translate(-50%,-50%); }
.fac-qr-croix::after{ width:4.1mm; height:1.3mm; transform:translate(-50%,-50%); }

.fac-avertissement{
  margin-top:20px; padding:12px 16px; border-left:3px solid var(--stamp);
  background:var(--stamp-tint); border-radius:0 8px 8px 0; font-size:13px; line-height:1.65; color:var(--ink);
}
.fac-avertissement strong{ color:var(--ink); }

/* ---------- Impression ---------- */
@media print{
  /* La section de paiement touche les bords de la feuille : la page s'imprime
     sans marge, et ce sont les blocs qui portent leurs propres retraits. */
  #pro-impression .fac-page{
    width:210mm; min-height:297mm; margin:0; box-shadow:none; border:0;
  }
}

@media (max-width:520px){
  .fac-lignes{ font-size:12px; }
}
