body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #f5f7fa;
  margin: 0;
  padding: 0;
}

.top-controls {
  margin-top: 60px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  background: #fff;
  padding: 16px 20px 6px 20px;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 2px 6px #0001;
  position: sticky;
  top: 0;
  z-index: 10;
}

.top-controls .esquerda {
  flex: 1 1 200px;
  min-width: 180px;
  font-size: 1.1em;
  color: #333;
}

.busca-cidade {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 2 1 250px;
  min-width: 180px;
}

.busca-cidade input {
  padding: 6px 12px;
  font-size: 1em;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  width: 190px;
}

.busca-cidade select {
  padding: 6px 10px;
  font-size: 1em;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #f3f3f7;
  min-width: 150px;
}

.filtros-modo {
  margin: 14px 0 10px 0;
  text-align: center;
}

.filtro {
  background: #f0f2f5;
  color: #222;
  border: 1px solid #d1d5db;
  padding: 8px 18px;
  margin: 0 6px;
  border-radius: 20px;
  font-size: 1em;
  cursor: pointer;
  transition: background 0.22s;
}

.filtro.ativo,
.filtro:hover {
  background: #007bff;
  color: #fff;
  border-color: #007bff;
}

.grafico-cidade {
  width: 100% !important;
  max-width: 100vw;
  min-width: 0;
  box-sizing: border-box;
  padding-left: 2vw;
  padding-right: 2vw;
}

.grafico-cidade canvas {
  width: 100% !important;
  max-width: 100vw;
  min-width: 0;
  height: 120px !important;  /* altura customizável */
  display: block;
}


#painel {
  width: 100%;
  margin: 0;
  padding: 10px 2vw 30px 2vw;
  display: flex;
  flex-wrap: wrap;
  gap: 24px 14px; /* mais espaçamento horizontal */
  justify-content: flex-start;
  box-sizing: border-box;
}

.card {
  background: #fff;
  border-radius: 13px;
  box-shadow: 0 2px 14px #0002;
  padding: 10px 10px 10px 10px;
  margin-bottom: 18px;
  min-width: 250px;
  flex: 1 1 290px;
  max-width: 165px;
  transition: transform 0.1s;
}

.card:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 4px 20px #0002;
}

.card h3 {
  margin: 0 0 3px 0;
  font-size: 0.9em;
  color: #007bff;
}

.card .mensagem {
  font-size: 0.80em;
  margin: 5px 0 4px 0;
  color: #222;
}

.status {
  margin-top: 8px;
  font-size: 0.80em;
  font-weight: bold;
  padding: 3px 10px;
  border-radius: 9px;
  display: inline-block;
}
.status.bot {
  background: #e8f8ff;
  color: #007bff;
}
.status.humano {
  background: #fff5f2;
  color: #d14124;
}

.card button {
  display: block;
  margin: 10px 0 10px 0;
  padding: 8px 8px;
  border: none;
  border-radius: 8px;
  font-size: 0.85em;
  background: #007bff;
  color: #fff;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.22s;
}
.card button.ligar {
  background: #28a745;
}
.card button.desligar {
  background: #dc3545;
}
.card button:hover {
  opacity: 0.9;
}

/* Responsivo para mobile */
@media (max-width: 720px) {
  .top-controls {
    flex-direction: column;
    align-items: stretch;
    padding: 4px 1vw 0 1vw;
    gap: 0;
    margin-bottom: 0 !important;
  }
  .esquerda {
    display: flex;
    flex-direction: row;
    gap: 8px;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 1em;
    flex-wrap: wrap;
  }
  .esquerda > span {
    margin-left: 0 !important;
    padding: 0 !important;
  }
  .busca-cidade {
    flex-direction: column;
    align-items: stretch;
    gap: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  #busca, #filtro-cidade {
    width: 100%;
    margin-bottom: 2px !important;
    margin-top: 0 !important;
    font-size: 1.05em;
  }
  .grafico-cidade {
    width: 100vw !important;
    max-width: 100vw;
    min-width: 0;
    box-sizing: border-box;
    padding-left: 2vw;
    padding-right: 2vw;
    margin-top: 0 !important;
  }
  .grafico-cidade canvas {
    width: 100% !important;
    max-width: 100vw;
    min-width: 0;
    height: 120px !important;
    display: block;
  }
}






/* Estilo para o cabeçalho principal */
.main-header2 {
  /* Fixa o cabeçalho no topo da tela */
  position: fixed;
  top: 0;
  left: 0;
  /* Garante que o cabeçalho ocupe toda a largura */
  width: 100%;
  /* Fundo verde e altura para o cabeçalho */
  background-color: #4CAF50; /* Um tom de verde */
  /* Adiciona uma sombra sutil para dar profundidade */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  /* Garante que o cabeçalho fique acima de outros elementos */
  z-index: 1000;
}

