.invoice-box {
  max-width: 210mm;
  margin: auto;
  border: 1px solid #000;
  padding: 10px;
  background-color: #fff;
  box-sizing: border-box;
  position: relative;
  margin-top: 50px;
  font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif;
  color: #555;
  font-size: 12px;
  line-height: 1.4;
  
}
.invoice-boxx{
  max-width: 210mm;
  margin: auto;
  height: 800px;
  border: 1px solid ;
  position: relative;
  margin-top: 50px;

  font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif;
  color: #555;

}

.invoice-boxxx{
  max-width: 210mm;
  margin: auto;
  height: 800px;
  border: 1px solid ;
  position: relative;
  margin-top: 50px;

  font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif;
  color: #555;

}

.invoice-boxxxx{
  max-width: 200mm;
  margin: auto;
  height: 800px;
  border: 1px solid ;
  position: relative;
  margin-top: 50px;

  font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif;
  color: #555;

}


.invoice-header {
  max-width: 210mm;
  border: px solid #dddddd;
  font-size: 12px;
  line-height: 1.4;
  font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif;
  color: #555;
  
}

table{
  font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif;
  border-collapse: collapse;
  width: 100%;
}

@media only screen and (max-width: 600px) {
  .invoice-box table tr.top table td {
    width: 100%;
    display: block;
    text-align: center;
    margin: 5px;
    
  }

  .invoice-box table tr.information table td {
    width: 100%;
    display: block;
    text-align: center;
    
  }
}


/** RTL **/
.invoice-box.rtl {
  direction: rtl;
  font-family: Tahoma, "Helvetica Neue", "Helvetica", Helvetica, Arial,
    sans-serif;
}

.tables {
  font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif;
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  page-break-inside: avoid;
}

.tables tfoot {
  bottom: 0;
}

td,th {
  text-align: left;
  padding: 8px;
  border: 1px solid #dddddd;
}

.tables td,
.tables th {
  padding: 6px;
  vertical-align: middle;
  font-size: 11px;
}

/* Print Styles */
@media print {
  @page {
    size: A4;
    margin: 10mm;
  }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body {
    margin: 0;
    padding: 0;
    background: white;
  }

  .invoice-box {
    margin: 0;
    padding: 10px;
    border: 1px solid #000;
    box-shadow: none;
    max-width: 100%;
    width: 100%;
    page-break-inside: avoid;
    background: white;
  }

  .invoice-header {
    page-break-inside: avoid;
  }

  .invoice-box table {
    page-break-inside: avoid;
    border-collapse: collapse;
  }
  
  .invoice-box tr {
    page-break-inside: avoid;
  }

  .tables {
    page-break-inside: avoid;
  }

  .tables tbody tr {
    page-break-inside: avoid;
  }

  img {
    max-width: 100%;
    height: auto;
    page-break-inside: avoid;
  }

  /* Hide print buttons and no-print elements */
  .no-print,
  button {
    display: none !important;
  }

  /* Ensure colors print */
  td[style*="background-color"],
  th[style*="background-color"] {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Prevent page breaks in critical sections */
  .invoice-header,
  .tables thead,
  .tables tbody tr:first-child {
    page-break-after: avoid;
  }

  /* Ensure proper spacing */
  .invoice-box > * {
    page-break-inside: avoid;
  }

  /* Table row spacing for print */
  .tables tbody tr {
    page-break-inside: avoid;
    page-break-after: auto;
  }

  /* Footer section */
  .invoice-box > table:last-child {
    page-break-inside: avoid;
  }
}