/* ==========================================================================
   OFFICIAL NBR MUSHAK 6.3 TAX CHALLAN STYLESHEET
   100% Exact Mathematical Geometry Extracted from Reference PDF
   (Mushak 6.3 (Tax Book) - 2026-09-15T162447.152.pdf)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700;900&display=swap');

/* A4 Sheet Container: Exactly 210mm x 297mm */
.mushak-exact-sheet {
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  color: #000000 !important;
  background-color: #ffffff !important;
  width: 210mm;
  min-height: 297mm;
  height: 297mm;
  margin: 0 auto;
  padding: 10mm 8.5mm 14mm 12.5mm; /* Top margin reduced to 10mm, Left 12.5mm, Right 8.5mm */
  box-sizing: border-box;
  font-size: 12px;
  line-height: 1.4;
  position: relative;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.7);
  display: block;
  overflow: hidden;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/* Document Top Header */
.mushak-pdf-header {
  position: relative;
  width: 100%;
}

/* Authentic Seal of Bangladesh: Perfectly unclipped */
.mushak-pdf-seal {
  position: absolute;
  left: 0;
  top: 2px; /* Brought down so top circle is 100% visible and unclipped */
  height: 75px;
  width: 75px;
  object-fit: contain;
}

/* MUSHAK 6.3 Solid Border Box (Slightly smaller text, bold, crisp black border) */
.mushak-pdf-badge {
  position: absolute;
  right: 5mm; /* Slightly left */
  top: 10.5mm; /* 1 space up */
  border: 2.2px solid #000000; /* Crisp black border */
  padding: 3px 13px;
  font-weight: 900; /* Bold & black */
  font-size: 11.7px; /* Slightly smaller */
  color: #000000 !important;
  letter-spacing: 0.5px;
  font-family: 'Lato', sans-serif;
  text-transform: uppercase;
  background: #ffffff;
}

/* Centered Government Titles (Completely Bold and Black) */
.mushak-pdf-gov-title {
  font-size: 16px; /* 12pt */
  font-weight: 900;
  color: #000000 !important;
  text-align: center;
  margin-bottom: 2px;
}

.mushak-pdf-nbr-title {
  font-size: 16px; /* 12pt */
  font-weight: 900;
  color: #000000 !important;
  text-align: center;
  margin-bottom: 26px; /* 1 space down before Tax Challan */
}

.mushak-pdf-challan-title {
  font-size: 15.3px; /* 11.5pt */
  font-weight: 900;
  color: #000000 !important;
  text-align: center;
  margin-bottom: 2px;
}

.mushak-pdf-subrule-title {
  font-size: 14.6px; /* 11pt */
  font-weight: 900;
  color: #000000 !important;
  text-align: center;
  margin-bottom: 16px;
}

/* Registered Person Information (Normal Weight, NOT Bold) */
.mushak-pdf-registered-info {
  font-size: 13.5px; /* 10pt */
  text-align: center;
  line-height: 1.45;
  font-weight: 400 !important; /* Normal weight, NOT bold */
  color: #000000 !important;
}

.mushak-pdf-registered-info div {
  font-weight: 400 !important;
}

.mushak-pdf-registered-info div:last-child {
  margin-bottom: 0;
}

/* Purchaser & Logistics Metadata: Strictly 1 line space above, 2 lines gap between items */
.mushak-pdf-meta-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-top: 3.5mm; /* Exactly 1 line space below Challan Issuing Address */
  margin-bottom: 0;
  font-size: 12.6px; /* 9.5pt */
  line-height: 1.35;
}

.mushak-pdf-meta-left {
  width: 63%;
  display: flex;
  flex-direction: column;
  gap: 5.5mm; /* Exactly 2 lines space between each option */
}

.mushak-pdf-meta-right {
  width: 35%;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 5.5mm; /* Exactly 2 lines space between each option */
}

/* Official 11-Column Tax Table: Strictly 1 line space above table */
.mushak-pdf-table {
  width: 100% !important;
  border-collapse: collapse !important;
  border: 1px solid #000000 !important;
  margin-top: 3.5mm; /* Exactly 1 line space above table */
  margin-bottom: 0;
  table-layout: fixed;
  color: #000000 !important;
}

.mushak-pdf-table th,
.mushak-pdf-table td {
  border: 1px solid #000000 !important;
  color: #000000 !important;
  padding: 2px 1px !important;
  text-align: center !important;
  vertical-align: middle !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
  hyphens: none !important;
}

/* Header Row 1: Aligned to the bottom of the cell (24.7mm height) */
.mushak-pdf-table thead tr:first-child th {
  font-weight: 700 !important;
  background-color: transparent !important;
  font-size: 11px !important;
  line-height: 1.25 !important;
  vertical-align: bottom !important;
  padding-bottom: 4px !important;
  height: 64px !important;
}

/* Header Row 2: Sub-row (1) to (11) */
.mushak-pdf-table tr.col-indices th {
  font-size: 11px !important;
  font-weight: 700 !important;
  padding: 3px 1px !important;
  height: 22px !important;
  vertical-align: middle !important;
}

/* Data Body Rows */
.mushak-pdf-table tbody tr td {
  font-size: 11.5px !important;
  line-height: 1.35 !important;
  padding: 6px 1px !important;
  vertical-align: middle !important;
}

/* Total Row */
.mushak-pdf-table tfoot tr td,
.mushak-pdf-table tbody tr.row-total td {
  font-weight: 700 !important;
  font-size: 11.5px !important;
  padding: 5px 1px !important;
  vertical-align: middle !important;
}

/* Officer Certification & Seal Block: Strictly 2 lines of space above */
.mushak-pdf-cert-block {
  margin-top: 7mm; /* Strictly 2 lines space below table */
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-size: 12px;
  line-height: 1.6;
}

.mushak-pdf-officer-info {
  width: 55%;
}

.mushak-pdf-seal-info {
  width: 35%;
  text-align: left;
  padding-top: 18mm; /* 3 spaces down */
  padding-left: 8mm; /* 2 spaces right */
  font-size: 12px;
}

.mushak-pdf-footnote {
  font-size: 11px;
  margin-top: 14mm; /* Strictly 4 spaces above footnote */
  color: #000000;
}

/* Page Footer: Pinned directly to bottom */
.mushak-pdf-footer-row {
  position: absolute;
  bottom: 8mm;
  left: 12.5mm;
  right: 8.5mm;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px; /* 10.2pt in PDF */
  font-family: 'Lato', sans-serif;
  color: #000000;
}

/* ==========================================================================
   PHYSICAL A4 PRINT RULES: STRICTLY 1 SHEET OF PAPER
   ========================================================================== */
@media print {
  @page {
    size: A4 portrait;
    margin: 10mm 8.5mm 14mm 12.5mm;
  }

  html, body {
    background: #ffffff !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: 100% !important;
  }

  body * {
    visibility: hidden !important;
  }

  #printModal,
  #printModalContainer,
  #printModalContainer * {
    visibility: visible !important;
  }

  #printModal {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: #ffffff !important;
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
    box-shadow: none !important;
    border: none !important;
  }

  #printModalContainer {
    position: relative !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
  }

  .mushak-exact-sheet {
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 272mm !important;
    min-height: 272mm !important;
    max-height: 272mm !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    border: none !important;
    page-break-inside: avoid !important;
    page-break-after: avoid !important;
  }

  .mushak-pdf-footer-row {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

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