/* CeibeRRHH - Custom Styles */

/* Variables CSS para consistencia */
:root {
    --ceibe-primary: #2563eb;
    --ceibe-secondary: #64748b;
    --ceibe-accent: #f59e0b;
    --ceibe-success: #10b981;
    --ceibe-error: #ef4444;
    --ceibe-warning: #f59e0b;
    --ceibe-dark: #1e293b;
    --ceibe-light: #f8fafc;
    --ceibe-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --ceibe-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --ceibe-transition: all 0.3s ease;
}

/* Victor Mono - Fuente monoespaciada global */
@font-face {
    font-family: 'Victor Mono';
    src: url('../webfonts/VictorMono-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Victor Mono';
    src: url('../webfonts/VictorMono-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

/* Mobile navigation container - hide on desktop (768px+) */
#mobileNavContainer {
    display: flex;
}
@media (min-width: 768px) {
    #mobileNavContainer {
        display: none !important;
    }
}

/* Paginación de DataTables - Solo visible cuando hay más de 500 registros */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

.dataTables_paginate {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.dataTables_paginate .paginate_button {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    background: white;
    color: #475569;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.dataTables_paginate .paginate_button:hover:not(.disabled) {
    background: #f1f5f9;
    border-color: var(--ceibe-primary);
    color: var(--ceibe-primary);
}

.dataTables_paginate .paginate_button.current {
    background: var(--ceibe-primary);
    border-color: var(--ceibe-primary);
    color: white;
}

.dataTables_paginate .paginate_button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Estilos base */
body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--ceibe-light);
    color: var(--ceibe-dark);
}

/* Compensación para header fijo */
.main-content {
    padding-top: 80px; /* Desktop header height + margin */
}

@media (max-width: 768px) {
    .main-content {
        padding-top: 70px; /* Mobile header height + margin */
    }
}

/* Navigation Links */
.nav-link {
    position: relative;
    transition: all 0.2s ease-in-out;
}

.nav-link:hover {
    /* Sin movimiento, solo el efecto de gradiente del fondo */
}

.nav-link.active {
    color: var(--ceibe-primary) !important;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background-color: var(--ceibe-primary);
    border-radius: 1px;
}

/* Desktop Navigation with vertical icons */
@media (min-width: 768px) {
    .nav-link-vertical {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        padding: 8px 12px !important;
        min-width: 80px;
        position: relative;
        border-radius: 8px;
        transition: all 0.2s ease-in-out;
        border: 1px solid transparent;
    }
    
    .nav-link-vertical::before {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 100%;
        background: linear-gradient(to top, rgba(219, 234, 254, 0.8) 0%, transparent 70%);
        border-radius: 8px;
        opacity: 0;
        transition: opacity 0.2s ease-in-out;
        pointer-events: none;
    }
    
    .nav-link-vertical:hover {
        border-color: #bfdbfe;
    }
    
    .nav-link-vertical:hover::before {
        opacity: 1;
    }
    
    .nav-link-vertical i {
        font-size: 16px;
        margin: 0 !important;
        position: relative;
        z-index: 1;
    }
    
    .nav-link-vertical .nav-text {
        font-size: 12px;
        font-weight: 500;
        text-align: center;
        white-space: nowrap;
        position: relative;
        z-index: 1;
    }
    
    .nav-button-vertical {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        padding: 8px 12px !important;
        min-width: 80px;
        border: 1px solid transparent;
        background: none;
        cursor: pointer;
        position: relative;
        border-radius: 8px;
        transition: all 0.2s ease-in-out;
    }
    
    .nav-button-vertical::before {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 100%;
        background: linear-gradient(to top, rgba(219, 234, 254, 0.8) 0%, transparent 70%);
        border-radius: 8px;
        opacity: 0;
        transition: opacity 0.2s ease-in-out;
        pointer-events: none;
    }
    
    .nav-button-vertical:hover {
        border-color: #bfdbfe;
    }
    
    .nav-button-vertical:hover::before {
        opacity: 1;
    }
    
    .nav-button-vertical i {
        font-size: 16px;
        margin: 0 !important;
        position: relative;
        z-index: 1;
    }
    
    .nav-button-vertical .nav-text {
        font-size: 12px;
        font-weight: 500;
        text-align: center;
        white-space: nowrap;
        position: relative;
        z-index: 1;
    }
    
    .nav-button-vertical .chevron {
        display: none;
    }
}

