/* Wizard da Investigação de Ocorrência (Vigimed).
   Escopado inteiramente sob .investigacao-wizard porque esta pasta é
   carregada automaticamente em TODAS as telas do módulo Vigimed
   (Layout::getScriptsAndLinks) -- nao deve vazar pro dashboard/notificacoes. */

.investigacao-wizard .wz-contexto {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
  font-size: .92rem;
}

.investigacao-wizard .wz-contexto .wz-badge-status {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  background: #f1c40f22;
  color: #8a6d00;
}
.investigacao-wizard .wz-contexto .wz-badge-status.is-concluida {
  background: #03a34e22;
  color: #03a34e;
}
.investigacao-wizard .wz-contexto .wz-salvo-em {
  color: #6c757d;
  margin-left: auto;
}

/* ---- Stepper (desktop) ---- */
.investigacao-wizard .wz-stepper {
  position: sticky;
  top: 66px;
}
.investigacao-wizard .wz-fase {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #8a8f98;
  padding: 14px 10px 4px;
}
.investigacao-wizard .wz-fase:first-child { padding-top: 2px; }

.investigacao-wizard .wz-step {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: .9rem;
  color: #343a40;
}
.investigacao-wizard .wz-step:hover { background: #f1f3f5; }
.investigacao-wizard .wz-step.is-atual {
  background: #101c4212;
  color: #101c42;
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--brand-accent, #03a34e);
}
.investigacao-wizard .wz-step-num {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e9ecef;
  color: #495057;
  font-size: .76rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.investigacao-wizard .wz-step.is-atual .wz-step-num {
  background: var(--brand-accent, #03a34e);
  color: #fff;
}
.investigacao-wizard .wz-step-label { flex: 1; line-height: 1.2; }
.investigacao-wizard .wz-step-icone { flex: none; font-size: .85rem; }
.investigacao-wizard .wz-step[data-estado="completa"] .wz-step-icone { color: #03a34e; }
.investigacao-wizard .wz-step[data-estado="parcial"] .wz-step-icone { color: #b8860b; }
.investigacao-wizard .wz-step[data-estado="vazia"] .wz-step-icone { color: #ced4da; }

/* ---- Mobile nav ---- */
.investigacao-wizard .wz-mobile-head { margin-bottom: 14px; }
.investigacao-wizard .wz-mobile-head .progress { height: 6px; margin-bottom: 8px; }

/* ---- Conteúdo da etapa ---- */
.investigacao-wizard .wz-etapa-card {
  padding: 20px;
}
.investigacao-wizard .wz-etapa-titulo {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 2px;
}
.investigacao-wizard .wz-etapa-intro {
  color: #6c757d;
  font-size: .88rem;
  margin-bottom: 16px;
}

/* ---- Rodapé de navegação ---- */
.investigacao-wizard .wz-nav {
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 1px solid #dee2e6;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  border-radius: 0 0 10px 10px;
}

/* ---- Causa e Efeito: cards por categoria ---- */
.investigacao-wizard .wz-ce-card {
  border: 1px solid #dee2e6;
  border-radius: 10px;
  padding: 14px;
  height: 100%;
}
.investigacao-wizard .wz-ce-card .wz-ce-titulo {
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 700; margin-bottom: 8px;
}
.investigacao-wizard .wz-ce-card .wz-ce-contador {
  font-size: .74rem; font-weight: 700; color: #6c757d;
  background: #f1f3f5; border-radius: 999px; padding: 1px 9px;
}

/* ---- Fatores contribuintes ---- */
.investigacao-wizard .wz-fator-card {
  border: 1px solid #dee2e6;
  border-radius: 10px;
  padding: 14px;
  height: 100%;
}
.investigacao-wizard .wz-fator-card.tem-selecionado { border-color: #03a34e66; background: #03a34e08; }
.investigacao-wizard .wz-fator-card .wz-fator-titulo {
  display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 6px; font-size: .92rem;
}
.investigacao-wizard .wz-fator-card .wz-fator-check-ok { color: #03a34e; display: none; }
.investigacao-wizard .wz-fator-card.tem-selecionado .wz-fator-check-ok { display: inline; }

/* ---- Empty states ---- */
.investigacao-wizard .wz-empty {
  border: 1px dashed #ced4da;
  border-radius: 10px;
  padding: 22px;
  text-align: center;
  color: #6c757d;
  background: #f8f9fa;
}

/* ---- Plano de ação em cards ---- */
.investigacao-wizard .wz-acao-card {
  border: 1px solid #dee2e6;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
}

/* ---- Revisão ---- */
.investigacao-wizard .wz-resumo-item {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid #eef0f2;
}
.investigacao-wizard .wz-resumo-item:last-child { border-bottom: none; }
.investigacao-wizard .wz-resumo-texto { color: #6c757d; font-size: .86rem; }
.investigacao-wizard .wz-pendencias {
  border: 1px solid #f1c40f66;
  background: #fdf6e3;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 18px;
}

/* ---- Estado somente-leitura (investigação concluída) ---- */
.investigacao-wizard.is-readonly .wz-etapa :is(input, textarea, select, button.remover-linha, .adicionar-causa-efeito, #adicionar-entrevista, #adicionar-profissional, #adicionar-plano-acao) {
  pointer-events: none;
  opacity: .7;
}

@media (max-width: 991.98px) {
  .investigacao-wizard .wz-contexto { position: static; }
  .investigacao-wizard .wz-nav { position: static; border-radius: 10px; }
}
