/* ========================================================
   0. IDENTIDAD VISUAL CORPORATIVA (COMUNIDAD DE GRACIA)
======================================================== */
/* 🌟 Importamos las fuentes exactas del sitio oficial */
@import url('https://fonts.googleapis.com/css2?family=Alice&family=Open+Sans:wght@400;600;700&family=Playfair+Display:wght@400;700&display=swap');

:root {
    /* 🌟 Colores Oficiales extraídos de Divi */
    --color-primario: #1d3945; /* Azul oscuro corporativo principal */
    --color-secundario: #001426; /* Azul noche (casi negro) */
    --color-acento: #2ea3f2; /* Azul vibrante para enlaces */
    --color-fondo: #f4f7f6; /* Gris muy suave para fondos */
    
    /* 🌟 Tipografías Oficiales */
    --fuente-titulos: 'Alice', Georgia, serif;
    --fuente-texto: 'Open Sans', Arial, sans-serif;
    --fuente-alterna: 'Playfair Display', serif;
}

/* Aplicamos las fuentes generales a todo el cuerpo */
body {
    font-family: var(--fuente-texto);
}

/* Aplicamos la fuente elegante a todos los títulos importantes */
h1, h2, h3, h4, h5, h6, .titulo-mes-prog, .titulo-inventario {
    font-family: var(--fuente-titulos);
    color: var(--color-primario);
}