/* Dropdown Links */
.dropdown-link {
    display: block;
    padding: 8px 16px;
    text-decoration: none;
    color: var(--ceibe-dark);
    font-size: 14px;
    transition: all 0.2s ease-in-out;
    border-left: 2.5px solid transparent;
}

.dropdown-link:hover {
    background-color: #dbeafe;
    color: var(--ceibe-dark);
    border-left: 2.5px solid #3b82f6;
}

.dropdown-link i {
    width: 16px;
    text-align: center;
}

/*
 * Flyout submenus (desktop header)
 * Evita el “hueco” entre el item padre y su submenú lateral.
 * El solape ligero mantiene el hover al mover el ratón.
 */
.flyout-menu {
    margin-left: -0.25rem !important; /* solapa sobre el menú padre cuando abre a la derecha */
}

.flyout-menu.flyout-left {
    left: auto !important;
    right: 100% !important;
    margin-left: 0 !important;
    margin-right: -0.25rem !important; /* solapa sobre el menú padre cuando abre a la izquierda */
}

/* Mobile Navigation */
.mobile-nav-link {
    transition: all 0.2s ease-in-out;
}

.mobile-nav-link:hover {
    transform: translateX(4px);
}

.mobile-nav-section {
    margin-bottom: 16px;
}

/* Botones personalizados */
.btn-ceibe {
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    outline: none;
    border: none;
    cursor: pointer;
}

.btn-ceibe:focus {
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.5);
}

.btn-primary {
    background-color: var(--ceibe-primary);
    color: white;
}

.btn-primary:hover {
    background-color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: var(--ceibe-shadow-lg);
}

.btn-primary:focus {
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.5);
}

.btn-secondary {
    background-color: var(--ceibe-secondary);
    color: white;
}

.btn-secondary:hover {
    background-color: #475569;
}

.btn-success {
    background-color: var(--ceibe-success);
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

.btn-warning {
    background-color: var(--ceibe-warning);
    color: white;
}

.btn-warning:hover {
    background-color: #d97706;
}

.btn-error {
    background-color: var(--ceibe-error);
    color: white;
}

.btn-error:hover {
    background-color: #dc2626;
}

/* Cards personalizadas */
.card-ceibe {
    background: white;
    border-radius: 12px;
    box-shadow: var(--ceibe-shadow-lg);
    padding: 24px;
    transition: all 0.3s ease;
}

.card-ceibe:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Inputs personalizados */
.input-ceibe {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    outline: none;
    transition: all 0.3s ease;
}

.input-ceibe:focus {
    border-color: var(--ceibe-primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.5);
}

/* Efectos hover para elementos interactivos */
.hover-lift {
    transition: transform 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-2px);
}

/* Loader personalizado */
.loader {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Dashboard tab loader */
.dash-spinner {
    animation: dashSpin 0.9s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes dashSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Animaciones personalizadas */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Heartbeat animation for discrepancy alerts */
@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    14% { transform: scale(1.08); }
    28% { transform: scale(1); }
    42% { transform: scale(1.08); }
    56% { transform: scale(1); }
}
.animate-heartbeat {
    animation: heartbeat 1.5s ease-in-out infinite;
}

/* Snake border animation for nomina discrepancy */
@property --nomina-snake-angle {
    syntax: '<angle>';
    inherits: false;
    initial-value: 0deg;
}
.nomina-snake-border {
    position: relative;
    border-radius: 0.5rem;
    overflow: hidden;
}
.nomina-snake-border::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 2px;
    border-radius: 0.5rem;
    background: conic-gradient(from var(--nomina-snake-angle), #f87171 0deg, #ef4444 70deg, #dc2626 110deg, #fca5a5 160deg, transparent 220deg, transparent 360deg);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    animation: nominaSnakeSpin 2.4s linear infinite;
    z-index: 0;
}
@keyframes nominaSnakeSpin {
    to { --nomina-snake-angle: 360deg; }
}

/* Badge bounce animation for notifications */
@keyframes badge-bounce {
    0%, 100% { 
        transform: scale(1); 
    }
    25% { 
        transform: scale(1.3); 
    }
    50% { 
        transform: scale(1); 
    }
    75% { 
        transform: scale(1.2); 
    }
}

.badge-bounce {
    animation: badge-bounce 0.6s ease-in-out 3;
}

/* New petition row highlight */
.new-petition-row {
    background-color: rgba(147, 51, 234, 0.1) !important;
    animation: pulse 1s ease-in-out infinite;
}

/* Responsive utilities */
@media (max-width: 640px) {
    .desktop-only {
        display: none !important;
    }
}

@media (min-width: 641px) {
    .mobile-only {
        display: none !important;
    }
}

/* Estilos de formularios específicos */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    color: var(--ceibe-dark);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--ceibe-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px 12px;
    padding-right: 40px;
}

