/* =========================================================
   POP QUOTE - LETTERHEAD PRINT & PDF STYLESHEET
   ========================================================= */

@media print {

  /* Clean slate for printing */
  html,
  body {
    background: #FFFFFF !important;
    color: #000000 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Completely remove non-printable application shell from document flow */
  .app-layout,
  .sidebar,
  .top-header,
  .mobile-bottom-nav,
  .toast-container,
  .modal-overlay:not(#quotePrintModal):not(#invoicePrintModal):not(#receiptPrintModal),
  .modal-header,
  .modal-footer,
  .no-print {
    display: none !important;
  }

  /* Keep active print modal in normal static document flow */
  #quotePrintModal,
  #invoicePrintModal,
  #receiptPrintModal {
    display: block !important;
    position: static !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #FFFFFF !important;
    box-shadow: none !important;
    border: none !important;
    overflow: visible !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  #quotePrintModal:not(.active),
  #invoicePrintModal:not(.active),
  #receiptPrintModal:not(.active) {
    display: none !important;
  }

  #quotePrintModal.active,
  #invoicePrintModal.active,
  #receiptPrintModal.active {
    display: block !important;
  }

  #quotePrintModal .modal-dialog,
  #invoicePrintModal .modal-dialog,
  #receiptPrintModal .modal-dialog {
    display: block !important;
    position: static !important;
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: #FFFFFF !important;
    overflow: visible !important;
    border-radius: 0 !important;
    animation: none !important;
    transform: none !important;
  }

  #quotePrintModal .modal-body,
  #invoicePrintModal .modal-body,
  #receiptPrintModal .modal-body {
    display: block !important;
    position: static !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #FFFFFF !important;
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
  }

  #quotePrintModal .letterhead-sheet,
  #invoicePrintModal .letterhead-sheet,
  #receiptPrintModal .letterhead-sheet,
  .letterhead-sheet,
    .letterhead-sheet.template-modern,
  .letterhead-sheet.template-classic,
  .letterhead-sheet.template-nordic,
  .letterhead-sheet.template-emerald,
  .invoice-statement-sheet,
  .payment-receipt-sheet {
    display: block !important;
    position: static !important;
    padding: 0 !important;
    margin: 0 auto !important;
    margin-bottom: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    transform: none !important;
    -webkit-transform: none !important;
    zoom: 1 !important;
    background: #FFFFFF !important;
    overflow: visible !important;
  }

  /* Table and grid formatting strictly inside A4 printable width */
  .print-table,
  .letterhead-sheet.template-modern .print-table,
  .letterhead-sheet.template-classic .print-table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
    box-sizing: border-box !important;
  }

  .print-meta-grid,
  .letterhead-sheet.template-modern .print-meta-grid,
  .letterhead-sheet.template-classic .print-meta-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 16px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .print-meta-grid .meta-col,
  .letterhead-sheet.template-modern .print-meta-grid .meta-col,
  .letterhead-sheet.template-classic .print-meta-grid .meta-col {
    min-width: 0 !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    box-sizing: border-box !important;
  }

  .print-bottom-grid,
  .letterhead-sheet.template-modern .print-bottom-grid,
  .letterhead-sheet.template-classic .print-bottom-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr) !important;
    gap: 16px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .print-bank-card,
  .print-totals-card {
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .print-header {
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .print-quote-badge {
    max-width: 45% !important;
    flex-shrink: 0 !important;
    word-break: break-word !important;
  }

  /* Keep authentic voucher layout during print */
  .receipt-header {
    flex-direction: row !important;
    align-items: center !important;
    gap: 16px !important;
  }

  .receipt-badge {
    align-items: flex-end !important;
    text-align: right !important;
    border-top: none !important;
    padding-top: 0 !important;
  }

  .receipt-amount-card {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
  }

  .receipt-amount-card .amt-right {
    align-items: flex-end !important;
    width: auto !important;
  }

  .receipt-meta-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 12px !important;
  }

  .receipt-signatures {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    margin-top: 24px !important;
  }

  #quotePrintModal *,
  #invoicePrintModal *,
  #receiptPrintModal *,
  .letterhead-sheet * {
    visibility: visible !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  @page {
    size: A4 portrait;
    margin: 10mm 12mm 10mm 12mm;
  }

  /* Prevent awkward page breaks */
  .print-header,
  .print-meta-grid,
  .receipt-header,
  .receipt-amount-card,
  .receipt-meta-grid {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  .print-table tr,
  .print-payment-table tr {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  .print-bottom-grid,
  .print-bank-card,
  .print-totals-card,
  .print-amount-words,
  .print-terms-block,
  .print-signatures-grid,
  .receipt-ledger-box,
  .receipt-signatures {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }
}

/* Base Letterhead Sheet Layout (Visible in preview & print) */
.letterhead-sheet {
  background: #FFFFFF;
  color: #1E293B;
  padding: 24px 28px;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  width: 794px;
  max-width: 794px;
  min-width: 794px;
  margin: 0 auto;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.05);
  border-radius: 6px;
  position: relative;
  font-size: 12px;
  line-height: 1.45;
  box-sizing: border-box;
  text-align: left;
}

/* Header & Branding */
.print-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  border-bottom: 1.5px solid #0F172A;
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.print-company-info {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.print-company-info .print-logo,
.print-company-info .print-company-logo,
.print-company-info .receipt-logo {
  width: 2in;
  height: 2in;
  max-width: 120px;
  max-height: 120px;
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 0;
  margin: 0;
}

.print-company-info h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: #0F172A;
  margin: 0 0 2px 0;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.print-company-info p.tagline {
  font-size: 10px;
  font-weight: 700;
  color: #B8860B;
  margin: 0 0 2px 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.print-company-info p.address,
.print-company-details p {
  font-size: 9.5px;
  color: #64748B;
  margin: 0 0 2px 0;
  line-height: 1.35;
  max-width: 440px;
}

.print-company-info .contact-line,
.print-company-details .contact-line {
  font-size: 9.5px;
  color: #64748B;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.print-company-info .contact-line span,
.print-company-details .contact-line span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.print-quote-badge {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}

.print-quote-badge .quote-tag,
.print-quote-badge .badge-title {
  background: #0F172A;
  color: #FFFFFF;
  padding: 3px 10px;
  border-radius: 4px;
  font-family: 'Plus Jakarta Sans', monospace;
  font-weight: 800;
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 4px;
  display: inline-block;
}

.print-quote-badge .quote-num {
  font-family: 'Plus Jakarta Sans', monospace;
  font-weight: 800;
  font-size: 12px;
  color: #0284C7;
  margin-bottom: 2px;
}

.print-quote-badge .quote-meta-line {
  font-size: 9.5px;
  color: #64748B;
  margin-bottom: 2px;
}

.print-quote-badge .quote-meta-line strong {
  color: #0F172A;
}

/* Client & Project Details Bar */
.print-meta-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.print-meta-grid .meta-col,
.print-meta-box {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 5px;
  padding: 8px 12px;
  min-width: 0;
  overflow: hidden;
}

.print-meta-grid .meta-col h4,
.print-meta-box h4 {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748B;
  margin: 0 0 5px 0;
  font-weight: 800;
  border-bottom: 1px solid #E2E8F0;
  padding-bottom: 3px;
}

.print-meta-grid .meta-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 10.5px;
  margin-bottom: 3px;
  gap: 8px;
}

.print-meta-grid .meta-row span {
  color: #64748B;
  font-weight: 600;
  flex-shrink: 0;
}

.print-meta-grid .meta-row strong {
  color: #0F172A;
  font-weight: 700;
  text-align: right;
  word-break: break-word;
}

/* Sections & Line Items Table */
.print-section-block {
  margin-bottom: 12px;
}

.print-section-heading {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  background: #0F172A;
  color: #FFFFFF;
  padding: 5px 10px;
  border-radius: 4px 4px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  letter-spacing: 0.02em;
}

.print-table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 6px;
}

.print-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0;
  table-layout: fixed;
  box-sizing: border-box;
}

.print-table th {
  background: #F1F5F9;
  color: #334155;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 5px 8px;
  border: 1px solid #CBD5E1;
  text-align: left;
}

.print-table td {
  padding: 5px 8px;
  border: 1px solid #E2E8F0;
  font-size: 10.5px;
  color: #334155;
  vertical-align: middle;
  overflow-wrap: break-word;
  word-break: break-word;
}

.print-table td.text-right,
.print-table th.text-right {
  text-align: right;
}

.print-table td.text-center,
.print-table th.text-center {
  text-align: center;
}

.print-item-content-wrap {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.print-item-thumb-container {
  flex-shrink: 0;
  width: 0.7in;
  height: 0.7in;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #CBD5E1;
  background: #F8FAFC;
  display: flex;
  align-items: center;
  justify-content: center;
}

.print-item-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.print-item-text-container {
  flex: 1;
  min-width: 0;
}

.print-item-title {
  font-weight: 700;
  color: #0F172A;
  font-size: 11px;
  margin-bottom: 1px;
  line-height: 1.3;
}

.print-item-specs {
  font-size: 9px;
  color: #64748B;
  line-height: 1.3;
}

.print-item-brands {
  font-size: 9px;
  color: #B8860B;
  font-weight: 600;
  margin-top: 1px;
}

/* Calculation Summary & Bank Block */
.print-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 16px;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1.5px solid #E2E8F0;
  align-items: start;
}

.print-bank-upi-combo {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.print-bank-card {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  padding: 8px 12px;
  min-width: 0;
}

.print-bank-card h4 {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  color: #0F172A;
  margin-bottom: 6px;
  border-bottom: 1px solid #E2E8F0;
  padding-bottom: 3px;
  letter-spacing: 0.04em;
}

.print-bank-content-split {
  display: flex;
  align-items: center;
  gap: 12px;
}

.print-bank-qr-col {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 78px;
}

.print-upi-qr-box {
  width: 72px;
  height: 72px;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 4px;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.print-upi-qr-box img,
.print-upi-qr-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.print-upi-qr-sub {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  text-align: center;
}

.print-upi-qr-sub .upi-scan-lbl {
  font-size: 8px;
  font-weight: 800;
  color: #15803D;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 2px;
}

.print-upi-qr-sub .upi-apps-lbl {
  font-size: 7px;
  font-weight: 600;
  color: #64748B;
}

.print-bank-info-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.print-bank-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 9.5px;
  color: #475569;
  line-height: 1.35;
}

.print-bank-row span {
  font-weight: 600;
  color: #64748B;
  flex-shrink: 0;
}

.print-bank-row strong {
  color: #0F172A;
  font-weight: 700;
  text-align: right;
  word-break: break-all;
}

/* Totals Summary Card */
.print-totals-card {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.print-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 3px 0;
  border-bottom: 1px dashed #E2E8F0;
  font-size: 11.5px;
  color: #334155;
}

.print-total-row:last-of-type {
  border-bottom: none;
}

.print-total-row span {
  font-weight: 600;
  color: #475569;
  font-size: 11px;
  text-align: left;
}

.print-total-row strong {
  font-weight: 800;
  color: #0F172A;
  font-size: 12.5px;
  text-align: right;
  letter-spacing: -0.01em;
}

.print-total-row.grand-total {
  background: #0F172A;
  color: #FFFFFF;
  padding: 6px 10px;
  border-radius: 4px;
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border: none;
}

.print-total-row.grand-total span,
.print-total-row.grand-total span:first-child {
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.print-total-row.grand-total strong,
.print-total-row.grand-total span:last-child {
  color: #FFFFFF;
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-align: right;
}

.print-amount-words {
  background: #F8FAFC;
  color: #334155;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 600;
  margin-top: 6px;
  text-align: left;
  border: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.print-amount-words strong {
  color: #0F172A;
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

/* Terms & Conditions Block */
.print-terms-block {
  margin-top: 10px;
  border-top: 1px solid #E2E8F0;
  padding-top: 6px;
}

.print-terms-block h4 {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  color: #0F172A;
  margin-bottom: 4px;
  letter-spacing: 0.05em;
}

.print-terms-list {
  padding-left: 0;
  list-style: none;
  font-size: 8.5px;
  color: #475569;
  line-height: 1.35;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
}

.print-terms-list li {
  display: flex;
  align-items: flex-start;
  gap: 5px;
}

.print-terms-list li strong {
  color: #0F172A;
  flex-shrink: 0;
}

/* Signatures Block */
/* Signatures Block */
.print-signatures-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  margin-top: 14px;
  padding-top: 6px;
  page-break-inside: avoid !important;
  break-inside: avoid !important;
}

.sig-box {
  text-align: center;
  padding: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.sig-box .sig-line {
  width: 80%;
  height: 28px;
  border-bottom: 1.5px dashed #94A3B8;
  margin-bottom: 4px;
}

.sig-box p.title {
  font-weight: 800;
  font-size: 9.5px;
  color: #0F172A;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
}

.sig-box p.subtitle {
  font-size: 8.5px;
  color: #64748B;
  font-weight: 600;
  margin: 2px 0 0 0;
}

.print-footer-brand-bar {
  display: none;
}

/* =========================================================
   MOBILE RESPONSIVE PRINT PREVIEW (SMART AUTO-FIT)
   The sheet keeps full A4 layout, scaled proportionally to fit.
   ========================================================= */
@media screen and (max-width: 860px) {

  /* Hide close button in mobile footer for invoice and receipt preview modals */
  #invoicePrintModal .modal-footer .preview-close-btn,
  #receiptPrintModal .modal-footer .preview-close-btn,
  #invoicePrintModal .modal-footer>.btn-secondary:first-child,
  #receiptPrintModal .modal-footer>.btn-secondary:first-child {
    display: none !important;
  }

  /* Modal dialog fits mobile screen seamlessly */
  #quotePrintModal .modal-dialog,
  #invoicePrintModal .modal-dialog,
  #receiptPrintModal .modal-dialog {
    max-width: 100% !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    height: 94vh !important;
    max-height: 94vh !important;
    overflow: hidden !important;
    border-radius: 20px 20px 0 0 !important;
  }

  /* Modal body becomes the viewport/stage */
  #quotePrintModal .modal-body,
  #invoicePrintModal .modal-body,
  #receiptPrintModal .modal-body {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    padding: 14px 6px 24px !important;
    background: #CBD5E1 !important;
    overflow-x: auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    display: block !important;
    text-align: center !important;
    box-sizing: border-box !important;
  }

  /* Sticky quick action menu at bottom of screen */
  #invoicePrintModal .modal-footer,
  #quotePrintModal .modal-footer,
  #receiptPrintModal .modal-footer {
    display: flex !important;
    position: sticky !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 100 !important;
    flex-shrink: 0 !important;
    background: var(--bg-surface, #FFFFFF) !important;
    border-top: 1px solid var(--border-subtle, #E2E8F0) !important;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.12) !important;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 8px)) !important;
    gap: 8px !important;
  }

  /* The actual A4 sheet stays full-size, scaled smoothly by JS */
  .letterhead-sheet,
  .invoice-statement-sheet,
  .payment-receipt-sheet {
    width: 794px;
    max-width: 794px;
    min-width: 794px;
    box-sizing: border-box;
    margin: 0 auto;
    display: block;
    text-align: left;
  }
}

/* =========================================================
   INVOICE WITH PAYMENT HISTORY STYLES
   ========================================================= */
.print-status-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 6px;
}

.print-status-paid {
  background: #ECFDF5;
  color: #059669;
  border: 1px solid #A7F3D0;
}

.print-status-partial {
  background: #FFFBEB;
  color: #D97706;
  border: 1px solid #FDE68A;
}

.print-status-unpaid {
  background: #FEF2F2;
  color: #DC2626;
  border: 1px solid #FECACA;
}

/* Payment History Ledger in Invoice */
.print-payment-history-block {
  margin-top: 22px;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  overflow: hidden;
  background: #FFFFFF;
}

.print-payment-history-heading {
  background: #0F172A;
  color: #FFFFFF;
  padding: 8px 14px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.print-payment-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.print-payment-table th {
  background: #F8FAFC;
  color: #475569;
  font-weight: 700;
  padding: 7px 10px;
  border-bottom: 1px solid #E2E8F0;
  text-align: left;
}

.print-payment-table td {
  padding: 7px 10px;
  border-bottom: 1px solid #F1F5F9;
  color: #1E293B;
}

.print-payment-summary-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #F8FAFC;
  border-top: 1px solid #CBD5E1;
  font-size: 12px;
}

.print-payment-summary-strip .pay-stat {
  display: flex;
  flex-direction: column;
}

.print-payment-summary-strip .pay-stat-lbl {
  font-size: 9.5px;
  color: #64748B;
  text-transform: uppercase;
  font-weight: 700;
}

.print-payment-summary-strip .pay-stat-val {
  font-size: 13px;
  font-weight: 800;
}

/* =========================================================
   OFFICIAL PAYMENT RECEIPT VOUCHER STYLES
   ========================================================= */
.payment-receipt-sheet {
  background: #FFFFFF;
  border-radius: 6px;
  padding: 24px 28px;
  position: relative;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  width: 794px;
  max-width: 794px;
  min-width: 794px;
  margin: 0 auto;
  box-sizing: border-box;
  text-align: left;
}

.receipt-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  border-bottom: 1.5px solid #0F172A;
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.receipt-company-info {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
}

.receipt-logo {
  max-height: 55px;
  max-width: 150px;
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 2px;
}

.receipt-company-info h1 {
  font-size: 16px;
  font-weight: 800;
  color: #0F172A;
  margin: 0 0 2px 0;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.receipt-company-info .tagline {
  font-size: 10px;
  font-weight: 700;
  color: #B8860B;
  text-transform: uppercase;
  margin: 0 0 2px 0;
  letter-spacing: 0.04em;
}

.receipt-company-info .address {
  font-size: 9.5px;
  color: #475569;
  margin: 0 0 2px 0;
  line-height: 1.35;
}

.receipt-company-info .contacts {
  font-size: 9.5px;
  color: #64748B;
  margin: 0;
  line-height: 1.35;
}

.receipt-badge {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}

.receipt-badge .badge-title {
  background: #0F172A;
  color: #FFFFFF;
  padding: 3px 10px;
  border-radius: 4px;
  font-weight: 800;
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 4px;
  display: inline-block;
}

.receipt-badge .receipt-num {
  font-family: 'Plus Jakarta Sans', monospace;
  font-weight: 800;
  font-size: 12px;
  color: #0284C7;
  margin-bottom: 2px;
}

.receipt-badge .receipt-date {
  font-size: 10px;
  color: #64748B;
  font-weight: 600;
  margin-bottom: 4px;
}

.receipt-badge .receipt-status {
  background: #ECFDF5;
  color: #059669;
  border: 1px solid #10B981;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.receipt-amount-card {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
  color: #FFFFFF;
  border-radius: 8px;
  padding: 12px 18px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.1);
}

.receipt-amount-card .amt-left {
  flex: 1;
}

.receipt-amount-card .amt-lbl {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94A3B8;
  margin-bottom: 2px;
}

.receipt-amount-card .amt-val {
  font-size: 22px;
  font-weight: 900;
  color: #10B981;
  line-height: 1.15;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.receipt-amount-card .amt-words {
  font-size: 10.5px;
  color: #E2E8F0;
  font-style: italic;
  margin-top: 3px;
  font-weight: 500;
  line-height: 1.3;
}

.receipt-amount-card .amt-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.receipt-amount-card .amt-mode-tag {
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.receipt-amount-card .amt-ref-tag {
  font-family: monospace;
  font-size: 10px;
  color: #94A3B8;
}

.receipt-meta-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 14px;
}

.receipt-meta-col h4 {
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #475569;
  margin: 0 0 6px 0;
  border-bottom: 1px solid #E2E8F0;
  padding-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.receipt-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11px;
  margin-bottom: 3px;
  gap: 6px;
}

.receipt-meta-row span {
  color: #64748B;
  font-weight: 500;
  flex-shrink: 0;
}

.receipt-meta-row strong {
  color: #0F172A;
  font-weight: 700;
  text-align: right;
  word-break: break-word;
}

.receipt-ledger-box {
  background: #FFFFFF;
  border: 1.5px dashed #CBD5E1;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 16px;
}

.receipt-ledger-box h4 {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #334155;
  margin: 0 0 8px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.receipt-ledger-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.receipt-ledger-item {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 5px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.receipt-ledger-item .lbl {
  font-size: 9px;
  font-weight: 700;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 2px;
}

.receipt-ledger-item .val {
  font-size: 12.5px;
  font-weight: 800;
  color: #0F172A;
}

.receipt-signatures {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  margin-top: 20px;
  padding-top: 8px;
  page-break-inside: avoid;
}

.receipt-sig-box {
  text-align: center;
  border-top: 1px dashed #94A3B8;
  padding-top: 6px;
}

.receipt-sig-box p.title {
  font-weight: 700;
  font-size: 11px;
  color: #0F172A;
  margin: 0;
}

.receipt-sig-box p.subtitle {
  font-size: 9.5px;
  color: #64748B;
  font-weight: 600;
  margin: 2px 0 0 0;
}

.receipt-footer-note {
  text-align: center;
  margin-top: 14px;
  padding-top: 8px;
  border-top: 1px solid #F1F5F9;
  font-size: 9.5px;
  color: #94A3B8;
  font-weight: 500;
}

/* =========================================================
   OFF-SCREEN CLEAN A4 PDF RENDER ENGINE
   Used by generateCleanPDF to guarantee unscaled A4 export
   ========================================================= */
.pdf-render-sandbox {
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
  width: 794px !important;
  min-width: 794px !important;
  max-width: 794px !important;
  background: #FFFFFF !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: -9999 !important;
  pointer-events: none !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}

.pdf-render-mode,
.letterhead-sheet.pdf-render-mode,
.invoice-statement-sheet.pdf-render-mode,
.payment-receipt-sheet.pdf-render-mode,
.pdf-render-sandbox .letterhead-sheet,
.pdf-render-sandbox .invoice-statement-sheet,
.pdf-render-sandbox .payment-receipt-sheet {
  width: 794px !important;
  min-width: 794px !important;
  max-width: 794px !important;
  zoom: 1 !important;
  transform: none !important;
  -webkit-transform: none !important;
  margin: 0 !important;
  margin-bottom: 0 !important;
  margin-top: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  box-sizing: border-box !important;
  background: #FFFFFF !important;
  overflow: visible !important;
}

.pdf-render-mode .receipt-header,
.pdf-render-sandbox .receipt-header {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
}

.pdf-render-mode .receipt-badge,
.pdf-render-sandbox .receipt-badge {
  display: flex !important;
  align-items: flex-end !important;
  text-align: right !important;
  border-top: none !important;
  padding-top: 0 !important;
}

.pdf-render-mode .receipt-amount-card,
.pdf-render-sandbox .receipt-amount-card {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
}

.pdf-render-mode .receipt-amount-card .amt-right,
.pdf-render-sandbox .receipt-amount-card .amt-right {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  width: auto !important;
}

.pdf-render-mode .receipt-meta-grid,
.pdf-render-sandbox .receipt-meta-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 12px !important;
}

.pdf-render-mode .receipt-signatures,
.pdf-render-sandbox .receipt-signatures {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 20px !important;
  margin-top: 24px !important;
}

/* =========================================================
   TEMPLATE 1: MODERN EXECUTIVE (.template-modern - DEFAULT)
   ========================================================= */
.letterhead-sheet.template-modern .print-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #0F172A;
  gap: 14px;
}

.letterhead-sheet.template-modern .print-company-info {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.letterhead-sheet.template-modern .print-company-info .print-logo,
.letterhead-sheet.template-modern .print-company-info .print-company-logo,
.letterhead-sheet.template-modern .print-company-info .receipt-logo {
  width: 1.5in !important;
  height: 1.5in !important;
  max-width: 1.5in !important;
  max-height: 1.5in !important;
  object-fit: contain !important;
  border-radius: 4px;
  flex-shrink: 0;
  margin: 0;
}

.letterhead-sheet.template-modern .print-quote-badge .quote-tag,
.letterhead-sheet.template-modern .print-quote-badge .badge-title {
  background: #0F172A;
  color: #FFFFFF;
}

.letterhead-sheet.template-modern .print-section-heading {
  background: #0F172A;
  color: #FFFFFF;
}

.letterhead-sheet.template-modern .print-item-thumb-container {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
}

.letterhead-sheet.template-modern .print-item-image-tag {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.88);
  color: #FFFFFF;
  font-size: 7.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 4px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  line-height: 1.2;
}

/* =========================================================
   TEMPLATE 2: MINIMAL CLEAN (.template-minimal)
   - Contemporary High-Key Minimalist Layout (Matching Reference)
   - Big Left Logo, Bold "Quote" Title, From & Bill to Stacks,
   - Vibrant Blue Header Ribbon (#0084FF), Alternating Rows,
   - Payment Instruction & Notes Left, Soft Blue Total Capsule Right
   ========================================================= */
.letterhead-sheet.template-minimal {
  background: #FFFFFF !important;
  border: none !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05) !important;
  padding: 22px 26px !important;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif !important;
  color: #111827 !important;
}

.letterhead-sheet.template-minimal .print-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: flex-start !important;
  border-bottom: none !important;
  padding-bottom: 0 !important;
  margin-bottom: 20px !important;
}

.letterhead-sheet.template-minimal .print-company-info {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 0 !important;
}

.letterhead-sheet.template-minimal .print-company-info .print-logo,
.letterhead-sheet.template-minimal .print-company-info .print-company-logo,
.letterhead-sheet.template-minimal .print-company-info .receipt-logo {
  width: 2in !important;
  height: 2in !important;
  max-width: 2in !important;
  max-height: 2in !important;
  object-fit: contain !important;
  margin-bottom: 0 !important;
  border: none !important;
  padding: 0 !important;
  background: transparent !important;
}

.letterhead-sheet.template-minimal .print-company-info > div {
  display: none !important;
}

.letterhead-sheet.template-minimal .print-quote-badge {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.letterhead-sheet.template-minimal .print-quote-badge .quote-tag,
.letterhead-sheet.template-minimal .print-quote-badge .badge-title {
  font-size: 32px !important;
  font-weight: 900 !important;
  color: #000000 !important;
  letter-spacing: -0.04em !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 0 10px 0 !important;
  text-transform: capitalize !important;
  line-height: 1 !important;
}

.letterhead-sheet.template-minimal .print-quote-badge .quote-num {
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #000000 !important;
  letter-spacing: 0 !important;
  margin: 0 !important;
  display: flex !important;
  gap: 12px !important;
}

.letterhead-sheet.template-minimal .print-quote-badge .quote-num::before {
  content: "Quote no.:";
  color: #8A94A6;
  font-weight: 600;
}

.letterhead-sheet.template-minimal .print-meta-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 40px !important;
  margin-bottom: 24px !important;
  background: transparent !important;
  border: none !important;
}

.letterhead-sheet.template-minimal .print-meta-grid .meta-col {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
}

.letterhead-sheet.template-minimal .print-meta-grid .meta-col:first-child h4 {
  font-size: 14px !important;
  font-weight: 900 !important;
  color: #000000 !important;
  text-transform: capitalize !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 0 3px 0 !important;
  letter-spacing: -0.01em !important;
}

.letterhead-sheet.template-minimal .print-meta-grid .meta-col:last-child {
  text-align: right !important;
  align-items: flex-end !important;
}

.letterhead-sheet.template-minimal .print-meta-grid .meta-col:last-child h4 {
  font-size: 14px !important;
  font-weight: 900 !important;
  color: #000000 !important;
  text-transform: capitalize !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 0 3px 0 !important;
  letter-spacing: -0.01em !important;
  text-align: right !important;
}

.letterhead-sheet.template-minimal .print-meta-grid .meta-row {
  font-size: 10px !important;
  color: #374151 !important;
  line-height: 1.4 !important;
  padding: 1px 0 !important;
  display: flex !important;
  justify-content: flex-start !important;
  gap: 6px !important;
}

.letterhead-sheet.template-minimal .print-meta-grid .meta-col:last-child .meta-row {
  justify-content: flex-end !important;
  text-align: right !important;
}

.letterhead-sheet.template-minimal .print-meta-grid .meta-row span {
  color: #8A94A6 !important;
  font-weight: 500 !important;
}

.letterhead-sheet.template-minimal .print-meta-grid .meta-row strong {
  color: #111827 !important;
  font-weight: 700 !important;
}

.letterhead-sheet.template-minimal .print-section-heading {
  display: none !important;
}

.letterhead-sheet.template-minimal .print-table {
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  margin-top: 6px !important;
  margin-bottom: 20px !important;
  border: none !important;
}

.letterhead-sheet.template-minimal .print-table th {
  background: #0084FF !important;
  color: #FFFFFF !important;
  font-weight: 800 !important;
  font-size: 9px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  padding: 8px 12px !important;
  border: none !important;
}

.letterhead-sheet.template-minimal .print-table th:first-child {
  border-top-left-radius: 4px !important;
  border-bottom-left-radius: 4px !important;
}

.letterhead-sheet.template-minimal .print-table th:last-child {
  border-top-right-radius: 4px !important;
  border-bottom-right-radius: 4px !important;
}

.letterhead-sheet.template-minimal .print-table td {
  padding: 10px 12px !important;
  font-size: 10px !important;
  color: #111827 !important;
  border: none !important;
  vertical-align: middle !important;
}

.letterhead-sheet.template-minimal .print-table tbody tr:nth-child(even) {
  background: #F4F8FD !important;
}

.letterhead-sheet.template-minimal .print-table .print-item-title {
  font-weight: 800 !important;
  color: #111827 !important;
  font-size: 10.5px !important;
}

.letterhead-sheet.template-minimal .print-table .print-item-specs {
  font-size: 9px !important;
  color: #6B7280 !important;
  margin-top: 2px !important;
  line-height: 1.35 !important;
}

.letterhead-sheet.template-minimal .print-bottom-grid {
  display: grid !important;
  grid-template-columns: 1.1fr 0.9fr !important;
  gap: 36px !important;
  align-items: flex-start !important;
  margin-top: 14px !important;
}

.letterhead-sheet.template-minimal .print-bank-card {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
}

.letterhead-sheet.template-minimal .print-bank-card h4 {
  font-size: 12px !important;
  font-weight: 900 !important;
  color: #000000 !important;
  border: none !important;
  padding: 0 !important;
  margin-bottom: 8px !important;
  text-transform: capitalize !important;
  letter-spacing: 0 !important;
}

.letterhead-sheet.template-minimal .print-bank-content-split {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
}

.letterhead-sheet.template-minimal .print-bank-qr-col {
  flex-shrink: 0 !important;
}

.letterhead-sheet.template-minimal .print-bank-info-col {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
}

.letterhead-sheet.template-minimal .print-bank-row {
  display: flex !important;
  justify-content: flex-start !important;
  gap: 6px !important;
  font-size: 9.5px !important;
  color: #374151 !important;
  padding: 1px 0 !important;
}

.letterhead-sheet.template-minimal .print-bank-row span {
  color: #8A94A6 !important;
  font-weight: 500 !important;
}

.letterhead-sheet.template-minimal .print-bank-row strong {
  color: #111827 !important;
  font-weight: 700 !important;
}

.letterhead-sheet.template-minimal .print-terms-block {
  margin-top: 14px !important;
  border-top: none !important;
  padding-top: 0 !important;
}

.letterhead-sheet.template-minimal .print-terms-block h4 {
  font-size: 12px !important;
  font-weight: 900 !important;
  color: #000000 !important;
  text-transform: capitalize !important;
  margin-bottom: 6px !important;
  letter-spacing: 0 !important;
}

.letterhead-sheet.template-minimal .print-terms-list {
  font-size: 9px !important;
  color: #4B5563 !important;
  line-height: 1.4 !important;
  padding-left: 0 !important;
}

.letterhead-sheet.template-minimal .print-totals-card {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
}

.letterhead-sheet.template-minimal .print-total-row {
  display: flex !important;
  justify-content: space-between !important;
  align-items: baseline !important;
  padding: 3px 0 !important;
  border-bottom: none !important;
  font-size: 11px !important;
}

.letterhead-sheet.template-minimal .print-total-row span {
  color: #4B5563 !important;
  font-weight: 600 !important;
}

.letterhead-sheet.template-minimal .print-total-row strong {
  color: #111827 !important;
  font-weight: 800 !important;
}

.letterhead-sheet.template-minimal .print-total-row.grand-total {
  background: #EEF6FF !important;
  color: #000000 !important;
  padding: 10px 14px !important;
  border-radius: 4px !important;
  margin-top: 8px !important;
  border: none !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
}

.letterhead-sheet.template-minimal .print-total-row.grand-total span {
  color: #000000 !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  text-transform: capitalize !important;
  letter-spacing: 0 !important;
}

.letterhead-sheet.template-minimal .print-total-row.grand-total strong {
  color: #000000 !important;
  font-size: 15px !important;
  font-weight: 900 !important;
  letter-spacing: -0.02em !important;
}

.letterhead-sheet.template-minimal .print-amount-words {
  display: none !important;
}

.letterhead-sheet.template-minimal .print-signatures-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 36px !important;
  margin-top: 24px !important;
  padding-top: 10px !important;
  border-top: none !important;
}

.letterhead-sheet.template-minimal .sig-box {
  text-align: center !important;
  align-items: center !important;
  padding: 0 !important;
}

.letterhead-sheet.template-minimal .sig-box .sig-line {
  width: 80% !important;
  height: 32px !important;
  border-bottom: 1.5px dashed #94A3B8 !important;
  margin-bottom: 4px !important;
}

.letterhead-sheet.template-minimal .sig-box p.title {
  font-size: 9.5px !important;
  font-weight: 800 !important;
  color: #000000 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
}

.letterhead-sheet.template-minimal .sig-box p.subtitle {
  font-size: 8.5px !important;
  color: #6B7280 !important;
}

.print-footer-note {
  margin-top: 18px;
  padding-top: 10px;
  border-top: 1px solid #E2E8F0;
  font-size: 8.5px;
  color: #64748B;
  text-align: center;
  line-height: 1.4;
}

.letterhead-sheet.template-minimal .print-footer-note {
  border-top: 1px dashed #CBD5E1 !important;
  color: #6B7280 !important;
  font-size: 8.5px !important;
  margin-top: 16px !important;
  padding-top: 8px !important;
  text-align: center !important;
}


/* =========================================================
   TEMPLATE 3: CLASSIC LUXURY (.template-classic)
   - Contemporary Architectural Luxury Edition
   - Refined Gold Hairline Trim, Modern Aligned Header, Ivory Ledger Finish
   ========================================================= */
.letterhead-sheet.template-classic {
  border: 1.5px solid #C5A059 !important;
  outline: 1px solid #E8DFD0 !important;
  outline-offset: -5px !important;
  padding: 24px 28px !important;
  background: #FCFBF8 !important;
  color: #1E293B !important;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif !important;
  border-radius: 6px !important;
}

.letterhead-sheet.template-classic .print-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: flex-start !important;
  text-align: left !important;
  border-bottom: 2px solid #C5A059 !important;
  padding-bottom: 14px !important;
  margin-bottom: 16px !important;
  gap: 16px !important;
}

