/* Reset e estilos gerais */
html, body {
  max-width: 100%;
  overflow-x: hidden;
  margin: 0;
  padding: 20px;
  font-family: Arial, sans-serif;
  box-sizing: border-box;
}

/* Cabeçalho */
header {
  margin-bottom: 20px;
  display: flex;
  gap: 90px;
  align-items: center;
}

.cabecalho {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: -20px;
  width: 100%;
}

.cabecalho h1 {
  margin: 10px;
  text-align: center;
  font-size: 24px;
}

h2 {
  font-size: 20px;
  color: black;
}

/* Inputs e filtros */
.input-data, .filtros {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  background: #f8f9fa;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ddd;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 650px;
  margin: 10px auto;
  font-size: 12px;
}

.input-data label, .filtros label {
  font-weight: bold;
  color: #333;
}

.input-data input, .filtros select, #tipoPrograma, #regiao, #busca, #ordenacao {
  padding: 8px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  outline: none;
  background: #fff;
  max-width: 180px;
  transition: border-color 0.3s ease;
}

#ordenacao {
  max-width: 180px;
  padding: 4px;
  font-size: 12px;
}

.input-data input:focus, .filtros select:focus {
  border-color: #007bff;
  box-shadow: 0 0 5px rgba(0,123,255,0.3);
}

/* Input date customizado */
.input-data input[type="date"] {
  appearance: none;
  padding: 8px 12px;
  width: 100%;
  background: #fff url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24"><path fill="%23007bff" d="M19 4h-1V2h-2v2H8V2H6v2H5a2 2 0 0 0-2 2v15a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2ZM5 21V10h14v11Zm0-13V6h14v2Z"/></svg>') no-repeat right 10px center;
  background-size: 24px;
  cursor: pointer;
}

.input-data input[type="date"]:hover {
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24"><path fill="%230056b3" d="M19 4h-1V2h-2v2H8V2H6v2H5a2 2 0 0 0-2 2v15a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2ZM5 21V10h14v11Zm0-13V6h14v2Z"/></svg>');
}

/* Remove ícone padrão do calendário */
.input-data input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0;
  cursor: pointer;
  position: absolute;
  width: 100%;
}

/* Botões */
button, .btn-relatorio, #exibirDetalhesBtn {
  background-color: #017c9b;
  color: white;
  border: none;
  font-size: 14px;
  border-radius: 5px;
  padding: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  margin: 0;
}

button:hover, .btn-relatorio:hover, #exibirDetalhesBtn:hover {
  background-color: #0056b3;
}

.btn-email, #gerarBtn {
  padding: 10px 20px;
  font-weight: bold;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.btn-email {
  background-color: #017c9b;
  color: white;
  cursor: pointer;
}

#totais {
    display: none; /* Oculta a div inicialmente */
    padding: 10px;
    background: #f4f4f4;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Sombra suave */
    text-align: center; /* Centraliza o conteúdo */
    margin: 0px;
    max-width: 400px; /* Limita a largura para manter o alinhamento */
}

.total {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.total h3 {
    margin-bottom: 10px;
    font-size: 18px;
    color: #202020;
    text-align: center;
}

.total p {
    font-size: 16px;
    margin: 5px 0;
    font-weight: bold;
    color: #555;
    display: flex;
    justify-content: space-between;
    width: 100%; /* Garante que os itens ocupem toda a largura */
    max-width: 250px; /* Ajuste para não espalhar demais */
    padding: 5px;
    align-items: baseline;
}
#gerarBtn {
  background-color: #007bff;
}

.btn-email:hover, #gerarBtn:hover {
  background-color: #0b7dda;
}

/* Contêiner das ações principais */
.acoes-principais {
  display: flex;
  gap: 10px;
  margin-top: 5px;
}

/* Tabelas */
table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  border: 1px solid #ddd;
  padding: 12px;
  text-align: left;
  font-size: 14px;
}

th {
  background-color: #007bff;
  color: white;
  font-weight: bold;
}

tr:nth-child(even) {
  background-color: #f9f9f9;
}

tr:hover {
  background-color: #f1f1f1;
}

tr.selected {
  background-color: #e6f7ff;
  outline: 2px solid #1890ff;
}

/* Containers */
.table-container, #relatorio-container {
  width: 100%;
  max-height: 600px;
  overflow-x: auto;
  border: 1px solid #ddd;
  background: #f9f9f9;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Relatórios */
.relatorio-empresa {
  padding: 15px;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.relatorio-empresa h3 {
  color: #007bff;
}

ul {
  list-style: none;
  padding: 0;
}

ul li {
  background: #e9f2ff;
  margin: 5px 0;
  padding: 10px;
  border-radius: 5px;
}

/* Mensagens */
.error {
  color: red;
  text-align: center;
  font-weight: bold;
}

/* Loader */
.loading-indicator {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  color: white;
}

.spinner {
  border: 5px solid #f3f3f3;
  border-top: 5px solid #3498db;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

#ordenacao-container {
  display: none; /* só aparece se o JS ativar */
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 10px;
  align-items: center;
}

.acoes-principais {
  display: flex;
  gap: 10px;
  justify-content: flex-start; /* ou 'flex-end' se quiser alinhar à direita */
  margin-top: 10px;
}

.acoes-principais button {
  padding: 8px 16px;
  background-color: #1976d2;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.acoes-principais button:hover {
  background-color: #1565c0;
}


@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.error-message {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 15px;
  background: #ff4444;
  color: white;
  border-radius: 5px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  z-index: 1000;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

/* Paginação */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.pagination button {
  background-color: #017c9b;
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s ease;
  min-width: 40px;
}

.pagination button:hover:not(:disabled) {
  background-color: #0b7dda;
}

.pagination button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
  opacity: 0.7;
}

.pagination button.active {
  background-color: #0056b3;
  cursor: default;
}
