/* ============================================================
   Tax Invoice A4 Preview — Exact GST Invoice Layout
   ============================================================ */
.inv-container {
  border: 1.5px solid #000;
  font-family: Arial, Helvetica, sans-serif;
  color: #000;
  font-size: 13px;
  line-height: 1.3;
  background: #fff;
  width: 190mm;
  min-height: 270mm;
  height: auto;
  margin: 10mm auto;
  box-sizing: border-box;
  transform-origin: top center;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
  display: block;
}
.inv-container * { 
  box-sizing: border-box; margin: 0; padding: 0; border-color: #000 !important; 
  word-wrap: break-word; overflow-wrap: break-word;
}
.inv-container strong { font-weight: 700; color: #000; }

/* ── Title Bar ── */
.inv-title-bar {
  text-align: center; font-weight: bold; font-size: 17px;
  position: relative; padding: 6px 8px;
  border-bottom: 1.5px solid #000; background: #fff;
}
.inv-title { font-family: Arial, Helvetica, sans-serif; letter-spacing: 0.5px; font-size: 18px; text-transform: uppercase; }
.inv-copy-type {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-weight: bold; font-size: 12px; color: #000; font-style: italic;
}

/* ── Layout Helpers ── */
.inv-row { display: flex; width: 100%; min-width: 0; }
.inv-col { display: flex; flex-direction: column; min-width: 0; }
.inv-w50 { width: 50%; min-width: 0; }
.inv-w100 { width: 100%; min-width: 0; }
.inv-bb { border-bottom: 1.5px solid #000; }
.inv-br { border-right: 1.5px solid #000; }
.inv-pad { padding: 4px 6px; }
.inv-label { font-size: 11px; color: #000; margin-bottom: 1px; display: block; font-style: italic; font-weight: bold; }
.inv-right { text-align: right; }
.inv-center { text-align: center; }

/* ── Company Header ── */
.inv-company-block { display: flex; gap: 8px; align-items: flex-start; min-width: 0; }
.inv-logo-box {
  width: 80px; height: 80px; border: 1px solid #ccc; display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
  font-weight: bold; font-size: 16px; color: #000; background: #fff;
  overflow: hidden;
}
.inv-logo-box img { width: 100%; height: 100%; object-fit: contain; }
.inv-company-name { font-size: 17px; font-weight: 700; margin-bottom: 2px; letter-spacing: 0.2px; }
.inv-company-detail { font-size: 11.5px; line-height: 1.15; color: #000; font-weight: 500; }
.inv-company-detail span { display: block; }

/* ── Meta Grid (right side of header) ── */
.inv-meta-row { display: flex; width: 100%; border-bottom: 1px solid #000; }
.inv-meta-row:last-child { border-bottom: none; }
.inv-meta-cell { flex: 1; padding: 2.5px 5px; border-right: 1px solid #000; min-width: 0; }
.inv-meta-cell:last-child { border-right: none; }

/* ── Customer Blocks ── */
.inv-customer-block { padding: 3px 6px; font-size: 11.5px; line-height: 1.25; min-width: 0; }
.inv-customer-block strong { font-size: 13px; }

/* ── Main Items Table ── */
.inv-table-wrapper { display: block; border-bottom: 1.5px solid #000; }
.inv-table {
  width: 100%; border-collapse: collapse;
  table-layout: fixed; height: 100%; flex-grow: 1;
}
.inv-table th, .inv-table td {
  border-right: 1px solid #000;
  padding: 2px 4px; font-size: 13px; vertical-align: top; font-weight: 500;
}
.inv-table th {
  border-bottom: 1.5px solid #000;
  text-align: center; font-weight: 700; font-size: 12px;
  background: #fff; padding: 2px 4px;
}
.inv-table td { border-bottom: none; word-wrap: break-word; }
.inv-table th:last-child, .inv-table td:last-child { border-right: none; }
.inv-table th:first-child, .inv-table td:first-child { text-align: center; }

/* Column widths */
.inv-col-sl { width: 4%; }
.inv-col-desc { width: 34%; }
.inv-col-hsn { width: 8%; }
.inv-col-gst { width: 8%; }
.inv-col-qty { width: 9%; }
.inv-col-rate { width: 10%; }
.inv-col-per { width: 4%; }
.inv-col-disc { width: 6%; }
.inv-col-amt { width: 17%; }

/* Item details */
.inv-item-name { font-weight: 700; font-size: 13px; }
.inv-item-batch { font-size: 11.5px; color: #000; font-style: italic; margin-top: 1px; }

/* Filler row */
.inv-filler { height: 100%; }
.inv-filler td { vertical-align: bottom; height: auto; }
.inv-calc-line { display: flex; justify-content: space-between; font-size: 13px; padding: 2px 0; font-weight: bold; }

/* Table footer */
.inv-table tfoot td {
  border-top: 1.5px solid #000; border-bottom: none;
  background: #fff; font-weight: 700; font-size: 14px;
}

/* ── Amount in Words ── */
.inv-words-row {
  padding: 4px 6px; border-bottom: 1.5px solid #000;
  font-size: 13px; position: relative;
}
.inv-eoe { position: absolute; right: 6px; bottom: 4px; font-size: 12px; font-style: italic; color: #000; font-weight: bold; }

/* ── Tax Summary Table ── */
.inv-tax-table { width: 100%; border-collapse: collapse; }
.inv-tax-table th, .inv-tax-table td {
  border: 1px solid #000; padding: 2px 4px; text-align: center; font-size: 12px; font-weight: 500;
}
.inv-tax-table th { font-weight: 700; background: #fff; font-size: 11.5px; }
.inv-tax-table tr:first-child th { border-top: none; }
.inv-tax-table tr:last-child td { border-bottom: none; }
.inv-tax-table th:first-child, .inv-tax-table td:first-child { border-left: none; }
.inv-tax-table th:last-child, .inv-tax-table td:last-child { border-right: none; }

/* ── Tax Words + Company Details ── */
.inv-tax-words {
  padding: 4px 6px; border-bottom: 1.5px solid #000; font-size: 13px;
}
.inv-company-refs { font-size: 11.5px; padding: 2px 6px; line-height: 1.3; font-weight: bold; }

/* ── Bank & Declaration ── */
.inv-bank-table { border-collapse: collapse; width: 100%; margin-top: 2px; }
.inv-bank-table td { border: none; padding: 1px 0; font-size: 11.5px; font-weight: bold; }
.inv-bank-table td:first-child { width: 130px; }

/* QR Box */
.inv-qr-box {
  width: 80px; height: 80px; border: 1px solid #ccc;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.inv-qr-box img { width: 100%; height: 100%; object-fit: contain; }

/* Declaration */
.inv-declaration { font-size: 10px; line-height: 1.25; color: #000; margin-top: 2px; font-weight: 600; }

/* Signature */
.inv-sign-area { position: relative; min-height: 45px; }
.inv-sign-for { font-size: 13px; font-weight: 700; text-align: right; }
.inv-auth-sign { position: absolute; bottom: 2px; right: 6px; text-align: right; font-size: 12px; color: #000; font-weight: bold; }
.inv-cust-sign { position: absolute; bottom: 2px; left: 6px; font-size: 12px; color: #000; font-weight: bold; }

/* Footer */
.inv-footer {
  text-align: center; font-size: 11.5px; padding: 4px;
  border-top: 1.5px solid #000; color: #000; font-weight: bold;
}

/* Date-time stamp */
.inv-datetime { font-size: 11.5px; color: #000; margin-bottom: 4px; font-weight: bold; }
