/* Importação da fonte (caso queira no próprio CSS, mas já estará no HTML) */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=KoHo:wght@700&display=swap');
button {
    all: unset;
    font: inherit;
}


html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}


/* Aplicando a fonte ao body e ao header */
body {
    font-family: 'Poppins', sans-serif;
    background-color: #132a69;
    height: 100vh; /* Garante que o body ocupe toda a tela */
    margin: 0;
    padding: 0;
    text-align: center;
}

header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background-color: rgb(237, 236, 241);
    width: 40%;
    margin: 10px auto;
    border-radius: 20px;
    white-space: nowrap;
    overflow: hidden;
}

h1 {
    font-size: 2.0rem;
    color: #0e142c;
}

form {
    margin-bottom: 50px;
}

input[type="file"] {
    padding: 20px;
    font-size: 14px;
    margin-right: 10px;
}


input[type="text"] {
    padding: 10px;
    font-size: 16px;
    margin-right: 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
    width: 60%;
}

/* Responsividade */
@media (max-width: 768px) {
    table {
        width: 100%;
        display: block;
        overflow-x: auto;
    }

    td,
    th {
        display: block;
        width: 100%;
    }

    td {
        padding: 10px;
    }
}

.header img {
        width: 140px;
        margin-right: 5px;
    }

.container-principal {
    width: 95%; /* Tamanho ajustado da área */
    max-width: 1200px;
    margin: 50px auto; /* Centraliza na tela */
    padding: 30px;
    background-color: rgb(222, 226, 233);
    box-shadow: 0px 4px 6px rgba(85, 84, 84, 0.1);
    margin-top: 20px;
    border-radius: 8px;
}

.container-secundario {
    max-width: 400px;
    margin: 40px auto;
    padding: 30px 25px;
    background-color: #f9f9f9;
    border-radius: 10px;
    box-shadow: 0 8px 16px rgb(0 0 0 / 0.1);
    font-family: 'Poppins', sans-serif;
}

/*___________________________________________________________________________________________*/



.footer {
    background-color: #011222;
    padding: 10px 0 15px; /* padding mais enxuto */
    text-align: center;
    margin-top: 30px;
    font-size: 13px;
}

.footer-text {
    color: #555;
    margin: 2px 0;
    font-size: 15px;
}

.footer-text1 {
    color: #888;
    margin: 0;
    font-size: 15px;
}


.imagem {
    max-width: 140px;
    height: auto;
    padding: 10px;
    border-radius: 20px;
    box-shadow: 16px 4px 6px #616263;
}
.resultados table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}


table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 20px;
        }

table th, table td {
            padding: 12px;
            text-align: left;
            border-bottom: 1px solid #ddd;
        }

table th {
            background-color: #194176;
            color: white;
            position: sticky;
            top: 0;
            z-index: 10;
        }

        
.info-row {
    display: flex;
    justify-content: space-between; /* separa os itens: um vai para esquerda, outro para direita */
    align-items: center;
    gap: 25px;
    font-family: 'Poppins', sans-serif;
    padding: 0px 50px;

}

.user-left {
    text-align: left;
}

.user-right {
    text-align: right;
}

.info-box {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

td[colspan="5"] > div {
    background-color: #f9f9f9;
    border-radius: 8px;
}

.resultados td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: left;
}

.resultados th {
    background-color: #f1f1f1;
}


.top-bar {
    position: absolute;
    top: 5px;
    right: 10px;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px; /* Espaço entre os elementos */
}

.top-bar a {
    color: white;
    text-decoration: none; /* Remove o sublinhado */
    font-weight: bold;
}

.top-bar a:hover {
    text-decoration: underline; /* Adiciona sublinhado ao passar o mouse */
}

.button-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.button-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
}

.lista-produtos {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.lista-produtos li {
    background-color: #f5f5f5;
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 8px;
    text-align: left;
    font-size: 1.1em;
}


.material-icons {
    vertical-align: middle;
    margin-right: 5px;
}

/* Estilo para a barra de filtro */
.filtro-container {
    display: flex;
    justify-content: space-between; /* Alinha os elementos */
    align-items: center;
    width: 80%; /* Define uma largura mais compacta */
    margin: 0 auto; /* Centraliza o container */
    margin-bottom: 20px; /* Adiciona espaçamento abaixo */
  }
  
  .filtro-container select {
    padding: 8px 16px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #f9f9f9;
  }
  
  .filtro-container label {
    font-size: 16px;
    margin-right: 10px;
  }
  
  /* Estilo para o gráfico */
  #graficoTop5 {
    width: 100%;
    max-width: 800px; /* Define um tamanho máximo para o gráfico */
    height: 400px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  }
  

