/* AL PRINCIPIO DE TU style.css */
@import "https://cdn.jsdelivr.net/npm/vanilla-calendar-pro@2.9.0/build/vanilla-calendar.min.css";

/* --- Paleta de Colores y Variables Globales (según especificaciones) --- */
:root {
    --primary: #6366f1;        /* Índigo principal */
    --primary-light: #a5b4fc;  /* Índigo claro */
    --secondary: #8b5cf6;      /* Violeta secundario */
    --success: #10b981;        /* Verde completado */
    --warning: #f59e0b;        /* Naranja pendiente */
    --danger: #ef4444;         /* Rojo alertas */
    --background: #f8fafc;     /* Gris muy claro fondo */
    --surface: #ffffff;        /* Blanco tarjetas */
    --surface-dark: #f1f5f9;   /* Gris claro superficies */
    --text: #334155;           /* Gris oscuro texto principal */
    --text-light: #64748b;     /* Gris medio texto secundario */
    --border: #e2e8f0;         /* Gris claro bordes */
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

/* --- Estilos Generales --- */
body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--background);
    color: var(--text);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.hidden {
    display: none !important;
}

/* --- Estilos de la Caja de Login --- */
#login-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-box {
    background-color: var(--surface);
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-box h1 {
    color: var(--primary);
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.login-box p {
    color: var(--text-light);
    margin-bottom: 2rem;
}

/* --- Estilos del Formulario --- */
#login-form .input-group {
    text-align: left;
    margin-bottom: 1.5rem;
}

#login-form label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

#login-form input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box; /* Asegura que el padding no afecte el ancho total */
}

#login-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.error-message {
    color: var(--danger);
    font-size: 0.9rem;
    height: 1.2em; /* Reserva espacio para que no salte el layout */
    margin-bottom: 1rem;
}

/* --- Estilos de Botones --- */
.btn {
    width: 100%;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: #4f46e5; /* Un tono de índigo más oscuro */
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

/* --- Estilos del Contenedor Principal de la App --- */
#app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    background-color: var(--background);
}

/* --- 1. BARRA LATERAL (SIDEBAR) --- */
#sidebar {
    width: 250px;
    background-color: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
}

.sidebar-header {
    padding: 1rem 1.5rem;
    color: var(--primary);
    border-bottom: 1px solid var(--border);
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.5rem;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.sidebar-menu li a {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.sidebar-menu li a:hover {
    background-color: var(--surface-dark);
}

.sidebar-menu li a.active {
    color: var(--primary);
    font-weight: 700;
    border-left: 3px solid var(--primary);
    background-color: #eef2ff; /* Índigo muy claro */
}


/* --- 2. CONTENIDO PRINCIPAL (Wrapper) --- */
#main-content-wrapper {
    flex-grow: 1; /* Ocupa el resto del espacio */
    display: flex;
    flex-direction: column;
    height: 100vh;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
}

header #user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

header #logout-button {
    width: auto; /* Ancho automático para el botón de logout */
}

#view-title {
    margin: 0;
}

main#view-content {
    flex-grow: 1;
    padding: 2rem;
    overflow-y: auto; /* Permite scroll si el contenido es muy largo */
}

/* --- Estilos del Dashboard --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.dashboard-card {
    background-color: var(--surface);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.dashboard-card h3 {
    margin-top: 0;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}

#next-pending-button {
    margin-top: 1rem;
    width: auto;
    background-color: var(--warning);
}
#next-pending-button:hover {
    background-color: #d97706; /* Naranja más oscuro */
}

/* --- Estilos de la Lista de Estudiantes --- */
#student-list {
    max-height: 300px;
    overflow-y: auto;
}

.student-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    font-weight: 500;
    transition: background-color 0.2s;
}

.student-item.status-pending {
    background-color: var(--warning-light);
    border-left: 5px solid var(--warning);
}

.student-item.status-completed {
    background-color: var(--success-light);
    border-left: 5px solid var(--success);
}

/* --- Estilos del Formulario de Registro --- */
#daily-register-form {
    background: var(--surface);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.form-header {
    display: flex;
    gap: 2rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.form-column .form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box;
    background-color: var(--background);
}

.form-group input:disabled {
    background-color: var(--surface-dark);
    color: var(--text-light);
    cursor: not-allowed;
}