.letterhead-sheet.template-classic .print-company-info {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  text-align: left !important;
  gap: 16px !important;
  flex: 1 !important;
}

.letterhead-sheet.template-classic .print-company-info .print-logo,
.letterhead-sheet.template-classic .print-company-info .print-company-logo,
.letterhead-sheet.template-classic .print-company-info .receipt-logo {
  width: 2in !important;
  height: 2in !important;
  max-width: 120px !important;
  max-height: 120px !important;
  object-fit: contain !important;
  margin: 0 !important;
  border: none !important;
  padding: 0 !important;
  background: transparent !important;
  flex-shrink: 0 !important;
}

.letterhead-sheet.template-classic .print-company-info h1 {
  font-family: 'Playfair Display', 'Cinzel', 'Georgia', serif !important;
  font-size: 17px !important;
  font-weight: 800 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  color: #0F172A !important;
  margin: 0 0 2px 0 !important;
  line-height: 1.25 !important;
}

.letterhead-sheet.template-classic .print-company-info p.tagline {
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  font-weight: 700 !important;
  color: #B8860B !important;
  font-size: 9.5px !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  margin: 0 0 3px 0 !important;
}

.letterhead-sheet.template-classic .print-company-info p.address {
  margin: 0 0 3px 0 !important;
  text-align: left !important;
  font-size: 9.5px !important;
  color: #64748B !important;
  line-height: 1.35 !important;
  max-width: 440px !important;
}