/* 🌟 Clase maestra para crear botones con el estilo oficial de la iglesia */
.btn-iglesia {
    font-family: var(--fuente-texto);
    color: #ffffff;
    background-color: var(--color-primario);
    border: 2px solid var(--color-primario);
    border-radius: 100px; /* Bordes totalmente curvos (estilo píldora) */
    letter-spacing: 2px; /* Separación de letras oficial */
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 12px 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-iglesia:hover {
    background-color: transparent;
    color: var(--color-primario);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* ========================================================
   1. ESTILOS GENERALES Y BASE
======================================================== */
* { box-sizing: border-box; } 

body { 
    font-family: 'Segoe UI', Arial, sans-serif; 
    background-color: #f4f7f6; 
    color: #333;
    margin: 0; 
    padding: 10px; 
}

.container { 
    max-width: 1800px; 
    width: 100%; 
    margin: 0 auto; 
    overflow-x: hidden; 
} 

.header, .header-bar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    background-color: #ffffff;
    padding: 15px 20px;
    margin-bottom: 20px; 
    flex-wrap: wrap; 
    gap: 10px; 
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.seccion-oculta {
    display: none !important;
}

/* ========================================================
   2. COMPONENTES DE TARJETAS (CARDS)
======================================================== */
.card { 
    background: white; 
    border-radius: 8px; 
    padding: 20px; 
    margin-bottom: 20px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); 
    border-top: 4px solid #FF9800; /* Naranja por defecto */
    width: 100%; 
    box-sizing: border-box;
}

/* Variaciones de color para bordes de tarjetas */
.card-azul { border-top-color: #3498db !important; }
.card-verde { border-top-color: #4CAF50 !important; }
.card-rojo { border-top-color: #d9534f !important; }

.card h3 { 
    margin-top: 0; 
    color: #d35400; /* Naranja Activos */
    border-bottom: 2px solid #fdf2e9; 
    padding-bottom: 10px; 
    font-size: 16px;
}

/* Título azul para Consumo */
.card-azul h3 { 
    color: #2980b9 !important; 
    border-bottom-color: #e3f2fd !important; 
}

/* ========================================================
   3. BOTONES (Generales)
======================================================== */
.btn { 
    padding: 10px 15px; 
    border-radius: 5px; 
    text-decoration: none; 
    font-weight: bold; 
    border: none; 
    cursor: pointer; 
    transition: 0.2s; 
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn:hover { opacity: 0.8; transform: translateY(-1px); }

/* Colores de botones */
.btn-principal { background-color: #e67e22; color: white; } /* Naranja */
.btn-azul { background-color: #3498db; color: white; }      /* Azul */
.btn-verde { background-color: #4CAF50; color: white; }     /* Verde */
.btn-rojo { background-color: #d9534f; color: white; }      /* Rojo */
.btn-gris { background-color: #e0e0e0; color: #333; }       /* Gris */

/* Botón ancho completo para formularios */
.btn-block { width: 100%; justify-content: center; margin-top: 10px; }

/* ========================================================
   4. FORMULARIOS Y ENTRADAS
======================================================== */
label { 
    display: block; 
    margin-top: 12px; 
    font-weight: bold; 
    font-size: 13px; 
    color: #555;
}

select, input[type="number"], input[type="text"], input[type="month"], input[type="date"], input[type="time"], textarea { 
    width: 100%; 
    padding: 10px; 
    margin-top: 5px; 
    border: 1px solid #ccc; 
    border-radius: 5px; 
    box-sizing: border-box; 
    font-family: inherit;
    font-size: 14px;
}

select:focus, input:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 5px rgba(52,152,219,0.2);
}

.filtro-caja { 
    display: flex; 
    gap: 10px; 
    align-items: flex-end; 
    background: #fdf2e9; /* Fondo naranja claro */
    padding: 15px; 
    border-radius: 8px; 
    margin-bottom: 20px; 
    flex-wrap: wrap; 
    border: 2px solid #e67e22;
}

.filtro-caja-azul { 
    background: #e3f2fd !important; 
    border-color: #3498db !important; 
}

/* ========================================================
   5. ESTILOS PARA TABLAS RESPONSIVAS Y BOTONES DE ACCIÓN
======================================================== */

/* Contenedor para permitir scroll horizontal solo en la tabla */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* Scroll suave en dispositivos iOS */
    margin-bottom: 15px;
    border-radius: 8px; /* Opcional: suaviza las esquinas del contenedor */
}

.table-responsive table {
    width: 100%;
    border-collapse: collapse; /* Mantiene las líneas de la tabla limpias y unidas */
}

/* Estructura base para todos los botones de acción en las tablas */
.btn-accion {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
    margin: 2px;
    box-sizing: border-box;
}

/* Diseño para el botón de Desactivar (Naranja) */
.btn-naranja {
    background-color: #ff9800;
    color: white;
    box-shadow: 0 2px 4px rgba(255, 152, 0, 0.3);
}

.btn-naranja:hover {
    background-color: #f57c00;
    box-shadow: 0 4px 8px rgba(255, 152, 0, 0.4);
    transform: translateY(-1px);
}

/* Diseño para el botón de Retirar/Borrar (Gris con texto rojo) */
.btn-gris {
    background-color: #f8f9fa;
    color: #d32f2f;
    border: 1px solid #dee2e6;
}

.btn-gris:hover {
    background-color: #e2e6ea;
    border-color: #c8cbcf;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

/* ========================================================
   6. PESTAÑAS (TABS)
======================================================== */
.tab-buttons { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 8px; 
    margin-bottom: 15px; 
    border-bottom: 2px solid #eee; 
    padding-bottom: 10px; 
}

.tab-btn { 
    flex: 1 1 auto; 
    background: #f9f9f9; 
    border: 1px solid #ddd; 
    padding: 10px; 
    font-weight: bold; 
    cursor: pointer; 
    color: #555; 
    border-radius: 5px; 
    text-align: center; 
    font-size: 13px; 
}

.tab-btn.active { background: #FF9800; color: white; border-color: #FF9800; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ========================================================
   7. GRILLA DE HORARIO (ADMIN Y EXPORTACIÓN)
======================================================== */
.grilla-horario {
    display: grid;
    grid-template-columns: repeat(4, max-content);
    gap: 15px;
    margin-bottom: 35px;
    align-items: start;
    justify-content: start; 
}

@media (min-width: 1600px) {
    .grilla-horario { grid-template-columns: repeat(5, max-content); }
}

/* ========================================================
   8. DASHBOARD Y CONFIRMACIÓN (VISTA USUARIO)
======================================================== */
.tarjeta-fecha {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.barra-envio {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    padding: 20px;
    box-shadow: 0 -5px 15px rgba(0,0,0,0.1);
    text-align: center;
    z-index: 100;
    display: none;
    animation: subir 0.3s ease-out forwards;
}

@keyframes subir {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* ========================================================
   9. ETIQUETAS Y BADGES
======================================================== */
.badge-ingreso { background-color: #e3f2fd; color: #1565c0; padding: 3px 8px; border-radius: 12px; font-weight: bold; font-size: 11px; }
.badge-salida { background-color: #ffebee; color: #c62828; padding: 3px 8px; border-radius: 12px; font-weight: bold; font-size: 11px; }
.cat-tag { font-size: 10px; padding: 2px 6px; border-radius: 4px; background: #f5f5f5; border: 1px solid #ddd; color: #666; }
.stock-bajo { color: #d9534f; font-weight: bold; }

/* ========================================================
   10. MEDIA QUERIES (RESPONSIVIDAD)
======================================================== */
@media (max-width: 1100px) {
    .grid-turnos { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .grid-superior { grid-template-columns: 1fr; }
    .header-bar h2 { font-size: 1.2rem; }
    .tab-btn { font-size: 11px; padding: 8px 5px; }
}

@media (max-width: 480px) {
    table.tarjeta-turno td, table.tarjeta-turno th { padding: 8px 5px !important; font-size: 12px; }
    .container { padding: 5px; }
}

/* ========================================================
   11. CUADRÍCULA DE INSUMOS (ACTIVOS Y CONSUMO)
======================================================== */
.grid-superior { 
    display: grid; 
    grid-template-columns: 1fr 1fr 2fr; 
    gap: 20px; 
    margin-bottom: 20px; 
}

@media (max-width: 1200px) { 
    .grid-superior { grid-template-columns: 1fr 1fr; } 
    .tabla-resumen { grid-column: 1 / -1; } 
}

@media (max-width: 768px) { 
    .grid-superior { grid-template-columns: 1fr; } 
}

/* Centrar textos en tablas */
.text-centro { text-align: center; }

/* Etiqueta pequeña para las categorías */
.cat-tag { 
    font-size: 10px; 
    padding: 2px 6px; 
    border-radius: 4px; 
    background: #f5f5f5; 
    border: 1px solid #ddd; 
    color: #666; 
    text-transform: uppercase;
}

/* ========================================================
   12. BOTONES DEL DASHBOARD (ME APUNTO / LLENO)
======================================================== */
.btn-apuntar {
    width: 100%;
    padding: 12px;
    background-color: white;
    color: #4CAF50;
    border: 2px solid #4CAF50;
    border-radius: 8px;
    font-weight: bold;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 15px;
}

.btn-apuntar:hover { 
    background-color: #e8f5e9; 
}

.btn-seleccionado {
    background-color: #4CAF50 !important;
    color: white !important;
    border: 2px solid #4CAF50 !important;
    box-shadow: 0 4px 10px rgba(76, 175, 80, 0.3);
}

.btn-lleno {
    width: 100%;
    padding: 12px;
    background-color: #f5f5f5;
    color: #9e9e9e;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-weight: bold;
    font-size: 15px;
    cursor: not-allowed;
    margin-top: 15px;
}

/* ========================================================
   13. SELECTOR DE INVENTARIOS (MENÚ PRINCIPAL)
======================================================== */
.titulo-inventario { 
    color: #2c3e50; 
    font-size: 28px; 
    margin-bottom: 5px; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
}

.subtitulo-inventario { 
    color: #7f8c8d; 
    font-size: 16px; 
    margin-bottom: 40px; 
}

.grid-inventarios { 
    display: flex; 
    gap: 30px; 
    justify-content: center; 
    flex-wrap: wrap; 
}

.card-inventario {
    background: white; 
    border-radius: 15px; 
    padding: 40px 20px; 
    width: 300px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05); 
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    border: 2px solid transparent;
}

/* 🔵 Tarjeta de Consumo */
.card-consumo:hover { transform: translateY(-5px); box-shadow: 0 15px 25px rgba(52, 152, 219, 0.2); border-color: #3498db; }
.card-consumo .icono { background: #e3f2fd; color: #3498db; }

/* 🟠 Tarjeta de Activos Fijos */
.card-activos:hover { transform: translateY(-5px); box-shadow: 0 15px 25px rgba(230, 126, 34, 0.2); border-color: #e67e22; }
.card-activos .icono { background: #fdf2e9; color: #e67e22; }

/* 🌟 NUEVO: 🟣 Tarjeta de Librería y Recursos */
.card-libreria:hover { transform: translateY(-5px); box-shadow: 0 15px 25px rgba(156, 39, 176, 0.2); border-color: #9c27b0; }
.card-libreria .icono { background: #f3e5f5; color: #9c27b0; }

.icono { 
    width: 80px; 
    height: 80px; 
    border-radius: 50%; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    font-size: 35px; 
    margin-bottom: 20px; 
}

.card-inventario-titulo { 
    color: #333; 
    font-size: 20px; 
    font-weight: bold; 
    margin-bottom: 10px; 
}

.card-inventario-texto { 
    color: #666; 
    font-size: 14px; 
    line-height: 1.5; 
    padding: 0 10px; 
}

/* ========================================================
   14. SELECTOR DE MINISTERIOS Y SUPER-ADMIN
======================================================== */
.perfiles-grid {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 60px; 
}

.perfil-card {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.2s ease;
}

.perfil-card:hover {
    transform: translateY(-5px);
}

.avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 50px;
    margin-bottom: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s ease, border 0.2s ease;
    border: 4px solid transparent;
}

.perfil-card:hover .avatar {
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    border: 4px solid #ddd;
}

.nombre-ministerio {
    color: #5f6368;
    font-size: 16px;
    font-weight: 600;
    transition: color 0.2s ease;
}

.perfil-card:hover .nombre-ministerio {
    color: #202124;
}

/* Alertas y Mensajes Flash */
.alert {
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    margin-bottom: 20px;
    width: 100%;
    max-width: 600px;
}
.alert-error { background-color: #ffebee; color: #c62828; border: 1px solid #ffcdd2; }
.alert-success { background-color: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }

/* ========================================================
   15. MENÚ DESPLEGABLE EN EL PANEL GLOBAL (TRES PUNTOS)
======================================================== */
.dropdown-container {
    position: relative;
    display: inline-block;
}

.btn-dots {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #555;
    padding: 5px 15px;
    border-radius: 5px;
    transition: background-color 0.2s;
}

.btn-dots:hover {
    background-color: #e0e0e0;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: white;
    min-width: 220px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    border-radius: 8px;
    z-index: 1000;
    overflow: hidden;
    border: 1px solid #eee;
    text-align: left;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    padding: 12px 15px;
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    font-weight: bold;
    transition: background 0.2s;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover:not([disabled]) {
    background-color: #f8f9fa;
}

.dropdown-item[disabled] {
    color: #aaa;
    cursor: not-allowed;
}

.dropdown-item.danger {
    color: #d32f2f;
}

/* ========================================================
   16. PESTAÑA DE HORARIOS Y TARJETAS DE TURNOS
======================================================== */
/* Contenedor de la tarjeta individual */
.contenedor-tarjeta-turno {
    border: 2px solid #33691e;
    border-radius: 6px;
    overflow: hidden;
    background: white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Tabla dentro de la tarjeta */
.tarjeta-turno {
    border-collapse: collapse;
    width: 100%;
    height: 100%;
    table-layout: auto;
    flex-grow: 1; /* Estira la tabla para llenar el contenedor si este crece */
}

/* Cabeceras de la tabla */
.tarjeta-turno thead th {
    border-bottom: 2px solid #33691e;
}

.header-fecha {
    background-color: #f1f8e9;
    padding: 12px 8px;
    text-align: center;
}

.header-fecha-titulo {
    color: #33691e;
    font-weight: bold;
    font-size: 15px;
    text-transform: uppercase;
}

.header-fecha-sub {
    font-size: 13px;
    color: #555;
    text-transform: uppercase;
    margin: 4px 0 8px 0;
}

.header-sub-fila {
    background-color: #f9fbe7;
    border-bottom: 1px solid #c8e6c9;
}

/* Columna de ÁREA (Se adapta al texto más largo) */
.col-area {
    width: 1%; /* Truco para que se encoja al tamaño del texto */
    white-space: nowrap; /* Evita que el texto salte a la siguiente línea */
    border-right: 1px solid #c8e6c9;
    padding: 10px 15px;
    text-align: center;
    vertical-align: middle;
    font-weight: bold;
    font-size: 13px;
}

.col-area-header {
    font-size: 12px;
    color: #555;
}
/* Columnas de Horas (Se dividen el espacio restante) */
.col-hora {
    padding: 8px;
    text-align: center;
    color: #d84315;
    font-size: 13px;
    border-right: 1px solid #c8e6c9;
    width: 1%;
    white-space: nowrap; /* Mantiene la hora en una sola línea horizontal*/
}

.col-hora:last-child {
    border-right: none;
}

.col-hora-cuerpo {
    vertical-align: top;
    border-right: 1px solid #ccc;
}

.col-hora-cuerpo:last-child {
    border-right: none;
}

/* Filas del cuerpo de la tabla */
.fila-area {
    border-bottom: 1px solid #ccc;
}

.fila-area:nth-child(odd) {
    background-color: #e3f2fd; /* Azul muy claro para celdas impares */
}

.fila-area:nth-child(even) {
    background-color: #fff; /* Blanco para celdas pares */
}

/* Fila especial de Responsable */
.fila-responsable-contenedor {
    background-color: #fff9c4 !important; /* Amarillo claro */
}

.texto-responsable {
    color: #f57f17 !important;
}

/* Elementos internos de la celda de horas (Nombres y Botones) */
.contenedor-celda {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: flex-start;
}

.lista-asignados-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 5px;
}

.item-asignado {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: bold;
    color: #333;
    padding: 4px 0;
    border-bottom: 1px dashed #ddd;
    word-break: break-word;
}
.item-asignado span {
    white-space: normal;
    line-height: 1.3;
    padding-right: 5px; /* Da un pequeño respiro antes de la X de eliminar */
}

.btn-quitar-persona {
    background: transparent;
    border: none;
    color: #d9534f;
    cursor: pointer;
    font-size: 12px;
    padding: 0 0 0 6px;
    font-weight: bold;
    display: none; /* Oculto por defecto hasta activar edición */
}

/* Selectores para añadir personas */
.select-persona {
    display: none; /* Oculto por defecto hasta activar edición */
    width: 100%;
    padding: 6px;
    border: 1px dashed #2196F3;
    background: #f0f8ff;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
}

.select-persona-resp {
    border-color: #f57f17;
    background: #fffde7;
    color: #f57f17;
    font-weight: bold;
}

/* Encabezados del panel */
.header-mes-prog {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #dcedc8;
    padding: 15px;
    border: 2px solid #33691e;
    border-radius: 5px;
    margin-bottom: 25px;
}

.titulo-mes-prog {
    margin: 0;
    color: #33691e;
    font-size: 22px;
    text-transform: uppercase;
}

.titulo-dia {
    color: #33691e;
    border-bottom: 2px solid #33691e;
    padding-bottom: 5px;
    margin-top: 10px;
    font-size: 20px;
}

.panel-horario-export {
    background: white; 
    padding: 20px; 
    border-radius: 8px; 
    border: 2px solid #ddd; 
    overflow-x: auto;
}

/* ==========================================
   AJUSTES GENERALES - DISEÑO RESPONSIVO
   ========================================== */

/* 1. Comportamiento por defecto (Computadoras/Tablets) - Lado a Lado compactos */
.grupo-ajustes {
    flex: 0 0 auto; /* 🌟 EL TRUCO: 0 para que no se estire como un chicle */
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 2. Comportamiento en Celulares (Pantallas de 600px o menos) - Apilados */
@media (max-width: 600px) {
    .grupo-ajustes {
        flex-direction: column;      /* Cambia la fila por una columna */
        align-items: flex-start;     /* Alinea los textos a la izquierda */
        gap: 5px;                    /* Reduce un poco el espacio vertical */
        width: 100%;                 /* 🌟 NUEVO: Asegura que ocupe todo el ancho en el celular */
    }

    /* Hacemos que los selectores y la caja de números ocupen el 100% del ancho del celular */
    .grupo-ajustes select, 
    .grupo-ajustes input[type="number"] {
        width: 100% !important;
    }
}

/* ========================================================
   17. MÓDULO DE LIBRERÍA Y MOVIMIENTOS EXPANDIBLES
======================================================== */

/* Miniatura de la portada del libro en la tabla */
.portada-miniatura { 
    width: 45px; 
    height: 65px; 
    object-fit: cover; 
    border-radius: 4px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.2); 
}

/* Centrado vertical para la fila cuando hay imagen */
.fila-libro td { 
    vertical-align: middle; 
}

/* 🌟 Widget Expandible de Detalles (details / summary) */
details summary { 
    cursor: pointer; 
    color: #3498db; /* Azul corporativo para indicar que es clickeable */
    font-weight: bold; 
    font-size: 13px; 
    outline: none; 
}

details[open] summary { 
    color: #e67e22; /* Cambia a naranja cuando está abierto */
}

/* Caja gris claro que aparece al expandir los detalles */
.detalle-movimiento { 
    background: #f9f9f9; 
    padding: 10px; 
    margin-top: 5px; 
    border-radius: 5px; 
    font-size: 13px; 
    border-left: 3px solid #ccc; 
}

/* ========================================================
   18. MODALES OSCUROS (LIBRERÍA)
======================================================== */
.modal-overlay {
    display: none; 
    position: fixed; 
    top: 0; left: 0; 
    width: 100%; height: 100%; 
    background: rgba(0,0,0,0.8); 
    z-index: 1000; 
    justify-content: center; 
    align-items: center; 
    backdrop-filter: blur(3px);
}

.modal-caja {
    background: white; 
    padding: 25px; 
    border-radius: 8px; 
    width: 90%; 
    max-width: 450px; 
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    max-height: 90vh; 
    overflow-y: auto;
}

.caja-info-libro {
    display: flex; 
    gap: 15px; 
    margin-bottom: 20px; 
    background: #f9f9f9; 
    padding: 15px; 
    border-radius: 8px; 
    align-items: center;
}

/* ========================================================
   19. RESALTADO INTELIGENTE DE FILAS (UNIFICADO)
======================================================== */
/* Estilo base para las filas de las tablas */
.table-responsive tbody tr {
    transition: background-color 0.3s ease, outline 0.2s ease;
    cursor: pointer;
}

/* 1. Efecto al pasar el mouse (Solo en computadoras) */
@media (hover: hover) {
    .table-responsive tbody tr:hover {
        background-color: #f0f7ff !important; /* Azul muy pálido */
    }
}

/* 2. Estilo de FILA SELECCIONADA (Clic en móvil o PC) */
.fila-seleccionada-unica {
    background-color: #fff3e0 !important; /* Naranja suave */
    outline: 2px solid #ff9800; /* Borde naranja */
    position: relative;
    z-index: 1; /* Para que el borde se vea sobre las otras filas */
}

/* ========================================================
   20. OPTIMIZACIÓN DE CÁMARA (ESCÁNER)
======================================================== */

#lector-camara-venta video,
#lector-camara-venta canvas.drawingBuffer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Evita que la cámara se vea estirada/aplastada */
}

/* ========================================================
   21. OPTIMIZACIÓN DE CÁMARA (ESCÁNER MULTIPANTALLA)
======================================================== */
#lector-camara-venta video,
#lector-camara-venta canvas.drawingBuffer,
#lector-camara video,
#lector-camara canvas.drawingBuffer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Evita que la cámara se vea estirada/aplastada */
}

/* ========================================================
   22. ANIMACIÓN DE ALERTA (Nuevos Turnos)
======================================================== */
@keyframes latido {
    0% { box-shadow: 0 0 0 0 rgba(255, 152, 0, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(255, 152, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 152, 0, 0); }
}

/* ========================================================
   23. AJUSTES RESPONSIVOS PARA TABLAS (LIBRERÍA)
======================================================== */

/* 1. Comportamiento del contenedor de "Inventario" y "Arqueo" */
.grid-tablas-inventario {
    display: grid;
    grid-template-columns: 1fr 1fr; /* En PC: mitad y mitad */
    gap: 20px;
    align-items: start;
    margin-bottom: 20px;
}

/* 2. Scroll horizontal táctil para todas las tablas (Desglose, Apartados, Inventario, Arqueo, Histórico) */
.table-responsive {
    width: 100%;
    overflow-x: auto; /* Permite el scroll si la tabla es ancha */
    -webkit-overflow-scrolling: touch; /* Scroll suave y con inercia en celulares */
    padding-bottom: 10px; /* Espacio debajo de la tabla para que no se pegue al scrollbar */
    margin-bottom: 15px;
}

/* Evitamos que el texto dentro de las tablas se aplaste en celulares */
.table-responsive table {
    width: 100%;
    min-width: 600px; /* Obliga a la tabla a mantener un ancho legible. ¡Aquí nace el scroll! */
    border-collapse: collapse;
}

/* Excepciones de ancho para tablas que necesitan más espacio (Arqueo y Apartados) */
.card h3:contains("Arqueo") + .table-responsive table,
.card h4:contains("Apartados") + .table-responsive table {
    min-width: 800px; /* Obliga a estas tablas a ser más anchas para no aplastar sus muchas columnas */
}


/* 3. Media Query para Celulares y Tablets pequeñas */
@media screen and (max-width: 992px) {
    /* Apila "Inventario" arriba y "Arqueo" abajo */
    .grid-tablas-inventario {
        grid-template-columns: 1fr; /* Una sola columna en móviles */
        gap: 25px;
    }
}

/* ========================================================
   24. AIRE Y ESPACIO EN LAS TABLAS CON SCROLL
======================================================== */

/* 1. Aumentamos el relleno (aire) dentro de cada celda de las tablas */
.table-responsive table th,
.table-responsive table td {
    padding: 5px 10px !important; /* Arriba/Abajo 15px, Izquierda/Derecha 25px (¡Cámbialo a 35px si quieres más espacio!) */
    white-space: nowrap; /* Evita que el texto de una celda se parta en dos renglones */
}

/* 2. Forzamos un ancho mínimo MÁS GRANDE para que la tabla empuje el scroll */
.table-responsive table {
    min-width: 800px; /* Ancho mínimo para Desglose, Inventario e Histórico */
}

/* 3. Aún más ancho para las tablas con muchísimas columnas */
.card h3:contains("Arqueo") + .table-responsive table,
.card h4:contains("Apartados") + .table-responsive table {
    min-width: 1000px; /* Obligamos a que sea súper ancha para que quede mucho aire */
}

/* =========================================
   25. ANIMACIÓN DE ESPERA (ESTILO GEMINI - CRUZ)
   ========================================= */
#overlay-espera {
    display: flex;
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh; /* Respaldo para navegadores antiguos */
    height: 100dvh; /* 🌟 Centrado milimétrico en celulares (ignora las barras de navegación) */
    background: #000000;
    z-index: 99999;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#canvas-gemini-cross {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
}

/* 🌟 ESTILOS PARA TU IMAGEN / LOGO */
.logo-splash {
    max-width: 350px; /* Ajusta este valor si tu logo se ve muy grande o pequeño */
    height: auto;
    opacity: 0;
    /* Usa la misma animación elegante de revelado */
    animation: fadeInUpGemini 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) 0.5s forwards;
    /* Le da un resplandor celestial sutil alrededor a las letras de tu imagen */
    filter: drop-shadow(0px 4px 15px rgba(168, 199, 250, 0.3)); 
}

.espera-content {
    position: relative;
    z-index: 2;
    text-align: center;
    pointer-events: none; 
    margin-top: 120px; /* 🌟 Bajamos el texto un poco para que la Cruz brille sola exactamente en el medio */
}

/* 🌟 Animación elegante de revelado de texto (Nítida) */
@keyframes fadeInUpGemini {
    0% {
        opacity: 0;
        transform: translateY(30px);
        filter: blur(6px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0px) drop-shadow(0px 4px 10px rgba(168, 199, 250, 0.15)); 
        /* Termina en 0 exacto y aplica un brillo sutil */
    }
}

.espera-titulo {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-weight: 500; /* Más peso para mayor nitidez */
    letter-spacing: -0.5px;
    margin: 0 0 15px 0;
    font-size: 44px;
    background: linear-gradient(90deg, #ffffff 30%, #a8c7fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    
    /* 🌟 Motores de alta resolución para el texto */
    -webkit-font-smoothing: antialiased; 
    -moz-osx-font-smoothing: grayscale; 
    
    opacity: 0; 
    animation: fadeInUpGemini 1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.5s forwards;
}

.espera-texto {
    font-family: system-ui, -apple-system, sans-serif;
    color: #a8c7fa; 
    font-weight: 400; /* Letra un poco más gruesa para que no se pierda */
    max-width: 400px;
    margin: 0 auto;
    font-size: 18px;
    line-height: 1.5;
    
    -webkit-font-smoothing: antialiased; 
    -moz-osx-font-smoothing: grayscale;
    
    opacity: 0; 
    animation: fadeInUpGemini 1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.9s forwards;
}

/* =========================================
   26. ENTRADA CASCADA Y BRILLO DE ESPEJO (BOTONES MINISTERIO)
   ========================================= */

/* 1. Estado inicial de los botones (Ocultos y listos para entrar) */
.perfiles-grid > * {
    opacity: 0;
    transform: translateY(30px);
    position: relative;
    overflow: hidden; /* Asegura que el brillo no se salga de las esquinas redondeadas */
}

/* 2. La clase que JS añadirá para hacerlos aparecer */
.perfiles-grid.mostrar-cards > * {
    /* La entrada dura 0.6s con un efecto elástico suave */
    animation: cardFadeInUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes cardFadeInUp {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* 3. El Efecto de Brillo de Espejo / Vidrio */
.perfiles-grid > *::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 60%;
    height: 100%;
    /* Un gradiente blanco semi-transparente que simula la luz */
    background: linear-gradient(
        to right, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(255, 255, 255, 0.4) 50%, 
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-25deg); /* Inclina la luz en diagonal */
    animation: shineEspejo 5s infinite; /* Se repite cada 4 segundos */
    z-index: 10;
    pointer-events: none; /* 🌟 MUY IMPORTANTE: Permite que el botón se pueda clickear */
}

@keyframes shineEspejo {
    0% { left: -150%; }
    15% { left: 200%; }  /* La luz cruza rápidamente el botón */
    100% { left: 200%; } /* El resto del tiempo espera invisible */
}