/* --- Cấu hình vùng xuất PDF A4 ngang --- */
.print-sheet {
  display: none;
  width: 297mm;
  background: #fff;
  padding: 0;
  margin: 0;
  overflow: visible;
  font-family: 'Manrope', Arial, sans-serif;
  color: #1f1f1f;
  box-sizing: border-box;
}

.print-page {
  width: 297mm;
  min-height: 210mm;
  /* Chiều cao tối thiểu của 1 trang A4 */
  padding: 8mm;
  background: #fff;
  box-sizing: border-box;
  overflow: visible;
}

.print-head {
  display: grid;
  grid-template-columns: 86px 1fr auto;
  gap: 12px;
  align-items: center;
  border-bottom: 2px solid var(--brand);
  padding-bottom: 7px;
}

.print-head img {
  width: 84px;
}

.print-head h1 {
  margin: 0;
  color: var(--brand);
  font-size: 18px;
}

.print-head p {
  margin: 2px 0 0;
  font-size: 9px;
  color: #607268;
}

.print-code {
  border: 1px solid #c5ddd0;
  border-radius: 7px;
  padding: 6px 9px;
  text-align: right;
  font-size: 9px;
}

.print-grid {
  display: block !important;
  margin-top: 7px !important;
}

.print-box {
  border: 1px solid #c9ddd2;
  border-radius: 7px;
  padding: 6px;
  margin-bottom: 7px !important;
  /* Tránh ngắt đôi khối bảng giữa 2 trang */
  page-break-inside: avoid;
  break-inside: avoid;
}

.print-box h3 {
  margin: 0 0 4px;
  color: var(--brand);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.mini {
  width: 100%;
  border-collapse: collapse;
}

.mini th,
.mini td {
  border: 1px solid #d9e9e0;
  padding: 3.2px 4.2px;
  font-size: 8.3px;
  line-height: 1.22;
}

.mini th {
  background: var(--brand);
  color: #fff;
  font-size: 8.6px;
  font-weight: 900;
  text-align: center;
}

.price-mini th:first-child,
.price-mini td:first-child {
  width: 26%;
  text-align: left;
}

.price-mini th:not(:first-child),
.price-mini td:not(:first-child) {
  width: 14.8%;
}

.program-mini th:first-child,
.program-mini td:first-child {
  width: 44%;
  text-align: left;
}

.schedule-discount-mini th:first-child,
.schedule-discount-mini td:first-child {
  width: 28%;
  text-align: left;
}

.schedule-discount-mini th:last-child,
.schedule-discount-mini td:last-child {
  width: 44%;
  text-align: left;
}

.payment-mini th:nth-child(1),
.payment-mini td:nth-child(1) {
  width: 5%;
  text-align: center;
}

.payment-mini th:nth-child(2),
.payment-mini td:nth-child(2) {
  width: 39%;
  text-align: left;
}

.payment-mini th:nth-child(3),
.payment-mini td:nth-child(3) {
  width: 11%;
  text-align: center;
}

.payment-mini th:nth-child(4),
.payment-mini td:nth-child(4),
.payment-mini th:nth-child(6),
.payment-mini td:nth-child(6) {
  width: 8%;
}

.payment-mini th:nth-child(5),
.payment-mini td:nth-child(5),
.payment-mini th:nth-child(7),
.payment-mini td:nth-child(7) {
  width: 14.5%;
}

.compare-mini th:first-child,
.compare-mini td:first-child {
  width: 21%;
  text-align: left;
}

.compare-mini th:not(:first-child),
.compare-mini td:not(:first-child) {
  width: 11.28%;
}

.mini .section-row td {
  background: #f4faf7;
  color: var(--brand);
  font-weight: 900;
}

.mini .note-row td {
  background: #fffbe8;
  color: var(--brand);
  font-weight: 800;
}

.summary-mini td:nth-child(1),
.summary-mini td:nth-child(3) {
  width: 22%;
  color: var(--brand);
  font-weight: 800;
  background: #f8fcfa;
}

.summary-mini td:nth-child(2),
.summary-mini td:nth-child(4) {
  width: 28%;
  font-size: 9px;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.summary-mini td.summary-card-hdmb {
  background: #dff3e8;
  color: var(--brand);
  border-color: #79b392;
  font-weight: 900;
}

.mini td.num,
.mini th.num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.mini .total-row td {
  font-size: 8.7px;
  font-weight: 900;
  background: #eaf7ef;
  color: var(--brand);
}

.mini tr.payment-row-selected td {
  background: #fff3bf;
  color: #4a3a05;
  font-weight: 900;
}

@media print {
  body * {
    visibility: hidden !important;
  }

  .print-sheet,
  .print-sheet * {
    visibility: visible !important;
  }

  .print-sheet {
    display: block !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
  }

  @page {
    size: A4 landscape;
    margin: 0;
  }
}