.radio-group {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.radio-group input[type="radio"] {
    margin-right: 0.5rem;
}

/* Para que la etiqueta al lado del radio sea clickeable */
.radio-group label {
    margin-bottom: 0; 
    font-weight: 400;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.form-actions .btn {
    width: auto;
}

/* --- Estilos Vista Gestión Estudiantes --- */
.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.view-header h2 {
    margin: 0;
}

#management-student-list .student-manage-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--surface);
    padding: 1rem 1.5rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

#management-student-list .student-name {
    font-weight: 500;
}

#management-student-list .student-name.inactive {
    text-decoration: line-through;
    color: var(--text-light);
}

.student-actions {
    display: flex;
    gap: 0.5rem;
}

.student-actions .btn {
    padding: 0.4rem 0.8rem;
    width: auto;
    font-size: 0.9rem;
}

/* --- Estilos del Modal --- */
.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: var(--surface);
    padding: 2.5rem;
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

.modal-content #student-form {
    margin-top: 1.5rem;
}

/* --- Estilos Vista de Reportes --- */
.report-filters {
    display: flex;
    align-items: flex-end;
    gap: 1.5rem;
    padding: 1.5rem;
    background-color: var(--surface);
    border-radius: 8px;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

#report-results {
    background-color: var(--surface);
    padding: 1.5rem;
    border-radius: 8px;
}

#report-results h3 {
    margin-top: 0;
}

#export-excel-button {
    width: auto;
    float: right;
    margin-bottom: 1rem;
}

.table-container {
    width: 100%;
    overflow-x: auto; /* Para tablas anchas en móvil */
}

#report-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

#report-table th, #report-table td {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    text-align: left;
}

#report-table th {
    background-color: var(--surface-dark);
    font-weight: 700;
}

#report-table tbody tr:nth-child(even) {
    background-color: var(--background);
}

/* --- Estilos Adicionales para Matriz de Reportes --- */
#report-table th, #report-table td {
    min-width: 50px; /* Ancho mínimo para las columnas de día */
    text-align: center; /* Centramos el contenido de las celdas */
    padding: 0.6rem 0.4rem; /* Hacemos el padding más compacto */
}

#report-table td.student-name-cell {
    text-align: left;
    font-weight: 500;
    min-width: 200px; /* Ancho para la columna de nombres */
}

#report-table td.absence-cell {
    color: var(--danger);
    font-weight: 700;
}

/* --- Estilos del Cabecero del Sidebar con Logo --- */
.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem; /* Espacio entre el logo y el texto */
    padding: 1rem 1.25rem; /* Ajustamos el padding */
}

.sidebar-logo {
    height: 40px; /* Ajusta la altura del logo como necesites */
    width: auto;
}

.sidebar-header span {
    font-size: 1.1rem; /* Tamaño del texto */
    font-weight: 700;
    color: var(--primary);
}

/* --- Estilos para Reporte Completo --- */
#report-table td.full-report-cell {
    text-align: left;
    vertical-align: top;
    font-size: 0.85rem; /* Letra un poco más pequeña */
    white-space: pre-wrap; /* Permite saltos de línea y respeta espacios */
    min-width: 150px; /* Ancho mínimo para que quepa algo de texto */
    max-width: 250px; /* Ancho máximo para que no se desmadre */
}

#report-table td.full-report-cell strong {
    color: var(--primary);
}

/* --- Estilos para el Calendario del Dashboard --- */
#calendar-container {
    padding: 0.5rem; /* Ajustamos el padding para que el calendario encaje mejor */
}

/* Colores para los días según su estado */
.vanilla-calendar-day--completed {
    background-color: var(--success-light) !important;
    color: var(--success) !important;
    font-weight: 700;
}

.vanilla-calendar-day--pending {
    background-color: var(--warning-light) !important;
    color: var(--warning) !important;
    font-weight: 700;
}

/* --- Estilos para el Widget de Fichaje Horario --- */
.main-widget {
    grid-column: 1 / -1; /* Ocupa todo el ancho de la fila */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

#clock-display {
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary);
    background-color: var(--surface-dark);
    padding: 1rem 2rem;
    border-radius: 8px;
    letter-spacing: 2px;
}

