/**
 * NES — Pré-visualização de impressão (tela)
 */

.nes-print-preview-modal {
  z-index: 12050;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 47, 63, 0.45);
}

.nes-print-preview-dialog {
  display: flex;
  flex-direction: column;
  width: min(1080px, 92vw);
  max-height: 88vh;
  height: 88vh;
  background: #f8fafc;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.nes-print-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
  min-height: 52px;
}

.nes-print-preview-header h3 {
  margin: 0;
  font-size: 0.95rem;
  color: #0f4c66;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nes-print-preview-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.nes-print-preview-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 16px;
  background: #e8f0ee;
}

.nes-print-preview-iframe {
  display: block;
  width: 100%;
  height: calc(88vh - 52px);
  min-height: 300px;
  border: 0;
  background: #fff;
}

@media (max-width: 640px) {
  .nes-print-preview-dialog {
    width: 100vw;
    max-height: 100dvh;
    height: 100dvh;
    border-radius: 0;
  }
  .nes-print-preview-iframe {
    height: calc(100dvh - 52px);
  }
}

/* Folha A4 na pré-visualização (dentro do iframe) */
.nes-print-preview-sheet .documento-a4,
.nes-print-preview-sheet body {
  width: 210mm;
  max-width: 100%;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
}

.nes-print-preview-sheet {
  overflow-x: hidden;
  min-height: 100%;
}

.nes-print-preview-sheet .nes-doc-print-root {
  padding: 12px;
  background: #e8f0ee;
}
