/* ==============================================================================
   SHIFT ERP - SISTEMA DE ESTILOS GLOBALES Y REGIONALES (GLOBAL CSS)
   ============================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

/* --- CONFIGURACIÓN BASE DE CUERPO Y FUENTES PREMUM --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f8fafc;
    color: #0f172a;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- ANIMACIONES & EFECTOS --- */
.fade-in {
    animation: fadeIn 0.25s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.mirror {
    transform: scaleX(-1);
}

.camera-container {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    background: #000;
}

/* --- ESTILIZACIÓN DE BARRAS DE DESPLAZAMIENTO --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ==============================================================================
   ESTILOS REFORZADOS FALLBACK PARA NUEVOS MÓDULOS & COMPONENTES
   (Sin interferir con clases especificas de Tailwind o botones de pestañas)
   ============================================================================== */

.btn-default {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 0.875rem;
    transition: all 0.15s ease-in-out;
    cursor: pointer;
}

/* Estilos de Modales Fallback */
.shift-modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.shift-modal-content {
    background-color: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    max-width: 32rem;
    width: 100%;
    overflow: hidden;
}

/* ==============================================================================
   ESTILOS OFICIALES DE IMPRESIÓN - BOLETAS Y REPORTES SHIFT
   ============================================================================== */
@media print {
    @page {
        margin: 10mm 12mm;
        size: letter portrait;
    }
    
    html, body {
        height: auto !important;
        overflow: visible !important;
        background: #ffffff !important;
        font-size: 9pt !important;
        color: #0f172a !important;
    }
    
    #root, #root > div, main {
        height: auto !important;
        overflow: visible !important;
        display: block !important;
    }
    
    nav, button, select, input, aside, header, .print\:hidden, [class*="z-[100]"], [class*="z-[140]"] { 
        display: none !important; 
    }
    
    .print-table {
        width: 100% !important;
        border-collapse: collapse !important;
    }
    
    .print-table th, .print-table td {
        padding: 4px 6px !important;
        border: 1px solid #cbd5e1 !important;
        font-size: 8pt !important;
    }
    
    .print-table th {
        background-color: #f1f5f9 !important;
        font-weight: bold !important;
        text-transform: uppercase !important;
    }

    body:has(.print-modal-overlay) #root > div > aside,
    body:has(.print-modal-overlay) #root > div > header,
    body:has(.print-modal-overlay) main > *:not(.print-modal-overlay) {
        display: none !important;
    }

    .print-modal-overlay {
        position: static !important;
        inset: auto !important;
        background: white !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        padding: 0 !important;
        margin: 0 !important;
        display: block !important;
        width: 100% !important;
        height: auto !important;
        box-shadow: none !important;
        border: none !important;
    }
    
    .print-modal-container {
        position: static !important;
        max-width: 100% !important;
        width: 100% !important;
        max-height: none !important;
        height: auto !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        background: white !important;
        overflow: visible !important;
    }
    
    .print-document-sheet {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        box-shadow: none !important;
        border: none !important;
        background: white !important;
        overflow: visible !important;
    }
    
    .avoid-break {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .page-break {
        break-after: page;
        page-break-after: always;
    }
}

/* ==============================================================================
   OPTIMIZACIÓN UX EXCLUSIVA PARA EL PANEL DE ADMINISTRACIÓN EN MÓVIL Y TABLET
   (Sin alterar la versión de escritorio lg: ni la vista de marcadas de empleados)
   ============================================================================== */

/* Safe area inset padding para iOS / Android */
.pb-safe {
    padding-bottom: max(1rem, env(safe-area-inset-bottom, 1rem));
}

/* Animación de entrada Bottom Sheet */
.slide-up-sheet {
    animation: slideUpSheet 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Responsive tables & cards para dispositivos móviles (< 1024px) */
@media (max-width: 1023px) {
    /* Optimización de celdas de tablas en pantallas táctiles */
    .admin-mobile-table-cell {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
        font-size: 0.75rem !important;
    }
    
    /* Prevenir desbordamientos horizontales por textos extensos */
    .admin-mobile-truncate {
        max-width: 130px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Ocultar elementos secundarios en pantallas muy reducidas */
    .admin-mobile-hide-secondary {
        display: none !important;
    }
}

