html, body {
    height: 100%;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center; 
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box; /* LA CORRECCIÓN CLAVE PARA ELIMINAR EL SCROLL DOBLE */
}

body {
    width: 100%; /* Asegura que el gradiente ocupe todo */
    background: linear-gradient(125deg, #2c3e50, #1a252f);
    background-size: 200% 200%;
    overflow-y: auto; /* Permite un único scroll si el contenido es muy alto */
}

h1 {
    font-size: 2.5em;
    color: #f4f6f7;
    text-shadow: 0 2px 5px rgba(0,0,0,0.3);
    margin-bottom: 20px;
    text-align: center;
}

.inputs {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

input[type="date"] {
    padding: 12px 20px;
    font-size: 1rem;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50px;
    outline: none;
    background-color: rgba(0,0,0,0.25);
    color: #f4f6f7;
    box-shadow: none;
    color-scheme: dark;
}

input[type="date"]:focus {
    border: 1px solid #3b5998;
    box-shadow: 0 0 0 3px rgba(59, 89, 152, 0.5);
}

.sala {
    width: 100%;
    max-width: 900px;
    border-radius: 16px;
    padding: 30px;
    background: rgba(26, 37, 47, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    margin-top: 20px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 15px;
    margin-top: 20px;
    max-width: 100%;
}

.bloque {
    aspect-ratio: 11 / 7;
    margin: 0;
    padding: 10px;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    white-space: pre-line;
    text-align: center;
    box-shadow: none;
    font-size: 0.9em;
}

.bloque:not(.ocupado):hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    opacity: 1;
}

.bloque.seleccionado {
    background-image: linear-gradient(145deg, #2ecc71, #28b463);
    background-color: #2ecc71 !important;
    color: white;
    border-color: transparent;
    font-weight: bold;
    box-shadow: 0 0 20px rgba(46, 204, 113, 0.6);
}

.ocupado {
    background-color: rgba(192, 57, 43, 0.5) !important;
    border-color: rgba(231, 76, 60, 0.3) !important;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
}

.ocupado:hover {
    background-color: rgba(192, 57, 43, 0.7) !important;
    border-color: rgba(231, 76, 60, 0.5) !important;
}

@media (min-width: 550px) {
    .grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 768px) {
    .grid {
        grid-template-columns: repeat(5, 1fr);
    }
     .bloque {
        font-size: 1em;
    }
}