/* Utilidades para charts */
.chart-container {
    position: relative;
    height: 256px;
    width: 100%;
}

@media (min-width: 768px) {
    .chart-container {
        height: 320px;
    }
}

/* Overlay de loading */
.loading-overlay {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ============================================
   DataTable Selector de Empleados
   ============================================ */
#selectorEmpleadosTable_wrapper .dataTables_filter {
    padding: 8px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

#selectorEmpleadosTable_wrapper .dataTables_filter input {
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    padding: 6px 12px;
    font-size: 0.875rem;
    width: 100%;
    margin-left: 0;
}

#selectorEmpleadosTable_wrapper .dataTables_filter input:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

#selectorEmpleadosTable tbody tr {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

#selectorEmpleadosTable tbody tr:hover {
    background-color: #f3f4f6 !important;
}

#selectorEmpleadosTable tbody td {
    padding: 8px 12px;
    font-size: 0.875rem;
}

#selectorEmpleadosTable thead th {
    padding: 8px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    color: #6b7280;
}

/* ============================================
   Dev Mode Toast - Advertencia de desarrollo
   ============================================ */
.dev-mode-toast {
    border: 2px solid #FF6B00 !important;
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.3) !important;
}

.dev-mode-title {
    font-weight: 700 !important;
    color: #FF6B00 !important;
    font-size: 0.95rem !important;
}

.dev-mode-toast .swal2-html-container {
    margin-top: 0.25rem !important;
    font-size: 0.85rem !important;
}

/* ============================================
   CeibeRRHH Toast Horizontal - Diseño compacto
   Barra ancha y baja, texto negro, fondo pálido
   ============================================ */

/* Romper el width:360px del contenedor de SweetAlert2 para toasts anchos */
body.swal2-toast-shown .swal2-container:has(.ceibe-toast-vertical) {
    width: auto !important;
    max-width: 720px !important;
}

/* Layout horizontal: ancho, bajo, fondo pálido */
.swal2-popup.swal2-toast.ceibe-toast-vertical {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0.75rem !important;
    padding: 0.5rem 1.5rem !important;
    min-width: 500px !important;
    max-width: 700px !important;
    width: max-content !important;
    position: relative !important;
    border-radius: 10px !important;
    border: 1px solid #e2e8f0 !important;
    background: #f8fafc !important;
    box-shadow:
        0 2px 8px -2px rgba(0, 0, 0, 0.08),
        0 4px 12px -4px rgba(0, 0, 0, 0.05) !important;
    overflow: hidden !important;
}

/* Icono pequeño a la izquierda */
.swal2-popup.swal2-toast.ceibe-toast-vertical .swal2-icon {
    order: 1 !important;
    margin: 0 !important;
    transform: scale(0.6) !important;
    transform-origin: center center !important;
    flex-shrink: 0 !important;
    width: 1.5rem !important;
    height: 1.5rem !important;
    min-width: 1.5rem !important;
}

/* Título: negro, bold, inline */
.swal2-popup.swal2-toast.ceibe-toast-vertical .swal2-title {
    order: 2 !important;
    margin: 0 !important;
    padding: 0 !important;
    justify-content: flex-start !important;
    flex-shrink: 0 !important;
}

/* Icono de éxito */
.swal2-popup.swal2-toast.ceibe-toast-vertical .swal2-icon.swal2-success {
    border-color: #10b981 !important;
}

.swal2-popup.swal2-toast.ceibe-toast-vertical .swal2-icon.swal2-success [class^='swal2-success-line'] {
    background-color: #10b981 !important;
}

