/* Myc Medical — SGQ — Estilo compartilhado */

:root {
  --cor-primaria: #1a3a5c;
  --cor-secundaria: #2e6da4;
  --cor-alerta: #c0392b;
  --cor-ok: #27ae60;
  --cor-borda: #c8d6e0;
  --fonte: 'Calibri', 'Segoe UI', Arial, sans-serif;
  --tamanho-fonte: 11pt;
  --espacamento: 1.5;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--fonte);
  font-size: var(--tamanho-fonte);
  line-height: var(--espacamento);
  color: #222;
  background: #f4f6f8;
  padding: 24px;
}

/* ── Página ── */
.pagina {
  background: #fff;
  max-width: 210mm;
  margin: 0 auto;
  padding: 20mm 20mm 15mm 20mm;
  box-shadow: 0 2px 12px rgba(0,0,0,0.10);
  min-height: 297mm;
}

/* ── Cabeçalho padrão SGQ ── */
.doc-cabecalho {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  border: 2px solid var(--cor-primaria);
  margin-bottom: 24px;
}

.doc-cabecalho > div {
  padding: 6px 10px;
  border-right: 1px solid var(--cor-primaria);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.doc-cabecalho > div:last-child { border-right: none; }

.doc-cabecalho .empresa {
  font-weight: 700;
  font-size: 13pt;
  color: var(--cor-primaria);
  flex-direction: column;
}

.doc-cabecalho .bloco-central {
  flex-direction: column;
  gap: 2px;
}

.doc-cabecalho .sistema-label {
  font-size: 8pt;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #555;
}

.doc-cabecalho .doc-titulo {
  font-weight: 700;
  font-size: 11pt;
  color: var(--cor-primaria);
}

.doc-cabecalho .bloco-direito {
  flex-direction: column;
  gap: 4px;
  font-size: 9pt;
}

.doc-cabecalho .doc-codigo {
  font-weight: 700;
  font-size: 12pt;
  color: var(--cor-primaria);
}

/* ── Seções introdutórias (A, B, C, D, E) ── */
.secao-intro {
  margin-bottom: 16px;
}

.secao-intro h2 {
  font-size: 10pt;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--cor-primaria);
  border-bottom: 1px solid var(--cor-borda);
  padding-bottom: 3px;
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}

/* ── Seções numeradas (1, 2, 3...) ── */
.secao h2 {
  font-size: 11pt;
  font-weight: 700;
  color: var(--cor-primaria);
  background: #eaf0f7;
  padding: 6px 10px;
  border-left: 4px solid var(--cor-secundaria);
  margin: 20px 0 10px 0;
}

.secao h3 {
  font-size: 10.5pt;
  font-weight: 700;
  color: #2c3e50;
  margin: 14px 0 6px 0;
  border-bottom: 1px solid var(--cor-borda);
  padding-bottom: 2px;
}

.secao h4 {
  font-size: 10pt;
  font-weight: 700;
  color: #444;
  margin: 10px 0 4px 0;
}

.secao p, .secao-intro p {
  margin-bottom: 8px;
  text-align: justify;
}

.secao ul, .secao ol {
  margin: 6px 0 10px 24px;
}

.secao li { margin-bottom: 4px; }

/* ── Tabelas ── */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 10pt;
}

th {
  background: var(--cor-primaria);
  color: #fff;
  font-weight: 700;
  padding: 6px 10px;
  text-align: center;
  border: 1px solid var(--cor-primaria);
}

td {
  padding: 5px 10px;
  border: 1px solid var(--cor-borda);
  vertical-align: top;
}

tr:nth-child(even) td { background: #f7fafc; }

/* ── Tabela de histórico de revisões ── */
.tabela-revisoes th { font-size: 9pt; }
.tabela-revisoes td { font-size: 9pt; text-align: center; }

/* ── Links ── */
a {
  color: var(--cor-secundaria);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* ── Alertas / destaques ── */
.nota {
  background: #fffbe6;
  border-left: 4px solid #f0ad00;
  padding: 8px 12px;
  margin: 10px 0;
  font-size: 10pt;
}

.aviso-desvio {
  color: var(--cor-alerta);
  font-weight: 700;
}

/* ── Rodapé padrão SGQ ── */
.doc-rodape {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  border: 1px solid var(--cor-borda);
  border-top: 2px solid var(--cor-primaria);
  margin-top: 32px;
  font-size: 8.5pt;
}

.doc-rodape > div {
  padding: 6px 8px;
  border-right: 1px solid var(--cor-borda);
  text-align: center;
}

.doc-rodape > div:last-child { border-right: none; }

.doc-rodape .label-rodape {
  font-size: 7.5pt;
  color: #777;
  display: block;
  margin-bottom: 2px;
}

.doc-rodape .assinatura-area {
  min-height: 32px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.doc-rodape .assinatura-area img {
  max-height: 28px;
  max-width: 90%;
  opacity: 0.92;
}

/* ── Navegação (breadcrumb) ── */
.nav-breadcrumb {
  font-size: 9pt;
  color: #777;
  margin-bottom: 16px;
}

.nav-breadcrumb a { color: var(--cor-secundaria); }
.nav-breadcrumb span { margin: 0 4px; }

/* ── Formulários em branco (FR templates) ── */
.fr-campo {
  border: 1px solid #999;
  min-height: 24px;
  padding: 2px 6px;
  background: #fafafa;
}

.fr-campo-assinatura {
  border: 1px solid #999;
  min-height: 40px;
  background: #fafafa;
}

.fr-tabela-registro th {
  background: #eaf0f7;
  color: var(--cor-primaria);
  font-size: 9pt;
}

.fr-tabela-registro td {
  min-height: 22px;
  font-size: 9.5pt;
}

/* ── Status fornecedores (app/dashboard) ── */
.status-ok    { color: var(--cor-ok); font-weight: 700; }
.status-alerta{ color: #e67e22; font-weight: 700; }
.status-erro  { color: var(--cor-alerta); font-weight: 700; }

/* ── Print ── */
@media print {
  body { background: #fff; padding: 0; }
  .pagina {
    box-shadow: none;
    padding: 15mm 15mm 10mm 15mm;
    min-height: auto;
  }
  .nav-breadcrumb { display: none; }
  a { color: #000; text-decoration: none; }
  h2, h3 { page-break-after: avoid; }
  table { page-break-inside: avoid; }
}
