/* === Print CSS (Consolidated) — Two A4 pages, compact, no conflicting rules === */
@media print {
  /* Page setup */
  @page { size: A4; margin: 10mm; }
  html, body { background: white !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  /* Typography & spacing */
  h1 { font-size: 1.28rem; }
  h2 { font-size: 1.08rem; margin-top: 10px; }
  label, input, select, textarea, p, td, th { font-size: 0.90rem; }
  .small, .muted { font-size: 0.78rem; }
  .pill { font-size: 0.76rem; padding: 2px 6px; }
  .total-line { font-size: 1.02rem; }

  /* Cards & tables */
  .card { padding: 6px; margin-bottom: 8px; box-shadow: none !important; }
  table th, table td { padding: 5px 5px; }
  .card, table, thead, tbody, tfoot { break-inside: avoid; }

  /* Header/logo compact if present */
  header.card { padding-left: 90px; }
  .logo-btu { height: 44px; }

  /* Compact form controls (~10% reduced) */
  input[type="text"], input[type="number"], input[type="date"], input[type="time"], select, textarea {
    padding-top: 9px !important; padding-bottom: 9px !important; line-height: 1.1;
  }
  textarea { min-height: 72px !important; }

  /* Specific tightening between sections 5 & 6 to help keep to 2 pages */
  section.card:nth-of-type(6) { margin-top: 4px !important; }
  section.card:nth-of-type(5) { margin-bottom: 6px !important; }

  /* Hide interactive-only UI */
  .btn, #fileImport, #btnExport, #btnImport { display: none !important; }

  /* Show 'print-only' content only when printing */
  .print-only { display: block !important; }

  /* Signature image: ONLY in Section 7 */
  img.sig-print { display: none !important; }
  #section-erklaerung img.sig-print { display: block !important; }
  #section-erklaerung .sigbox.signatur .sigline { position: relative; }
/*
  #section-erklaerung img.sig-print {
    position: absolute; bottom: 2px; left: 0;
    max-height: 18mm; max-width: 100%; object-fit: contain;
  }
*/
  /* Never show the approval signature image in print */
  #sigPrintApproval { display: none !important; }
}