#clock-in-buttons .btn {
    min-width: 200px;
    font-size: 1.2rem;
}

#work-status {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.status-in {
    background-color: var(--success);
}

.status-out {
    background-color: var(--danger);
}

#clock-in-options {
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    width: 100%;
    text-align: center;
}

#clock-in-options label {
    margin: 0 1rem 0 0.25rem;
}

/* --- Estilos para el Widget de Estado de Personal --- */
#staff-status-widget {
    grid-column: 1 / -1; /* Ocupa todo el ancho */
}

#staff-status-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.staff-status-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    border-left: 5px solid; /* El color se definirá por clase */
}

.staff-status-item p {
    margin: 0;
    font-weight: 500;
}

.staff-status-item .status-label {
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    color: white;
}

/* Colores de estado */
.staff-status-in {
    border-left-color: var(--success);
}
.staff-status-in .status-label {
    background-color: var(--success);
}

.staff-status-out, .staff-status-default {
    border-left-color: var(--danger);
}
.staff-status-out .status-label, .staff-status-default .status-label {
    background-color: var(--danger);
}

.staff-status-break {
    border-left-color: var(--warning);
}
.staff-status-break .status-label {
    background-color: var(--warning);
}

.staff-status-special {
    border-left-color: var(--primary);
}
.staff-status-special .status-label {
    background-color: var(--primary);
}

/* --- Estilos para los inputs de fecha y hora en modales --- */
.modal-content input[type="datetime-local"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box;
    background-color: var(--background);
    font-family: inherit; /* Asegura que use la misma fuente */
}

/* --- Estilos para la Vista de Calendario Anual --- */
#calendar-grid-container {
    display: grid;
    /* Creamos una cuadrícula responsive para los calendarios */
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.month-calendar {
    break-inside: avoid; /* Evita que un calendario se parta al imprimir */
}

.month-header {
    background-color: var(--primary);
    color: white;
    padding: 0.5rem;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 6px 6px 0 0;
}

.calendar-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.calendar-table th, .calendar-table td {
    border: 1px solid var(--border);
    text-align: center;
    padding: 0.5rem 0;
    height: 45px;
}

.calendar-table th {
    font-weight: 700;
    background-color: var(--surface-dark);
}

.day-cell {
    font-weight: 500;
}

/* Colores para los días especiales */
.day-saturday {
    background-color: #f0f0f0; /* Gris claro para sábados */
    color: #888;
}

.day-sunday, .day-holiday {
    background-color: #fee2e2; /* Rojo claro para domingos y festivos */
    color: var(--danger);
    font-weight: 700;
}

.day-celebration {
    background-color: #dcfce7; /* Verde claro para celebraciones */
    color: var(--success);
    font-weight: 700;
}

.special-days-list {
    margin-top: 1rem;
    padding-left: 1.5rem;
}

.special-days-list li {
    margin-bottom: 0.25rem;
}

.special-days-list .holiday-item {
    color: var(--danger);
    font-weight: 500;
}

.special-days-list .celebration-item {
    color: var(--success);
    font-weight: 500;
}


/* --- Estilos para la Impresión (Exportar a PDF) --- */
@media print {
    /* Ocultamos todo lo que no queremos imprimir */
    body > *:not(#app-container) {
        display: none;
    }

    #app-container > *:not(#main-content-wrapper) {
        display: none;
    }
    
    #main-content-wrapper > *:not(main#view-content) {
        display: none;
    }

    main#view-content > *:not(#full-calendar-view) {
        display: none;
    }
    
    #full-calendar-view .view-header {
        display: none; /* Ocultamos la cabecera con el botón de exportar */
    }

    /* Nos aseguramos de que el contenedor del calendario ocupe toda la página */
    #full-calendar-view, #app-container, #main-content-wrapper, main#view-content {
        display: block;
        width: 100%;
        height: auto;
        padding: 0;
        margin: 0;
    }

    #calendar-grid-container {
        /* Para impresión, es mejor una sola columna */
        grid-template-columns: 1fr;
    }
}

/* --- Ocultar flechas en inputs de tipo number --- */

/* Para Chrome, Safari, Edge, Opera */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Para Firefox */
input[type=number] {
  appearance: textfield;
}