.letterhead-sheet.template-classic .print-company-info .contact-line {
  justify-content: flex-start !important;
  gap: 10px !important;
  font-size: 9.5px !important;
  color: #64748B !important;
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  margin-top: 3px !important;
}

.letterhead-sheet.template-classic .print-company-info .contact-line span {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
}

.letterhead-sheet.template-classic .print-quote-badge {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  text-align: right !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  width: auto !important;
  flex-shrink: 0 !important;
}

.letterhead-sheet.template-classic .print-quote-badge .quote-tag,
.letterhead-sheet.template-classic .print-quote-badge .badge-title {
  background: #0F172A !important;
  color: #FBBF24 !important;
  font-family: 'Cinzel', 'Plus Jakarta Sans', serif !important;
  font-size: 9.5px !important;
  font-weight: 800 !important;
  letter-spacing: 0.1em !important;
  padding: 3px 12px !important;
  border-radius: 4px !important;
  border: 1px solid #C5A059 !important;
  margin: 0 !important;
  text-transform: uppercase !important;
}

.letterhead-sheet.template-classic .print-quote-badge .quote-num {
  color: #B8860B !important;
  font-family: 'Plus Jakarta Sans', monospace !important;
  font-size: 13.5px !important;
  font-weight: 800 !important;
  letter-spacing: 0.02em !important;
  margin-top: 4px !important;
}

