/* =====================================================================================
   ARCHIVO: estilos.css - ESTÉTICA GLASSMORPHISM B2B V10.5 (MODULAR, MÓVIL Y COMPLEMENTARIO)
   ===================================================================================== */

:root {
    /* Paleta: Amarillo de Alto Contraste y Naranja Vivo */
    --accent-orange: #f97316;       
    --accent-yellow: #fde047;       
    --text-bright: #ffffff;
    --text-dim: #f1f5f9;            
    
    /* Configuración de Cristal (Glassmorphism Real) */
    --bg-glass-dark: rgba(10, 15, 25, 0.75);     
    --bg-glass-light: rgba(255, 255, 255, 0.05); 
    --border-glass: rgba(255, 255, 255, 0.12);   
    --blur-intensity: 20px;                      
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body, .base-theme {
    background-image: linear-gradient(rgba(10, 15, 25, 0.65), rgba(10, 15, 25, 0.85)), 
                      url('https://images.unsplash.com/photo-1581091226825-a6a2a5aee158?q=80&w=2560&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-bright);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ENCABEZADO FLOTANTE */
.identity-bar {
    background: var(--bg-glass-dark);
    backdrop-filter: blur(var(--blur-intensity));
    -webkit-backdrop-filter: blur(var(--blur-intensity));
    border-bottom: 1px solid var(--border-glass);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.brand-badge {
    background: linear-gradient(135deg, var(--accent-yellow), var(--accent-orange));
    color: #000;
    font-weight: 900;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.4);
}

/* PANELES DE CRISTAL (TARJETAS MODULARES) */
.card-theme, .card-login-glass {
    background: var(--bg-glass-light);
    backdrop-filter: blur(var(--blur-intensity));
    -webkit-backdrop-filter: blur(var(--blur-intensity));
    border: 1px solid var(--border-glass);
    border-radius: 20px; 
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-theme:hover {
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.7);
}

.card-modified {
    border-color: var(--accent-orange) !important;
    background: rgba(249, 115, 22, 0.08) !important;
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.25) !important;
}

/* INPUTS MODERNOS Y ESTADOS DISABLED (AJUSTES) */
.input-theme {
    background: rgba(0, 0, 0, 0.5) !important;
    border: 1px solid var(--border-glass) !important;
    border-radius: 12px;
    color: var(--text-bright) !important;
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

.input-theme:focus {
    outline: none;
    border-color: var(--accent-yellow) !important;
    box-shadow: 0 0 0 3px rgba(253, 224, 71, 0.25) !important;
    background: rgba(0, 0, 0, 0.7) !important;
}

.disabled-setting {
    opacity: 0.6;
    cursor: not-allowed;
    background: rgba(0, 0, 0, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
    color: #94a3b8 !important;
}

.disabled-setting:focus {
    box-shadow: none !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
}

/* BOTONES Y MICRÓFONO */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-yellow), var(--accent-orange)) !important;
    border: none;
    border-radius: 12px;
    color: #000 !important;
    font-weight: 800;
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.4);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:active {
    transform: scale(0.96);
}

.btn-voice {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-glass);
    color: var(--accent-yellow);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
}

/* Enlace directo con la lógica v10.5 del grabador */
.btn-voice.recording-active {
    background: rgba(239, 68, 68, 0.25) !important;
    color: #ef4444 !important;
    border-color: #ef4444 !important;
    animation: pulse-recording 1.5s infinite ease-in-out !important;
}

/* TABS NAVEGACIÓN (ESTABILIZADOS HORIZONTALMENTE) */
.tab-bar-theme {
    background: rgba(10, 15, 25, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-glass);
    border-bottom: 1px solid var(--border-glass);
}

.tab-button {
    color: #94a3b8; 
    transition: color 0.3s ease, border-color 0.3s ease;
    border-bottom: 2px solid transparent;
}

.tab-active {
    color: var(--accent-yellow) !important;
    font-weight: 800;
    border-bottom: 2px solid var(--accent-yellow) !important;
    background: rgba(253, 224, 71, 0.03);
}

/* GRILLA BUSCADOR MEILISEARCH (ALTA DENSIDAD) */
.btn-search-hit {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    color: var(--text-bright);
    font-weight: 600;
    font-size: 11px; 
    padding: 8px 10px; 
    text-align: left;
    line-height: 1.25;
    transition: all 0.2s;
}

.btn-search-hit:hover, .btn-search-hit:active {
    background: rgba(253, 224, 71, 0.15);
    border-color: var(--accent-yellow);
}

#search-results-container {
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
}

/* BOTONES TÁCTILES ACCIÓN (50px MÍNIMO) */
.btn-mobi-target {
    min-width: 50px;  
    min-height: 50px; 
    display: inline-flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.15s ease, transform 0.1s ease;
}

.btn-mobi-target:active {
    transform: scale(0.9);
}

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

#fiscal-sticky-bottom {
    background: rgba(10, 15, 25, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* LAYOUT MONITOR DE COMPUTADORA DESKTOP */
@media (min-width: 1025px) {
    #main-app {
        max-width: 1450px; 
        margin: 15px auto;
        border-radius: 24px;
        border: 1px solid var(--border-glass);
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
        background: rgba(0, 0, 0, 0.3); 
    }

    #search-results-container {
        max-height: 60vh !important; 
        padding: 8px;
    }

    .btn-search-hit {
        padding: 14px 18px; 
        font-size: 14px;
    }
}

/* ANIMACIÓN DE RADAR DE VOZ */
@keyframes pulse-recording {
    0% { 
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7), 
                    0 0 0 8px rgba(239, 68, 68, 0.4), 
                    0 0 0 16px rgba(239, 68, 68, 0.2); 
    }
    100% { 
        box-shadow: 0 0 0 18px rgba(239, 68, 68, 0), 
                    0 0 0 36px rgba(239, 68, 68, 0), 
                    0 0 0 54px rgba(239, 68, 68, 0); 
    }
}

/* =====================================================================================
   RESCATE V10.3: AJUSTES MÓVILES Y MODALES GLOBALES
   ===================================================================================== */

/* Capa de desenfoque absoluto para los modales que ahora viven en el index.html */
.modal-blur-overlay {
    background-color: var(--bg-glass-dark); 
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* Protección para que el botón de Generar PDF no se esconda detrás de la barra táctil del iPhone */
#fiscal-sticky-bottom {
    padding-bottom: calc(16px + env(safe-area-inset-bottom)) !important;
}

/* Permitir clic a través de los modales en dispositivos muy pequeños si fallara el z-index */
#draft-missing-sheet {
    max-height: 50vh;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.8);
}