.swal2-popup.swal2-toast.ceibe-toast-vertical .swal2-icon.swal2-success .swal2-success-ring {
    border-color: rgba(16, 185, 129, 0.3) !important;
}

/* Icono de error */
.swal2-popup.swal2-toast.ceibe-toast-vertical .swal2-icon.swal2-error {
    border-color: #ef4444 !important;
}

.swal2-popup.swal2-toast.ceibe-toast-vertical .swal2-icon.swal2-error .swal2-x-mark-line-left,
.swal2-popup.swal2-toast.ceibe-toast-vertical .swal2-icon.swal2-error .swal2-x-mark-line-right {
    background-color: #ef4444 !important;
}

/* Icono de warning */
.swal2-popup.swal2-toast.ceibe-toast-vertical .swal2-icon.swal2-warning {
    border-color: #f59e0b !important;
    color: #f59e0b !important;
}

/* Icono de info */
.swal2-popup.swal2-toast.ceibe-toast-vertical .swal2-icon.swal2-info {
    border-color: #3b82f6 !important;
    color: #3b82f6 !important;
}

/* Título: negro bold */
.swal2-popup.swal2-toast.ceibe-toast-vertical .swal2-title.ceibe-toast-title,
.ceibe-toast-title {
    color: #1e293b !important;
    font-weight: 700 !important;
    font-size: 0.8125rem !important;
    text-align: left !important;
    line-height: 1.3 !important;
    text-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    white-space: nowrap !important;
}

/* Barra de progreso en la parte inferior */
.swal2-popup.swal2-toast.ceibe-toast-vertical .swal2-timer-progress-bar-container {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 3px !important;
    border-radius: 0 0 10px 10px !important;
    overflow: hidden !important;
}

