/* Estilos de impressão/PDF da ficha do animal e do certificado CEIP. */

@media print {
  @page {
    size: A4 landscape;
    margin: 6mm;
  }

  body.snp-printing-animal {
    background: #ffffff !important;
  }

  body.snp-printing-animal > :not(.snp-animal-print-root) {
    display: none !important;
  }

  body.snp-printing-animal .snp-animal-print-root {
    width: 100%;
    display: block !important;
    color: #2b2e31 !important;
    font-family: "Manrope", Arial, sans-serif !important;
  }

  body.snp-printing-animal .snp-animal-print-root * {
    box-sizing: border-box;
    color: var(--ink);
    font-family: "Manrope", Arial, sans-serif !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body.snp-printing-animal .animal-print-document {
    width: 100%;
    min-height: 190mm;
    border: 1.5px solid #315b35;
    background: #ffffff !important;
    box-shadow: inset 0 0 0 1000px #ffffff;
  }

  body.snp-printing-animal .animal-print-header {
    display: grid;
    grid-template-columns: 46mm minmax(0, 1fr) 58mm;
    align-items: center;
    gap: 6mm;
    margin: 0;
    padding: 5mm 6mm;
    border-bottom: 2px solid #315b35;
    background: #eef3e8 !important;
    box-shadow: inset 0 0 0 1000px #eef3e8;
  }

  body.snp-printing-animal .animal-print-brand {
    padding: 3mm;
    border: 1px solid #cfd8bd;
    background: #ffffff !important;
    box-shadow: inset 0 0 0 1000px #ffffff;
  }

  body.snp-printing-animal .animal-print-brand img {
    width: 100%;
    height: auto;
    object-fit: contain;
  }

  body.snp-printing-animal .animal-print-title {
    min-width: 0;
    text-align: left;
  }

  body.snp-printing-animal .animal-print-title > span {
    display: block;
    margin: 0;
    color: #4b703c !important;
    font-size: 7pt;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  body.snp-printing-animal .animal-print-title h1 {
    margin: 1.2mm 0 .8mm;
    color: #24452a !important;
    font-size: 18pt;
    line-height: 1.05;
  }

  body.snp-printing-animal .animal-print-title p {
    margin: 0;
    color: #65705f !important;
    font-size: 8pt;
    line-height: 1.3;
  }

  body.snp-printing-animal .animal-print-identity {
    min-width: 0;
    display: grid;
    gap: .6mm;
    padding: 4mm;
    border: 1px solid #24452a;
    background: #315b35 !important;
    box-shadow: inset 0 0 0 1000px #315b35;
  }

  body.snp-printing-animal .animal-print-identity span,
  body.snp-printing-animal .animal-print-identity small,
  body.snp-printing-animal .animal-print-identity strong {
    color: #ffffff !important;
  }

  body.snp-printing-animal .animal-print-identity span {
    font-size: 7pt;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  body.snp-printing-animal .animal-print-identity strong {
    font-size: 15pt;
    line-height: 1.08;
    overflow-wrap: anywhere;
  }

  body.snp-printing-animal .animal-print-identity small {
    font-size: 7.5pt;
    opacity: .9;
  }

  body.snp-printing-animal .animal-print-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10mm;
    padding: 2.4mm 6mm;
    border-bottom: 1px solid #cfd8bd;
    background: #f7f9f4 !important;
    box-shadow: inset 0 0 0 1000px #f7f9f4;
    color: #65705f !important;
    font-size: 7pt;
    font-weight: 700;
  }

  body.snp-printing-animal .animal-print-content {
    padding: 4mm 6mm 13mm;
  }

  body.snp-printing-animal .animal-print-content > #animal-page-details,
  body.snp-printing-animal .animal-print-content > div {
    display: block !important;
  }

  body.snp-printing-animal .animal-genetic-layout {
    display: block !important;
  }

  body.snp-printing-animal .animal-report,
  body.snp-printing-animal .animal-detail-section {
    margin: 0 0 4mm;
    padding: 0;
    border: 1px solid #cfd8bd !important;
    border-radius: 0 !important;
    background: #ffffff !important;
    box-shadow: none !important;
  }

  body.snp-printing-animal .animal-print-section-title,
  body.snp-printing-animal .animal-detail-section > h3,
  body.snp-printing-animal .table-section-heading {
    min-height: 10mm;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10mm;
    margin: 0 !important;
    padding: 2.5mm 4mm;
    border: 0;
    border-bottom: 1px solid #24452a;
    background: #315b35 !important;
    box-shadow: inset 0 0 0 1000px #315b35;
    color: #ffffff !important;
    font-size: 10pt !important;
    line-height: 1.2;
    text-transform: uppercase;
  }

  body.snp-printing-animal .table-section-heading h3,
  body.snp-printing-animal .table-section-heading span,
  body.snp-printing-animal .animal-detail-section > h3 * {
    margin: 0 !important;
    color: #ffffff !important;
    font-size: inherit !important;
  }

  body.snp-printing-animal .animal-report-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    padding: 4mm;
  }

  body.snp-printing-animal .animal-report-card {
    min-height: 26mm;
    margin: 0;
    padding: 3.5mm 4mm;
    border: 1px solid #dce3d2 !important;
    border-radius: 0 !important;
    background: #f5f7f1 !important;
    box-shadow: inset 0 0 0 1000px #f5f7f1 !important;
  }

  body.snp-printing-animal .animal-report-card,
  body.snp-printing-animal .animal-highlight-section,
  body.snp-printing-animal .genetic-report-section {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.snp-printing-animal .genetic-report-section {
    break-before: page;
    page-break-before: always;
  }

  body.snp-printing-animal .animal-detail-section > h3 {
    color: #ffffff !important;
  }

  body.snp-printing-animal .animal-report-card h4 {
    color: #24452a !important;
  }

  body.snp-printing-animal .animal-report-card h4 {
    margin-bottom: 2.4mm;
    font-size: 8pt;
  }

  body.snp-printing-animal .animal-report-card h4 .snp-ui-icon {
    width: 11pt;
    height: 11pt;
    color: #4b703c !important;
  }

  body.snp-printing-animal .animal-report-facts {
    gap: 2mm 5mm;
  }

  body.snp-printing-animal .animal-report-facts dt {
    color: #65705f !important;
    font-size: 7pt;
  }

  body.snp-printing-animal .animal-report-facts dd {
    color: #20251f !important;
    font-size: 9pt;
    font-weight: 800;
  }

  body.snp-printing-animal .animal-highlight-section .animal-summary {
    grid-template-columns: repeat(auto-fit, minmax(34mm, 1fr));
    gap: 2mm;
    margin: 0;
    padding: 4mm;
  }

  body.snp-printing-animal .animal-summary > div {
    min-height: 19mm;
    padding: 3mm;
    border: 1px solid #cfd8bd !important;
    border-radius: 0 !important;
    background: #eef3e8 !important;
    box-shadow: inset 0 0 0 1000px #eef3e8 !important;
  }

  body.snp-printing-animal .animal-summary > div::before,
  body.snp-printing-animal .animal-summary > div::after {
    display: none;
  }

  body.snp-printing-animal .animal-summary span {
    color: #65705f !important;
    font-size: 6.5pt;
  }

  body.snp-printing-animal .animal-summary strong {
    color: #24452a !important;
    font-size: 10pt;
    font-weight: 900;
  }

  body.snp-printing-animal .detail-table-wrap,
  body.snp-printing-animal .table-wrap {
    max-height: none !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
  }

  body.snp-printing-animal .detail-table,
  body.snp-printing-animal .genetic-table {
    width: 100% !important;
    font-size: 8pt;
  }

  body.snp-printing-animal .detail-table thead {
    display: table-header-group;
  }

  body.snp-printing-animal .detail-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.snp-printing-animal .detail-table th,
  body.snp-printing-animal .detail-table td {
    padding: 2mm 2.2mm;
    border-color: #dce3d2 !important;
  }

  body.snp-printing-animal .detail-table th {
    position: static;
    background: #315b35 !important;
    box-shadow: inset 0 0 0 1000px #315b35;
    color: #ffffff !important;
    font-size: 7pt;
    font-weight: 800;
  }

  body.snp-printing-animal .detail-table th * {
    color: #ffffff !important;
  }

  body.snp-printing-animal .detail-table tbody tr:nth-child(even),
  body.snp-printing-animal .detail-table tbody tr:nth-child(even) td {
    background: #f5f7f1 !important;
    box-shadow: inset 0 0 0 1000px #f5f7f1;
  }

  body.snp-printing-animal .genetic-scale-fill {
    fill: #1f78b4 !important;
  }

  body.snp-printing-animal .genetic-scale-track {
    fill: #e7ecdf !important;
  }

  body.snp-printing-animal .no-print,
  body.snp-printing-animal button,
  body.snp-printing-animal [hidden] {
    display: none !important;
  }

  body.snp-printing-animal .animal-print-footer {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 0;
    padding: 2.5mm 6mm;
    border-top: 1px solid #cfd8bd;
    background: #f7f9f4 !important;
    box-shadow: inset 0 0 0 1000px #f7f9f4;
    color: #65705f !important;
    font-size: 7pt;
  }

  body.snp-printing-ceip {
    background: var(--white) !important;
  }

  body.snp-printing-ceip> :not(.snp-ceip-print-root) {
    display: none !important;
  }

  body.snp-printing-ceip .snp-ceip-print-root {
    display: block !important;
    width: 100%;
    font-family: "Manrope", Arial, sans-serif !important;
  }

  body.snp-printing-ceip .snp-ceip-print-root * {
    visibility: visible !important;
    font-family: "Manrope", Arial, sans-serif !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body.snp-printing-ceip .ceip-certificate.is-print-target {
    position: static;
    width: 100%;
    margin: 0;
    border-radius: 0;
    border: 0;
    box-shadow: none;
    font-size: 9pt;
    page-break-inside: avoid;
    break-inside: avoid;
    background: var(--white) !important;
  }

  body.snp-printing-ceip .snp-term {
    border-bottom: 0 !important;
  }

  body.snp-printing-ceip .ceip-screen-layout {
    display: none !important;
  }

  body.snp-printing-ceip .ceip-screen-title {
    display: none !important;
  }

  body.snp-printing-ceip .ceip-print-layout {
    display: block !important;
  }

  body.snp-printing-ceip .ceip-print-page {
    border: 1px solid var(--border-strong);
    background: var(--white) !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  body.snp-printing-ceip .ceip-certificate-header {
    display: grid !important;
    grid-template-columns: 128px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 8px 10px;
    border-bottom-width: 2px;
    background: var(--surface-soft) !important;
  }

  body.snp-printing-ceip .ceip-brand-logo {
    width: 112px;
  }

  body.snp-printing-ceip .ceip-title-block p,
  body.snp-printing-ceip .ceip-title-block>strong {
    font-size: .63rem;
    line-height: 1.25;
  }

  body.snp-printing-ceip .ceip-document-title,
  body.snp-printing-ceip .ceip-certificate-header h3 {
    display: block !important;
    color: var(--green-900) !important;
    font-size: .86rem;
    line-height: 1.18;
    font-weight: 900;
    margin: 0 0 2px;
  }

  body.snp-printing-ceip .ceip-certificate-actions {
    gap: 8px;
  }

  body.snp-printing-ceip .ceip-number {
    min-width: 112px;
    padding: 7px 9px;
    background: var(--white) !important;
  }

  body.snp-printing-ceip .ceip-number span,
  body.snp-printing-ceip .ceip-validation-box span,
  body.snp-printing-ceip .ceip-animal-card span,
  body.snp-printing-ceip .ceip-signature span {
    font-size: .56rem;
  }

  body.snp-printing-ceip .ceip-number strong {
    font-size: .82rem;
  }

  body.snp-printing-ceip .ceip-seal {
    width: 58px;
    height: 58px;
  }

  body.snp-printing-ceip .ceip-certificate-body {
    grid-template-columns: minmax(0, 1.08fr) minmax(262px, .72fr);
  }

  body.snp-printing-ceip .ceip-identity,
  body.snp-printing-ceip .ceip-evaluation {
    padding: 9px 9px;
  }

  body.snp-printing-ceip .ceip-evaluation {
    display: flex;
    flex-direction: column;
  }

  body.snp-printing-ceip .ceip-identity {
    gap: 12px;
  }

  body.snp-printing-ceip .ceip-section-heading {
    margin-bottom: 4px;
  }

  body.snp-printing-ceip .ceip-section-heading h4 {
    font-size: .65rem;
    line-height: 1.05;
    margin-bottom: 4px;
  }

  body.snp-printing-ceip .ceip-section-heading span {
    font-size: .52rem;
    line-height: 1.05;
  }

  body.snp-printing-ceip .ceip-animal-card {
    padding: 12px 12px;
    border-left-width: 3px;
    background: var(--white) !important;
  }

  body.snp-printing-ceip .ceip-animal-card span {
    font-size: .72rem;
  }

  body.snp-printing-ceip .ceip-animal-card strong {
    font-size: 1.7rem;
    line-height: 1.05;
  }

  body.snp-printing-ceip .ceip-animal-card small {
    font-size: .9rem;
    line-height: 1.1;
  }

  body.snp-printing-ceip .ceip-lineage-grid {
    gap: 6px;
  }

  body.snp-printing-ceip .ceip-lineage-item {
    gap: 3px;
    padding: 9px 8px;
    border-radius: 4px;
    background: var(--white) !important;
  }

  body.snp-printing-ceip .ceip-lineage-item span {
    font-size: .65rem;
    line-height: 1;
  }

  body.snp-printing-ceip .ceip-lineage-item strong {
    font-size: 1.12rem;
    font-weight: 800;
    line-height: 1.08;
  }

  body.snp-printing-ceip .ceip-lineage-item.is-animal strong {
    font-size: 1.28rem;
  }

  body.snp-printing-ceip .ceip-lineage-item .ceip-animal-id {
    font-size: .94rem;
  }

  body.snp-printing-ceip .ceip-lineage-item small {
    font-size: .62rem;
    line-height: 1.18;
  }

  body.snp-printing-ceip .animal-report-facts {
    gap: 27px 12px;
  }

  .animal-report-facts div {
    gap: 0;
}

  body.snp-printing-ceip .ceip-identity .ceip-animal-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 8px;
  }

  body.snp-printing-ceip .ceip-identity .ceip-animal-facts dt {
    font-size: .65rem;
    line-height: 1.08;
  }

  body.snp-printing-ceip .ceip-identity .ceip-animal-facts dd {
    font-size: .86rem;
    line-height: 1.08;
  }

  body.snp-printing-ceip .animal-report-facts dt {
    font-size: .72rem;
    line-height: 1.05;
  }

  body.snp-printing-ceip .animal-report-facts dd {
    font-size: 1.12rem;
    line-height: 1.08;
  }

  body.snp-printing-ceip .ceip-validation-box {
    gap: 11px;
    padding: 12px 10px;
    background: var(--white) !important;
  }

  body.snp-printing-ceip .ceip-qr-code,
  body.snp-printing-ceip .ceip-qr-placeholder {
    width: 72px;
    height: 72px;
    flex-basis: 72px;
  }

  body.snp-printing-ceip .ceip-validation-box strong {
    font-size: .9rem;
  }

  body.snp-printing-ceip .ceip-validation-box small {
    font-size: .66rem;
    line-height: 1.25;
  }

  body.snp-printing-ceip .ceip-table {
    height: 100%;
    font-size: .78rem;
    line-height: 1.1;
  }

  body.snp-printing-ceip .ceip-table-wrap {
    display: flex;
    flex: 1 1 auto;
  }

  body.snp-printing-ceip .ceip-table th {
    background: var(--green-deep) !important;
    color: var(--surface-soft) !important;
  }

  body.snp-printing-ceip .ceip-table thead th {
    height: 24px;
    padding: 0 5px !important;
    font-size: .74rem;
    line-height: 24px;
    vertical-align: bottom;
  }

  body.snp-printing-ceip .ceip-table thead th:first-child {
    text-align: center;
  }

  body.snp-printing-ceip .ceip-table tbody tr:nth-child(odd) td {
    background: var(--white) !important;
  }

  body.snp-printing-ceip .ceip-table tbody tr:nth-child(even) td {
    background: var(--surface-soft) !important;
  }

  body.snp-printing-ceip .ceip-table th,
  body.snp-printing-ceip .ceip-table td {
    padding: 4px 5px;
  }

  /* TESTE escala larga: voltar 200px para 148px se a tabela ficar apertada. */
  body.snp-printing-ceip .ceip-table .ceip-scale-heading {
    width: 200px;
    padding: 0;
    line-height: 1;
  }

  body.snp-printing-ceip .ceip-table th:last-child,
  body.snp-printing-ceip .ceip-table td:last-child {
    width: 200px;
    padding-left: 0 !important;
    padding-right: 0 !important;
    text-align: center;
  }

  body.snp-printing-ceip .ceip-scale-heading-axis {
    width: 200px;
    height: 20px;
  }

  body.snp-printing-ceip .ceip-scale-heading-axis span {
    top: 7px;
    font-size: 6.7px;
  }

  body.snp-printing-ceip .ceip-scale-heading-axis svg line {
    stroke-width: .35;
  }

  body.snp-printing-ceip .ceip-table .genetic-scale {
    width: 200px;
    height: 10px;
  }
  /* 11 */
  body.snp-printing-ceip .ceip-official-grid {
    display: block;
    padding: 12px 9px 13px;
    background: var(--white) !important;
  }

  body.snp-printing-ceip .ceip-official-grid .animal-report-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 12px;
  }
  /* 11 */
  body.snp-printing-ceip .ceip-official-grid .animal-report-facts dt {
    font-size: .82rem;
    line-height: 1.15;
  }

  body.snp-printing-ceip .ceip-official-grid .animal-report-facts dd {
    font-size: 1.16rem;
    line-height: 1.12;
  }
  /* 11 */
  body.snp-printing-ceip .ceip-signature {
    display: grid;
    grid-template-columns: minmax(95px, auto) minmax(0, 1fr) minmax(180px, auto);
    align-items: center;
    gap: 10px;
    margin: 0 9px 8px;
    padding: 8px 0 0;
  }

  body.snp-printing-ceip .ceip-signature span {
    font-size: .68rem;
    line-height: 1;
  }
  /* 11 */
  body.snp-printing-ceip .ceip-signature strong {
    font-size: .92rem;
    line-height: 1.05;
  }

  body.snp-printing-ceip .ceip-signature small {
    font-size: .72rem;
    line-height: 1.05;
    text-align: right;
  }

  body.snp-printing-ceip .ceip-signature-issued-at {
    display: block;
  }

  body.snp-printing-ceip .ceip-certificate-footer {
    display: block;
    padding: 4px 7px 5px;
    font-family: "Manrope", Arial, sans-serif !important;
    font-size: 7px !important;
    line-height: 1.05 !important;
    background: var(--surface-soft) !important;
  }

  body.snp-printing-ceip .ceip-certificate-footer p {
    margin: 2px 0;
    font-size: 7px !important;
    line-height: 1.05 !important;
  }

  body.snp-printing-ceip .ceip-appendix {
    display: grid !important;
    position: relative;
    min-height: 180mm;
    align-content: start;
    gap: 10px;
    page-break-before: always;
    break-before: page;
    padding: 10px 12px 0;
    overflow: hidden;
    background: var(--white) !important;
  }

  body.snp-printing-ceip .ceip-appendix::before {
    content: none;
  }

  body.snp-printing-ceip .ceip-appendix-watermark {
    position: absolute;
    top: 26mm;
    left: 50%;
    width: 106mm;
    height: 106mm;
    object-fit: contain;
    transform: translateX(-50%);
    filter: grayscale(1) contrast(.9);
    opacity: .4;
    z-index: 0;
    pointer-events: none;
  }

  body.snp-printing-ceip .ceip-legend,
  body.snp-printing-ceip .ceip-phenotype-legend {
    position: relative;
    z-index: 1;
    padding: 9px 11px;
    border: 1px solid var(--border-soft);
    border-radius: 6px;
    background: rgb(255 255 255 / .86) !important;
  }

  body.snp-printing-ceip .ceip-legend h4 {
    margin: 0 0 9px;
    padding: 5px 8px;
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    background: var(--green-deep) !important;
    color: var(--surface-soft) !important;
    font-size: .96rem;
    line-height: 1.1;
    text-align: center;
    text-transform: uppercase;
  }

  body.snp-printing-ceip .ceip-legend-grid {
    display: block;
    columns: auto;
    gap: 0;
  }

  body.snp-printing-ceip .ceip-legend-grid div {
    display: block;
    margin: 0 0 4px;
    color: var(--ink) !important;
    font-size: .86rem;
    line-height: 1.42;
  }

  body.snp-printing-ceip .ceip-legend-grid strong,
  body.snp-printing-ceip .ceip-phenotype-legend strong {
    color: var(--green-deep) !important;
    font-size: .86rem;
    font-weight: 900;
    line-height: 1.2;
  }

  body.snp-printing-ceip .ceip-legend-grid strong::after {
    content: ": ";
  }

  body.snp-printing-ceip .ceip-legend-grid span,
  body.snp-printing-ceip .ceip-phenotype-legend span {
    color: var(--ink) !important;
    font-size: .86rem;
    line-height: 1.42;
  }

  body.snp-printing-ceip .ceip-phenotype-legend {
    display: block;
    margin-top: 8px;
    color: var(--ink) !important;
  }

  body.snp-printing-ceip .ceip-certificate.is-print-target .no-print {
    display: none !important;
  }

  body.snp-printing-ceip .ceip-table-wrap,
  body.snp-printing-ceip .detail-table-wrap {
    max-height: none;
    overflow: visible;
  }
}
