/* ==========================================================================
   invoice-print.css — the ONE stylesheet for the invoice itself. Shared,
   unmodified, by the on-screen preview, window.print(), and the PDF renderer
   (html2canvas rasterizes this exact markup) — see js/ui/renderer/invoiceRenderer.js.
   Deliberately plain: no unnecessary borders, generous whitespace, one accent
   color used sparingly. Looks like a real printed bill, not a spreadsheet.
   ========================================================================== */

.invoice-sheet {
  width: 210mm;
  min-height: 297mm;
  box-sizing: border-box;
  padding: 14mm 14mm 10mm;
  background: #ffffff;
  color: #1a1f26;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 13px;
  line-height: 1.45;
}

.invoice-sheet * {
  box-sizing: border-box;
}

.invoice-header {
  padding-bottom: 12px;
  border-bottom: 2px solid #1a1f26;
}

.invoice-header__title-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.invoice-header__title {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.6px;
  padding: 5px 12px;
  border: 1.5px solid #1a1f26;
  border-radius: 4px;
}

.invoice-header__brand-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.invoice-header__logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  flex-shrink: 0;
}

.invoice-header__name {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.invoice-header__address {
  margin-top: 10px;
  font-size: 12px;
  color: #45505c;
  white-space: nowrap;
}

.invoice-header__gstin {
  margin-top: 5px;
  font-size: 12px;
  font-weight: 600;
  color: #1a1f26;
}

.invoice-header__contact {
  display: flex;
  gap: 28px;
  margin-top: 5px;
  font-size: 12px;
  color: #45505c;
}

.invoice-section-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #8a6d3b;
  margin-bottom: 6px;
}

.invoice-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 16px;
}

.invoice-kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 10px;
  font-size: 12.5px;
}

.invoice-kv dt {
  color: #6b7686;
}

.invoice-kv dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}

.invoice-kv--compact {
  grid-template-columns: auto auto;
  justify-content: start;
  column-gap: 12px;
  max-width: fit-content;
}

.invoice-kv--compact dd {
  text-align: left;
}

.invoice-customer-name {
  font-size: 14.5px;
  font-weight: 700;
  margin-bottom: 2px;
}

.invoice-customer-address {
  font-size: 12.5px;
  color: #45505c;
  margin-bottom: 6px;
}

.invoice-transport-section {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid #dde1e6;
}

.invoice-transport-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 28px;
}

.invoice-items-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  font-size: 12.5px;
}

.invoice-items-table thead th {
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #6b7686;
  font-weight: 700;
  padding: 0 8px 8px;
  border-bottom: 1.5px solid #1a1f26;
}

.invoice-items-table thead th.num,
.invoice-items-table td.num {
  text-align: right;
}

.invoice-items-table tbody td {
  padding: 9px 8px;
  border-bottom: 1px solid #e7eaee;
}

.invoice-items-table tbody tr:last-child td {
  border-bottom: 1.5px solid #1a1f26;
}

.invoice-total-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.invoice-total-row__box {
  min-width: 220px;
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 800;
  padding: 10px 14px;
  background: #f7f5f0;
  border-radius: 6px;
}

.invoice-words {
  margin-top: 10px;
  font-size: 12px;
  font-style: italic;
  color: #45505c;
}

.invoice-bank-seal-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-top: 34px;
}

.invoice-bank-kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 12px;
  font-size: 12px;
}

.invoice-bank-kv dt {
  color: #6b7686;
}

.invoice-bank-kv dd {
  margin: 0;
  font-weight: 600;
}

.invoice-seal {
  text-align: center;
  flex-shrink: 0;
}

.invoice-seal__for {
  font-size: 11.5px;
  font-weight: 700;
  margin-bottom: 4px;
}

.invoice-seal img {
  height: 68px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  display: block;
  margin: 0 auto 4px;
}

.invoice-seal__caption {
  font-size: 10.5px;
  color: #6b7686;
  border-top: 1px solid #1a1f26;
  padding-top: 4px;
}

.invoice-remarks {
  margin-top: 18px;
  font-size: 12px;
  color: #45505c;
}

.invoice-remarks dt {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #8a6d3b;
  font-weight: 700;
  margin-bottom: 3px;
}

.invoice-footer {
  margin-top: 26px;
  padding-top: 10px;
  border-top: 1px solid #dde1e6;
  text-align: center;
  font-size: 10.5px;
  color: #8a94a1;
}

@media print {
  @page {
    size: A4;
    margin: 0;
  }
  html, body {
    margin: 0;
    padding: 0;
  }
  body * {
    visibility: hidden;
  }
  .invoice-sheet, .invoice-sheet * {
    visibility: visible;
  }
  .invoice-sheet {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    min-height: 100vh;
    transform: none !important;
  }
}