.swal2-popup.swal2-toast.ceibe-toast-vertical .swal2-timer-progress-bar {
    height: 3px !important;
    background: linear-gradient(90deg, #94a3b8, #64748b) !important;
}

/* HTML container: items en línea, negro normal */
.swal2-popup.swal2-toast.ceibe-toast-vertical .swal2-html-container {
    order: 3 !important;
    color: #334155 !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: left !important;
    flex: 1 !important;
    min-width: 0 !important;
}

/* Lista compacta de notificaciones en línea */
.ceibe-toast-compact-list {
    display: flex !important;
    align-items: center !important;
    gap: 0.875rem !important;
    flex-wrap: nowrap !important;
    overflow: hidden !important;
}

.ceibe-toast-compact-item {
    display: flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    font-size: 0.8125rem !important;
    font-weight: 400 !important;
    color: #334155 !important;
    white-space: nowrap !important;
}

.ceibe-toast-compact-item i {
    font-size: 0.75rem !important;
}

/* ============================================
   Toast Flip Animations
   ============================================ */
@keyframes toastFlipIn {
    0% {
        transform: perspective(400px) rotateX(90deg);
        opacity: 0;
    }
    40% {
        transform: perspective(400px) rotateX(-10deg);
    }
    70% {
        transform: perspective(400px) rotateX(10deg);
    }
    100% {
        transform: perspective(400px) rotateX(0deg);
        opacity: 1;
    }
}

@keyframes toastFlipOut {
    0% {
        transform: perspective(400px) rotateX(0deg);
        opacity: 1;
    }
    30% {
        transform: perspective(400px) rotateX(-10deg);
        opacity: 1;
    }
    100% {
        transform: perspective(400px) rotateX(90deg);
        opacity: 0;
    }
}

.toast-flip-in {
    animation: toastFlipIn 0.5s ease-out forwards;
}

.toast-flip-out {
    animation: toastFlipOut 0.4s ease-in forwards;
}

/* ============================================
   SweetAlert2 Alerts - Estilo unificado con Toasts
   ============================================ */

/* Animaciones flip para alertas normales */
@keyframes alertFlipIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes alertFlipOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

.alert-flip-in {
    animation: alertFlipIn 0.5s ease-out forwards !important;
}

.alert-flip-out {
    animation: alertFlipOut 0.2s ease-in forwards !important;
}

/* Icono SweetAlert "Acceso Inhabilitado" — círculo naranja con icono FA */
.swal2-icon.ceibe-icon-acceso-inhabilitado {
    border-color: #f97316;
    color: #f97316;
}
.swal2-icon.ceibe-icon-acceso-inhabilitado .swal2-icon-content {
    font-size: 2.5em;
    line-height: 1;
}

/* Backdrop — sincronizar velocidad con popup */
.swal2-backdrop-show {
    animation-duration: 0.5s !important;
}
.swal2-backdrop-hide {
    animation-duration: 0.2s !important;
}

/* Badge animado en títulos SweetAlert del dashboard */
@keyframes badgeFadeScale {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}
.swal-badge-title {
    animation: badgeFadeScale 0.4s ease-out both;
    animation-delay: 0.15s;
    opacity: 0;
}

/* SweetAlert sobre modales - z-index muy alto */
.swal-over-modal {
    z-index: 99999 !important;
}

/* Estilos visuales para alertas normales (igual que toasts) */
.swal2-popup.ceibe-alert {
    border-radius: 16px !important;
    border: 2px solid transparent !important;
    background-image: linear-gradient(white, white), linear-gradient(135deg, #4f46e5, #7c3aed) !important;
    background-origin: padding-box, border-box !important;
    background-clip: padding-box, border-box !important;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 10px 15px -3px rgba(0, 0, 0, 0.15),
        0 20px 25px -5px rgba(0, 0, 0, 0.1) !important;
}

/* Loader Modal - Estilo limpio tipo Portal */
.swal2-popup.ceibe-loader {
    border: 2px solid #000 !important;
    border-radius: 16px !important;
    padding: 2rem 1.5rem !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    background: white !important;
}

.swal2-popup.ceibe-loader .swal2-title {
    color: #1f2937 !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    margin-bottom: 1rem !important;
}

/* Ocultar icono en loader */
.swal2-popup.ceibe-loader .swal2-icon {
    display: none !important;
}

/* Animación de entrada/salida suave para loader */
.swal2-popup.ceibe-loader.swal2-show {
    animation: loaderFadeIn 0.2s ease-out !important;
}

.swal2-popup.ceibe-loader.swal2-hide {
    animation: loaderFadeOut 0.15s ease-in !important;
}

@keyframes loaderFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes loaderFadeOut {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* Desactivar animaciones por defecto de SweetAlert2 para alertas con clase ceibe-alert */
.swal2-popup.ceibe-alert.swal2-show {
    animation: none !important;
}

.swal2-popup.ceibe-alert.swal2-hide {
    animation: none !important;
}

/* ============================================
   Animaciones Fade In/Out para alertas
   ============================================ */
@keyframes alertFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes alertFadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

.alert-fade-in {
    animation: alertFadeIn 0.5s ease-out forwards !important;
}

.alert-fade-out {
    animation: alertFadeOut 0.2s ease-in forwards !important;
}

/* Animación para modales HTML */
@keyframes modalFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.animate-modal-fade-in {
    animation: modalFadeIn 0.5s ease-out forwards;
}

/* ============================================ */
/* DATATABLES - ESTILOS GLOBALES PERSONALIZADOS */
/* ============================================ */

/* Botones de DataTables (Copiar, Excel, PDF, Print, Recargar) - Solo iconos */
.dt-button,
.dt-buttons .dt-button {
    background: #dbeafe !important; /* bg-blue-50 */
    border: 1.5px solid #3b82f6 !important; /* border-blue-500 */
    border-radius: 8px !important;
    color: #1e40af !important; /* text-blue-800 */
    padding: 0 !important;
    font-size: 0 !important; /* Oculta el texto */
    width: 32px !important;
    height: 32px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    margin-right: 4px !important;
    margin-bottom: 0 !important;
}

.dt-button:hover,
.dt-buttons .dt-button:hover {
    background: #bfdbfe !important; /* bg-blue-100 */
    border-color: #2563eb !important; /* border-blue-600 */
    color: #1e3a8a !important; /* text-blue-900 */
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2) !important;
}

.dt-button:active,
.dt-buttons .dt-button:active {
    transform: translateY(0) !important;
    box-shadow: none !important;
}

.dt-button i,
.dt-buttons .dt-button i {
    margin-right: 0 !important;
    font-size: 14px !important;
}

/* Campo de búsqueda de DataTables */
.dataTables_filter input,
.dataTables_filter input[type="search"] {
    border: 1.5px solid #3b82f6 !important; /* border-blue-500 - mismo que botones */
    border-radius: 8px !important; /* mismo que botones */
    padding: 0 12px !important;
    height: 32px !important; /* mismo alto que botones */
    font-size: 0.875rem !important;
    transition: all 0.2s ease !important;
    margin-left: 0.5rem !important;
    box-sizing: border-box !important;
}

.dataTables_filter input:focus,
.dataTables_filter input[type="search"]:focus {
    outline: none !important;
    border-color: #2563eb !important; /* border-blue-600 */
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

.dataTables_filter input::placeholder,
.dataTables_filter input[type="search"]::placeholder {
    color: #9ca3af !important; /* text-gray-400 */
}

/* Contenedor de controles de DataTables */
.dataTables_wrapper .dataTables_filter {
    display: flex;
    align-items: center;
}

.dataTables_wrapper .dataTables_filter label {
    display: flex;
    align-items: center;
    margin: 0;
}

/* Responsive para botones en móviles */
@media (max-width: 640px) {
    .dt-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }

    .dt-button,
    .dt-buttons .dt-button {
        flex: 0 0 auto;
        min-width: auto;
        width: 32px !important;
        height: 32px !important;
        margin-right: 0 !important;
    }
}

/* ============================================================
   PANEL LATERAL
   ============================================================ */

/* Resize handle visual feedback */
#panelResizeHandle {
    background: transparent;
    transition: background-color 150ms;
}
#panelResizeHandle:hover {
    background: linear-gradient(180deg, transparent 20%, rgba(139, 92, 246, 0.3) 50%, transparent 80%);
}
#panelResizeHandle:active {
    background: rgba(139, 92, 246, 0.5);
}

