:root {
  --vermelho: #b12b3d;
  --branco: #f3f3f3;
  --cinza-escuro: #6c6c6b;
  --cinza-claro: #e0e0e0;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

/* FUNDO PRETO PARA PREENCHER BORDAS RESTANTES NA TV */
body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  margin: 0;
  padding: 0;
  background-color: #000000;
  position: relative;
}

/* MÉTODO BLINDADO DE ROTAÇÃO PARA TV DEITADA */
.main-slider {
  width: 1080px;
  height: 1920px;
  background-color: var(--branco);

  position: absolute;

  transform: scale(calc(100vh / 1080));
  transform-origin: center center;
  overflow: hidden;
}

/* MARGEM DE 30PX PARA EVITAR CORTE NA TELA (OVERSCAN) */
.slide-page {
  position: absolute;

  left: 0;
  width: 100%;
  height: calc(100%); /* Tira 30px de cima e 30px de baixo */
  opacity: 0;
  visibility: hidden;
  transition: opacity 1s ease-in-out;
}
.slide-page.active {
  opacity: 1;
  visibility: visible;
}

/* MAPA E LEAFLET */
#map {
  width: 100%;
  height: 100%;
  background-color: #e5e3df;
}
.leaflet-control-zoom,
.leaflet-control-attribution {
  display: none !important;
}

/* DASHBOARD */
.dashboard-vertical {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}
.dash-section {
  flex: 1;
  padding: 20px 40px;
  display: flex;
  flex-direction: column;
  border-bottom: 4px solid var(--cinza-claro);
  overflow: hidden;
}
.dash-section:last-child {
  border-bottom: none;
}

.header-section {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 15px;
  height: 70px;
  flex-shrink: 0;
}
.header-left h1 {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1;
  color: var(--cinza-escuro);
}
.header-left h2 {
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--vermelho);
  letter-spacing: 2px;
  text-transform: uppercase;
}
.data-badge {
  background: var(--vermelho);
  color: #fff;
  padding: 8px 25px;
  border-radius: 8px;
  font-size: 1.2rem;
  font-weight: 700;
  text-transform: uppercase;
}

.content-wrapper {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.ranking-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.ranking-item {
  display: flex;
  align-items: center;
  gap: 15px;
}

.foto-vendedor {
  width: 65px;
  height: 65px;
  border-radius: 50%;
  border: 3px solid var(--vermelho);
  object-fit: cover;
  background: #ccc;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.15);
}
.termometro-bg {
  flex-grow: 1;
  height: 45px;
  background: var(--cinza-escuro);
  border-radius: 25px;
  position: relative;
  overflow: hidden;
}
.termometro-fill {
  height: 100%;
  background: var(--vermelho);
  border-radius: 25px 0 0 25px;
  transition: width 1.5s ease;
}
.info-vendedor-interna {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  color: #fff;
  font-weight: 700;
  font-size: 1.4rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.chart-wrapper {
  flex-grow: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 20px;
}
.chart-container {
  width: 100%;
  height: 420px;
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  border-bottom: 5px solid var(--cinza-escuro);
  padding-top: 50px;
}
.bar-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  width: 120px;
  height: 100%;
}
.meta-label {
  font-size: 1rem;
  font-weight: 700;
  color: #999;
  margin-bottom: 5px;
}
.bar-goal {
  width: 70px;
  background: var(--cinza-escuro);
  display: flex;
  align-items: flex-end;
  position: relative;
  border-radius: 5px 5px 0 0;
  overflow: visible;
  min-height: 2px;
}
.bar-fill-vertical {
  width: 100%;
  background: var(--vermelho);
  transition: height 1.5s ease;
  border-radius: 5px 5px 0 0;
  position: relative;
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.2);
  min-height: 2px;
}
.floating-value {
  position: absolute;
  top: -35px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--vermelho);
  font-weight: 800;
  font-size: 1.6rem;
  white-space: nowrap;
  z-index: 10;
  text-shadow: 2px 2px 0 #fff;
}
.bar-label-name {
  margin-top: 10px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--vermelho);
  text-transform: uppercase;
  text-align: center;
}

.podio-split-layout {
  flex-grow: 1;
  display: flex;
  flex-direction: row;
  gap: 20px;
  align-items: flex-start;
  margin-top: 15px;
}
.podio-lado-esquerdo,
.podio-lado-direito {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 50%;
}
.titulo-sessao {
  font-size: 1rem;
  color: var(--cinza-escuro);
  margin-bottom: 15px;
  text-transform: uppercase;
  border-left: 5px solid var(--vermelho);
  padding-left: 10px;
  letter-spacing: 1px;
}

