/* Rendu des documents AFECO — reproduction des modèles Word (A4). */
.pg {
  --ink: #1b1a18;
  --muted: #6f6a63;
  --light: #9b958c;
  --orange: #e85d22;
  --orange-dk: #b8471a;
  --panel: #f7f5f1;
  --peach: #fbeee6;
  --line: #e4e0d8;
  --serif: Garamond, 'EB Garamond', 'Times New Roman', serif;
  --sans: Arial, Arimo, 'Liberation Sans', Helvetica, sans-serif;
  --narrow: 'Arial Narrow', 'Archivo Narrow', 'Roboto Condensed', Arial, sans-serif;
  position: relative;
  box-sizing: border-box;
  width: 210mm;
  height: 297mm;
  padding: 12mm 12.7mm 7mm;
  background: #fff;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 11pt;
  line-height: 1.22;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.pg *, .pg *::before, .pg *::after { box-sizing: border-box; }
.pg p { margin: 0; }

/* En-tête et pied de page */
.pg-head { display: flex; justify-content: space-between; align-items: flex-end; padding-bottom: 2.6mm; border-bottom: 0.5mm solid var(--orange); }
.pg-head img { width: 44.5mm; height: auto; display: block; }
.pg-headtxt { font-size: 8.5pt; font-weight: 700; color: var(--muted); letter-spacing: 0.02em; text-transform: uppercase; padding-bottom: 1mm; }
.pg-body { flex: 1 1 auto; min-height: 0; overflow: hidden; padding-top: 1mm; }
.pg-foot { border-top: 0.25mm solid #ebe8e2; padding-top: 3mm; text-align: center; font-size: 7.5pt; line-height: 1.35; color: var(--muted); }
.pg-foot b { color: var(--orange); display: block; font-size: 7.5pt; }
.pg-foot i { color: var(--light); }

.pg-draft { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; z-index: 5; }
.pg-draft span { transform: rotate(-35deg); font: 700 64pt var(--sans); color: rgba(232, 93, 34, 0.09); letter-spacing: 0.1em; }

/* Bloc titre */
.d-top { display: grid; grid-template-columns: 1fr 65.5mm; gap: 6mm; align-items: start; margin-bottom: 7mm; }
.d-title { font: 700 28pt/1.1 var(--serif); margin: 4mm 0 1.6mm; letter-spacing: -0.005em; }
.d-sub { color: var(--orange); font-weight: 700; font-size: 9pt; text-transform: uppercase; letter-spacing: 0.01em; }
.d-meta { background: var(--panel); border: 0.25mm solid #ebe8e2; border-top: 0; padding: 3.2mm 3.5mm 4mm; font-size: 9.5pt; line-height: 1.45; color: var(--light); }
.d-meta b { color: var(--ink); }

/* Tiers */
.d-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 6mm; margin-bottom: 6.5mm; }
.d-lbl { font-size: 7.5pt; font-weight: 700; color: var(--light); text-transform: uppercase; letter-spacing: 0.02em; margin-bottom: 1.4mm; }
.d-name { font: 700 12pt/1.2 var(--serif); text-transform: uppercase; margin-bottom: 0.6mm; letter-spacing: 0.01em; }
.d-name.small { font-size: 10pt; text-transform: none; }
.d-party { color: var(--muted); font-size: 11pt; }
.d-party.dark { color: var(--ink); }
.d-serif-b { font: 700 10.5pt var(--serif); color: var(--ink); }

/* Tableau des lignes */
.d-table { width: 100%; border-collapse: collapse; table-layout: fixed; margin-bottom: 0; }
.d-table th { background: var(--panel); border-bottom: 0.55mm solid var(--orange); border-top: 0.25mm solid var(--line); text-align: left; font-size: 8.5pt; font-weight: 700; text-transform: uppercase; padding: 2.4mm 2.2mm; vertical-align: top; letter-spacing: 0.01em; }
.d-table th:first-child { border-left: 0.25mm solid var(--line); }
.d-table th:last-child { border-right: 0.25mm solid var(--line); }
.d-table td { border: 0.25mm solid var(--line); padding: 2mm 2.2mm; vertical-align: middle; font-size: 11pt; }
.d-table td.des { vertical-align: top; }
.d-table .ln-des { font-weight: 700; font-size: 11.5pt; }
.d-table .ln-det { color: var(--muted); font-size: 10pt; line-height: 1.25; }
.d-table .ref { color: var(--muted); }
.d-table .num { text-align: right; white-space: nowrap; }
.d-table .tot { font-weight: 700; }
.d-table .c { text-align: center; }
.d-after { height: 5.5mm; }

/* Conditions + totaux */
.d-bottom { display: grid; grid-template-columns: 1fr 87mm; gap: 2mm; margin-bottom: 5mm; }
.d-conds { font-size: 11pt; }
.d-conds div { margin-bottom: 1.2mm; }
.d-conds small { font-size: 7.5pt; font-weight: 700; color: var(--light); text-transform: uppercase; letter-spacing: 0.02em; margin-right: 1mm; }
.d-tot { font-size: 10.5pt; }
.d-tot .row { display: flex; justify-content: space-between; color: var(--muted); padding: 0.35mm 0; }
.d-tot .row b { color: var(--ink); }
.d-tot .row.strong { color: var(--ink); font-weight: 700; }
.d-net { margin-top: 1.2mm; background: var(--peach); border: 0.3mm solid #f0a47f; padding: 2.4mm 3.5mm 2.2mm; }
.d-net .l { color: var(--orange); font-weight: 700; font-size: 9pt; text-transform: uppercase; }
.d-net .v { font: 700 18pt/1.15 var(--serif); color: var(--orange-dk); }
.d-net .s { font-size: 8pt; color: var(--light); }

.d-words { text-align: center; font-style: italic; font-size: 11pt; margin: 0 0 3mm; }
.d-thanks { text-align: center; font-style: italic; font-size: 9.5pt; color: var(--muted); margin-bottom: 5mm; }

.d-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 6mm; font-size: 10.5pt; color: var(--muted); }
.d-sign h4 { margin: 0 0 3mm; color: var(--ink); font-size: 10pt; font-weight: 700; text-transform: uppercase; }
.d-sign p { margin-bottom: 2.6mm; }
.d-sign p:last-child { margin-bottom: 0; }

/* Conditions générales */
.cgv-title { font-weight: 700; font-size: 9pt; margin: 1mm 0 2mm; }
.cgv-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 5mm; }
.cgv-col { overflow: hidden; font-family: var(--narrow); font-size: 5pt; line-height: 1.22; text-align: justify; }
.cgv-col .h { font-weight: 700; margin-top: 0.8mm; }
.cgv-col p { margin: 0; }
.cgv-col p.split { text-align-last: justify; }

/* Fiche technique */
.ft-kicker { color: var(--orange); font-weight: 700; font-size: 9pt; text-transform: uppercase; margin-top: 0.8mm; }
.ft-title { font: 700 18pt/1.2 var(--serif); margin: 1.5mm 0 4mm; }
.ft-title span { font-weight: 700; }
.ft-photo { display: flex; justify-content: center; }
.ft-photo img { max-width: 110mm; max-height: 62mm; object-fit: contain; }
.ft-photo .ph { width: 64mm; height: 62mm; background: #efece6; border: 1.2mm solid #f4f2ee; outline: 0.25mm solid #d9d4cb; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--light); font-weight: 700; font-size: 10pt; }
.ft-cap { text-align: center; font-style: italic; font-size: 8pt; color: var(--light); margin: 2mm 0 3mm; }
.ft-specs { width: 100%; border-collapse: collapse; font-size: 10.5pt; margin-bottom: 4mm; }
.ft-specs td { border: 0.25mm solid var(--line); padding: 1.6mm 2.4mm; }
.ft-specs td:first-child { width: 32%; background: var(--panel); color: var(--muted); font-weight: 700; font-size: 9.5pt; }
.ft-desc h5 { margin: 0 0 1.5mm; font-size: 8.5pt; text-transform: uppercase; }
.ft-desc p { font-size: 9.5pt; margin-bottom: 1.4mm; }
.ft-src { font-style: italic; font-size: 7.5pt; color: var(--light); margin-top: 2mm; }

/* Reçu de paiement (mise en page spécifique) */
.pg.recu { --r: #ff7f38; padding: 14mm 18mm; }
.r-head { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 5mm; border-bottom: 0.6mm solid var(--r); margin-bottom: 5mm; }
.r-head img { width: 49mm; margin-top: 3mm; }
.r-head .t { text-align: right; }
.r-head h1 { margin: 0; color: var(--r); font-size: 16pt; font-weight: 700; }
.r-head .n { font-weight: 700; font-size: 11pt; margin-top: 1mm; }
.r-head .d { color: #666; font-size: 10pt; }
.r-boxes { display: grid; grid-template-columns: 1fr 1fr; gap: 4mm; margin-bottom: 8mm; }
.r-box { border: 0.25mm solid #e6e6e6; border-left: 1mm solid var(--r); padding: 2.6mm 3.5mm; font-size: 9.5pt; line-height: 1.5; color: #666; }
.r-box .k { color: var(--r); font-weight: 700; font-size: 7.5pt; letter-spacing: 0.15em; text-transform: uppercase; }
.r-box b { color: #000; }
.r-amount { display: grid; grid-template-columns: 62mm 1fr; margin-bottom: 8mm; }
.r-amount .a { background: #000; color: #fff; padding: 4mm; }
.r-amount .a .k { font-size: 8pt; font-weight: 700; letter-spacing: 0.15em; }
.r-amount .a .v { color: var(--r); font-size: 17pt; font-weight: 700; margin-top: 0.8mm; white-space: nowrap; }
.r-amount .w { background: #fff1e8; padding: 4mm; font-size: 8pt; color: #666; }
.r-amount .w i { display: block; font-weight: 700; font-size: 10.5pt; color: #000; margin-top: 1mm; }
.r-desc .k { background: var(--r); color: #fff; font-weight: 700; font-size: 8pt; letter-spacing: 0.15em; padding: 1.8mm 3mm; }
.r-desc .t { padding: 2.6mm 3mm; font-size: 10pt; border-bottom: 0.25mm solid #e6e6e6; min-height: 12mm; }
.r-sign { display: grid; grid-template-columns: 1fr 72mm; margin-top: 11mm; align-items: end; }
.r-sign .s { text-align: center; font-size: 10pt; }
.r-sign .s small { display: block; font-size: 7.5pt; color: #666; margin-bottom: 20mm; }
.r-sign .s .ln { border-top: 0.3mm solid #000; }
.r-sign .m { font-style: italic; color: #666; font-size: 9.5pt; }

/* Mise en forme du texte saisi */
.pg .pre { white-space: pre-line; }