.letterhead-sheet.template-classic .print-meta-grid .meta-col,
.letterhead-sheet.template-classic .print-meta-box {
  background: #FAF8F5 !important;
  border: 1px solid #E8DFD0 !important;
  border-left: 3.5px solid #C5A059 !important;
  border-radius: 6px !important;
  padding: 12px 14px !important;
}

.letterhead-sheet.template-classic .print-meta-grid .meta-col h4,
.letterhead-sheet.template-classic .print-meta-box h4 {
  font-family: 'Playfair Display', 'Cinzel', serif !important;
  color: #0F172A !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  letter-spacing: 0.04em !important;
  border-bottom: 1px solid #E8DFD0 !important;
  padding-bottom: 5px !important;
  margin-bottom: 8px !important;
  text-transform: uppercase !important;
}

.letterhead-sheet.template-classic .print-item-content-wrap {
  display: flex !important;
  align-items: flex-start !important;
  gap: 12px !important;
}

.letterhead-sheet.template-classic .print-item-thumb-container {
  width: 0.7in !important;
  height: 0.7in !important;
  max-width: 0.7in !important;
  max-height: 0.7in !important;
  border-radius: 4px !important;
  border: 1px solid #C5A059 !important;
  background: #FFFFFF !important;
  flex-shrink: 0 !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.letterhead-sheet.template-classic .print-item-thumb {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}

.letterhead-sheet.template-classic .print-section-heading {
  background: #0F172A !important;
  border-left: 4px solid #C5A059 !important;
  border-radius: 4px !important;
  padding: 7px 12px !important;
  margin-top: 14px !important;
}

.letterhead-sheet.template-classic .print-section-heading span {
  font-family: 'Playfair Display', 'Cinzel', serif !important;
  color: #F8FAFC !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  letter-spacing: 0.03em !important;
}

.letterhead-sheet.template-classic .print-table th {
  background: #F5EFEB !important;
  color: #0F172A !important;
  border-top: 1.5px solid #C5A059 !important;
  border-bottom: 1.5px solid #C5A059 !important;
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  font-size: 9.5px !important;
  font-weight: 800 !important;
  letter-spacing: 0.04em !important;
  padding: 8px 10px !important;
}

.letterhead-sheet.template-classic .print-table tr:nth-child(even) {
  background: #FAF8F5 !important;
}

.letterhead-sheet.template-classic .print-table td {
  border-bottom: 1px solid #E8DFD0 !important;
  padding: 8px 10px !important;
  font-size: 10px !important;
}

.letterhead-sheet.template-classic .print-bank-card {
  background: #FAF8F5 !important;
  border: 1px solid #E8DFD0 !important;
  border-left: 3.5px solid #C5A059 !important;
  border-radius: 6px !important;
  padding: 12px 14px !important;
}

.letterhead-sheet.template-classic .print-bank-card h4 {
  font-family: 'Playfair Display', 'Cinzel', serif !important;
  color: #0F172A !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  letter-spacing: 0.04em !important;
  border-bottom: 1px solid #E8DFD0 !important;
  padding-bottom: 5px !important;
  margin-bottom: 8px !important;
  text-transform: uppercase !important;
}

.letterhead-sheet.template-classic .print-totals-card {
  background: #FAF8F5 !important;
  border: 1px solid #E8DFD0 !important;
  border-top: 3px solid #C5A059 !important;
  border-radius: 6px !important;
  padding: 12px 14px !important;
}

.letterhead-sheet.template-classic .print-total-row.grand-total {
  background: #0F172A !important;
  color: #FFFFFF !important;
  border: 1px solid #C5A059 !important;
  border-radius: 4px !important;
  padding: 7px 10px !important;
}

.letterhead-sheet.template-classic .print-total-row.grand-total span {
  color: #F8FAFC !important;
  font-weight: 700 !important;
}

.letterhead-sheet.template-classic .print-total-row.grand-total strong {
  color: #FBBF24 !important;
  font-size: 13px !important;
  font-weight: 900 !important;
}

.letterhead-sheet.template-classic .print-signatures-grid .sig-box {
  background: #FAF8F5 !important;
  border: 1px solid #E8DFD0 !important;
  border-radius: 6px !important;
  padding: 10px 14px !important;
}

.letterhead-sheet.template-classic .sig-box p.title {
  font-family: 'Playfair Display', 'Cinzel', serif !important;
  color: #0F172A !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
}

.letterhead-sheet.template-classic .sig-box .sig-line {
  border-bottom: 1px solid #C5A059 !important;
}

/* =========================================================
   TEMPLATE 4: NORDIC SLATE (.template-nordic)
   Ultra-compact 10-item single page design with no item images
   ========================================================= */
.letterhead-sheet.template-nordic {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
  color: #0F172A !important;
  background: #FFFFFF !important;
  border-top: 4px solid #1E293B !important;
  padding: 14px 22px !important;
  box-sizing: border-box !important;
}

.letterhead-sheet.template-nordic .print-item-thumb-container,
.letterhead-sheet.template-nordic .print-item-image-tag {
  display: none !important;
}

.letterhead-sheet.template-nordic .print-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: flex-start !important;
  padding-bottom: 8px !important;
  border-bottom: 1.5px solid #1E293B !important;
  margin-bottom: 8px !important;
}

