/* PDF / Print — match letterhead preview + html2pdf export */
@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  html,
  body {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }

  .editor,
  .toast,
  .preview-label,
  .print-tip,
  .no-print,
  .view-toolbar,
  .db-status,
  .search-shell,
  .load-error {
    display: none !important;
  }

  .app {
    display: block !important;
  }

  .preview-wrap,
  .view-preview-wrap {
    padding: 0 !important;
    margin: 0 !important;
  }

  .invoice.pro-invoice {
    width: 210mm !important;
    max-width: 210mm !important;
    min-width: 210mm !important;
    margin: 0 auto !important;
    border: none !important;
    box-shadow: none !important;
    font-size: 11px !important;
  }

  .inv-accent-bar {
    background: linear-gradient(90deg, #e31e24 0%, #f7941d 55%, #e31e24 100%) !important;
  }

  .inv-sheet-header .ish-bar {
    background: #ffffff !important;
  }

  .ish-gap {
    background: #fff !important;
  }

  .ish-accent-red {
    background: #ee1c25 !important;
  }

  .ish-accent-grey {
    background: #a7a7a5 !important;
  }

  .ish-services {
    color: #ee1c25 !important;
  }

  .ish-vrule {
    background: #a7a7a5 !important;
  }

  .isf-rule-red {
    background: #ee1c25 !important;
  }

  .isf-rule-grey {
    background: #a7a7a5 !important;
  }

  .inv-info-block {
    margin: 0 !important;
    padding-bottom: 12px !important;
    border-bottom: 2px solid #e31e24 !important;
    font-family: Georgia, "Times New Roman", Times, serif !important;
  }

  .inv-ar-label,
  .th-ar,
  .t-ar {
    display: none !important;
  }

  .inv-title-classic {
    color: #e31e24 !important;
  }

  .inv-customer-box {
    border-color: #e31e24 !important;
  }

  .inv-no-box {
    background: #eceef2 !important;
    border-color: #b8bec8 !important;
  }

  .inv-doc-strip .inv-title-pro {
    color: #e31e24 !important;
  }

  .inv-logo-wrap {
    background: #ffffff !important;
    border: 1px solid #e2e5eb !important;
  }

  .inv-hero-inner {
    display: flex !important;
    padding: 22px 26px 18px !important;
  }

  .inv-title-pro {
    color: #e31e24 !important;
  }

  .inv-hero-rule {
    background: linear-gradient(90deg, #e31e24 0%, #f7941d 50%, transparent 100%) !important;
  }

  .inv-meta-grid {
    display: grid !important;
    grid-template-columns: 1.4fr 0.9fr 0.9fr 0.9fr !important;
    gap: 10px !important;
    margin: 0 !important;
  }

  .meta-card::before {
    background: linear-gradient(90deg, #e31e24 0%, #f7941d 100%) !important;
  }

  .items-table thead {
    background: #e31e24 !important;
    color: #fff !important;
  }

  .balance-row td {
    background: #e31e24 !important;
    color: #fff !important;
  }

  .balance-words-box {
    background: #fff8f0 !important;
    border: 1px solid #f7941d !important;
  }

  .qr-box {
    border: 2px solid #e31e24 !important;
  }

  .inv-sheet-footer {
    background: #ffffff !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  .isf-bottom-bar {
    background: #ee1c25 !important;
  }

  .invoice.density-tight .ish-bar {
    padding: 8px 34px !important;
    min-height: 116px !important;
    --ish-band-h: 116px !important;
  }

  .invoice.density-tight .ish-logo-img {
    height: 96px !important;
    min-height: 96px !important;
  }

  .invoice.density-tight .items-table td {
    padding: 5px 8px !important;
    font-size: 0.72rem !important;
  }
}

.invoice.pro-invoice.pdf-export,
.pdf-capture-host .invoice.pro-invoice,
.inv-page-sheet {
  width: 794px !important;
  max-width: 794px !important;
  min-width: 794px !important;
  min-height: 1123px !important;
  display: flex !important;
  flex-direction: column !important;
  margin: 0 !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  font-size: 11px !important;
  background: #ffffff !important;
  --inv-pad-x: 64px !important;
  --inv-header-pad-x: 12px !important;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

.pdf-capture-host .ish-bar,
.invoice.pro-invoice.pdf-export .ish-bar {
  background: #ffffff !important;
}

.pdf-capture-host .ish-accent-red,
.invoice.pro-invoice.pdf-export .ish-accent-red {
  background: #ee1c25 !important;
}

.pdf-capture-host .ish-accent-grey,
.invoice.pro-invoice.pdf-export .ish-accent-grey {
  background: #a7a7a5 !important;
}

.pdf-capture-host .ish-gap,
.invoice.pro-invoice.pdf-export .ish-gap {
  background: #fff !important;
}

.pdf-capture-host .ish-services,
.invoice.pro-invoice.pdf-export .ish-services {
  color: #ee1c25 !important;
}

.pdf-capture-host .ish-vrule,
.invoice.pro-invoice.pdf-export .ish-vrule {
  background: #a7a7a5 !important;
}

.pdf-capture-host .isf-rule-red,
.invoice.pro-invoice.pdf-export .isf-rule-red {
  background: #ee1c25 !important;
}

.pdf-capture-host .isf-rule-grey,
.invoice.pro-invoice.pdf-export .isf-rule-grey {
  background: #a7a7a5 !important;
}

.pdf-capture-host .inv-info-block,
.invoice.pro-invoice.pdf-export .inv-info-block {
  margin: 0 !important;
  padding-top: 4px !important;
  padding-bottom: 12px !important;
  border-bottom: 2px solid #e31e24 !important;
}

.pdf-capture-host .inv-ar-label,
.pdf-capture-host .inv-title-classic,
.invoice.pro-invoice.pdf-export .inv-ar-label,
.invoice.pro-invoice.pdf-export .inv-title-classic {
  color: #e31e24 !important;
}

.pdf-capture-host .inv-customer-box,
.invoice.pro-invoice.pdf-export .inv-customer-box {
  border-color: #e31e24 !important;
}

.pdf-capture-host .inv-no-box,
.invoice.pro-invoice.pdf-export .inv-no-box {
  background: #eceef2 !important;
  border-color: #b8bec8 !important;
}

.pdf-capture-host .items-table thead,
.invoice.pro-invoice.pdf-export .items-table thead {
  background: #e31e24 !important;
  color: #fff !important;
}

.pdf-capture-host .balance-row td,
.invoice.pro-invoice.pdf-export .balance-row td {
  background: #e31e24 !important;
  color: #fff !important;
}

.pdf-capture-host .balance-words-box,
.invoice.pro-invoice.pdf-export .balance-words-box {
  background: #fff8f0 !important;
  border: 1px solid #f7941d !important;
}

.pdf-capture-host .qr-box,
.invoice.pro-invoice.pdf-export .qr-box {
  border: 2px solid #e31e24 !important;
}

.pdf-capture-host .inv-watermark img,
.invoice.pro-invoice.pdf-export .inv-watermark img,
.inv-page-sheet .inv-watermark img {
  max-width: 220px !important;
  max-height: 160px !important;
  width: auto !important;
  height: auto !important;
  opacity: 0.08 !important;
}

.pdf-capture-host .ish-logo-img,
.invoice.pro-invoice.pdf-export .ish-logo-img {
  height: 96px !important;
  min-height: 96px !important;
  max-width: none !important;
}

.pdf-capture-host .isf-bottom-bar,
.invoice.pro-invoice.pdf-export .isf-bottom-bar {
  background: #ee1c25 !important;
}

.invoice.pro-invoice.pdf-export {
  box-shadow: none !important;
  margin: 0 !important;
}

body.pdf-export-active {
  overflow: hidden !important;
}

body.pdf-export-active .deploy-stamp {
  visibility: hidden !important;
}

body.print-invoice .editor,
body.print-invoice .preview-label,
body.print-invoice .no-print {
  display: none !important;
}

body.print-invoice .app {
  display: block !important;
}

body.print-invoice .preview-wrap {
  padding: 0 !important;
}
