.hidden {
    display: none !important;
}

/* --- HEADER PROFESIONAL V3 --- */

.admin-navigation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: #1a252f;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
}

/* Nivel 1: Logo y Usuario */
.admin-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 25px;
    background: #1a252f;
    color: white;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.admin-logo {
    font-size: 1.2rem;
    letter-spacing: 1px;
    color: #3498db;
}

.admin-user-info {
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-logout-header {
    background: #e74c3c;
    color: white;
    padding: 5px 12px;
    font-size: 0.75rem;
    border-radius: 4px;
}

/* Nivel 2: Navegación Principal */
.admin-nav-main {
    background: #2c3e50;
}

.admin-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0 15px;
}

.admin-menu > li {
    position: relative;
}

.admin-menu > li > a {
    display: block;
    padding: 12px 20px;
    color: #ecf0f1;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s;
}

.admin-menu > li:hover > a {
    background: #3498db;
    color: white;
}

/* Submenús Desplegables */
.admin-submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 220px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    display: none;
    list-style: none;
    padding: 8px 0;
    border-radius: 0 0 6px 6px;
    z-index: 1001;
}

.admin-submenu li a {
    display: block;
    padding: 10px 20px;
    color: #333;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.admin-submenu li a:hover {
    background: #f1f1f1;
    color: #3498db;
    padding-left: 25px;
}

.has-submenu:hover .admin-submenu {
    display: block;
}

/* --- AJUSTES DE ESPACIADO --- */

body.mode-admin #app-container {
    margin-top: 100px !important; /* Mantenemos el hueco para el Header V3 */
    padding: 0 !important;        /* ¡CLAVE! Quitamos los 25px de aire */
    width: 100% !important;
    max-width: 100% !important;   /* Por si tienes un max-width por ahí */
    height: calc(100vh - 100px);
    overflow: hidden;
}

/* 2. Aseguramos que la sección ocupe el 100% */
#view-monitor-jornada, 
.admin-worker-layout {
    width: 100%;
    height: 100%;
    margin: 0 !important;
    border-radius: 0; /* Quitamos redondeado para que pegue perfecto a los bordes */
    border: none;     /* Quitamos el borde exterior, ya tenemos divisiones internas */
}

/* 3. Ajuste de las columnas internas para que no bailen */
.worker-sidebar {
    height: 100%;
    border-right: 1px solid #e2e8f0;
}

.worker-main-content {
    height: 100%;
}

/* 4. Si tu body tiene un background gris, esto hará que el marco resalte */
body.mode-admin {
    background-color: #f1f5f9;
}


body.mode-worker #app-container {
    margin-top: 65px;
}

/* Contenedor para que la tabla no rompa el layout */
.table-responsive-informe {
    width: 100%;
    overflow-x: auto; /* Permite scroll lateral si no cabe */
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Estilo para que la tabla sea legible */
.tabla-informe-format {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem; /* Un poco más pequeña para que quepa más */
    min-width: 800px;   /* Forzamos un mínimo para que no se amontone el texto */
}

.tabla-informe-format th {
    background-color: #f1f5f9;
    color: #475569;
    text-align: left;
    padding: 10px;
    border-bottom: 2px solid #e2e8f0;
    position: sticky;
    top: 0; /* Cabecera fija al hacer scroll vertical */
}

.tabla-informe-format td {
    padding: 10px;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
}

/* Colores para filas alternas */
.tabla-informe-format tr:nth-child(even) {
    background-color: #f8fafc;
}

/* 1. La vista principal debe ocupar el 100% de la pantalla y no dejar salir nada */
#view-informe-individual {
    height: 100vh; /* Altura total de la ventana */
    overflow: hidden;
    display: flex;
}

/* 2. El panel derecho (donde está el informe) */
#panel-informe-detalle {
    height: 100vh;
    display: flex;
    flex-direction: column; /* Para que la cabecera se quede arriba y la tabla abajo */
    overflow: hidden; /* El panel en sí no hace scroll */
    flex: 1;
}

/* 3. El contenedor de la tabla (AQUÍ ES DONDE QUEREMOS EL SCROLL) */
#contenedor-resultado-informe {
    flex: 1; /* Ocupa todo el espacio sobrante debajo de los filtros */
    overflow-y: auto; /* Activa el scroll vertical */
    overflow-x: auto; /* Activa el scroll horizontal si la tabla es ancha */
    padding: 20px;
    background: #f8fafc;
}


