/* ============================================================
   PRINT STYLES — Lab Marco Venâncio
   Fichas, etiquetas e relatórios
   ============================================================ */

@media print {
  /* Reset geral para impressão */
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }

  body { margin: 0; padding: 0; background: #fff; font-family: 'Arial', sans-serif; }

  /* Ocultar elementos de navegação */
  #sidebar, #header, #sidebar-container, #header-container, .no-print, .btn-print-hide,
  .toast-container, .modal-overlay, nav, [class*='sidebar'], [class*='header'] { display: none !important; }

  /* Área de conteúdo ocupa tudo */
  #content, #page-content, .main-content { margin: 0 !important; padding: 0 !important; width: 100% !important; max-width: 100% !important; }
  body > * > *:first-child { display: none !important; }

  /* Evitar quebra dentro de cards */
  .print-no-break { page-break-inside: avoid; }

  /* Forçar quebra de página */
  .print-page-break { page-break-after: always; }
}

/* ============================================================
   FICHA DE ATENDIMENTO — A4 Portrait
   ============================================================ */
.ficha-atendimento {
  width: 210mm;
  min-height: 297mm;
  padding: 15mm 20mm;
  margin: 0 auto;
  background: #fff;
  font-family: 'Arial', sans-serif;
  font-size: 11pt;
  color: #1a1a1a;
  box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.ficha-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid #0F766E;
  padding-bottom: 10mm;
  margin-bottom: 8mm;
}

.ficha-logo { font-size: 18pt; font-weight: bold; color: #0F766E; }
.ficha-logo span { display: block; font-size: 9pt; font-weight: normal; color: #666; }

.ficha-protocolo {
  text-align: right;
  font-size: 10pt;
}
.ficha-protocolo .protocolo-num {
  font-size: 16pt;
  font-weight: bold;
  color: #0F766E;
  font-family: 'Courier New', monospace;
}

.ficha-section {
  margin-bottom: 6mm;
  border: 1px solid #ddd;
  border-radius: 3mm;
  overflow: hidden;
}

.ficha-section-title {
  background: #0F766E;
  color: #fff;
  font-weight: bold;
  font-size: 10pt;
  padding: 2mm 4mm;
  text-transform: uppercase;
  letter-spacing: 0.5mm;
}

.ficha-section-body { padding: 4mm; }

.ficha-field {
  display: flex;
  gap: 3mm;
  margin-bottom: 3mm;
  align-items: baseline;
}

.ficha-field label {
  font-size: 9pt;
  color: #666;
  min-width: 35mm;
  font-weight: bold;
}

.ficha-field .value {
  font-size: 10pt;
  border-bottom: 1px dotted #999;
  flex: 1;
  padding-bottom: 0.5mm;
}

.ficha-etapas {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3mm;
}

.ficha-etapa-box {
  border: 1px solid #ddd;
  border-radius: 2mm;
  padding: 2mm 3mm;
  text-align: center;
}

.ficha-etapa-box.necessaria { border-color: #0F766E; background: #f0fdf9; }
.ficha-etapa-box.nao-necessaria { border-color: #ccc; background: #f9f9f9; opacity: 0.6; }
.ficha-etapa-box.concluida { border-color: #16a34a; background: #f0fdf4; }

.ficha-etapa-nome { font-size: 8pt; font-weight: bold; }
.ficha-etapa-data { font-size: 7pt; color: #666; }

.ficha-assinaturas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10mm;
  margin-top: 15mm;
}

.assinatura-box {
  border-top: 1px solid #333;
  padding-top: 2mm;
  font-size: 9pt;
  color: #555;
  text-align: center;
}

/* ============================================================
   ETIQUETA DE PRÓTESE — 6cm × 4cm
   ============================================================ */
.etiqueta-protese {
  width: 60mm;
  height: 40mm;
  padding: 3mm;
  border: 2px solid #0F766E;
  border-radius: 2mm;
  font-family: 'Arial', sans-serif;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #fff;
  page-break-inside: avoid;
}

.etiqueta-protocolo {
  font-size: 13pt;
  font-weight: bold;
  font-family: 'Courier New', monospace;
  color: #0F766E;
  text-align: center;
  border-bottom: 1px solid #0F766E;
  padding-bottom: 1mm;
}

.etiqueta-paciente { font-size: 8pt; font-weight: bold; }
.etiqueta-tipo { font-size: 7pt; color: #444; }

.etiqueta-barcode {
  display: flex;
  gap: 1px;
  justify-content: center;
  align-items: flex-end;
  height: 8mm;
}

.barcode-bar {
  background: #000;
  width: 1px;
}

.etiqueta-municipio {
  font-size: 7pt;
  text-align: right;
  font-weight: bold;
  color: #0F766E;
}

/* Grade para impressão de múltiplas etiquetas */
.etiquetas-grid {
  display: grid;
  grid-template-columns: repeat(3, 60mm);
  gap: 5mm;
  padding: 10mm;
}

/* ============================================================
   TRANSIÇÕES DE PÁGINA — SPA
   ============================================================ */
#page-content {
  transition: opacity 0.15s ease;
}

/* Scrollbar customizada */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* Focus ring padrão */
*:focus-visible {
  outline: 2px solid #0d9488;
  outline-offset: 2px;
}

/* Tabelas: header sticky */
.sticky-thead thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

/* Animação de entrada para modais */
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
.modal-slide-in { animation: slideInRight 0.2s ease; }

/* Highlight de busca */
mark.highlight {
  background: #fef08a;
  border-radius: 2px;
  padding: 0 2px;
}

/* Status badge padrão */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