/* --- Estilos para Filtros en Gestión de Estudiantes --- */
.student-filters {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-left: auto; /* Empuja los filtros a la izquierda del botón de añadir */
    margin-right: 1.5rem;
}

.student-filters .form-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0; /* Anulamos el margen inferior por defecto */
}

.student-filters .form-group label {
    margin-bottom: 0;
    white-space: nowrap; /* Evita que el texto de la etiqueta se parta */
}

.student-filters select {
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background-color: var(--surface);
}

.radio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
}

/* --- Estilos para Contenedor de Filtros de Vista --- */
.view-filters-container {
    display: flex;
    gap: 1.5rem; /* Espacio entre los filtros */
    align-items: center;
    padding: 1rem 1.5rem;
    background-color: var(--surface);
    border-radius: 8px;
    margin-bottom: 1.5rem; /* Espacio antes de la lista */
    border: 1px solid var(--border);
}

.view-filters-container .form-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0;
}

.view-filters-container label {
    margin-bottom: 0;
    font-weight: 500;
}

/* --- Estilos Mejorados para la Tabla de Reporte de Datos Personales --- */

/* Estilo general para la tabla para asegurar consistencia */
#personal-data-report-table {
    width: 100%;
    border-collapse: collapse; /* Asegura que los bordes se unan */
    margin-top: 1rem;
    font-size: 0.9rem; /* Un poco más pequeña para que quepa más info */
    box-shadow: var(--shadow); /* Le damos una sombra sutil */
}

/* Estilo para las celdas de cabecera y de datos */
#personal-data-report-table th, 
#personal-data-report-table td {
    padding: 0.8rem 1rem;
    border: 1px solid var(--border);
    text-align: left;
}

/* Estilo específico para la cabecera */
#personal-data-report-table th {
    background-color: var(--primary); /* Usamos el color primario para la cabecera */
    color: white;
    font-weight: 700;
}

/* --- ¡LA MAGIA DEL ZEBRA STRIPING! --- */
/* Selecciona todas las filas impares (1, 3, 5...) del cuerpo de la tabla */
#personal-data-report-table tbody tr:nth-child(odd) {
    background-color: var(--surface); /* Fondo blanco (o el que tengas por defecto) */
}

/* Selecciona todas las filas pares (2, 4, 6...) del cuerpo de la tabla */
#personal-data-report-table tbody tr:nth-child(even) {
    background-color: #f0f8ff; /* AliceBlue - Un tono celeste muy suave */
}
/* --- FIN DEL ZEBRA STRIPING --- */


/* Efecto hover para resaltar la fila sobre la que está el ratón */
#personal-data-report-table tbody tr:hover {
    background-color: #e0e7ff; /* Un tono índigo muy claro */
    cursor: default;
}

/* --- Estilos para la Tabla de Reporte Económico --- */

/* Estilo base (reutilizamos el de la otra tabla) */
#economic-report-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    box-shadow: var(--shadow);
}

#economic-report-table th, 
#economic-report-table td {
    padding: 0.8rem 1rem;
    border: 1px solid var(--border);
    text-align: left;
}

#economic-report-table th {
    background-color: var(--success); /* Cabecera verde */
    color: white;
    font-weight: 700;
}

/* Zebra striping VERDE */
#economic-report-table tbody tr:nth-child(even) {
    background-color: #f0fff4; /* Honeydew - Un verde muy pálido */
}

/* Resaltado al pasar el ratón */
#economic-report-table tbody tr:hover {
    background-color: #dcfce7;
}

/* Clase para el texto en rojo si no ha pagado */
.pago-pendiente {
    color: var(--danger);
    font-weight: bold;
}

/* --- Estilos para la Fila de Totales del Reporte --- */
#economic-report-table tfoot tr {
    background-color: var(--surface-dark);
    font-weight: 700; /* Texto en negrita */
}

#economic-report-table tfoot td {
    border-top: 2px solid var(--primary); /* Línea superior más gruesa */
    color: var(--text);
}

/* --- Estilos para Reporte Horario Agrupado por Día --- */

/* Estilo base para la tabla horaria */
#time-log-report-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    box-shadow: var(--shadow);
}

#time-log-report-table th, 
#time-log-report-table td {
    padding: 0.8rem 1rem;
    border: 1px solid var(--border);
    text-align: left;
}