.letterhead-sheet.template-nordic .print-company-info {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}

.letterhead-sheet.template-nordic .print-company-logo,
.letterhead-sheet.template-nordic .print-logo {
  width: 1.2in !important;
  height: 1.2in !important;
  max-width: 1.2in !important;
  max-height: 1.2in !important;
  object-fit: contain !important;
}

.letterhead-sheet.template-nordic .print-company-info h1 {
  font-size: 13.5px !important;
  font-weight: 900 !important;
  color: #0F172A !important;
  margin: 0 0 2px 0 !important;
  letter-spacing: -0.02em !important;
}

.letterhead-sheet.template-nordic .print-company-info .tagline {
  font-size: 8px !important;
  color: #475569 !important;
  margin: 0 0 2px 0 !important;
}

.letterhead-sheet.template-nordic .print-company-info .address {
  font-size: 7.8px !important;
  color: #64748B !important;
  margin: 0 !important;
  line-height: 1.25 !important;
}

.letterhead-sheet.template-nordic .print-company-info .contact-line {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  margin-top: 2px !important;
  font-size: 7.5px !important;
  color: #334155 !important;
}

.letterhead-sheet.template-nordic .print-quote-badge {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  text-align: right !important;
  margin-left: auto !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  flex-shrink: 0 !important;
}

