/*
 * Tela de TV — CSS leve e compatível com navegadores antigos de Smart TV:
 * sem variáveis CSS, grid, clamp(), inset, gap, gradientes, sombras ou
 * animações. Sem rodapé nem barra de progresso: a tela é toda do slide.
 *
 * Identidade visual da intranet Conecta (amorix-intranet, css/tema-amorix.css):
 * fundo azul-marinho #06142E, menu #041026, cartões #0B1F4B, amarelo #F7C600 de
 * destaque, texto #EAF0FB / #9DB0CF, fonte Inter (cores fixas: TV não lê var()).
 * Logo só na versão branca sobre o fundo escuro, sem moldura, com área de
 * proteção = altura do "A" (~65% da altura do logo).
 */
* { -webkit-box-sizing: border-box; box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: #06142E;
  color: #EAF0FB;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  overflow: hidden;
  font-size: 16px;
}
body.ocioso { cursor: none; }
a { color: #F7C600; }

/* ---------- Estrutura fixa: topo baixo + palco ---------- */
/* Altura em vw (não vh) para acompanhar o relógio, que também é em vw. */
.tv-topo {
  position: absolute; top: 0; left: 0; right: 0; height: 4.4vw;
  background: #041026; border-bottom: 1px solid #15306A;
  padding: 0 2vw;
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center;
}
/* Logo branco (1200x419) com 1,9vw de altura: sobra ~1,25vw acima e abaixo,
   mais que a área de proteção (altura do "A" ≈ 1,2vw). */
.tv-marca { white-space: nowrap; display: -webkit-box; display: -webkit-flex; display: flex; -webkit-box-align: center; -webkit-align-items: center; align-items: center; }
.tv-logo { height: 1.9vw; width: auto; display: block; }
.tv-sistema { font-size: 1.1vw; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; color: #F7C600; margin-left: 1.4vw; padding-left: 1.4vw; border-left: 1px solid #1D3970; line-height: 1.2; }
.tv-dep {
  -webkit-box-flex: 1; -webkit-flex: 1; flex: 1;
  text-align: center; font-size: 1.9vw; font-weight: bold;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2vw;
}
/* Relógio 2x: hora 4vw e, ao lado, a data em duas linhas de 1,9vw */
.tv-relogio {
  white-space: nowrap;
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center;
}
#tv-hora { font-size: 4vw; font-weight: bold; line-height: 1; }
#tv-data { font-size: 1.9vw; line-height: 1.05; color: #9DB0CF; margin-left: 1vw; }

.tv-palco { position: absolute; top: 4.4vw; bottom: 0; left: 0; right: 0; overflow: hidden; }

.tv-pausado {
  display: none; position: absolute; top: 5.4vw; right: 2vw;
  background: #F7C600; color: #0B1F4B; font-weight: bold; font-size: 1.3vw;
  padding: .5vw 1.2vw; border-radius: 99px;
}
body.pausado .tv-pausado { display: block; }
/* versão publicada da tela (INV-167): bem pequena, no canto de baixo,
   por cima até do slide em tela cheia (z-index 20) */
.tv-versao { position: fixed; right: .6vw; bottom: .2vw; z-index: 30; font-size: .7vw; line-height: 1; color: #6A85AA; letter-spacing: .05em; }

/* "Sair do painel" neste aparelho: só aparece com alguém mexendo (body.ativo),
   no canto de baixo à direita, por cima até do slide em tela cheia.
   .confirmar = segundo toque pendente, em amarelo. */
.tv-sair { display: none; position: fixed; right: 2vw; bottom: 1.6vw; z-index: 40;
  padding: .6vw 1.4vw; border-radius: 99px; border: 2px solid #1D3970; background: #041026; color: #EAF0FB;
  font-family: inherit; font-size: 1.1vw; font-weight: bold; cursor: pointer; }
body.ativo .tv-sair { display: block; }
.tv-sair:focus { border-color: #F7C600; outline: none; }
.tv-sair.confirmar { background: #F7C600; border-color: #F7C600; color: #0B1F4B; }

/* posição do slide na volta (INV-227), no canto de baixo à esquerda, por
   cima até do slide em tela cheia; mesmo estilo do rodapé dos painéis prontos */
.tv-posicao { display: none; position: fixed; left: 2.4vw; bottom: .6vw; z-index: 30; padding: .25vw .7vw; border-radius: 99px;
  background: rgba(4, 16, 38, .75); color: #6A85AA; font-size: .85vw; font-weight: bold; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; }
.tv-posicao b { color: #C9D6EA; }
.tv-posicao i { font-style: normal; margin: 0 .7em; }

/* ---------- Slides ---------- */
.tv-slide { position: absolute; top: 0; left: 0; right: 0; bottom: 0; padding: 2.5vh 3vw 1.5vh; }
/* Imagem que não preenche a tela: as sobras (laterais ou em cima/embaixo)
   ficam no azul-marinho do topo (o do menu do Conecta), e não em preto. */
.tv-slide.imagem { padding: 0; background: #041026; }
.tv-slide.imagem img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; }

.tv-titulo { font-size: 3.2vw; font-weight: bold; margin: 0; line-height: 1.1; }
.tv-descricao { font-size: 1.4vw; color: #9DB0CF; margin: .6vh 0 0; }
.tv-selo { display: inline-block; font-size: .9vw; padding: .3vh .8vw; border-radius: 99px; background: #0B1F4B; color: #F7C600; margin-left: 1vw; vertical-align: middle; font-weight: bold; }
.tv-corpo { position: absolute; left: 3vw; right: 3vw; top: 13vh; bottom: 4.5vh; }
.tv-corpo svg { display: block; }
.tv-atualizado { position: absolute; right: 3vw; bottom: 1vh; font-size: .85vw; color: #6A85AA; }

/* Número em destaque */
.tv-kpi { position: absolute; top: 50%; left: 0; right: 0; -webkit-transform: translateY(-50%); transform: translateY(-50%); text-align: center; }
.tv-kpi .rotulo { font-size: 1.8vw; color: #9DB0CF; }
.tv-kpi .valor { font-size: 10vw; font-weight: bold; line-height: 1.05; margin: 1.5vh 0; }
.tv-kpi .meta { font-size: 1.8vw; }
.tv-kpi .barra-meta { width: 60vw; height: 2.2vh; margin: 2vh auto 0; background: #10295C; border-radius: 99px; overflow: hidden; }
.tv-kpi .barra-meta div { height: 100%; border-radius: 99px; }
.ok { color: #4FD69C; } .alerta { color: #F7C600; } .ruim { color: #FF2D3F; }
.bg-ok { background: #4FD69C; } .bg-alerta { background: #F7C600; } .bg-ruim { background: #FF2D3F; } .bg-neutro { background: #1C57DF; }

/* Tabela */
.tv-tabela { width: 100%; border-collapse: collapse; font-size: 1.5vw; }
.tv-tabela th { text-align: left; color: #9DB0CF; font-weight: bold; padding: 1vh 1vw; border-bottom: 2px solid #1D3970; font-size: 1.15vw; text-transform: uppercase; }
.tv-tabela td { padding: .9vh 1vw; border-bottom: 1px solid #15306A; }
.tv-tabela td.num { text-align: right; }
.tv-tabela tr.par td { background: #0B1F4B; }

.tv-mensagem {
  position: absolute; top: 50%; left: 4vw; right: 4vw;
  -webkit-transform: translateY(-50%); transform: translateY(-50%);
  text-align: center; font-size: 2vw; color: #9DB0CF; line-height: 1.5;
}
.tv-mensagem b { display: block; color: #EAF0FB; }
.tv-mensagem a { font-size: 1.4vw; }

/* ---------- Vínculo da TV (index.html) ---------- */
body.escolha { overflow: auto; }
.escolha-conteudo { position: absolute; top: 4.4vw; left: 0; right: 0; bottom: 0; overflow: auto; padding: 5vh 4vw; }
.link-admin { color: #9DB0CF; text-decoration: none; font-size: 1.1vw; }
.vinculo-msg { font-size: 2vw; color: #9DB0CF; margin-top: 20vh; text-align: center; }
.vinculo { max-width: 46vw; margin: 0 auto; }
.vinculo h1 { font-size: 2.8vw; margin: 0 0 1.5vh; }
.vinculo p { color: #9DB0CF; font-size: 1.25vw; line-height: 1.5; margin: 0 0 4vh; }
.vinculo p b { color: #EAF0FB; }
.vinculo label { display: block; color: #9DB0CF; font-weight: 600; font-size: 1.2vw; margin: 2.5vh 0 .8vh; }
.vinculo label span { color: #6A85AA; }
.vinculo input {
  display: block; width: 100%; font-size: 1.6vw; padding: 1.4vh 1vw;
  border-radius: 10px; border: 2px solid #1D3970; background: #0B1F4B; color: #EAF0FB;
  font-family: inherit;
}
.vinculo input:focus { border-color: #F7C600; outline: none; }
.vinculo input.campo-chave { font-size: 3.4vw; letter-spacing: .35em; text-align: center; font-family: "JetBrains Mono", Consolas, "Courier New", monospace; font-weight: bold; color: #F7C600; }
.vinculo-erro { color: #FF2D3F; font-size: 1.3vw; min-height: 3vh; margin-top: 2vh; }
.vinculo-botao {
  display: block; width: 100%; margin-top: 2vh; padding: 1.8vh 1vw;
  font-size: 1.8vw; font-weight: bold; color: #0B1F4B; background: #F7C600;
  border: 2px solid #F7C600; border-radius: 10px; cursor: pointer; font-family: inherit;
}
.vinculo-botao:focus { border-color: #EAF0FB; outline: none; }
.vinculo-botao:disabled { opacity: .6; }

/* Tela estreita (celular/tablet em pé): vw ficaria pequeno demais */
@media (max-width: 900px) {
  .tv-marca, .link-admin, .tv-sistema { font-size: 14px; }
  .tv-logo { height: 22px; }
  .tv-topo { height: 48px; }
  .escolha-conteudo, .tv-palco { top: 48px; }
  .tv-pausado { top: 58px; font-size: 13px; }
  .tv-posicao { font-size: 11px; left: 12px; bottom: 8px; max-width: 70%; overflow: hidden; text-overflow: ellipsis; }
  .tv-sair { font-size: 15px; padding: 10px 18px; right: 12px; bottom: 28px; }
  .vinculo { max-width: none; }
  .vinculo h1 { font-size: 24px; }
  .vinculo p, .vinculo label, .vinculo-erro { font-size: 15px; }
  .vinculo input { font-size: 18px; }
  .vinculo input.campo-chave { font-size: 28px; }
  .vinculo-botao { font-size: 18px; }
  .vinculo-msg { font-size: 18px; }
}

/* Painel de outro projeto: tela cheia, por cima do topo, sem rolagem */
.tv-slide.tela-cheia {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; padding: 0; z-index: 20;
  background-color: #041026; background-repeat: no-repeat; background-position: center center;
  -webkit-background-size: contain; background-size: contain;
  overflow: hidden;
}
/* Captura na resolução da TV: estica até as bordas, sem faixas pretas (a
   diferença de proporção, ex. barra do navegador, é mínima e não se nota). */
.tv-slide.tela-cheia.preencher { -webkit-background-size: 100% 100%; background-size: 100% 100%; }
.tv-pausado { z-index: 30; }