/* --- RESET PARA IMPRESIÓN PROFESIONAL (COMPACTO Y SIN AIRE) --- */
@media print {
    @page {
        size: A4;
        /* El margen 0 absoluto es lo que mata la URL en Chrome/Edge */
        margin: 0 !important; 
    }

    /* 2. Aplicamos el margen real al body para que el contenido no se pegue al borde físico */
    body { 
        margin: 1.5cm; /* Esto sustituye al margen de la página */
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* 3. Tu código actual (mantenerlo para limpiar la interfaz) */
    .admin-navigation, .admin-header-top, .admin-nav-main, .panel-sidebar, 
    #sidebar, nav, #acciones-informe, button, .no-print, #informe-empty-state {
        display: none !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Reset estructural total para eliminar "aire" heredado del layout web */
    #app-container, 
    #view-informe-individual, 
    .admin-panel-container, 
    #panel-informe-detalle, 
    #contenedor-resultado-informe {
        display: block !important;
        height: auto !important;
        overflow: visible !important;
        position: static !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
    }

    /* --- ESTÉTICA DE TABLA COMPACTA --- */
    .table-container-resizer {
        margin-top: 5px !important; /* Subimos la tabla casi al borde del encabezado */
        margin-bottom: 45mm !important; /* Espacio reservado para las firmas fijas */
    }

    table {
        width: 100% !important;
        border-collapse: collapse !important;
        border: 0.5pt solid #334155 !important;
    }

    thead {
        display: table-header-group !important; /* Repite cabecera si hay 2 páginas */
    }

    thead tr {
        background-color: #1e293b !important;
        color: white !important;
    }

    th {
        padding: 5px 8px !important;
        border: 0.5pt solid #334155 !important;
        text-transform: uppercase;
        font-size: 7.5pt !important;
        letter-spacing: 0.2px;
    }

    td {
        padding: 3px 8px !important; /* Reducido para compactar filas */
        border: 0.5pt solid #e2e8f0 !important;
        color: #000 !important;
        vertical-align: middle;
    }

    /* Filas alternas sutiles para no gastar tinta pero ayudar a la vista */
    tbody tr:nth-child(even) {
        background-color: #f1f5f9 !important;
    }

    /* Pie de página de firmas (Fijado al final del folio) */
    .espacio-firmas-legal {
        display: block !important;
        position: fixed;
        bottom: 1cm;
        left: 1.5cm;
        right: 1.5cm;
        background: white !important;
        page-break-inside: avoid;
        border-top: none !important;
    }
}

    /* Contenedor del Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

/* Ocultar el checkbox real */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* El carril del switch */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 24px;
}

/* El círculo blanco */
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Color cuando está activo (Azul Actividades) */
.switch-actividad input:checked + .slider {
  background-color: #3498db;
}

/* Color cuando está activo (Naranja Eventos) */
.switch-evento input:checked + .slider {
  background-color: #e67e22;
}

/* Movimiento del círculo al activar */
input:checked + .slider:before {
  transform: translateX(22px);
}

/* Estilo adicional para las filas del panel */
.config-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #f1f1f1;
    transition: background 0.2s;
}

.config-row:hover {
    background-color: #f9f9fb;
}

.config-row span {
    font-weight: 500;
    color: #444;
    font-size: 0.95em;
}

/* --- CORRECCIÓN VISTA ACTIVIDADES V3 --- */

#view-actividades {
    
    width: 100% !important;
    height: auto !important;
    overflow-y: auto !important;
}

#view-actividades .config-grid-layout {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important; /* Forzamos 2 columnas reales */
    gap: 25px !important;
    padding: 25px !important;
    width: 100% !important;
    max-width: 1400px; /* Evita que en pantallas ultra-anchas se estiren demasiado */
    margin: 0 auto;
    box-sizing: border-box !important;
}

.config-card {
    min-width: 0; 
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    align-self: start; /* Evita que una tarjeta crezca para igualar a la otra */
}

.card-header {
    padding: 15px 20px;
    border-bottom: 2px solid #f1f5f9;
}

.actividad-border { border-bottom-color: #3498db !important; }
.evento-border { border-bottom-color: #e67e22 !important; }

/* Responsive para tablets/móvil */
@media (max-width: 950px) {
    #view-actividades .config-grid-layout {
        grid-template-columns: 1fr !important;
    }
}