.letterhead-sheet.template-nordic .print-quote-badge .quote-tag {
  font-size: 8.5px !important;
  font-weight: 800 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  background: #2563EB !important;
  color: #FFFFFF !important;
  padding: 3px 10px !important;
  border-radius: 4px !important;
  display: inline-block !important;
  text-align: right !important;
  line-height: 1.2 !important;
  margin-bottom: 4px !important;
}

.letterhead-sheet.template-nordic .print-quote-badge .quote-num {
  font-size: 13.5px !important;
  font-weight: 900 !important;
  font-family: 'Plus Jakarta Sans', monospace !important;
  color: #000000 !important;
  background: transparent !important;
  letter-spacing: 0.04em !important;
  text-align: right !important;
  line-height: 1.2 !important;
}


.letterhead-sheet.template-nordic .print-meta-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 12px !important;
  background: #F8FAFC !important;
  border: 1px solid #E2E8F0 !important;
  border-radius: 4px !important;
  padding: 6px 10px !important;
  margin-bottom: 8px !important;
}

.letterhead-sheet.template-nordic .print-meta-grid .meta-col h4 {
  font-size: 8.5px !important;
  font-weight: 800 !important;
  color: #1E293B !important;
  text-transform: uppercase !important;
  margin: 0 0 3px 0 !important;
  letter-spacing: 0.04em !important;
}

.letterhead-sheet.template-nordic .print-meta-grid .meta-row {
  font-size: 8px !important;
  color: #475569 !important;
  line-height: 1.3 !important;
}

.letterhead-sheet.template-nordic .print-meta-grid .meta-row strong {
  color: #0F172A !important;
}

.letterhead-sheet.template-nordic .print-section-heading {
  background: #E2E8F0 !important;
  color: #0F172A !important;
  font-size: 8px !important;
  font-weight: 800 !important;
  padding: 2.5px 6px !important;
  border-radius: 3px !important;
  margin: 4px 0 2px 0 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.03em !important;
}

.letterhead-sheet.template-nordic .print-table {
  width: 100% !important;
  border-collapse: collapse !important;
  margin-bottom: 4px !important;
}

.letterhead-sheet.template-nordic .print-table thead tr {
  background: #1E293B !important;
  background-color: #1E293B !important;
}

.letterhead-sheet.template-nordic .print-table th {
  background: #1E293B !important;
  background-color: #1E293B !important;
  padding: 5px 6px !important;
  font-size: 8.5px !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  border: 1px solid #1E293B !important;
  color: #FFFFFF !important;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

.letterhead-sheet.template-nordic .print-table td {
  padding: 3.5px 6px !important;
  font-size: 8px !important;
  border-bottom: 1px solid #E2E8F0 !important;
  vertical-align: middle !important;
}

.letterhead-sheet.template-nordic .print-table tbody tr:nth-child(even) {
  background: #F8FAFC !important;
}

.letterhead-sheet.template-nordic .print-item-title {
  font-size: 8.5px !important;
  font-weight: 700 !important;
  color: #0F172A !important;
}

.letterhead-sheet.template-nordic .print-item-specs {
  font-size: 7.2px !important;
  color: #64748B !important;
  line-height: 1.15 !important;
}

.letterhead-sheet.template-nordic .print-bottom-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr) !important;
  gap: 10px !important;
  margin-top: 6px !important;
  align-items: stretch !important;
}

.letterhead-sheet.template-nordic .print-bank-card {
  background: #F8FAFC !important;
  border: 1px solid #CBD5E1 !important;
  border-left: 3.5px solid #1E293B !important;
  border-radius: 4px !important;
  padding: 8px 12px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  box-sizing: border-box !important;
}

.letterhead-sheet.template-nordic .print-bank-card h4 {
  font-size: 9.5px !important;
  font-weight: 800 !important;
  color: #0F172A !important;
  margin: 0 0 6px 0 !important;
  padding-bottom: 3.5px !important;
  border-bottom: 1px solid #E2E8F0 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
}

.letterhead-sheet.template-nordic .print-bank-content-split {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 12px !important;
  flex: 1 !important;
}

.letterhead-sheet.template-nordic .print-bank-qr-col {
  flex-shrink: 0 !important;
  width: 82px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 3px !important;
  padding-right: 12px !important;
  padding-left: 0 !important;
  border-right: 1px solid #CBD5E1 !important;
  border-left: none !important;
}

.letterhead-sheet.template-nordic .print-upi-qr-box {
  width: 64px !important;
  height: 64px !important;
  border: 1px solid #CBD5E1 !important;
  border-radius: 4px !important;
  padding: 2px !important;
  background: #FFFFFF !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.letterhead-sheet.template-nordic .print-upi-qr-img,
.letterhead-sheet.template-nordic .print-upi-qr-box img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  display: block !important;
  border: none !important;
  padding: 0 !important;
}

.letterhead-sheet.template-nordic .print-upi-qr-sub {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 1.5px !important;
  text-align: center !important;
  margin-top: 1px !important;
}

.letterhead-sheet.template-nordic .print-upi-qr-sub .upi-scan-lbl {
  font-size: 7.8px !important;
  font-weight: 800 !important;
  color: #15803D !important;
  text-transform: uppercase !important;
  letter-spacing: 0.03em !important;
  display: flex !important;
  align-items: center !important;
  gap: 2px !important;
  white-space: nowrap !important;
}

.letterhead-sheet.template-nordic .print-upi-qr-sub .upi-apps-lbl {
  font-size: 7px !important;
  font-weight: 600 !important;
  color: #64748B !important;
  white-space: nowrap !important;
}

.letterhead-sheet.template-nordic .print-bank-info-col {
  flex: 1 !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  gap: 3px !important;
}

.letterhead-sheet.template-nordic .print-bank-row {
  display: flex !important;
  align-items: baseline !important;
  justify-content: space-between !important;
  gap: 8px !important;
  padding: 1px 0 !important;
}

.letterhead-sheet.template-nordic .print-bank-row span {
  font-size: 8.8px !important;
  color: #64748B !important;
  font-weight: 600 !important;
  flex-shrink: 0 !important;
  text-align: left !important;
  white-space: nowrap !important;
}

.letterhead-sheet.template-nordic .print-bank-row strong {
  font-size: 9.2px !important;
  color: #0F172A !important;
  font-weight: 700 !important;
  text-align: right !important;
  word-break: break-all !important;
}

