/* =========================================
   1. VARIABLES Y CONFIGURACIÓN GLOBAL
   ========================================= */
:root {
    /* Paleta de Colores Oposura Ranch */
    --color-tierra: #8B4513;   /* Café principal */
    --color-crema: #F5F5DC;    /* Fondo suave */
    --blanco: #ffffff;
    --texto-oscuro: #333333;

    /* Semáforo de Estados */
    --estado-verde: #2E8B57;   /* Disponible */
    --estado-rojo: #D32F2F;    /* Ocupada */
    --estado-amarillo: #FBC02D;/* Sucia */
    --estado-gris: #757575;    /* Mantenimiento */
    --estado-azul: #1976D2;    /* Mesa Ocupada */
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--color-crema);
    color: var(--texto-oscuro);
    margin: 0;
    padding: 0;
    overflow-y: auto; 
}

/* =========================================
   2. ESTILOS DEL LOGIN (Centrado)
   ========================================= */
body.modo-login {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
}

.login-card {
    background: var(--blanco);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(139, 69, 19, 0.2);
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.logo-area h1 {
    color: var(--color-tierra);
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

/* Campos de texto gigantes */
input[type="text"],
input[type="password"],
input[type="number"],
select {
    width: 100%;
    padding: 15px;
    margin: 10px 0;
    border: 2px solid #ddd;
    border-radius: 12px;
    font-size: 1.1rem;
    box-sizing: border-box;
    font-family: inherit;
}

input:focus, select:focus {
    border-color: var(--color-tierra);
    outline: none;
}

/* Botón Gigante */
.btn-grande {
    width: 100%;
    padding: 18px;
    background-color: var(--color-tierra);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.3rem;
    font-weight: bold;
    cursor: pointer;
    margin-top: 15px;
    box-shadow: 0 4px 0 #5e2f0d;
    transition: transform 0.1s;
}

.btn-grande:active {
    transform: translateY(4px);
    box-shadow: none;
}

.alerta-error {
    background-color: #ffdddd;
    color: #a00;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: none;
}

/* =========================================
   3. ESTILOS DEL DASHBOARD (Tablero)
   ========================================= */

header {
    background-color: var(--color-tierra);
    color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    box-sizing: border-box;
}

.usuario-info span { font-weight: bold; font-size: 1.1rem; }

.btn-salir {
    background: rgba(255,255,255,0.2);
    padding: 8px 15px;
    border-radius: 8px;
    text-decoration: none;
    color: white;
    font-weight: bold;
}

.contenedor-principal {
    margin-top: 80px;
    padding: 20px;
    padding-bottom: 80px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

h2.titulo-seccion {
    border-bottom: 3px solid var(--color-tierra);
    padding-bottom: 10px;
    margin-top: 30px;
    color: var(--color-tierra);
    text-transform: uppercase;
}

/* Grids */
.grid-hotel {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.grid-restaurante {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

/* Tarjetas */
.card {
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    color: white;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    position: relative;
    height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.card:active { transform: scale(0.96); }

.card h3 { margin: 0; font-size: 2rem; font-weight: 800; }
.card p { margin: 5px 0 0; font-size: 1rem; opacity: 0.9; }

.card span.accion {
    margin-top: 10px;
    background: rgba(0,0,0,0.3);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
}

/* Colores de Estado */
.estado-Disponible { background-color: var(--estado-verde); }
.estado-Ocupada    { background-color: var(--estado-rojo); }
.estado-Mantenimiento { background-color: var(--estado-gris); }
.estado-Sucia { 
    background-color: var(--estado-amarillo); 
    color: #444; 
    border: 2px solid #e0a800;
}
.estado-Libre   { background-color: var(--estado-gris); opacity: 0.8; }
.estado-Ocupada-Mesa { background-color: var(--estado-azul); }

/* =========================================
   4. VENTANAS MODALES (POP-UPS)
   ========================================= */
.modal {
    display: none; /* Oculto por defecto */
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6); /* Fondo oscuro */
    justify-content: center;
    align-items: center;
}

.modal-contenido {
    background-color: var(--blanco);
    padding: 25px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    animation: aparecer 0.3s;
}

@keyframes aparecer {
    from {transform: scale(0.8); opacity: 0;}
    to {transform: scale(1); opacity: 1;}
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.modal-header h2 { margin: 0; color: var(--color-tierra); }

.cerrar-modal {
    font-size: 2.5rem;
    font-weight: bold;
    color: #aaa;
    line-height: 0.8;
    cursor: pointer;
}

.grupo-form { margin-bottom: 15px; text-align: left; }
.grupo-form label { display: block; font-weight: bold; margin-bottom: 5px; color: #555; }

.total-estimado {
    background: #e0f7fa; 
    color: #006064;
    padding: 15px; 
    border-radius: 10px; 
    font-weight: bold; 
    text-align: center; 
    margin: 20px 0;
    border: 1px solid #b2ebf2;
    font-size: 1.1rem;
}