/* PacienteSeguro — print.css v2 */
@media print {

  /* ── Forçar impressão de cores de fundo e bordas ── */
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }

  /* ── Ocultar tudo que não é resultado ── */
  .no-print, .ps-header, .ps-steps, .ps-nav, .acoes-res, .ps-footer,
  #overlay, .btn-mini, button, .etapa-topo, #bloqueio { display:none !important; }

  .ps-etapa  { display:none !important; }
  #e5        { display:block !important; }

  /* ── Base ── */
  @page { margin:14mm 16mm; size:A4 portrait; }

  html, body { background:#fff; margin:0; padding:0; }
  body { font-family:'Helvetica Neue', Arial, sans-serif; font-size:9.5pt; color:#111827; line-height:1.55; }
  .ps-main { max-width:100%; padding:0; margin:0; }
  #e5 { padding:0; }
  #resultado { display:block !important; }

  /* ── Cabeçalho ── */
  #e5::before {
    content: "PacienteSeguro  ·  Avaliação de Risco em Odontologia  ·  Dr. Laércio A. Amorim Jr.  ·  CRO-GO 19.385 / CRO-DF 16.998";
    display: block;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 7pt;
    font-weight: 700;
    color: #0D1B3E;
    letter-spacing: .06em;
    text-transform: uppercase;
    border-top: 3pt solid #0D1B3E;
    border-bottom: 1pt solid #c8d0e8;
    padding: 6pt 0 6pt;
    margin-bottom: 14pt;
  }

  /* ── Cards de resultado ── */
  .res-card {
    border: 1pt solid #d4d8e8;
    border-radius: 2pt;
    padding: 10pt 12pt;
    margin-bottom: 7pt;
    page-break-inside: avoid;
    box-shadow: none;
    background: #fff;
  }

  .res-topo {
    display: flex;
    align-items: center;
    gap: 8pt;
    border-bottom: .75pt solid #e0e4f0;
    padding-bottom: 5pt;
    margin-bottom: 7pt;
  }

  .res-label {
    flex: 1;
    font-size: 7pt;
    font-weight: 700;
    color: #0D1B3E;
    letter-spacing: .07em;
    text-transform: uppercase;
  }

  .res-sub {
    font-size: 7.5pt;
    color: #666;
    font-style: italic;
    margin: 0 0 6pt;
  }

  /* ── Badge ASA ── */
  .res-badge {
    font-size: 10pt;
    font-weight: 800;
    padding: 2pt 10pt;
    border-radius: 3pt;
    letter-spacing: .02em;
  }
  .asa1 { background:#e8f5e9; color:#1b5e20; }
  .asa2 { background:#fff8e1; color:#e65100; }
  .asa3 { background:#fff3e0; color:#bf360c; }
  .asa4 { background:#fce4ec; color:#880e4f; }

  .asa-escala { height: 5pt; margin: 8pt 0 3pt; border-radius: 1pt; overflow:hidden; }
  .ab { display:none; }
  .ab.ativo { display:block; width:100%; height:5pt; }
  .asa-labels { display:flex; justify-content:space-between; font-size:6.5pt; color:#999; margin-bottom:6pt; }

  #asa-desc { font-size: 9.5pt; margin: 5pt 0 7pt; line-height: 1.65; }
  .nota-asa { font-size: 7pt; font-style: italic; color: #888; }

  /* ── Encaminhamento ── */
  .enc-item {
    padding: 5pt 9pt;
    margin-bottom: 3pt;
    font-size: 8.5pt;
    line-height: 1.5;
    border-radius: 1pt;
  }
  .enc-sim { background:#fff0f0; border-left:3pt solid #c62828; color:#7a0000; }
  .enc-av  { background:#fffbea; border-left:3pt solid #f9a825; color:#5a3e00; }
  .enc-nao { background:#f0faf4; border-left:3pt solid #2e7d32; color:#1a4a25; }

  /* ── Tabelas (exames de imagem + labs) ── */
  .tabela-wrap { overflow: visible; }
  .tab-exames {
    width: 100%;
    border-collapse: collapse;
    font-size: 8pt;
    margin-top: 2pt;
  }
  .tab-exames thead tr { background: #0D1B3E; }
  .tab-exames th {
    background: #0D1B3E;
    color: #fff;
    padding: 4pt 7pt;
    font-size: 6.5pt;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    text-align: left;
  }
  .tab-exames td {
    padding: 4pt 7pt;
    border-bottom: .5pt solid #e4e4ee;
    vertical-align: top;
    line-height: 1.45;
  }
  .tab-exames td:first-child  { font-weight: 600; width: 30%; }
  .tab-exames td:nth-child(2) { width: 30%; }
  .tab-exames td:last-child   { color: #555; font-size: 7.5pt; display: table-cell !important; width: 40%; }
  .tab-exames tr:nth-child(even) td { background: #f7f8fd; }

  /* ── Conduta ── */
  .conduta-item {
    padding: 5pt 9pt 5pt 10pt;
    margin-bottom: 3pt;
    border-left: 3pt solid #0D1B3E;
    background: #eef2fb;
    font-size: 9pt;
    line-height: 1.5;
    border-radius: 0 2pt 2pt 0;
    page-break-inside: avoid;
  }

  /* ── Alertas e farmacológico ── */
  .lista-res { list-style: none; margin: 0; padding: 0; }
  .lista-res li {
    padding: 5pt 9pt;
    margin-bottom: 3pt;
    font-size: 8.5pt;
    line-height: 1.5;
    page-break-inside: avoid;
    border-radius: 1pt;
  }
  .al-v { background:#fff0f0; border-left:3pt solid #c62828; color:#7a0000; }
  .al-a { background:#fffbea; border-left:3pt solid #f9a825; color:#5a3e00; }
  .al-b { background:#e8f0fb; border-left:3pt solid #1565c0; color:#0d3b66; }

  /* ── Síntese integrada ── */
  .decision-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7pt;
  }
  .decision-col {
    border: 1pt solid #ddd;
    border-radius: 2pt;
    page-break-inside: avoid;
  }
  .decision-col h3 {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 8pt;
    letter-spacing: .04em;
    margin: 0;
    padding: 6pt 8pt;
    text-transform: uppercase;
  }
  .decision-col ul { list-style: none; margin: 0; padding: 0; }
  .decision-col li {
    border-top: 1pt solid #eee;
    font-size: 8pt;
    line-height: 1.45;
    padding: 5pt 7pt;
  }
  .decision-can h3 { background: #e8f5e9; color: #1b5e20; }
  .decision-cannot h3 { background: #ffebee; color: #7a0000; }
  .decision-note {
    background: #f8f8f8;
    border: 1pt solid #ddd;
    border-radius: 2pt;
    color: #555;
    font-size: 7.5pt;
    line-height: 1.45;
    margin-top: 6pt;
    padding: 6pt 8pt;
  }

  /* ── Caixas de texto (TCLE, Prontuário, Carta) ── */
  .caixa-txt {
    font-family: 'Courier New', Courier, monospace;
    font-size: 7.5pt;
    padding: 9pt 11pt;
    border: 1pt solid #ccc;
    background: #fafafa;
    white-space: pre-wrap;
    line-height: 1.7;
    word-break: break-word;
  }

  /* ── Avisos e referências ── */
  .box-avisos {
    border-top: 1.5pt solid #B8963E;
    padding: 8pt 10pt;
    background: #fdf9f3;
    font-size: 7pt;
    color: #666;
    margin-top: 8pt;
    page-break-inside: avoid;
  }
  .box-avisos ol { margin: 4pt 0 0; padding-left: 16pt; }
  .box-avisos li { margin-bottom: 2pt; line-height: 1.5; }

  /* ── Quebras de página ── */
  /* TCLE: nova página pois precisa de assinatura do paciente */
  #card-tcle      { page-break-before: always; }
  /* Carta: nova página — documento autônomo para entregar ao paciente */
  #card-encam-carta { page-break-before: always; }
  /* Prontuário: flui naturalmente após carta/TCLE */
  #card-pront-txt { page-break-before: auto; }

  /* ── Carta de encaminhamento ── */
  #card-encam-carta .res-label::before { content: ''; }
  #card-encam-carta .caixa-txt {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 9pt;
    line-height: 1.75;
    border: 1.5pt solid #0D1B3E;
    background: #fff;
    padding: 14pt 16pt;
  }

}