.flash-container {
    margin: 20px 0;
}
.flash-message {
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
    font-weight: bold;
}
.flash-message.erro {
    background-color: #f8d7da;
    color: #721c24;
}
.flash-message.sucesso {
    background-color: #d4edda;
    color: #155724;
}

header h1 {
    background-color: #49c07b;
    color: white;
    padding: 20px 0;
    margin: -30px -25px 30px -25px;
    border-radius: 10px 10px 0 0;
    text-align: center;
    font-weight: 600;
    font-size: 1.8rem;
}

.container-secundario label {
    display: block;
    max-width: 500px;
    margin: 0 auto;
    font-weight: 600;
    margin-bottom: 8px;
    padding: 20px;
    color: #103966;
    box-sizing: border-box;
}

/* Inputs estilizados */
.container-secundario input[type="text"],
.container-secundario input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 20px;
    border: 1.5px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.container-secundario input[type="text"]:focus,
.container-secundario input[type="password"]:focus {
    outline: none;
    border-color: #49c07b;
    box-shadow: 0 0 6px #49c07b;
}

/* Mensagens flash */
.flash-container {
    margin-bottom: 20px;
}

.flash-message {
    padding: 10px 15px;
    border-radius: 5px;
    font-weight: 600;
    margin-bottom: 10px;
}

.flash-message.error {
    background-color: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
}

.flash-message.success {
    background-color: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}

.index-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 50px 20px;
    background: linear-gradient(180deg, #f8fbfc 0%, #e0f4fc 100%);
    min-height: calc(100vh - 140px); /* ajustado para caber com header + footer */
}


/* _______________________________________________ BOTÕES CORRETOS */


.button-container {
    display: flex;
    flex-direction: column;
    align-items: center; /* Centraliza horizontalmente as linhas */
    gap: 20px;
}

.button-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center; /* Centraliza os botões dentro da linha */
}

.button-row form {
    display: flex;
    flex-direction: column;
    align-items: center; /* Centraliza os itens dentro do formulário */
    gap: 10px;
}


.btn-primario-menu-principal,
.btn-secundario-menu-principal,
.botton_empresas {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    font-size: 18px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: transform 0.2s ease-in-out;
}

.btn-primario-menu-principal {
    background-color: #3ac4fa;
    color: #fff;
}

.btn-secundario-menu-principal {
    background-color: #6df1a2;
    color: #2b2e31;
}

.botton_empresas {
    background-color: #3ac4fa !important;
    color: rgb(43, 46, 49) !important;
}

.btn-primario-menu-principal:hover,
.btn-secundario-menu-principal:hover,
.botton_empresas:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

/* BOTÕES CORRETOS */

form input[type="text"],
form input[type="password"] {
  width: 100%;
  max-width: 100%;
  padding: 10px;
  box-sizing: border-box;
}


.container-graficos {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px; /* espaçamento entre os blocos */
  max-width: 1200px; /* limita a largura total da página */
  margin: 0 auto; /* centraliza horizontalmente */
  padding: 20px;
}

.chart-container {
  flex: 1 1 calc(50% - 20px); /* largura aproximada 50% menos o gap */
  box-sizing: border-box;
  background: #fff;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgb(0 0 0 / 0.1);
  margin-bottom: 20px;
}

.chart-container h2 {
  font-size: 1.1rem;
  margin-bottom: 10px;
  text-align: center;
}

/* Deixa os canvases com tamanho definido e responsivos */
.chart-container canvas {
  display: block;
  width: 100% !important;
  height: 250px !important; /* altura menor para ficar mais compacto */
  max-width: 100%;
}

/* Se quiser ajustar título da label no select */
label[for="estabelecimento-select"] {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
}

/* Centraliza o select e limita a largura */
#estabelecimento-select {
  display: block;
  margin: 0 auto 30px auto;
  width: 200px;
  padding: 6px 10px;
  font-size: 1rem;
  border-radius: 6px;
  border: 1px solid #ccc;
}

#estabelecimento-select {
  display: block;
  margin: 0 auto 30px auto;
  width: 350px;       /* largura maior */
  min-width: 250px;   /* largura mínima */
  max-width: 90vw;    /* largura máxima responsiva, para telas pequenas */
  padding: 8px 12px;
  font-size: 1rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  white-space: nowrap; /* evita quebra de linha */
  text-overflow: ellipsis; /* corta texto longo com reticências se ultrapassar */
  overflow: hidden;
}