#podio-mes-chart .termometro-bg {
  height: 35px;
}
#podio-mes-chart .info-vendedor-interna {
  font-size: 1.1rem;
}
#podio-mes-chart .ranking-item {
  gap: 10px;
}

.campeoes-grid-2x2 {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  gap: 8px;
  justify-content: center;
  align-content: flex-start;
}
.card-campeao-grid {
  background: #fff;
  border-radius: 10px;
  padding: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  border-bottom: 4px solid var(--vermelho);
  width: 160px;
  height: 130px;
}
.card-campeao-grid:nth-child(5),
.card-campeao-grid-vazio:nth-child(5) {
  grid-column: 1 / -1;
  justify-self: center;
  width: 160px;
  height: 130px;
  margin-top: -5px;
}
.card-campeao-grid-vazio {
  width: 160px;
  height: 130px;
  background: transparent;
  border: none;
  box-shadow: none;
}
.foto-grid {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--vermelho);
  object-fit: cover;
  margin-bottom: 2px;
}
.label-sem-grid {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--vermelho);
  margin-bottom: 0;
}
.nome-sem-grid {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--cinza-escuro);
  line-height: 1;
}
.loading {
  font-size: 1.5rem;
  text-align: center;
  color: #999;
  margin-top: 30px;
}

/* ====================================================================
   ESTILOS DO RODAPÉ DE NOTÍCIAS (CORRIGIDO E BLINDADO)
   ==================================================================== */
.news-ticker {
  width: 100%;
  height: 120px; /* Trava a altura para não esmagar os gráficos */
  background: var(--cinza-escuro);
  display: flex;
  align-items: center;
  border-top: 3px solid var(--vermelho);
  flex-shrink: 0; /* Impede que o flexbox amasse o rodapé */
  overflow: hidden;
}

.ticker-title {
  background: var(--vermelho);
  color: #fff;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  font-weight: 800;
  font-size: 1.1rem;
  z-index: 10;
  white-space: nowrap;
  flex-shrink: 0;
}

/* O "trilho" por onde o texto vai correr */
.ticker-wrapper {
  flex: 1;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.ticker-content {
  display: flex;
  align-items: center;
  height: 100%;
  width: max-content; /* O SEGREDO: Cresce infinitamente pro lado, nunca pra baixo */
  animation: scroll-news 60s linear infinite;
  will-change: transform;
}

@keyframes scroll-news {
  0% {
    transform: translateX(1080px);
  } /* Começa no lado direito da TV */
  100% {
    transform: translateX(-100%);
  } /* Roda até sumir no lado esquerdo */
}

.ticker-content span {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-right: 50px;
  color: var(--branco);
  white-space: nowrap; /* Proíbe terminantemente o texto de quebrar linha */
  font-size: 1.2rem;
}

.ticker-img {
  height: 110px;
  width: 200px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--cinza-claro);
  flex-shrink: 0; /* Proíbe a imagem de ser esmagada */
}

@keyframes scroll-news {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}
.ticker-content span {
  margin-right: 50px;
  color: var(--cinza-claro);
}

/* --- PAINEL FIXO DE NAVIOS SOBRE O MAPA (ALINHADO E CENTRALIZADO) --- */
.logistics-panel {
  position: absolute;
  top: 30px;
  left: 30px;
  right: 30px;
  background: rgba(30, 30, 30, 0.9);
  border: 3px solid #ffaa00;
  border-radius: 12px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
}

.logistics-title {
  background: #ffaa00;
  color: #000;
  padding: 10px 0; /* Espaço reduzido */
  font-weight: 800;
  font-size: 1.3rem; /* Fonte do título menor */
  text-transform: uppercase;
  text-align: center;
  letter-spacing: 2px;
  width: 100%;
}

.logistics-list {
  padding: 15px 30px; /* Espaço interno reduzido */
  display: flex;
  flex-direction: column;
  gap: 10px; /* Menos espaço entre as linhas */
}

.logistics-item {
  color: #fff;
  font-size: 1rem; /* Fonte base menor */
  font-weight: 500;
  border-bottom: 1px solid rgba(255, 170, 0, 0.3); /* Linha mais fina */
  padding-bottom: 10px;
  display: flex;
  justify-content: space-between; /* Empurra os blocos para os lados */
  align-items: center;
}

.logistics-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* O SEGREDO DO ALINHAMENTO: Cada bloco divide o espaço igualmente */
.info-block {
  flex: 1;
  text-align: center; /* Centraliza o texto dentro do seu próprio terço da tela */
}