/* Estilo para a navegação interna */
.main-nav2 {
  /* Usa flexbox para alinhar os itens horizontalmente */
  display: flex;
  /* Espaço entre os itens (logo à esquerda, botões à direita) */
  justify-content: space-between;
  /* Alinha os itens verticalmente no centro */
  align-items: center;
  /* Adiciona um espaçamento interno para não ficar grudado nas bordas */
  padding: 15px 20px;
}

/* Estilo para o título (logo) */
.logo2 {
  /* Cor branca para o texto */
  color: #fff;
  /* Aumenta o tamanho e a espessura da fonte */
  font-size: 24px;
  font-weight: bold;
  /* Remove a margem padrão do h1 */
  margin: 0;
}

/* Estilo para os links e botões de sair */
.logout-button2 {
  /* Cor do texto branca */
  color: #fff;
  /* Remove o sublinhado dos links */
  text-decoration: none;
  /* Adiciona um espaçamento para separar os botões */
  margin-left: 15px;
  /* Estiliza o botão */
  background-color: transparent; /* Fundo transparente */
  border: 1px solid #fff; /* Borda branca */
  padding: 8px 16px;
  border-radius: 5px;
  /* Adiciona transição suave para o efeito hover */
  transition: all 0.3s ease;
  font-size: 14px; /* Define um tamanho de fonte consistente para ambos */
}

/* Efeito de hover nos botões */
.logout-button2:hover {
  background-color: rgba(255, 255, 255, 0.2); /* Fundo branco semi-transparente */
}


/* 1. Garante que o container do dropdown não force largura total nos filhos */
.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 160px; /* Largura mínima para o menu */
    width: max-content; /* Faz o menu se ajustar ao tamanho do texto */
    box-shadow: 0px 8px 16px rgba(0,0,0,0.2);
    z-index: 1000;
    border-radius: 4px;
    border: 1px solid #ccc;
    padding: 5px 0;
}

/* 2. Classe que o JS usa para mostrar o menu */
.dropdown-content.show {
    display: block !important;
}

/* 3. Alinhamento dos itens (Onde estava o erro de ficarem afastados) */
.checkbox-group-vertical {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Alinha tudo à esquerda */
}

.checkbox-group-vertical label {
    display: flex;
    align-items: center;    /* Alinha verticalmente checkbox e texto */
    justify-content: flex-start; /* COLA o conteúdo no início (esquerda) */
    width: 100%;            /* Garante que a área clicável ocupe a linha toda */
    padding: 8px 15px;      /* Espaço confortável para o clique */
    cursor: pointer;
    white-space: nowrap;    /* Impede que o texto quebre linha */
    gap: 8px;               /* DISTÂNCIA EXATA entre o quadradinho e o texto */
}

/* 4. Reset de margens dos inputs para não empurrar o texto */
.checkbox-group-vertical input[type="checkbox"] {
    margin: 0; 
    cursor: pointer;
    width: auto;            /* Impede que o checkbox tente crescer */
}

/* 5. Efeito visual ao passar o mouse */
.checkbox-group-vertical label:hover {
    background-color: #f1f1f1;
}




.dropbtn {
    min-width: 160px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: white;
    border: 1px solid #ccc;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: border-color 0.2s;
}

.dropbtn:hover {
    border-color: #007bff;
}

.btn-download-csv {
    min-width: 160px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: white;
    border: 1px solid #ccc;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: border-color 0.2s;
}

.btn-download-csv:hover {
    border-color: #007bff;
}
main input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    /* Faz com que o padding não "aumente" o tamanho do input */
    box-sizing: border-box; 
    margin-top: 5px;
}


/* Estilos do Formulário de Login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    text-align: center;
}

.login-card {
    background-color: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-input {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid #bdc3c7;
    border-radius: 8px;
    box-sizing: border-box;
}

.login-button {
    width: 100%;
    padding: 12px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.2s ease;
}

.login-button:hover {
    background-color: #2980b9;
}

.login-message {
    margin-top: 15px;
    font-size: 14px;
    font-weight: bold;
}

.dashboard-container {
  padding: 40px 20px;
  display: none;
  
}
.wts-btn-submit:hover {
    background-color: #008f6f !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2) !important;
}

/* Botão de Envio */
.wts-btn-submit {
    width: 100% !important;
    background-color: #4CAF50 !important;
    color: #ffffff !important;
    border: none !important;
    padding: 14px !important;
    border-radius: 30px !important;
    font-weight: bold !important;
    font-size: 0.9rem !important;
    cursor: pointer !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1) !important;
}
.dropbtn span {
    pointer-events: none;
}


/* Estado padrão do botão de envio em massa (quando ativo pelo servidor) */
.btn-sending-active {
    background-color: #ff4d4d !important; /* Vermelho */
    background: #ff4d4d !important;
    color: white !important;
    border: 1px solid #cc0000 !important;
    cursor: not-allowed !important;
    pointer-events: none; /* Impede cliques repetidos */
    position: relative;
}

/* Opcional: Efeito de pulso para mostrar que está trabalhando */
.btn-sending-active::after {
    content: " (Processando...)";
    font-size: 0.8em;
    opacity: 0.7;
}