/* Identificação de anomalias e emergências (Aeroportos, lado ar): três casos com vídeo e o painel ao vivo.
   Usa as cores do tema (--tela, --cartao, --borda, --texto, --sev-*) e as peças .pr__* do painel de perguntas. */

/* ---------- três casos ---------- */
.an-casos { list-style: none; margin: 40px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 24px; }
.an-caso { display: flex; flex-direction: column; }
.an-caso__titulo { margin: 18px 0 0; font-size: 22px; line-height: 28px; font-weight: 700; color: var(--texto); }
.an-caso .ref-video__legenda { margin-top: 8px; }
.an-regra { margin: 16px 0 0; display: grid; gap: 8px; }
.an-regra > div { padding: 10px 14px; background: var(--cartao); border: 1px solid var(--borda); border-left: 3px solid var(--an-cor, var(--sev-atencao)); border-radius: var(--raio-pequeno); }
.an-regra dt { font-family: var(--fonte-mono); font-size: 11px; line-height: 16px; letter-spacing: .1em; text-transform: uppercase; color: var(--texto-3); }
.an-regra dd { margin: 2px 0 0; font-size: 15px; line-height: 22px; color: var(--texto-2); }
.an-caso--mala { --an-cor: var(--sev-critica); }
.an-caso--pet { --an-cor: var(--sev-atencao); }
.an-caso--abertura { --an-cor: var(--setor-industria); }

/* reforço: o mesmo caso num pátio filmado, em destaque mais largo */
.an-reforco { margin-top: 36px; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 28px; align-items: center; }
.an-reforco .an-caso__titulo { margin-top: 0; }

