/* Scoped to PDF layout only (html.pdf-root). Generic names like .card do not leak to the web app. */
@page {
  margin: 18mm 14mm 22mm;
}

html.pdf-root,
html.pdf-root body.pdf-body {
  height: 100%;
}

html.pdf-root body.pdf-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: Helvetica, Arial, sans-serif;
  color: #111827;
  font-size: 11pt;
  line-height: 1.45;
}

html.pdf-root .pdf-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #111827;
  padding-bottom: 6mm;
  margin-bottom: 8mm;
}

html.pdf-root .pdf-header-brand {
  font-size: 20pt;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #111827;
}

html.pdf-root .pdf-header-meta {
  text-align: right;
  font-size: 9pt;
  color: #4b5563;
}

html.pdf-root .pdf-header-meta p {
  margin: 0;
}

html.pdf-root .pdf-header-meta .pdf-header-legal-name {
  font-weight: 600;
  color: #111827;
  margin-bottom: 2mm;
}

html.pdf-root .pdf-header-meta .pdf-header-tax,
html.pdf-root .pdf-header-meta .pdf-header-legal-form,
html.pdf-root .pdf-header-meta .pdf-header-address-line,
html.pdf-root .pdf-header-meta .pdf-header-email {
  margin-top: 1mm;
}

html.pdf-root .pdf-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding-bottom: 12mm;
}

html.pdf-root .card--pdf-lines-totals {
  margin-top: auto;
  page-break-inside: auto;
}

html.pdf-root .card--pdf-lines-totals .totals {
  page-break-inside: avoid;
  page-break-before: avoid;
}

html.pdf-root .pdf-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  font-size: 9pt;
  color: #6b7280;
  text-align: center;
  border-top: 1px solid #e5e7eb;
  padding-top: 3mm;
}

html.pdf-root .pdf-footer p {
  margin: 0;
}

html.pdf-root .card {
  margin-bottom: 8mm;
}

html.pdf-root .card-section {
  padding: 3mm 0;
}

html.pdf-root .card-title {
  font-size: 18pt;
  font-weight: 700;
  margin: 0 0 2mm;
}

html.pdf-root .card-subtitle {
  font-size: 13pt;
  font-weight: 600;
  margin: 0 0 3mm;
}

html.pdf-root .card-description {
  color: #4b5563;
  font-size: 10pt;
  margin: 0;
}

html.pdf-root .details-list {
  display: table;
  width: 100%;
}

html.pdf-root .details-list > div {
  display: table-row;
}

html.pdf-root .details-list dt {
  display: table-cell;
  padding: 2mm 6mm 2mm 0;
  color: #4b5563;
  width: 36%;
  vertical-align: top;
}

html.pdf-root .details-list dd {
  display: table-cell;
  padding: 2mm 0;
  font-weight: 600;
  vertical-align: top;
}

html.pdf-root .index-table {
  width: 100%;
}

html.pdf-root .index-table table {
  width: 100%;
  border-collapse: collapse;
}

html.pdf-root .index-table th,
html.pdf-root .index-table td {
  border-bottom: 1px solid #e5e7eb;
  padding: 2.5mm 2mm;
  text-align: left;
  font-size: 9.5pt;
  vertical-align: top;
}

html.pdf-root .index-table thead th {
  background: #f3f4f6;
  font-weight: 700;
  color: #111827;
}

html.pdf-root .index-table tbody tr:nth-child(even) td {
  background: #fafafa;
}

html.pdf-root .totals {
  margin-top: 6mm;
  width: 52%;
  margin-left: auto;
}

html.pdf-root .totals .row {
  display: flex;
  justify-content: space-between;
  padding: 1.5mm 0;
  font-size: 10pt;
}

html.pdf-root .totals .grand {
  margin-top: 2mm;
  padding-top: 3mm;
  border-top: 2px solid #111827;
  font-weight: 700;
  font-size: 12pt;
}