.logistics-item span {
  color: #ffaa00;
  font-weight: 800;
  font-size: 1.1rem; /* Fonte de destaque reduzida */
}

/* --- DESTAQUE: CAMPEÃO DO MÊS ANTERIOR (1ª SEMANA) --- */
.campeao-mes-unico {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  padding-top: 20px;
}

.card-campeao-mes {
  background: #fff;
  border-radius: 15px;
  padding: 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  border-bottom: 6px solid #ffaa00; /* Borda Dourada/Laranja */
  width: 280px;
  text-align: center;
  animation: pulse-gold 2.5s infinite; /* Efeito de brilho chamativo na TV */
}

@keyframes pulse-gold {
  0% {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  }
  50% {
    box-shadow: 0 10px 45px rgba(255, 170, 0, 0.6);
  }
  100% {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  }
}

.card-campeao-mes .foto-grid {
  width: 150px;
  height: 150px;
  border: 4px solid #ffaa00;
  margin-bottom: 15px;
}

.label-campeao {
  font-size: 1.2rem;
  font-weight: 800;
  color: #ffaa00;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.card-campeao-mes .nome-sem-grid {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--cinza-escuro);
  line-height: 1.2;
}

.card-campeao-mes .pts-campeao {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--vermelho);
  margin-top: 8px;
}

/* ====================================================================
   CARDS DE META BATIDA (100%+) NO RANKING INDIVIDUAL
   ==================================================================== */
.cards-meta-batida-wrapper {
  width: 100%;
  margin-bottom: 20px;
}

.cards-meta-batida {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.card-meta-individual {
  flex: 1 1 0;
  max-width: 235px;
  min-width: 180px;
  padding: 12px 10px;
  border-radius: 12px;
  border-bottom: 5px solid #ffaa00;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  animation: pulse-gold 2.5s infinite;
  box-sizing: border-box;
}

/* Quando apenas 1 pessoa bate a meta, card ganha destaque ampliado */
.cards-meta-batida.qtd-1 .card-meta-individual {
  max-width: 290px;
  padding: 16px 20px;
}

.cards-meta-batida.qtd-1 .card-meta-individual .foto-grid {
  width: 90px;
  height: 90px;
}

.card-meta-individual .foto-grid {
  width: 70px;
  height: 70px;
  border: 3px solid #ffaa00;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 6px;
}

.card-meta-individual .label-campeao {
  font-size: 0.8rem;
  font-weight: 800;
  color: #ffaa00;
  margin-bottom: 3px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.card-meta-individual .nome-sem-grid {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--cinza-escuro);
  line-height: 1.2;
}

.card-meta-individual .pts-campeao {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--vermelho);
  margin-top: 4px;
}

/* Ajustes dinâmicos na lista de ranking quando houver cards de meta batida */
.has-meta-batida .ranking-container {
  gap: 10px;
}

.has-meta-batida .ranking-item .foto-vendedor {
  width: 48px;
  height: 48px;
}

.has-meta-batida .ranking-item .termometro-bg {
  height: 38px;
}

.has-meta-batida .ranking-item .info-vendedor-interna {
  font-size: 1.15rem;
  padding: 0 15px;
}

/* ====================================================================
   DESTAQUE EXCLUSIVO DA 1ª SEMANA DO MÊS (SEM BARRAS)
   ==================================================================== */