/* ---------- painel ---------- */
.an-painel { margin-top: 48px; padding: 24px; background: var(--tela); border: 1px solid var(--borda); border-radius: var(--raio-grande); }
.an-painel__topo { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding-bottom: 16px; border-bottom: 1px solid var(--borda); }
.an-painel__titulo { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 20px; line-height: 26px; font-weight: 700; color: var(--texto); }
.an-vivo { width: 8px; height: 8px; border-radius: 50%; background: var(--sev-ok); box-shadow: 0 0 0 0 rgba(49, 191, 139, .6); animation: anVivo 2s infinite; }
@keyframes anVivo { 70% { box-shadow: 0 0 0 8px rgba(49, 191, 139, 0); } 100% { box-shadow: 0 0 0 0 rgba(49, 191, 139, 0); } }
.an-painel__hora { margin: 0; font-size: 15px; color: var(--texto-2); font-variant-numeric: tabular-nums; }
.an-kpis { margin: 16px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.an-kpis > div { padding: 12px 14px; background: var(--cartao); border: 1px solid var(--borda); border-radius: var(--raio-pequeno); }
.an-kpis dt { font-size: 13px; line-height: 18px; color: var(--texto-3); }
.an-kpis dd { margin: 4px 0 0; font-size: 26px; line-height: 30px; font-weight: 700; color: var(--texto); font-variant-numeric: tabular-nums; }
#anAbertos { color: var(--sev-atencao); }
.an-painel__corpo { margin-top: 20px; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px; align-items: start; }

/* pets */
.an-pets__cab { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.an-pets__cab .pr__rotulo { margin: 0; }
.an-temp { display: flex; align-items: center; gap: 8px; }
.an-temp__bt {
  -webkit-appearance: none; appearance: none; width: 36px; height: 36px; display: grid; place-items: center; cursor: pointer;
  font: 700 20px/1 var(--fonte); color: var(--texto); background: var(--cartao); border: 1px solid var(--borda-forte); border-radius: var(--raio-pequeno);
}
.an-temp__bt:hover { border-color: var(--azul-link); }
.an-temp__valor { margin: 0; min-width: 136px; text-align: center; }
.an-temp__valor b { display: block; font-size: 24px; line-height: 28px; color: var(--texto); font-variant-numeric: tabular-nums; }
.an-temp__valor span { display: block; font-size: 13px; line-height: 18px; color: var(--sev-atencao); }
.an-regua { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.an-regua li { padding: 8px 12px; border: 1px solid var(--borda); border-radius: var(--raio-pequeno); opacity: .5; transition: opacity .3s, border-color .3s; }
.an-regua li.ativa { opacity: 1; border-color: var(--sev-atencao); box-shadow: inset 3px 0 0 var(--sev-atencao); }
.an-regua b { display: block; font-size: 14px; line-height: 20px; color: var(--texto); }
.an-regua span { font-size: 13px; line-height: 18px; color: var(--texto-3); }
.an-pets__lista { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.an-pet { padding: 12px 14px; background: var(--cartao); border: 1px solid var(--borda); border-radius: var(--raio-pequeno); transition: border-color .3s, background-color .3s; }
.an-pet__linha { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.an-pet__nome { font-size: 16px; line-height: 22px; font-weight: 700; color: var(--texto); }
.an-pet__tempo { font-family: var(--fonte-mono); font-size: 18px; line-height: 22px; color: var(--texto); font-variant-numeric: tabular-nums; white-space: nowrap; }
.an-pet__onde { margin: 2px 0 0; font-size: 13px; line-height: 18px; color: var(--texto-3); }
.an-pet__barra { height: 6px; margin-top: 10px; border-radius: 3px; background: rgba(163, 174, 198, .14); overflow: hidden; }
.an-pet__barra i { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--sev-ok); transition: width .4s linear, background-color .3s; }
.an-pet__estado { display: inline-block; margin-top: 8px; padding: 0 9px; font-size: 12px; line-height: 20px; font-weight: 700; color: var(--est, var(--texto-3)); border: 1px solid currentColor; border-radius: 999px; }
.an-pet--sol, .an-pet--perto { --est: var(--sev-atencao); }
.an-pet--perto .an-pet__barra i { background: var(--sev-atencao); }
.an-pet--alarme { --est: var(--sev-critica); border-color: var(--sev-critica); background: rgba(255, 138, 122, .08); }
.an-pet--alarme .an-pet__barra i { background: var(--sev-critica); }
.an-pet--alarme .an-pet__tempo { color: var(--sev-critica); }
.an-pet--equipe { --est: var(--azul-link); }
.an-pet--equipe .an-pet__barra i { background: var(--sev-critica); }
.an-pet--sombra { --est: var(--sev-ok); }
.an-pets__nota { margin: 12px 0 0; font-size: 13px; line-height: 20px; color: var(--texto-3); }

/* casos */
.an-feed .pr__rotulo { margin-bottom: 10px; }
.an-feed__lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.an-item {
  -webkit-appearance: none; appearance: none; width: 100%; display: grid; grid-template-columns: 72px auto minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 9px 12px; text-align: left; cursor: pointer; font: inherit; color: var(--texto-2);
  background: var(--cartao); border: 1px solid var(--borda); border-radius: var(--raio-pequeno); transition: border-color .2s;
}
.an-item:hover { border-color: var(--borda-forte); }
.an-item[aria-pressed="true"] { border-color: var(--azul-link); box-shadow: inset 3px 0 0 var(--azul-link); }
.an-item__hora { font-family: var(--fonte-mono); font-size: 14px; color: var(--texto-2); font-variant-numeric: tabular-nums; }
.an-item__tipo { justify-self: start; padding: 0 9px; font-size: 12px; line-height: 20px; font-weight: 700; white-space: nowrap; color: var(--an-cor); border: 1px solid currentColor; border-radius: 999px; }
.an-item__onde { font-size: 14px; line-height: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-item__st { font-size: 12px; line-height: 20px; font-weight: 700; white-space: nowrap; color: var(--texto-3); }
.an-item__st--novo { color: var(--sev-critica); }
.an-item__st--analise { color: var(--sev-atencao); }
.an-item__st--fechado { color: var(--sev-ok); }
.an-item--mala { --an-cor: var(--sev-critica); }
.an-item--pet { --an-cor: var(--sev-atencao); }
.an-item--abertura { --an-cor: var(--setor-industria); }
.an-novo { animation: anEntra .45s ease-out both; }
@keyframes anEntra { from { opacity: 0; transform: translateY(-8px); } }

.an-caso-detalhe:empty { display: none; }
.an-caso-detalhe { margin-top: 14px; padding: 18px; background: var(--tela-2); border: 1px solid var(--borda); border-radius: var(--raio-tela); }
.an-det__cab { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 16px; align-items: start; margin-bottom: 16px; }
.an-det__foto { position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #000; border: 1px solid var(--borda); }
.an-det__foto img { display: block; width: 100%; height: 100%; object-fit: cover; }
.an-det__foto span { position: absolute; left: 6px; bottom: 6px; padding: 0 6px; font-size: 11px; line-height: 18px; font-weight: 700; color: #fff; background: rgba(0, 0, 0, .7); border-radius: 4px; }
.an-det__titulo { margin: 0; font-size: 18px; line-height: 24px; font-weight: 700; color: var(--texto); }
.an-det__meta { margin: 4px 0 0; font-size: 14px; line-height: 21px; color: var(--texto-3); }
.an-det__meta b { color: var(--texto-2); font-weight: 600; }
.an-caso-detalhe .pr__ordem { margin-bottom: 16px; }
.an-caso-detalhe .pr__separa { margin-bottom: 0; }
.pr__passo--aviso { --pr-cor: var(--sev-critica); }

/* ---------- telas menores ---------- */
@media (max-width: 1180px) {
  .an-painel__corpo { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1023px) {
  .an-reforco { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .an-casos { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .an-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .an-casos { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .an-painel { padding: 18px 14px; border-radius: var(--raio-tela); }
  .an-kpis dd { font-size: 22px; }
  .an-item { grid-template-columns: 64px minmax(0, 1fr) auto; }
  .an-item__onde { grid-column: 1 / -1; white-space: normal; }
  .an-det__cab { grid-template-columns: minmax(0, 1fr); }
  .an-det__foto { max-width: 320px; }
}
