body {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    
    height: 100vh;
    background-color: #fcfcfc;
    
}

/* Contenedor fijo */
#fixed {
    background-color: #e12020;
    width: 100%;
    padding-bottom: 10px;
}

/* Contenedor principal 
#contenedor {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px;
    padding: 20px;
    background-color: #ebebeb;
    border-radius: 5px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
    min-width: 100px;
    max-width: calc(100% - 10px);
}
*/

#checkboxContainer label {
    font-weight: normal !important;
}


/* Contenedor adhesivo */
#sticky-container {
    position: sticky;
    top: 10px;
    z-index: 2;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 10px;
    border-radius: 5px;
    display: flex; /* Hace que los hijos se alineen en fila */
    justify-content: space-between; /* Distribuye el espacio entre los elementos */
    align-items: center; /* Alinea los elementos verticalmente en el centro */
}

#consultaForm {
    display: flex; /* Alinea los elementos del formulario en fila */
    flex-wrap: wrap; /* Permite que los elementos del formulario se envuelvan si es necesario */
    gap: 2px; /* Espacio entre los elementos del formulario */
    align-items: center; /* Alinea los elementos verticalmente en el centro */
}

#consultaForm .form-row {
    display: flex;
    align-items: center; /* Alinea los elementos verticalmente en el centro */
    
}

#consultaForm label {
    margin: 5px; /* Espacio entre la etiqueta y el input */
    
}

#consultaForm input[type="number"] {
    width: 70px;
    padding: 3px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
}

#consultaForm button {
    margin-left: 0px; /* Espacio entre los botones */
    border-color: #d3d3d3;
}
/* Estilos del formulario */
#form {
    display: flex; /* Alinea los elementos del formulario en fila */
    flex-wrap: wrap; /* Permite que los elementos del formulario se envuelvan si es necesario */
    gap: 2px; /* Espacio entre los elementos del formulario */
    align-items: center; /* Alinea los elementos verticalmente en el centro */
}

#form .form-row {
    display: flex;
    align-items: center; /* Alinea los elementos verticalmente en el centro */
    
}

#form label {
    margin-right: 5px; /* Espacio entre la etiqueta y el input */
    
}

#form input[type="number"] {
    width: 70px;
    padding: 3px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
}

#form button {
    margin-left: 0px; /* Espacio entre los botones botonesform*/
    border-color:1px grey;
}


button { /*botons foerm*/
    color: #000000;
    font-size: 13px;
    background-color: #e6e6e6;
    border-radius: 5px;

    border-color: #ebebeb;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    
  }
button:hover {
    background-color: #d1d1d1;
    color: #BF0000;
    
    border-color: #f1f1f1;
}

rect.highlight {
    stroke: #462dff; /* Color del borde cuando se resalta */
    stroke-width: 2px; /* Ancho del borde resaltado */
    fill-opacity: 0.8; /* Opcional: Cambiar la opacidad del color de fondo */
  }
.Btn {
    display: flex;
    align-items: center;
    margin-left: 10px; /* Ajustar espaciado entre botones */
}

.Btn .svgIcon {
    fill: #fcfcfc;
    width: 10px; /* Ajustado ancho */
    height: auto; /* Mantener proporción */
}

.Btn .icon2 {
    width: 8px;
    height: 5px;
    border-bottom: 2px solid #fcfcfc;
    border-left: 2px solid #fcfcfc;
    border-right: 2px solid #fcfcfc;
   
}

.Btn .tooltip {
    position: absolute;
    right: -105px;
    opacity: 0;
    background-color: rgb(12, 12, 12);
    color: white;
    padding: 5px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition-duration: .2s;
    pointer-events: none;
    letter-spacing: 0.5px;
}

.Btn:hover .tooltip {
    opacity: 1;
    transition-duration: .3s;
}

.Btn:hover {
    background-color: #900000;
    transition-duration: .3s;
}

.Btn:hover .icon2 {
    border-color: rgb(235, 235, 235); /* Ajustar color del borde */
}

.Btn:hover .svgIcon {
    fill: rgb(255, 255, 255);
    animation: slide-in-top 0.6s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
}

@keyframes slide-in-top {
    0% {
        transform: translateY(-10px);
        opacity: 0;
    }

    100% {
        transform: translateY(0px);
        opacity: 1;
    }
}

/* Input de número */
input[type="number"] {
    width: 70px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
}

/* Contenedor del gráfico */
#chart {
    margin-top: 0px;
    width: 100%;
    max-width: calc(100% - 10px);
    overflow: hidden; /* Asegúrate de que no haya desbordamiento */
}

.chart-container {
    display: grid;
    align-items: center;
    grid-template-columns: 1fr 10fr;
    gap: 5px;
    margin-bottom: 10px; /* Espacio entre los gráficos */
}

.chart-controls {
    display: flex;
    align-items: center;
    flex-direction: column;
    align-items: flex-start;
    margin-left: 10px;
}

.chart-controls label {
    display: flex;
    align-items: center;
    margin-bottom: 0px;
}

/* Contenedor general */
#container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
     /* Añadir margen para separar del borde */
}

#controls-container {
    flex: 1;
    align-items: flex-start;
}

#chart {
    flex: 7; /* Ocupa 7 partes de 8, proporción 7:1 */
    margin-right: 10px; /* Espacio entre el gráfico y los resultados */
}

#resultados {
    flex: 2; /* Ocupa 2 partes de 8, proporción 2:8 */
   /*  max-width: 20%; Ancho máximo de los resultados */
    margin-left: 0px; /* Espacio entre los resultados y el gráfico */
    margin-top: 30px;
}

.resultado-item {
    padding: calc(5.5vw/2);
    font-size: 1vw; /* La fuente será 2% del ancho de la ventana */
    height: calc(22vw*0.36);
}
/* La leyenda siempre debe estar en una nueva línea */
.legend-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    margin: 0 auto;
    width: 100%; /* Ocupar todo el ancho disponible */
    clear: both; /* Evita que se sitúe junto a otros elementos flotantes */
    flex-direction: row; /* Mantener los elementos en línea si hay espacio */
    padding-top: 10px; /* Espaciado opcional */
}

.legend-item {
    display: flex;
    align-items: center;
    margin-right: 10px;
}

.color-box {
    width: 20px;
    height: 20px;
    margin-right: 5px;
    border: 1px solid #ccc;
}

.greenfosc { background-color: #75d16b; }
.green { background-color: #adff5c; }
.yellow { background-color: #FFFF00; }
.orange { background-color: #fd847b; }
.grey { background-color: #ccc; }


/*botó descàrrega*/
.Btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background-color: rgb(27, 27, 27);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition-duration: .3s;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.11);
  }
  
  .svgIcon {
    fill: #900000;
  }
  
  .icon2 {
    width: 14px;
    height: 5px;
    border-bottom: 2px solid #900000;
    border-left: 2px solid #900000;
    border-right: 2px solid #900000;
  }
  
/* Reducir tamaño de los checkboxes */
input[type="checkbox"] {
    width: 10px;
    height: 10px;
  }
  /*highlight celda*/
  rect.highlight {
    stroke: #462dff; /* Color del borde cuando se resalta */
    stroke-width: 2px; /* Ancho del borde resaltado */
    fill-opacity: 0.8; /* Opcional: Cambiar la opacidad del color de fondo */
  }

  #cargargrafico{
    padding: 10px;
  }