.modo-primeira-semana .cards-meta-batida-wrapper {
  margin-bottom: 0;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modo-primeira-semana .destaque-primeira-semana {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  width: 100%;
  height: 100%;
}

/* Card individual em destaque na 1ª semana */
.card-primeira-semana {
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Quando apenas 1 pessoa bateu a meta na 1ª semana: card grande e centralizado */
.destaque-primeira-semana.qtd-1 .card-primeira-semana {
  max-width: 340px;
  padding: 25px 30px;
  border-bottom: 6px solid #ffaa00;
}

.destaque-primeira-semana.qtd-1 .card-primeira-semana .foto-grid {
  width: 140px;
  height: 140px;
  border: 4px solid #ffaa00;
  margin-bottom: 12px;
}

.destaque-primeira-semana.qtd-1 .card-primeira-semana .label-campeao {
  font-size: 1.15rem;
  margin-bottom: 6px;
}

.destaque-primeira-semana.qtd-1 .card-primeira-semana .nome-sem-grid {
  font-size: 1.7rem;
  line-height: 1.2;
}

.destaque-primeira-semana.qtd-1 .card-primeira-semana .pts-campeao {
  font-size: 1.6rem;
  margin-top: 8px;
}

/* Quando 2 pessoas bateram a meta na 1ª semana */
.destaque-primeira-semana.qtd-2 .card-primeira-semana {
  max-width: 280px;
  padding: 20px;
  border-bottom: 6px solid #ffaa00;
}

.destaque-primeira-semana.qtd-2 .card-primeira-semana .foto-grid {
  width: 110px;
  height: 110px;
  border: 4px solid #ffaa00;
  margin-bottom: 10px;
}

.destaque-primeira-semana.qtd-2 .card-primeira-semana .nome-sem-grid {
  font-size: 1.4rem;
}

.destaque-primeira-semana.qtd-2 .card-primeira-semana .pts-campeao {
  font-size: 1.45rem;
}

/* Quando 3 pessoas bateram a meta na 1ª semana */
.destaque-primeira-semana.qtd-3 .card-primeira-semana {
  max-width: 250px;
  padding: 18px;
  border-bottom: 5px solid #ffaa00;
}

.destaque-primeira-semana.qtd-3 .card-primeira-semana .foto-grid {
  width: 95px;
  height: 95px;
}

.destaque-primeira-semana.qtd-3 .card-primeira-semana .nome-sem-grid {
  font-size: 1.3rem;
}

.destaque-primeira-semana.qtd-3 .card-primeira-semana .pts-campeao {
  font-size: 1.35rem;
}

/* Quando todos os 4 baterem a meta na 1ª semana */
.destaque-primeira-semana.qtd-4 .card-primeira-semana {
  max-width: 230px;
  padding: 16px 12px;
  border-bottom: 5px solid #ffaa00;
}

.destaque-primeira-semana.qtd-4 .card-primeira-semana .foto-grid {
  width: 85px;
  height: 85px;
}

.destaque-primeira-semana.qtd-4 .card-primeira-semana .nome-sem-grid {
  font-size: 1.2rem;
}

.destaque-primeira-semana.qtd-4 .card-primeira-semana .pts-campeao {
  font-size: 1.3rem;
}

/* Estado de busca caso ninguém tenha batido ainda na 1ª semana */
.card-primeira-semana.sem-meta {
  max-width: 320px;
  padding: 30px;
  border-bottom: 5px solid var(--cinza-escuro);
  animation: none;
}

/* ====================================================================
   ESTILOS DE LOGÍSTICA & CLIMA DO MAPA ATIVO
   ==================================================================== */

/* Linhas logísticas com fluxo tracejado animado */
.logistic-line {
  stroke-dasharray: 10, 10;
  animation: logistic-flow 25s linear infinite;
  stroke-linecap: round;
}

@keyframes logistic-flow {
  from {
    stroke-dashoffset: 500;
  }
  to {
    stroke-dashoffset: 0;
  }
}

/* Marcadores de pulso customizados para Leaflet */
.custom-pulse-marker {
  position: relative;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  position: absolute;
  z-index: 10;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.4);
}

.pulse-dot.blue {
  background: #3498db;
  border: 1.5px solid #fff;
}

.pulse-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  animation: pulse-grow 2s infinite ease-out;
  opacity: 0;
  z-index: 5;
}

.pulse-ring.blue {
  border: 3px solid #3498db;
  box-shadow: 0 0 10px rgba(52, 152, 219, 0.4);
}

@keyframes pulse-grow {
  0% {
    transform: scale(0.3);
    opacity: 0.8;
  }
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}


/* ====================================================================
   NUVENS OPERACIONAIS DINÂMICAS (SIMULADOR DE ATMOSFERA PREMIUM)
   ==================================================================== */
.animated-clouds {
  animation: cloud-atmosphere-drift 45s ease-in-out infinite alternate;
  pointer-events: none !important;
  mix-blend-mode: screen;
  filter: drop-shadow(0 15px 15px rgba(0, 0, 0, 0.15));
}

@keyframes cloud-atmosphere-drift {
  0% {
    transform: translate(0px, 0px) scale(1) rotate(0deg);
    opacity: 0.75;
  }
  33% {
    transform: translate(-15px, 10px) scale(1.03) rotate(0.5deg);
    opacity: 0.9;
  }
  66% {
    transform: translate(15px, -10px) scale(0.97) rotate(-0.5deg);
    opacity: 0.8;
  }
  100% {
    transform: translate(-5px, -5px) scale(1.01) rotate(0.2deg);
    opacity: 0.85;
  }
}