/* Nota adhesiva font */
#panelNota {
    font-family: 'Victor Mono', 'Courier New', monospace;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.06);
}
#panelNota:focus {
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.06), 0 0 0 2px rgba(168, 85, 247, 0.15);
}

/* Todo item transitions */
#todoList .group,
#todoCompletedList .group {
    transition: background-color 150ms, opacity 150ms;
}

/* Checks pills - needed because Tailwind dynamic classes don't compile */
#checksPills .bg-red-100    { background-color: #fee2e2; }
#checksPills .text-red-700  { color: #b91c1c; }
#checksPills .border-red-300 { border-color: #fca5a5; }
#checksPills .bg-amber-100  { background-color: #fef3c7; }
#checksPills .text-amber-700 { color: #b45309; }
#checksPills .border-amber-300 { border-color: #fcd34d; }
#checksPills .bg-blue-100   { background-color: #dbeafe; }
#checksPills .text-blue-700 { color: #1d4ed8; }
#checksPills .border-blue-300 { border-color: #93c5fd; }

/* Notification tree */
.notif-chevron {
    transition: transform 150ms ease;
}
.notif-group button:hover .notif-chevron {
    color: #6b7280;
}

/* Scrollbar slim for panel */
#panelTabPrincipal::-webkit-scrollbar,
#panelTabNotificaciones::-webkit-scrollbar,
#todoList::-webkit-scrollbar,
#todoCompletedList::-webkit-scrollbar,
#checksContent::-webkit-scrollbar {
    width: 4px;
}
#panelTabPrincipal::-webkit-scrollbar-thumb,
#panelTabNotificaciones::-webkit-scrollbar-thumb,
#todoList::-webkit-scrollbar-thumb,
#todoCompletedList::-webkit-scrollbar-thumb,
#checksContent::-webkit-scrollbar-thumb {
    background: #9ca3af;
    border-radius: 4px;
}
#panelTabPrincipal::-webkit-scrollbar-track,
#panelTabNotificaciones::-webkit-scrollbar-track,
#todoList::-webkit-scrollbar-track,
#todoCompletedList::-webkit-scrollbar-track,
#checksContent::-webkit-scrollbar-track {
    background: #e5e7eb;
}

/* Pin button rotation base */
#panelPinBtn i {
    transition: transform 200ms ease, color 150ms;
}