.letterhead-sheet.template-nordic .print-totals-card {
  background: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
  border-radius: 4px !important;
  padding: 6px 8px !important;
}

.letterhead-sheet.template-nordic .print-total-row {
  display: flex !important;
  justify-content: space-between !important;
  font-size: 7.8px !important;
  padding: 1.5px 0 !important;
  color: #475569 !important;
}

.letterhead-sheet.template-nordic .print-total-row.grand-total {
  background: #1E293B !important;
  color: #FFFFFF !important;
  padding: 4px 7px !important;
  border-radius: 3px !important;
  margin-top: 4px !important;
  font-size: 9.5px !important;
  font-weight: 900 !important;
}

.letterhead-sheet.template-nordic .print-total-row.grand-total strong {
  color: #F8FAFC !important;
}

.letterhead-sheet.template-nordic .print-footer-section {
  margin-top: 14px !important;
  padding-top: 0 !important;
  border-top: none !important;
}

.letterhead-sheet.template-nordic .print-terms-block {
  margin-bottom: 8px !important;
}

.letterhead-sheet.template-nordic .print-terms-block h4 {
  font-size: 8.5px !important;
  font-weight: 800 !important;
  color: #0F172A !important;
  margin: 0 0 5px 0 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
}

.letterhead-sheet.template-nordic .print-terms-list {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 3px 12px !important;
  list-style: none !important;
  padding: 0 !important;
  margin: 0 0 8px 0 !important;
}

.letterhead-sheet.template-nordic .print-terms-list li {
  font-size: 7.2px !important;
  color: #475569 !important;
  line-height: 1.3 !important;
}

.letterhead-sheet.template-nordic .print-footer-note {
  font-size: 7px !important;
  color: #94A3B8 !important;
  margin-top: 6px !important;
  padding-top: 5px !important;
  border-top: 1px solid #E2E8F0 !important;
}

/* =========================================================
   TEMPLATE 5: EMERALD TECH (.template-emerald)
   Clean Monochrome High-Legibility Executive Layout
   - Clean white background, crisp slate/dark borders and typography
   - Company name top center, details underneath, Bill to directly below
   - Larger font sizes tuned for 7 items per page
   - No top-right badge/number in header
   - Footer contains company logo left and "Authorized Business Quotation" on the right
   ========================================================= */
.letterhead-sheet.template-emerald {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif !important;
  color: #1E293B !important;
  background: #FFFFFF !important;
  border-top: none !important;
  padding: 16px 20px !important;
  box-sizing: border-box !important;
}

.letterhead-sheet.template-emerald .print-item-thumb-container,
.letterhead-sheet.template-emerald .print-item-image-tag {
  display: none !important;
}

/* Clean Header: Company Name Top Center, Info Directly Underneath, No Heavy Color */
.letterhead-sheet.template-emerald .print-header {
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  background: #FFFFFF !important;
  color: #0F172A !important;
  border-radius: 0 !important;
  padding: 4px 0 10px 0 !important;
  margin-bottom: 8px !important;
  border-bottom: 2px solid #0F172A !important;
  box-shadow: none !important;
}

.letterhead-sheet.template-emerald .print-header .print-company-logo,
.letterhead-sheet.template-emerald .print-header .print-logo {
  display: none !important;
}

.letterhead-sheet.template-emerald .print-company-info {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  width: 100% !important;
}

.letterhead-sheet.template-emerald .print-company-info h1 {
  font-size: 20px !important;
  font-weight: 900 !important;
  color: #0F172A !important;
  margin: 0 0 3px 0 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  text-align: center !important;
}

.letterhead-sheet.template-emerald .print-company-info .tagline {
  font-size: 10px !important;
  font-weight: 700 !important;
  color: #475569 !important;
  margin: 0 0 3px 0 !important;
  text-align: center !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
}

.letterhead-sheet.template-emerald .print-company-info .address {
  font-size: 9.5px !important;
  color: #334155 !important;
  margin: 0 0 3px 0 !important;
  line-height: 1.3 !important;
  text-align: center !important;
}

.letterhead-sheet.template-emerald .print-company-info .contact-line {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 12px !important;
  margin-top: 2px !important;
  font-size: 9.5px !important;
  color: #475569 !important;
  text-align: center !important;
}

.letterhead-sheet.template-emerald .print-company-info .contact-line strong {
  color: #0F172A !important;
}

/* Remove quotation and number from top right corner */
.letterhead-sheet.template-emerald .print-quote-badge {
  display: none !important;
}

/* Clean Bill To & Quotation Meta Grid Directly Underneath Header */
.letterhead-sheet.template-emerald .print-meta-grid {
  display: grid !important;
  grid-template-columns: 1.2fr 0.8fr !important;
  gap: 12px !important;
  background: #F8FAFC !important;
  border: 1.5px solid #E2E8F0 !important;
  border-radius: 6px !important;
  padding: 8px 14px !important;
  margin-bottom: 8px !important;
}

.letterhead-sheet.template-emerald .print-meta-grid .meta-col h4 {
  font-size: 9.5px !important;
  font-weight: 900 !important;
  color: #0F172A !important;
  text-transform: uppercase !important;
  margin: 0 0 4px 0 !important;
  letter-spacing: 0.05em !important;
  border-bottom: 1px solid #CBD5E1 !important;
  padding-bottom: 2px !important;
}

.letterhead-sheet.template-emerald .print-meta-grid .meta-row {
  font-size: 9.5px !important;
  color: #334155 !important;
  line-height: 1.35 !important;
  display: flex !important;
  justify-content: space-between !important;
  margin-bottom: 2px !important;
}

.letterhead-sheet.template-emerald .print-meta-grid .meta-row strong {
  color: #0F172A !important;
  font-weight: 700 !important;
}

.letterhead-sheet.template-emerald .print-section-heading {
  background: #F1F5F9 !important;
  color: #0F172A !important;
  border-left: 3.5px solid #0F172A !important;
  border-top: 1px solid #E2E8F0 !important;
  border-right: 1px solid #E2E8F0 !important;
  font-size: 9.5px !important;
  font-weight: 900 !important;
  padding: 4px 8px !important;
  border-radius: 3px 3px 0 0 !important;
  margin: 4px 0 0 0 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
}

/* Clean High-Legibility Line Items Table */
.letterhead-sheet.template-emerald .print-table {
  width: 100% !important;
  border-collapse: collapse !important;
  margin-bottom: 6px !important;
  border: 1px solid #CBD5E1 !important;
}

.letterhead-sheet.template-emerald .print-table thead tr {
  background: #0F172A !important;
  background-color: #0F172A !important;
}

.letterhead-sheet.template-emerald .print-table th {
  background: #0F172A !important;
  background-color: #0F172A !important;
  padding: 5.5px 8px !important;
  font-size: 9.5px !important;
  font-weight: 900 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  color: #FFFFFF !important;
  border: 1px solid #0F172A !important;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

.letterhead-sheet.template-emerald .print-table td {
  padding: 4.5px 8px !important;
  font-size: 9.5px !important;
  border-bottom: 1px solid #E2E8F0 !important;
  vertical-align: middle !important;
  background: #FFFFFF !important;
  color: #1E293B !important;
}

.letterhead-sheet.template-emerald .print-table tbody tr:nth-child(even) td {
  background: #F8FAFC !important;
}

.letterhead-sheet.template-emerald .print-item-title {
  font-size: 10px !important;
  font-weight: 800 !important;
  color: #0F172A !important;
  line-height: 1.25 !important;
}

.letterhead-sheet.template-emerald .print-item-specs {
  font-size: 8.5px !important;
  color: #64748B !important;
  line-height: 1.2 !important;
}

/* Bottom Grid: Banking & Totals */
.letterhead-sheet.template-emerald .print-bottom-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1.32fr) minmax(0, 0.68fr) !important;
  gap: 12px !important;
  margin-top: 6px !important;
  align-items: stretch !important;
}

.letterhead-sheet.template-emerald .print-bank-card {
  background: #F8FAFC !important;
  border: 1.5px solid #CBD5E1 !important;
  border-radius: 6px !important;
  padding: 8px 12px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  box-sizing: border-box !important;
}

.letterhead-sheet.template-emerald .print-bank-card h4 {
  font-size: 10.5px !important;
  font-weight: 900 !important;
  color: #0F172A !important;
  margin: 0 0 6px 0 !important;
  text-transform: uppercase !important;
  border-bottom: 1px solid #E2E8F0 !important;
  padding-bottom: 3.5px !important;
  letter-spacing: 0.04em !important;
}

