/* ==========================================================================
   ZALIKHA VA MANAGEMENT SYSTEM v5.0 — A4 PRINT STYLESHEET
   Dedicated for Official Quotation, Invoice & Receipt Templates
   ========================================================================== */

.print-root {
  display: none;
}

@page {
  size: A4 portrait;
  margin: 15mm;
}

@media print {
  /* Hide all interactive Application UI */
  .app-shell,
  .modal-root,
  .drawer-root,
  .toast-root,
  .no-print {
    display: none !important;
  }

  /* Reset body for crisp white A4 paper output */
  html,
  body {
    background: #FFFFFF !important;
    color: #0F172A !important;
    font-size: 11pt;
    line-height: 1.45;
    width: 100%;
    height: auto;
    overflow: visible !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Display only the dedicated Print Root Container */
  .print-root {
    display: block !important;
    width: 100%;
    background: #FFFFFF !important;
    color: #0F172A !important;
  }

  /* Standard A4 Document Sheet Wrapper */
  .a4-document {
    width: 100%;
    max-width: 180mm;
    margin: 0 auto;
    background: #FFFFFF;
    color: #0F172A;
  }

  .a4-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 14pt;
    border-bottom: 2px solid #0F172A;
    margin-bottom: 16pt;
  }

  .a4-doc-type {
    font-size: 20pt;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #0F172A;
  }

  .a4-table {
    width: 100%;
    border-collapse: collapse;
    margin: 14pt 0;
  }

  .a4-table th {
    background-color: #F1F5F9 !important;
    color: #0F172A !important;
    font-size: 9pt;
    font-weight: 700;
    text-transform: uppercase;
    padding: 7pt 8pt;
    border-top: 1px solid #94A3B8;
    border-bottom: 1px solid #94A3B8;
    text-align: left;
  }

  .a4-table td {
    padding: 7pt 8pt;
    font-size: 10pt;
    border-bottom: 1px solid #E2E8F0;
    vertical-align: top;
  }

  .a4-totals {
    width: 45%;
    margin-left: auto;
    margin-top: 10pt;
  }

  .a4-totals-row {
    display: flex;
    justify-content: space-between;
    padding: 4pt 0;
    font-size: 10pt;
  }

  .a4-totals-row.grand-total {
    border-top: 1.5px solid #0F172A;
    border-bottom: 1.5px solid #0F172A;
    font-weight: 700;
    font-size: 11.5pt;
    padding: 6pt 0;
    margin-top: 4pt;
  }

  .a4-footer {
    margin-top: 24pt;
    padding-top: 10pt;
    border-top: 1px solid #CBD5E1;
    font-size: 8.5pt;
    color: #475569;
  }

  /* Prevent awkward page breaks inside table rows or totals */
  tr,
  .a4-totals,
  .a4-footer {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}