#time-log-report-table th {
    background-color: var(--primary); /* Cabecera azul para diferenciar */
    color: white;
}

/* Fila con color de fondo alterno para agrupar por día */
#time-log-report-table .day-group-alternate {
    background-color: #fffbeb; /* Un naranja/amarillo muy pálido */
}

/* Efecto hover se mantiene para todas las filas */
#time-log-report-table tbody tr:hover {
    background-color: #e0e7ff; 
}

/* Estilo para los botones de acción en tablas */
.action-btn {
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
    margin-right: 0.25rem;
}

/* --- Estilos para Formulario de Entrada de Contabilidad --- */
.entry-form-container {
    background-color: var(--surface);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-row {
    display: flex;
    gap: 1.5rem;
    align-items: flex-end; /* Alinea los elementos en la parte inferior */
}

.entry-form-container .form-group {
    margin-bottom: 0;
    width: 100%;
}

/* --- Estilos de Tabla Genéricos y Mejorados --- */
.styled-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    box-shadow: var(--shadow);
    font-size: 0.9rem;
}

.styled-table th, 
.styled-table td {
    padding: 0.8rem 1rem;
    border: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.styled-table thead th {
    background-color: var(--primary);
    color: white;
    font-weight: 700;
    position: sticky; /* Cabecera pegajosa al hacer scroll */
    top: 0;
}

.styled-table tbody tr:nth-child(even) {
    background-color: #f7fafc; /* Un gris muy, muy claro */
}

.styled-table tbody tr:hover {
    background-color: #eef2ff;
}

.styled-table tfoot tr {
    background-color: var(--surface-dark);
    font-weight: 700;
    border-top: 3px solid var(--primary);
}

/* Estilo para la celda del Gran Total Anual */
#annual-report-table .grand-total-cell {
    background-color: var(--danger);
    color: white;
    font-size: 1.1rem;
}

/* --- Estilos para la Subida de Ficheros --- */
.file-name-display {
    font-size: 0.85rem;
    color: var(--text-light);
    font-style: italic;
    margin-right: 1rem;
    /* Evita que el texto se desborde si el nombre es muy largo */
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Estilo para el enlace del ticket en la tabla */
.ticket-link {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    background-color: var(--primary);
    color: white !important; /* Importante para sobreescribir otros estilos de 'a' */
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: background-color 0.2s;
}
.ticket-link:hover {
    background-color: #4f46e5;
}

/* =================================================================
   --- SECCIÓN DE ESTILOS PARA EL MÓDULO DE INVENTARIO ---
   ================================================================= */

/* --- Variables y Estilos Generales del Módulo --- */
/* (Usamos las variables globales de la app, pero estas son específicas si se necesitaran) */

#papeleria-view,
#reporte-inventario-view,
#inventory-product-modal,
#inventory-reassign-modal {
    --inv-primary: #4a6fa5;
    --inv-secondary: #6d9dc5;
    --inv-accent: #ff7b9c;
    --card-shadow: 0 10px 20px rgba(0,0,0,0.1);
    /*--transition: all 0.3s ease;*/
}

/* --- Contenedores Principales del Módulo --- */
#papeleria-view .filters,
#reporte-inventario-view .location-report {
    background: white;
    border-radius: 12px;
    padding: 20px 25px;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 2rem;
    margin-top: 1.5rem; /* <-- AÑADE ESTA LÍNEA */
}

#papeleria-view .filter-group,
#reporte-inventario-view .location-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#papeleria-view .filter-group label,
#reporte-inventario-view .location-selector label {
    font-weight: 600;
    color: var(--inv-primary);
    margin-bottom: 0;
}

#papeleria-view .filter-select,
#papeleria-view .search-box input {
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 1rem;
    background: var(--surface-dark);
}

#papeleria-view .search-box {
    position: relative;
    flex: 2;
}
#papeleria-view .search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}
#papeleria-view .search-box input {
    padding-left: 40px;
    width: 100%;
}

/* --- Botones de Ubicación --- */
#inventory-location-buttons,
#report-location-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

#inventory-location-buttons .location-btn,
#report-location-selector .location-btn {
    padding: 10px 20px;
    border-radius: 50px;
    background: var(--surface-dark);
    border: 2px solid var(--border);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