.letterhead-sheet.template-emerald .print-bank-content-split {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 12px !important;
  flex: 1 !important;
}

.letterhead-sheet.template-emerald .print-bank-qr-col {
  flex-shrink: 0 !important;
  width: 86px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 3px !important;
  padding-right: 12px !important;
  padding-left: 0 !important;
  border-right: 1px solid #CBD5E1 !important;
  border-left: none !important;
}

.letterhead-sheet.template-emerald .print-upi-qr-box {
  width: 68px !important;
  height: 68px !important;
  border: 1px solid #94A3B8 !important;
  border-radius: 4px !important;
  padding: 2px !important;
  background: #FFFFFF !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.letterhead-sheet.template-emerald .print-upi-qr-img,
.letterhead-sheet.template-emerald .print-upi-qr-box img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  display: block !important;
  border: none !important;
  padding: 0 !important;
}

.letterhead-sheet.template-emerald .print-upi-qr-sub {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 1.5px !important;
  text-align: center !important;
  margin-top: 1px !important;
}

.letterhead-sheet.template-emerald .print-upi-qr-sub .upi-scan-lbl {
  font-size: 8.2px !important;
  font-weight: 800 !important;
  color: #15803D !important;
  text-transform: uppercase !important;
  letter-spacing: 0.03em !important;
  display: flex !important;
  align-items: center !important;
  gap: 2px !important;
  white-space: nowrap !important;
}

.letterhead-sheet.template-emerald .print-upi-qr-sub .upi-apps-lbl {
  font-size: 7.2px !important;
  font-weight: 600 !important;
  color: #64748B !important;
  white-space: nowrap !important;
}

.letterhead-sheet.template-emerald .print-bank-info-col {
  flex: 1 !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  gap: 3px !important;
}

.letterhead-sheet.template-emerald .print-bank-row {
  display: flex !important;
  align-items: baseline !important;
  justify-content: space-between !important;
  gap: 8px !important;
  padding: 1px 0 !important;
}

.letterhead-sheet.template-emerald .print-bank-row span {
  font-size: 9.2px !important;
  color: #64748B !important;
  font-weight: 600 !important;
  flex-shrink: 0 !important;
  text-align: left !important;
  white-space: nowrap !important;
}

.letterhead-sheet.template-emerald .print-bank-row strong {
  font-size: 9.8px !important;
  color: #0F172A !important;
  font-weight: 700 !important;
  text-align: right !important;
  word-break: break-all !important;
}

.letterhead-sheet.template-emerald .print-totals-card {
  background: #FFFFFF !important;
  border: 1.5px solid #CBD5E1 !important;
  border-radius: 6px !important;
  padding: 7px 10px !important;
}

.letterhead-sheet.template-emerald .print-total-row {
  display: flex !important;
  justify-content: space-between !important;
  font-size: 9px !important;
  padding: 2px 0 !important;
  color: #334155 !important;
}

.letterhead-sheet.template-emerald .print-total-row strong {
  color: #0F172A !important;
  font-size: 10px !important;
}

.letterhead-sheet.template-emerald .print-total-row.grand-total {
  background: #0F172A !important;
  color: #FFFFFF !important;
  padding: 5px 8px !important;
  border-radius: 4px !important;
  margin-top: 4px !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  box-shadow: none !important;
}

.letterhead-sheet.template-emerald .print-total-row.grand-total strong {
  color: #FFFFFF !important;
  font-size: 12.5px !important;
}

.letterhead-sheet.template-emerald .print-amount-words {
  background: #F8FAFC !important;
  color: #334155 !important;
  font-size: 8.5px !important;
  border: 1px solid #E2E8F0 !important;
  margin-top: 5px !important;
  padding: 4px 8px !important;
}

.letterhead-sheet.template-emerald .print-footer-section {
  margin-top: 14px !important;
  padding-top: 0 !important;
  border-top: none !important;
}

.letterhead-sheet.template-emerald .print-terms-block {
  margin-bottom: 8px !important;
}

.letterhead-sheet.template-emerald .print-terms-block h4 {
  font-size: 9px !important;
  font-weight: 900 !important;
  color: #0F172A !important;
  margin: 0 0 5px 0 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
}

.letterhead-sheet.template-emerald .print-terms-list {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 3px 14px !important;
  list-style: none !important;
  padding: 0 !important;
  margin: 0 0 8px 0 !important;
}

.letterhead-sheet.template-emerald .print-terms-list li {
  font-size: 8px !important;
  color: #475569 !important;
  line-height: 1.3 !important;
}

.letterhead-sheet.template-emerald .print-footer-note {
  font-size: 8px !important;
  color: #64748B !important;
  margin-top: 6px !important;
  padding-top: 5px !important;
  border-top: 1px solid #E2E8F0 !important;
}

/* Clean Footer Brand Bar: Company Logo on Left, Quotation Number on Bottom Right (Emerald Tech Only) */
.letterhead-sheet.template-emerald .print-footer-brand-bar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-top: 10px !important;
  padding: 8px 0 0 0 !important;
  background: transparent !important;
  border: none !important;
  border-top: 1px solid #CBD5E1 !important;
  border-radius: 0 !important;
}

.letterhead-sheet.template-emerald .print-footer-logo-wrap {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  margin: 0 !important;
  padding: 0 !important;
  justify-content: flex-start !important;
}

.letterhead-sheet.template-emerald .print-footer-logo-wrap img,
.letterhead-sheet.template-emerald .print-footer-logo {
  width: auto !important;
  height: auto !important;
  max-width: 2.2in !important;
  max-height: 0.85in !important;
  object-fit: contain !important;
  object-position: left center !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  display: block !important;
}

.letterhead-sheet.template-emerald .print-footer-brand-text {
  font-size: 10px !important;
  color: #0F172A !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
}

.letterhead-sheet.template-emerald .print-footer-brand-tagline {
  font-size: 8px !important;
  color: #64748B !important;
}

.letterhead-sheet.template-emerald .print-footer-auth-right {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  text-align: right !important;
  gap: 2px !important;
  border: none !important;
  padding: 0 !important;
  background: transparent !important;
  flex-shrink: 0 !important;
}

.letterhead-sheet.template-emerald .print-footer-auth-right .quote-tag {
  background: #0F172A !important;
  color: #FFFFFF !important;
  padding: 3px 9px !important;
  border-radius: 4px !important;
  font-size: 8.5px !important;
  font-weight: 800 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  display: inline-block !important;
  line-height: 1.2 !important;
}

.letterhead-sheet.template-emerald .print-footer-auth-right .quote-num {
  font-size: 13px !important;
  font-weight: 900 !important;
  font-family: 'Plus Jakarta Sans', monospace !important;
  color: #0F172A !important;
  letter-spacing: 0.04em !important;
  line-height: 1.2 !important;
}

/* Nordic Slate: Hide footer brand bar completely */
.letterhead-sheet.template-nordic .print-footer-brand-bar {
  display: none !important;
}

/* =========================================================
   UNIVERSAL PRECISION ALIGNMENT (Minimal Clean, Nordic Slate, Emerald Tech)
   ========================================================= */
.letterhead-sheet.template-nordic .print-table th:first-child,
.letterhead-sheet.template-nordic .print-table td:first-child,
.letterhead-sheet.template-emerald .print-table th:first-child,
.letterhead-sheet.template-emerald .print-table td:first-child {
  width: 32px !important;
  text-align: center !important;
  vertical-align: middle !important;
}

.letterhead-sheet.template-nordic .print-table th:nth-child(2),
.letterhead-sheet.template-nordic .print-table td:nth-child(2),
.letterhead-sheet.template-emerald .print-table th:nth-child(2),
.letterhead-sheet.template-emerald .print-table td:nth-child(2) {
  text-align: left !important;
  vertical-align: middle !important;
}

.letterhead-sheet.template-nordic .print-table th.text-center,
.letterhead-sheet.template-nordic .print-table td.text-center,
.letterhead-sheet.template-emerald .print-table th.text-center,
.letterhead-sheet.template-emerald .print-table td.text-center {
  text-align: center !important;
  vertical-align: middle !important;
}

.letterhead-sheet.template-nordic .print-table th.text-right,
.letterhead-sheet.template-nordic .print-table td.text-right,
.letterhead-sheet.template-emerald .print-table th.text-right,
.letterhead-sheet.template-emerald .print-table td.text-right {
  text-align: right !important;
  vertical-align: middle !important;
}

.letterhead-sheet.template-nordic .print-bottom-grid,
.letterhead-sheet.template-emerald .print-bottom-grid {
  align-items: stretch !important;
}