/* iOS Toggle Switch */
.ios-toggle {
    position: relative;
    width: 36px;
    height: 20px;
    -webkit-appearance: none;
    appearance: none;
    background: #d1d5db;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s ease;
    flex-shrink: 0;
}
.ios-toggle:checked {
    background: #10b981;
}
.ios-toggle::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.ios-toggle:checked::before {
    transform: translateX(16px);
}
.ios-toggle:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Firmas: pulso stat-card Sin validar ── */
.firmas-pulse-low {
    animation: firmasPulseLow 2s ease-in-out infinite;
    border-color: #eab308 !important;
}
.firmas-pulse-mid {
    animation: firmasPulseMid 1.5s ease-in-out infinite;
    border-color: #f97316 !important;
}
.firmas-pulse-high {
    animation: firmasPulseHigh 1.2s ease-in-out infinite;
    border-color: #ea580c !important;
}
.firmas-pulse-crit {
    animation: firmasPulseCrit 0.8s ease-in-out infinite;
    border-color: #dc2626 !important;
}

@keyframes firmasPulseLow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(234, 179, 8, 0.4); }
    50% { box-shadow: 0 0 0 4px rgba(234, 179, 8, 0); }
}
@keyframes firmasPulseMid {
    0%, 100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.5); }
    50% { box-shadow: 0 0 0 6px rgba(249, 115, 22, 0); }
}
@keyframes firmasPulseHigh {
    0%, 100% { box-shadow: 0 0 0 0 rgba(234, 88, 12, 0.6); background-color: rgba(234, 88, 12, 0.05); }
    50% { box-shadow: 0 0 0 8px rgba(234, 88, 12, 0); background-color: rgba(234, 88, 12, 0.12); }
}
@keyframes firmasPulseCrit {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7); background-color: rgba(220, 38, 38, 0.05); }
    50% { box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); background-color: rgba(220, 38, 38, 0.15); }
}

.badge-baja-voluntaria {
    animation: bajaVoluntariaPulse 1.5s ease-in-out infinite;
}
@keyframes bajaVoluntariaPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(234, 88, 12, 0.5); }
    50% { box-shadow: 0 0 0 6px rgba(234, 88, 12, 0); }
}

/* Badge "No es válido" — para datos del empleado que no cumplen normativa */
@keyframes badgeNoValidoPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.55);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(220, 38, 38, 0);
        transform: scale(1.05);
    }
}
.badge-no-valido {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    margin-left: 0.4rem;
    border: 1px solid #DC2626;
    background: #FEE2E2;
    color: #DC2626;
    border-radius: 9999px;
    font-size: 0.6rem;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.02em;
    white-space: nowrap;
    vertical-align: middle;
    animation: badgeNoValidoPulse 1.6s ease-in-out infinite;
}

/* ──────────────────────────────────────────────────────────────
   Alertas de alta sensibilidad: borde grueso pulsante + backdrop coloreado
   ─ swal-danger-* : ROJO  (acciones críticas: ascender a Root, CeibeCONTA)
   ─ swal-warn-*   : NARANJA (acciones importantes: ascender a Admin)
   ──────────────────────────────────────────────────────────────*/
@keyframes ceibeDangerPulseRing {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.75), 0 25px 50px -12px rgba(0,0,0,.45); }
    50%      { box-shadow: 0 0 0 18px rgba(239, 68, 68, 0),  0 25px 50px -12px rgba(0,0,0,.45); }
}
.swal-danger-pulse {
    border: 4px solid #ef4444 !important;
    animation: ceibeDangerPulseRing 1.4s ease-in-out infinite;
}
.swal-danger-backdrop.swal2-container {
    background: rgba(127, 29, 29, 0.62) !important;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

@keyframes ceibeWarnPulseRing {
    0%, 100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.75), 0 25px 50px -12px rgba(0,0,0,.4); }
    50%      { box-shadow: 0 0 0 18px rgba(249, 115, 22, 0),  0 25px 50px -12px rgba(0,0,0,.4); }
}
.swal-warn-pulse {
    border: 4px solid #f97316 !important;
    animation: ceibeWarnPulseRing 1.4s ease-in-out infinite;
}
.swal-warn-backdrop.swal2-container {
    background: rgba(154, 52, 18, 0.58) !important;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

