/* Mise en page A4 reprenant le modèle Excel DISTEK */
body.printing { background: #e9ebef; }
body.printing .topbar { display: none; }
body.printing main { max-width: none; padding: 16px; }

.print-bar { max-width: 210mm; margin: 0 auto 12px; display: flex; gap: 8px; align-items: center; }

.sheet {
  width: 210mm; min-height: 297mm; margin: 0 auto; background: #fff; color: #000;
  padding: 14mm 14mm 12mm; font-family: Arial, Helvetica, sans-serif; font-size: 10pt;
  box-shadow: 0 2px 12px rgba(0,0,0,.15); display: flex; flex-direction: column;
}
.sheet .soc-nom { text-align: center; font: italic 700 18pt "Times New Roman", serif; margin: 4mm 0 8mm; }
.sheet .soc-info { font: italic 700 9.5pt "Times New Roman", serif; line-height: 1.35; }

.sheet .head { display: flex; justify-content: space-between; align-items: flex-start; margin-top: 8mm; gap: 8mm; }
.sheet .box { border: 1.3px solid #000; border-radius: 3mm; }
.sheet .doc-box { width: 72mm; overflow: hidden; margin-top: 2mm; }
.sheet .doc-box .titre { text-align: center; font-weight: 700; font-size: 11pt; border-bottom: 1.3px solid #000; padding: 1mm; }
.sheet .doc-box table { width: 100%; border-collapse: collapse; font-size: 8.5pt; }
.sheet .doc-box th { font-weight: 700; font-style: italic; border-right: 1px solid #000; border-bottom: 1px solid #000; padding: 1mm; }
.sheet .doc-box td { border-right: 1px solid #000; padding: 2mm 1mm; text-align: center; font-style: italic; font-weight: 700; }
.sheet .doc-box th:last-child, .sheet .doc-box td:last-child { border-right: none; }
.sheet .client-box { width: 82mm; min-height: 24mm; padding: 2mm 3mm; font-style: italic; font-weight: 700; line-height: 1.45; }

.sheet table.items { width: 100%; border-collapse: collapse; margin-top: 10mm; }
.sheet table.items th { border: 1px solid #000; border-bottom: 2px solid #000; font-style: italic; font-size: 8.5pt; padding: 1.5mm; }
.sheet table.items td { border-left: 1px solid #000; border-right: 1px solid #000; padding: 2mm 1.5mm; font-style: italic; font-weight: 700; vertical-align: top; }
.sheet table.items tbody tr:last-child td { border-bottom: 1px solid #000; }
.sheet table.items .c { text-align: center; }
.sheet table.items .r { text-align: right; white-space: nowrap; }
.sheet table.items .des { width: 46%; }
.sheet table.items tr.filler td { height: 8mm; }

.sheet .bas { display: flex; justify-content: space-between; align-items: flex-start; margin-top: 8mm; gap: 8mm; }
.sheet .tva-box { width: 58mm; min-height: 30mm; overflow: hidden; }
.sheet .tva-box table { width: 100%; border-collapse: collapse; font-size: 8.5pt; }
.sheet .tva-box th { font-style: italic; border-bottom: 1px solid #000; border-right: 1px solid #000; padding: 1mm; }
.sheet .tva-box td { border-right: 1px solid #000; padding: 1.5mm; text-align: center; }
.sheet .tva-box th:last-child, .sheet .tva-box td:last-child { border-right: none; }
.sheet .tot-box { width: 52mm; padding: 2mm 3mm; font-weight: 700; font-size: 9pt; }
.sheet .tot-box div { display: flex; justify-content: space-between; padding: 1mm 0; }
.sheet .tot-box .net { margin-top: 2mm; }
.sheet .exo { margin-top: 3mm; font-size: 8.5pt; font-style: italic; font-weight: 700; }

.sheet .arrete { display: flex; margin-top: 8mm; min-height: 22mm; }
.sheet .arrete .txt { flex: 1; padding: 2mm 3mm; font-weight: 700; font-size: 9.5pt; border-right: 1.3px solid #000; }
.sheet .arrete .sig { width: 48mm; text-align: center; font-weight: 700; font-style: italic; text-decoration: underline; font-size: 8.5pt; padding-top: 1mm; }
.sheet .notes { margin-top: 5mm; font-size: 8.5pt; white-space: pre-wrap; }
.sheet .pied { margin-top: auto; padding-top: 6mm; font-size: 7.5pt; text-align: center; color: #333; border-top: 1px solid #999; }
.sheet .filigrane { position: relative; }
.sheet .brouillon { text-align: center; color: #c00; font-weight: 700; font-size: 12pt; border: 2px dashed #c00; padding: 2mm; margin-bottom: 4mm; }

@media print {
  @page { size: A4; margin: 0; }
  body, body.printing { background: #fff; }
  body.printing main { padding: 0; }
  .no-print, .print-bar { display: none !important; }
  .sheet { box-shadow: none; margin: 0; width: 210mm; min-height: 297mm; }
  .sheet table.items tr { break-inside: avoid; }
}
