:root {
    --lupa-naranja: #ff6600; /* Color de acento Lupa */
    --lupa-azul: #003366;    /* Color corporativo estructura */
    --lupa-gris: #f4f4f4;    /* Fondo general */
    --lupa-blanco: #ffffff;
    --texto: #333333;
    
    /* Colores Turnos Suaves */
    --turno-m-bg: #e3f2fd; --turno-m-txt: #1565c0;
    --turno-t-bg: #fff3e0; --turno-t-txt: #e65100;
}

body { 
    font-family: 'Open Sans', sans-serif; 
    background-color: var(--lupa-gris); 
    color: var(--texto); 
    margin: 0; 
    padding: 0; 
}

/* --- ESTRUCTURA PRINCIPAL --- */
header { 
    background-color: var(--lupa-azul); 
    color: var(--lupa-blanco); 
    padding: 1rem 2rem; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); 
}

.nav-lupa { 
    background: var(--lupa-blanco); 
    padding: 10px 2rem; 
    border-bottom: 3px solid var(--lupa-naranja); 
    display: flex; 
    gap: 20px; 
    align-items: center;
}
.nav-lupa a { 
    text-decoration: none; 
    color: var(--lupa-azul); 
    font-weight: bold; 
    font-size: 0.9em; 
    padding: 5px 10px;
    border-radius: 4px;
    transition: 0.2s;
}
.nav-lupa a:hover { background-color: #f0f7ff; }

.container { padding: 2rem; max-width: 1300px; margin: auto; }

/* --- COMPONENTES UI (Botones e Inputs) --- */
.btn-lupa {
    background-color: var(--lupa-naranja);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9em;
    transition: background 0.2s;
    text-transform: uppercase;
}
.btn-lupa:hover { background-color: #e65c00; }

.input-lupa {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    font-family: inherit;
}

/* --- TARJETAS DE CONTADORES --- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 2rem; }
.stat-card { 
    background: var(--lupa-blanco); 
    padding: 20px; 
    border-radius: 8px; 
    border-top: 4px solid var(--lupa-naranja); 
    text-align: center; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.05); 
}
.stat-card span { display: block; font-size: 2.5em; font-weight: 800; color: var(--lupa-azul); }
.stat-card label { font-size: 0.8em; text-transform: uppercase; color: #777; font-weight: bold; }

/* --- CALENDARIO (VISTA FICHA - DIVS) --- */
.calendario-anual { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 25px; }
.mes-box { background: var(--lupa-blanco); border-radius: 8px; padding: 15px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.mes-nombre { color: var(--lupa-azul); font-weight: 800; text-align: center; margin-bottom: 10px; border-bottom: 1px solid var(--lupa-gris); padding-bottom: 5px; text-transform: uppercase; }
.dias-header { display: grid; grid-template-columns: repeat(7, 1fr); font-weight: bold; color: var(--lupa-naranja); text-align: center; font-size: 0.7em; margin-bottom: 5px; }
.dias-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }

.dia { 
    padding: 8px 0; text-align: center; border-radius: 4px; font-size: 0.85em; 
    cursor: pointer; border: 1px solid #f9f9f9; transition: 0.2s; 
}
.dia:hover { background: #eee; }

/* --- ESTILOS DE TURNOS E INCIDENCIAS (Sirve para Ficha y Tabla Mensual) --- */

/* Mañana y Tarde (Los que faltaban) */
.dia-M, .celda-M { background-color: var(--turno-m-bg); color: var(--turno-m-txt); font-weight: bold; border-color: #bbdefb; }
.dia-T, .celda-T { background-color: var(--turno-t-bg); color: var(--turno-t-txt); font-weight: bold; border-color: #ffe0b2; }

/* Incidencias */
.dia-V, .celda-V { background-color: var(--lupa-naranja) !important; color: white !important; font-weight: bold; }
.dia-S, .celda-S { background-color: var(--lupa-azul) !important; color: white !important; font-weight: bold; }
.dia-B, .celda-B { background-color: #d9534f !important; color: white !important; }
.dia-D, .celda-D { background-color: #5bc0de !important; color: white !important; }
.dia-L, .celda-L { background-color: #f0f0f0; color: #bbb; } /* Libre 5+2 */
.dia-OFF, .celda-OFF { background-color: #fafafa; color: #ddd; } /* Domingo */

/* FESTIVOS (IMPORTANTE) */
.dia-F, .celda-F, .badge-F {
    background-color: #d32f2f !important; /* Rojo Intenso */
    color: white !important;
    font-weight: bold;
    border-color: #b71c1c !important;
}

/* Selección de Rangos (JavaScript) */
.sel-inicio { background-color: var(--lupa-azul) !important; color: white !important; transform: scale(1.1); z-index: 2; box-shadow: 0 0 5px rgba(0,0,0,0.3); }
.sel-rango { background-color: #fff8e1 !important; border: 1px dashed var(--lupa-naranja) !important; }

/* --- CALENDARIO MENSUAL (TABLA) --- */
/* Esto faltaba para que calendario.php se vea bien */
.container-cal { max-width: 98%; margin: 20px auto; background: white; padding: 20px; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.85em; white-space: nowrap; }
th, td { border: 1px solid #e0e0e0; padding: 5px; text-align: center; }

/* Cabeceras Fijas */
.col-nombre { position: sticky; left: 0; background: white; z-index: 10; text-align: left; font-weight: bold; color: var(--lupa-azul); border-right: 2px solid var(--lupa-naranja); min-width: 150px; padding-left: 10px; }
.header-dia { background: var(--lupa-azul); color: white; font-weight: normal; }
.header-dia.finde { background: #002a4d; }

/* Totales */
.total-ok { color: green; font-weight: bold; background: #e8f5e9; }
.total-low { color: #d32f2f; font-weight: bold; background: #ffebee; }