/* ═══════════════════════════════════════════════════════════════════════════
   JRS · AET (NR-17 itens 17.3.2 e 17.3.3)
   Lista de GHE com os riscos ergonômicos de cada um. A avaliação preliminar
   fica no PGR — aqui só o que exige análise da atividade.
   ═══════════════════════════════════════════════════════════════════════════ */

.aet-carregando, .aet-vazio, .aet-erro {
  padding: 40px 20px; text-align: center; font-size: 9pt; color: #8a98a5;
}
.aet-erro { color: #A32D2D; }
.aet-erro span { display: block; margin-top: 6px; font-size: 8pt; color: #8a98a5; }

.aet-topo { padding: 4px 2px 12px; }
.aet-titulo { display: block; font-size: 11pt; font-weight: 600; color: #1e3a5f; }
.aet-sub { display: block; margin-top: 3px; font-size: 8pt; color: #8a98a5; }

.aet-lista { display: flex; flex-direction: column; gap: 6px; }

.aet-ghe-bloco {
  border: 1px solid #e3e9f0; border-radius: 8px; overflow: hidden; background: #fff;
}

.aet-ghe {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 13px; background: #f8fafc; cursor: pointer;
  transition: background .12s;
}
.aet-ghe:hover { background: #eef3fa; }
.aet-ghe-aberto { background: #eef3fa; }

/* GHE sem risco ergonômico: aparece na lista (para o especialista ver que
   não foi esquecido) mas não abre — não há o que analisar.

   A opacidade fica nos TEXTOS, não no bloco: o botão de medições continua
   valendo aqui (medir conforto ambiental independe de haver risco lançado),
   e herdar o esmaecido faria parecer desabilitado. */
.aet-ghe-vazio { cursor: default; }
.aet-ghe-vazio .aet-seta,
.aet-ghe-vazio .aet-num,
.aet-ghe-vazio .aet-nome,
.aet-ghe-vazio .aet-selo { opacity: .55; }
.aet-ghe-vazio:hover { background: #f8fafc; }

.aet-seta { width: 10px; font-size: 8pt; color: #8a98a5; flex-shrink: 0; }
.aet-num {
  background: #1e3a5f; color: #fff; border-radius: 4px;
  padding: 2px 8px; font-size: 7.5pt; font-weight: 600; flex-shrink: 0;
}
.aet-nome { flex: 1; min-width: 0; font-size: 8.5pt; color: #2f3a46; }
.aet-nome i { color: #8a98a5; font-style: italic; }

.aet-selo {
  background: #fdf8ec; color: #8a6d1f; border-radius: 10px;
  padding: 2px 9px; font-size: 7.5pt; white-space: nowrap; flex-shrink: 0;
}
.aet-selo-tem { background: #eef3fa; color: #1e3a5f; }
.aet-selo-vazio { background: #f4f7fa; color: #8a98a5; }

.aet-riscos { padding: 10px 13px 12px 34px; background: #fbfcfe; }
.aet-riscos-tit {
  font-size: 7.5pt; color: #8a98a5; margin: 0 0 8px;
  text-transform: uppercase; letter-spacing: .3px;
}

.aet-risco {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid #e3e9f0; border-radius: 7px;
  padding: 9px 11px; margin-bottom: 6px;
}
.aet-risco:last-child { margin-bottom: 0; }
.aet-risco-txt { flex: 1; min-width: 0; }
.aet-risco-nome { font-size: 8.5pt; font-weight: 600; color: #2f3a46; margin: 0 0 2px; }
.aet-risco-meta { font-size: 7.5pt; color: #8a98a5; margin: 0; }
.aet-ggr { border-radius: 8px; padding: 1px 7px; font-weight: 600; }

.aet-btn {
  background: #fff; color: #1e3a5f; border: 1px solid #1e3a5f; border-radius: 6px;
  padding: 5px 13px; font-size: 8pt; font-weight: 600; font-family: inherit;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.aet-btn:hover { background: #eaf0f7; }
.aet-btn-continuar { background: #1e3a5f; color: #fff; }
.aet-btn-continuar:hover { background: #16304f; }

@media (max-width: 640px) {
  .aet-riscos { padding-left: 13px; }
  .aet-risco { flex-wrap: wrap; }
  .aet-btn { flex: 1 0 100%; }
  .aet-nome i { display: none; }   /* a lista de funções estoura em tela estreita */
}

/* ── Preenchimento das seis etapas (17.3.3) ──────────────────────────────── */

.aet-preench { display: flex; flex-direction: column; gap: 8px; }

.aet-preench-topo {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid #e3e9f0; border-radius: 8px; padding: 10px 13px;
  position: sticky; top: 0; z-index: 5;
}
.aet-voltar {
  background: #fff; color: #1e3a5f; border: 1px solid #dfe5ec; border-radius: 6px;
  padding: 5px 11px; font-size: 8pt; font-family: inherit; cursor: pointer; flex-shrink: 0;
}
.aet-voltar:hover { background: #eef3fa; border-color: #1e3a5f; }
.aet-preench-tit { flex: 1; min-width: 0; }
.aet-preench-tit b { display: block; font-size: 9.5pt; color: #1e3a5f; }
.aet-preench-tit span { display: block; font-size: 7.5pt; color: #8a98a5; margin-top: 2px; }

.aet-btn-concluir {
  background: #3d8b37; color: #fff; border: 1px solid #3d8b37; border-radius: 6px;
  padding: 7px 16px; font-size: 8.5pt; font-weight: 600; font-family: inherit;
  cursor: pointer; flex-shrink: 0;
}
.aet-btn-concluir:hover { background: #35782f; }
.aet-selo-concl {
  background: #e8f0e6; color: #2d6f28; border-radius: 10px;
  padding: 4px 11px; font-size: 8pt; font-weight: 600; flex-shrink: 0;
}
.aet-aviso-concl {
  background: #f1f8f0; border: 1px solid #bcdcb7; border-radius: 7px;
  padding: 8px 11px; margin: 0; font-size: 8pt; color: #2d6f28;
}

.aet-etapa {
  background: #fff; border: 1px solid #e3e9f0; border-radius: 8px; padding: 12px 14px;
}
.aet-etapa-cab { display: flex; gap: 10px; margin-bottom: 9px; }
.aet-etapa-num {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  background: #1e3a5f; color: #fff; font-size: 8pt; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.aet-etapa-tit { font-size: 9pt; font-weight: 600; color: #1e3a5f; margin: 0 0 2px; }
.aet-etapa-ajuda { font-size: 7.5pt; color: #8a98a5; margin: 0; line-height: 1.5; }

/* Conteúdo obrigatório do Anexo II — precisa ficar visível enquanto escreve,
   não escondido numa dica. */
.aet-extra {
  background: #fdf8ec; border: 1px solid #e8dcc0; border-radius: 6px;
  padding: 8px 11px; margin-bottom: 9px;
}
.aet-extra-tit { font-size: 7.5pt; font-weight: 600; color: #8a6d1f; margin: 0 0 5px; }
.aet-extra ul { margin: 0; padding-left: 16px; }
.aet-extra li { font-size: 7.5pt; color: #6b5a2f; line-height: 1.55; }

.aet-txt {
  width: 100%; box-sizing: border-box; font-family: inherit; font-size: 8.5pt;
  color: #2f3a46; background: #fbfcfe; border: 1px solid #dfe5ec; border-radius: 6px;
  padding: 8px 10px; resize: vertical; line-height: 1.55;
}
.aet-txt:focus { outline: 0; border-color: #7fa8c8; box-shadow: 0 0 0 2px #e6eef8; background: #fff; }
.aet-txt[readonly] { background: #f4f7fa; color: #5a6675; }

.aet-ouvidos {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px;
  margin-top: 9px; padding-top: 8px; border-top: 1px solid #eef2f6;
}
.aet-ouvidos-tit { font-size: 7.5pt; color: #8a98a5; margin-right: 4px; }
.aet-ouvido {
  display: inline-flex; align-items: center; gap: 5px;
  background: #1e3a5f; color: #fff; border-radius: 11px; padding: 2px 4px 2px 9px; font-size: 7.5pt;
}
.aet-ouvido i { font-style: normal; opacity: .7; }
.aet-ouvido-x {
  background: rgba(255,255,255,.2); border: 0; color: #fff; border-radius: 50%;
  width: 15px; height: 15px; font-size: 11px; line-height: 1; cursor: pointer; font-family: inherit;
}
.aet-ouvido-x:hover { background: rgba(255,255,255,.4); }
.aet-add-ouvido {
  background: #fff; color: #1e3a5f; border: 1px dashed #cfd8e3; border-radius: 11px;
  padding: 2px 9px; font-size: 7.5pt; font-family: inherit; cursor: pointer;
}
.aet-add-ouvido:hover { border-color: #1e3a5f; background: #eef3fa; }
.aet-nenhum { font-size: 7.5pt; color: #b0b8c2; font-style: italic; margin: 0; }

/* Recomendações — viram plano de ação do PGR ao concluir */
.aet-recs { display: flex; flex-direction: column; gap: 6px; }
.aet-rec { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.aet-rec input {
  font-family: inherit; font-size: 8.5pt; color: #2f3a46;
  background: #fbfcfe; border: 1px solid #dfe5ec; border-radius: 6px; padding: 6px 9px;
}
.aet-rec input:focus { outline: 0; border-color: #7fa8c8; box-shadow: 0 0 0 2px #e6eef8; background: #fff; }
.aet-rec-acao { flex: 3 1 240px; min-width: 0; }
.aet-rec-resp { flex: 1 1 130px; min-width: 0; }
.aet-rec-prazo { flex: 0 0 132px; }
.aet-rec-x {
  background: #fff; color: #A32D2D; border: 1px solid #e3d0d0; border-radius: 6px;
  width: 26px; height: 28px; font-size: 13px; cursor: pointer; font-family: inherit; flex-shrink: 0;
}
.aet-rec-x:hover { background: #fdf2f2; }
.aet-add-rec {
  align-self: flex-start; background: #fff; color: #1e3a5f;
  border: 1px solid #1e3a5f; border-radius: 6px; padding: 5px 12px;
  font-size: 8pt; font-weight: 600; font-family: inherit; cursor: pointer;
}
.aet-add-rec:hover { background: #eef3fa; }
.aet-rec-nota { font-size: 7.5pt; color: #8a98a5; margin: 2px 0 0; }

@media (max-width: 640px) {
  .aet-preench-topo { flex-wrap: wrap; }
  .aet-preench-tit { flex: 1 0 100%; order: 3; }
  .aet-rec-prazo { flex: 1 1 100%; }
}

/* ── Etapa recolhida / aberta ────────────────────────────────────────────
   Seis campos abertos deixavam a página enorme e vazia. Recolhida mostra
   prévia; só uma abre por vez.                                            */

.aet-etapa-aberta { border: 2px solid #1e3a5f; padding: 11px 13px; }
.aet-etapa-corpo { flex: 1; min-width: 0; }
.aet-etapa-num.ok { background: #3d8b37; }

.aet-selo-et {
  flex-shrink: 0; align-self: flex-start;
  background: #f4f7fa; color: #8a98a5; border-radius: 10px;
  padding: 2px 9px; font-size: 7.5pt; white-space: nowrap;
}
.aet-selo-et.ok { background: #e8f0e6; color: #2d6f28; }

/* Prévia: barra à esquerda distingue do texto de ajuda, que é cinza */
.aet-previa {
  font-size: 8.5pt; color: #2f3a46; line-height: 1.55; margin: 0;
  background: #fbfcfe; border-left: 2px solid #dfe5ec;
  padding: 6px 9px; border-radius: 0 5px 5px 0;
}

.aet-etapa-acoes {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 8px;
}
.aet-btn-escrever {
  background: #fff; color: #1e3a5f; border: 1px dashed #cfd8e3; border-radius: 6px;
  padding: 5px 12px; font-size: 8pt; font-weight: 600; font-family: inherit; cursor: pointer;
}
.aet-btn-escrever:hover { border-color: #1e3a5f; background: #eef3fa; }
.aet-btn-escrever.editar { border-style: solid; border-color: #dfe5ec; font-weight: 400; }

.aet-btn-pronto {
  background: #1e3a5f; color: #fff; border: 1px solid #1e3a5f; border-radius: 6px;
  padding: 5px 14px; font-size: 8pt; font-weight: 600; font-family: inherit; cursor: pointer;
}
.aet-btn-pronto:hover { background: #16304f; }

/* Roxo distingue a ação da IA das ações do documento */
.aet-btn-ia {
  background: #fff; color: #6b4a9e; border: 1px solid #cfc3e8; border-radius: 6px;
  padding: 5px 12px; font-size: 8pt; font-weight: 600; font-family: inherit; cursor: pointer;
}
.aet-btn-ia:hover { background: #f6f2fc; border-color: #6b4a9e; }
.aet-auto { font-size: 7.5pt; color: #8a98a5; }

/* Prévia da etapa 5 recolhida — as outras mostram o texto; esta, a lista */
.aet-previa-recs { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.aet-previa-recs li {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  background: #fbfcfe; border-left: 2px solid #dfe5ec;
  padding: 5px 9px; border-radius: 0 5px 5px 0;
}
.aet-previa-acao { flex: 1; min-width: 0; font-size: 8.5pt; color: #2f3a46; }
.aet-previa-resp { font-size: 7.5pt; color: #8a98a5; white-space: nowrap; }
.aet-previa-prazo {
  font-size: 7.5pt; color: #1e3a5f; background: #eef3fa;
  border-radius: 8px; padding: 1px 7px; white-space: nowrap;
}

/* Visualizar PDF — mesmo tom neutro do botão do PGR */
.aet-btn-pdf {
  background: #fff; color: #1e3a5f; border: 1px solid #dfe5ec; border-radius: 6px;
  padding: 7px 14px; font-size: 8.5pt; font-weight: 600; font-family: inherit;
  cursor: pointer; flex-shrink: 0; white-space: nowrap;
}
.aet-btn-pdf:hover { background: #eef3fa; border-color: #1e3a5f; }
.aet-btn-pdf:disabled { opacity: .6; cursor: default; }

/* ── Registro fotográfico ─────────────────────────────────────────────────
   Miniaturas em grade: numa etapa com 4 ou 5 fotos, empilhar em tamanho
   grande empurraria o resto da tela para baixo demais.                     */

.aet-fotos {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px;
}
.aet-foto {
  position: relative; margin: 0; width: 150px;
  background: #fbfcfe; border: 1px solid #e3e9f0; border-radius: 7px;
  overflow: hidden;
}
/* Quadrada: com 105px de altura a foto EM PÉ perdia topo e base — que é
   justamente onde está a postura. Quadrada recorta menos nas duas
   orientações, e o clique abre inteira. */
.aet-foto img {
  display: block; width: 100%; height: 150px; object-fit: cover;
  background: #eef2f6; cursor: zoom-in;
}
.aet-foto img:hover { opacity: .9; }
.aet-foto-erro {
  height: 150px; display: flex; align-items: center; justify-content: center;
  font-size: 7.5pt; color: #b0b8c2; background: #f4f7fa;
}
.aet-foto figcaption {
  padding: 5px 7px; font-size: 7.5pt; color: #5a6675; line-height: 1.4;
  cursor: text;
  /* 2 linhas: legenda longa não pode esticar a miniatura */
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.aet-foto-x {
  position: absolute; top: 4px; right: 4px;
  background: rgba(26,26,26,.6); color: #fff; border: 0; border-radius: 50%;
  width: 20px; height: 20px; font-size: 13px; line-height: 1;
  cursor: pointer; font-family: inherit;
}
.aet-foto-x:hover { background: #A32D2D; }

.aet-btn-foto {
  background: #fff; color: #1e3a5f; border: 1px solid #dfe5ec; border-radius: 6px;
  padding: 5px 12px; font-size: 8pt; font-weight: 600; font-family: inherit; cursor: pointer;
}
.aet-btn-foto:hover { background: #eef3fa; border-color: #1e3a5f; }
.aet-btn-foto:disabled { opacity: .6; cursor: default; }

@media (max-width: 640px) {
  .aet-foto { width: calc(50% - 4px); }
}

.aet-foto figcaption.sem { color: #b0b8c2; font-style: italic; }
.aet-foto figcaption[data-legenda-foto]:hover { background: #eef3fa; color: #1e3a5f; }
.aet-fotos-nota { font-size: 7.5pt; color: #8a98a5; margin: 5px 0 0; }

/* Foto inteira sobre a tela — a miniatura recorta, aqui se confere */
.aet-lightbox {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(16, 22, 32, .88);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 30px; cursor: zoom-out;
}
.aet-lightbox img {
  max-width: 92vw; max-height: 82vh;
  object-fit: contain;          /* inteira, sem corte e sem distorcer */
  border-radius: 6px; background: #1a1a1a; cursor: default;
}
.aet-lightbox p {
  color: #e8edf3; font-size: 9pt; margin: 0; text-align: center;
  max-width: 70ch; line-height: 1.5;
}
.aet-lightbox-x {
  position: absolute; top: 16px; right: 20px;
  background: rgba(255,255,255,.15); color: #fff; border: 0; border-radius: 50%;
  width: 34px; height: 34px; font-size: 20px; line-height: 1; cursor: pointer; font-family: inherit;
}
.aet-lightbox-x:hover { background: rgba(255,255,255,.3); }

/* ── Medições ambientais (NR-17 cap. 17.8) ─────────────────────────────────
   Um modal com os seis valores. A primeira versão era uma tela inteira com
   um cartão por parâmetro — muito para o que é: anotar o que o aparelho
   mostrou.                                                                 */

.aet-med-selo {
  background: #fff; color: #1e3a5f; border: 1px dashed #cfd8e3; border-radius: 6px;
  padding: 4px 11px; font-size: 7.5pt; font-weight: 600; font-family: inherit;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.aet-med-selo:hover { border-color: #1e3a5f; background: #eef3fa; }
.aet-med-selo.tem { border-style: solid; border-color: #1e3a5f; background: #eef3fa; }

.aet-med-tab { width: 100%; border-collapse: collapse; }
.aet-med-tab td { padding: 5px 0; vertical-align: middle; }
.aet-med-lbl { font-size: 8.5pt; color: #2f3a46; }
.aet-med-inp { width: 108px; white-space: nowrap; }
.aet-med-inp input {
  width: 62px; box-sizing: border-box; font-family: inherit; font-size: 8.5pt;
  color: #2f3a46; background: #fbfcfe; border: 1px solid #dfe5ec; border-radius: 5px;
  padding: 6px 8px; text-align: right;
}
.aet-med-inp input:focus {
  outline: 0; border-color: #7fa8c8; box-shadow: 0 0 0 2px #e6eef8; background: #fff;
}
.aet-med-un { font-size: 7.5pt; color: #8a98a5; margin-left: 5px; }
.aet-med-res { width: 100px; text-align: right; }
.aet-med-sit {
  border-radius: 9px; padding: 2px 8px; font-size: 7.5pt; font-weight: 600; white-space: nowrap;
}

/* Modal da medição — vários campos, o modal de input do PGR só tem um */
.aet-modal-overlay {
  position: fixed; inset: 0; z-index: 9998; background: rgba(20, 28, 40, .55);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.aet-modal {
  background: #fff; border-radius: 10px; width: 100%; max-width: 480px;
  max-height: 88vh; display: flex; flex-direction: column;
  box-shadow: 0 10px 34px rgba(20, 30, 50, .28);
}
.aet-modal-cab {
  background: #1e3a5f; color: #fff; padding: 11px 15px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 9.5pt; font-weight: 600; border-radius: 10px 10px 0 0;
}
.aet-modal-x {
  background: rgba(255,255,255,.18); border: 0; color: #fff; border-radius: 50%;
  width: 24px; height: 24px; font-size: 15px; line-height: 1; cursor: pointer; font-family: inherit;
}
.aet-modal-corpo { padding: 13px 15px; overflow-y: auto; }
.aet-modal-ajuda {
  font-size: 7.5pt; color: #8a98a5; line-height: 1.5; margin: 0 0 11px;
}
.aet-modal-corpo label {
  display: block; font-size: 8pt; font-weight: 600; color: #1e3a5f; margin: 9px 0 3px;
}
.aet-modal-corpo label i { color: #8a98a5; font-weight: 400; font-style: normal; }
.aet-modal-corpo input, .aet-modal-corpo select, .aet-modal-corpo textarea {
  width: 100%; box-sizing: border-box; font-family: inherit; font-size: 8.5pt;
  color: #2f3a46; background: #fbfcfe; border: 1px solid #dfe5ec; border-radius: 6px;
  padding: 7px 9px;
}
.aet-modal-corpo input:focus, .aet-modal-corpo select:focus, .aet-modal-corpo textarea:focus {
  outline: 0; border-color: #7fa8c8; box-shadow: 0 0 0 2px #e6eef8; background: #fff;
}
.aet-modal-linha { display: flex; gap: 9px; }
.aet-modal-linha > div { flex: 1; min-width: 0; }
.aet-modal-dica { font-size: 7.5pt; color: #8a98a5; margin: 4px 0 0; line-height: 1.45; }
.aet-modal-pe {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 11px 15px; border-top: 1px solid #eef2f6;
}
.aet-modal-cancel {
  background: #fff; color: #6b7683; border: 1px solid #dfe5ec; border-radius: 6px;
  padding: 7px 15px; font-size: 8.5pt; font-family: inherit; cursor: pointer;
}
.aet-modal-ok {
  background: #1e3a5f; color: #fff; border: 0; border-radius: 6px;
  padding: 7px 18px; font-size: 8.5pt; font-weight: 600; font-family: inherit; cursor: pointer;
}
.aet-modal-ok:hover { background: #16304f; }

@media (max-width: 640px) {
  .aet-modal-linha { flex-direction: column; gap: 0; }
}