#inventory-location-buttons .location-btn.active, 
#inventory-location-buttons .location-btn:hover,
#report-location-selector .location-btn.active,
#report-location-selector .location-btn:hover {
    background: var(--inv-primary);
    color: white;
    border-color: var(--inv-primary);
}


/* --- Grid de Productos --- */
#inventory-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

#inventory-products-grid .product-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

#inventory-products-grid .product-card:hover {
    transform: translateY(-5px);
}

#inventory-products-grid .product-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid var(--border);
}

#inventory-products-grid .product-emoji {
    font-size: 36px;
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

#inventory-products-grid .product-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 5px;
}
#inventory-products-grid .product-category {
    font-size: 14px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 5px;
}

#inventory-products-grid .product-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#inventory-products-grid .product-meta {
    display: flex;
    justify-content: space-between;
}

#inventory-products-grid .location {
    font-size: 14px;
    background: rgba(74, 111, 165, 0.1);
    padding: 6px 12px;
    border-radius: 50px;
    color: var(--inv-primary);
    font-weight: 500;
}

#inventory-products-grid .quantity {
    font-size: 28px;
    font-weight: 700;
    color: var(--inv-primary);
}
#inventory-products-grid .quantity.low {
    color: var(--danger);
}

#inventory-products-grid .actions {
    display: flex;
    gap: 10px;
}

#inventory-products-grid .action-btn {
    flex: 1;
    padding: 10px;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
#inventory-products-grid .action-btn.edit { background: var(--warning-light); color: var(--warning); }
#inventory-products-grid .action-btn.reassign { background-color: var(--primary-light); color: var(--primary); }


/* --- Vista de Reportes de Inventario --- */
#reporte-inventario-view .reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

#reporte-inventario-view .report-card {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: var(--card-shadow);
}
#reporte-inventario-view .report-card h3 { margin-top: 0; }

#reporte-inventario-view .stat {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
#reporte-inventario-view .stat:last-child { border-bottom: none; }
#reporte-inventario-view .stat-label { font-weight: 500; }
#reporte-inventario-view .stat-value { font-weight: 700; font-size: 18px; }
#reporte-inventario-view .stat-value.low { color: var(--danger); }

#reporte-inventario-view .products-table {
    width: 100%;
    border-collapse: collapse;
}

#reporte-inventario-view .products-table th, 
#reporte-inventario-view .products-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
}
#reporte-inventario-view .products-table th { background: var(--surface-dark); }
#reporte-inventario-view .status-badge {
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
}
#reporte-inventario-view .status-badge.low { background: #fee2e2; color: var(--danger); }
#reporte-inventario-view .status-badge.ok { background: #dcfce7; color: var(--success); }

#inventory-product-modal .modal-header,
#inventory-reassign-modal .modal-header {
    padding: 20px;
    background: var(--inv-primary);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
#inventory-product-modal .modal-header h2,
#inventory-reassign-modal .modal-header h2 { font-size: 22px; }

#inventory-product-modal .close-modal,
#inventory-reassign-modal .close-modal {
    background: rgba(255,255,255,0.2);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

#inventory-product-modal .modal-body,
#inventory-reassign-modal .modal-body {
    padding: 25px;
}

#inventory-product-modal .form-control,
#inventory-reassign-modal .form-control {
    width: 100%;
}
#inventory-product-modal .form-row { display: flex; gap: 15px; }
#inventory-product-modal .form-row .form-group { flex: 1; }

#inventory-product-modal .emoji-selector {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: 10px;
    max-height: 150px;
    overflow-y: auto;
    padding: 10px;
    background: var(--surface-dark);
    border-radius: 8px;
}
#inventory-product-modal .emoji-option { font-size: 24px; cursor: pointer; padding: 5px; border-radius: 8px; }
#inventory-product-modal .emoji-option:hover { background: rgba(74, 111, 165, 0.1); }
#inventory-product-modal .emoji-option.selected { background: rgba(74, 111, 165, 0.2); }

/* Reassign Modal */
#inventory-reassign-modal .location-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 10px;
}
#inventory-reassign-modal .location-option {
    padding: 15px;
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
}
#inventory-reassign-modal .location-option.selected { border-color: var(--inv-primary); background: #eef2ff; }
#inventory-reassign-modal .location-option .emoji { font-size: 28px; margin-bottom: 8px; }

