/* Report Styles - A4 Formatting */

/* Screen styles */
.report-body {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  background-color: #f5f5f5;
}

.report-container {
  max-width: 210mm;
  margin: 20px auto;
  background-color: white;
  padding: 20mm;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.report-actions {
  margin-bottom: 20px;
  text-align: right;
}

.report-actions .btn {
  padding: 10px 20px;
  font-size: 14px;
  cursor: pointer;
}

/* Header styles */
.report-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #333;
}

.report-header-left {
  flex: 1;
}

.report-header-row {
  margin-bottom: 1px;
  font-size: 12px;
}

.report-header-row strong {
  display: inline-block;
  width: 140px;
}

.report-header-right {
  flex-shrink: 0;
  margin-left: 20px;
}

.report-logo {
  max-width: 150px;
  max-height: 100px;
  object-fit: contain;
}

/* Content styles */
.report-content {
  margin-bottom: 30px;
}

.report-section {
  margin-bottom: 15px;
}

.report-title {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 20px;
  color: #333;
  text-align: left;
}

.section-title {
  font-size: 15px;
  font-weight: bold;
  margin-bottom: 15px;
  color: #333;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
  table-layout: fixed;
}

.report-table th,
.report-table td {
  padding: 3px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.report-table th {
  background-color: #e8ecfe75;
  font-weight: bold;
  font-size: 12px;
}

.report-table td {
  font-size: 12px;
}

.report-table .text-right {
  text-align: right;
}

/* Align columns across all tables */
.report-table th:nth-child(1),
.report-table td:nth-child(1) {
  width: auto;
}

.report-table th:nth-child(2),
.report-table td:nth-child(2) {
  width: 200px;
}

.report-table th:nth-child(3),
.report-table td:nth-child(3) {
  width: auto;
}

.report-table .total-row {
  background-color: #e8ecfe75;
  font-weight: bold;
  border-top: 2px solid #333;
  border-bottom: 2px solid #333;
}

.report-table .final-total {
  background-color: #e8ecfe75;
  font-size: 16px;
}

.report-notes {
  padding-left: 15px;
  padding-right: 15px;
  padding-top: 5px;
  padding-bottom: 5px;
  background-color: #e8ecfe75;
  border-left: 4px solid #333;
  font-size: 14px;
  line-height: 1.6;
}

.report-notes p {
  font-size: 12px;
  margin-top: 5px;
  margin-bottom: 5px;
}

/* Footer styles */
.report-footer {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #ddd;
  font-size: 12px;
  color: #666;
}

.report-footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.report-footer-left {
  flex: 1;
  text-align: left;
}

.report-footer-center {
  flex: 1;
  text-align: center;
}

.report-footer-right {
  flex: 1;
  text-align: right;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.report-footer-logo {
  height: 16px;
  vertical-align: middle;
}

/* Print styles - A4 formatting */
@media print {
  @page {
    size: A4 portrait;
    margin-top: 15mm;
    margin-bottom: 20mm;
    margin-left: 0;
    margin-right: 0;
    /* Remove browser-generated headers/footers (timestamp) */
    @top-left {
      content: "";
    }
    @top-center {
      content: "";
    }
    @top-right {
      content: "";
    }
    @bottom-left {
      content: "";
    }
    @bottom-center {
      content: "";
    }
    @bottom-right {
      content: "";
    }
  }

  /* Force background colors to print */
  * {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .no-print {
    display: none !important;
  }

  .report-body {
    background-color: white;
    margin: 0;
    padding: 0;
  }

  .report-container {
    max-width: 210mm;
    margin: auto;
    padding-top: 0mm;
    padding-bottom: 0mm;
    padding-left: 10mm;
    padding-right: 10mm;
    box-shadow: none;
  }

  .report-header {
    break-inside: avoid;
  }

  .report-section {
    break-inside: auto;
  }

  .report-table {
    break-inside: avoid;
  }

  .report-table tr {
    break-inside: avoid;
  }

  /* Ensure totals don't break across pages */
  .total-row {
    break-inside: avoid;
  }

  .final-total {
    break-inside: avoid;
    break-after: avoid;
  }

  /* Ensure footer appears on each page in print */
  .report-footer {
    position: fixed;
    bottom: 0;
    left: 10mm;
    right: 10mm;
    margin-top: 0;
    padding-top: 10px;
    padding-bottom: 10px;
    padding-left: 0;
    padding-right: 0;
  }
}