/*
   (He omitido intencionadamente algunos estilos de tu fichero original como los de alerta 
   y botones de cantidad, ya que los implementaremos con la lógica de JS para que se
   integren mejor con nuestro sistema.)
*/

/* Estilo para los grupos de radio buttons en el formulario de cocina */
#kitchen-records-form .form-group.radio-group {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

/* --- Estilos para Tablas de Control Diario (Cocina) --- */
.daily-check-table {
    table-layout: auto; /* El navegador calculará el ancho */
    width: 100%;       /* Aseguramos que ocupe todo el espacio */
}

.daily-check-table th,
.daily-check-table td {
    width: 2.5%; /* Espacio para 31 días + conceptos */
    text-align: center;
    padding: 0.5rem 0.2rem;
    font-size: 0.85rem;
}

.daily-check-table th:first-child,
.daily-check-table td:first-child {
    width: 20%; /* Columna de conceptos más ancha */
    text-align: left;
    font-weight: 700;
}

.daily-check-table th:nth-child(2),
.daily-check-table td:nth-child(2) {
    width: 10%; /* Columna de frecuencia */
}

.daily-check-table tfoot td {
    text-align: left;
}

/* Estilo para las celdas con la cruz (check) */
.check-mark {
    color: var(--success);
    font-size: 1.2rem;
    font-weight: bold;
}
/* ... */
.check-mark.supervisor-check {
    color: var(--primary); /* La cruz de supervisión en azul */
}
/* ... */

.report-header-center {
    text-align: center;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 1rem;
}
.report-header-center h3 {
    margin-bottom: 0.5rem;
}
.report-header-center p {
    font-weight: 500;
    color: var(--text-light);
    margin: 0;
}

/* --- Estilos para Columnas de Supervisión en Reportes --- */

/* Estilo para la celda de cabecera y datos de supervisión */
.supervisor-col {
    border-left: 3px solid var(--primary) !important; /* Línea azul gruesa a la izquierda */
}

/* Un estilo un poco más sutil para el texto de incidencias */
.incidencia-text {
    font-size: 0.8rem;
    color: var(--text-light);
    white-space: pre-wrap; /* Respeta saltos de línea */
}

/* --- ESTILOS PARA EL MÓDULO DE LISTA DE LA COMPRA --- */
.shop-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.shop-product-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 90px;
    padding: 0.5rem;
    background-color: var(--surface-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.shop-product-btn:hover {
    background-color: var(--primary-light);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.shop-product-btn .icon {
    font-size: 2rem;
}

.shop-product-btn .name {
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

#shop-listContainer ul {
    list-style: none;
    padding: 0;
}

#shop-listContainer li {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border);
}

#shop-listContainer li .item-name {
    flex-grow: 1;
}

#shop-listContainer li .quantity-input {
    width: 60px;
    text-align: center;
    margin: 0 0.5rem;
}

/* --- Estilos para Botones de Icono --- */
.btn-icon {
    width: 40px;  /* Ancho fijo */
    height: 40px; /* Alto fijo */
    padding: 0;   /* Quitamos el padding para que el icono se centre */
    border-radius: 50%; /* Lo hacemos redondo */
    flex-shrink: 0; /* Evita que se encoja si el nombre es largo */
}

.btn-icon i {
    font-size: 1rem; /* Tamaño del icono */
}
/* --- Estilos para Grupo de Botones de Acción (Ancho Fijo) --- */
.action-buttons-group {
    display: flex;
    flex-direction: column; /* Apila los botones verticalmente */
    align-items: center; /* Centra el grupo de botones */
    gap: 0.75rem;
}

.action-buttons-group .btn {
    width: 300px; /* O el ancho que prefieras, ej: 250px */
    max-width: 100%; /* Asegura que en pantallas pequeñas no se desborde */
    justify-content: center; /* Centra el texto e icono dentro del botón */
}

/* --- Estilo para Imágenes dentro de Botones --- */
.btn-icon-img {
    width: 20px;  /* Ajusta el tamaño como necesites */
    height: 20px; /* Ajusta el tamaño como necesites */
    margin-right: 0.5rem; /* Espacio entre el icono y el texto */
}