/* Estilos principales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, #0E0F5E 0%, #1a1b7a 100%);
    position: relative;
    overflow-x: hidden;
}

/* Fondo animado con robots y juguetes */
.animated-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.toy-element {
    position: absolute;
    font-size: 2.5rem;
    opacity: 0.9;
    animation: float 15s infinite linear;
    filter: drop-shadow(0 3px 6px rgba(255, 255, 255, 0.4)) drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.6), 0 2px 4px rgba(0, 0, 0, 0.3);
    transform-style: preserve-3d;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    z-index: 10;
    pointer-events: auto;
}

/* Efectos hover para iconos flotantes */
.toy-element:hover {
    transform: scale(1.3) rotate(15deg);
    opacity: 1;
    filter: drop-shadow(0 5px 15px rgba(255, 255, 255, 0.8)) drop-shadow(0 0 20px rgba(255, 255, 255, 0.6));
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.9), 0 3px 6px rgba(0, 0, 0, 0.4);
    animation-play-state: paused;
}

/* Efectos de click para iconos flotantes */
.toy-element:active {
    transform: scale(1.1) rotate(-10deg);
    filter: drop-shadow(0 2px 8px rgba(255, 255, 255, 0.9)) drop-shadow(0 0 25px rgba(255, 255, 255, 0.8));
}

/* Animación de pulso para iconos clickeados */
.toy-element.clicked {
    animation: toyPulse 0.6s ease-out;
}

/* Efecto de click mejorado */
.toy-element.clicked {
    transform: scale(1.6) rotate(360deg) !important;
    filter: brightness(1.5) drop-shadow(0 0 25px rgba(255, 255, 255, 0.8)) !important;
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
}

/* Animación de partículas */
@keyframes particleExplosion {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--dx), var(--dy)) scale(0);
        opacity: 0;
    }
}

/* Cursor pointer para iconos */
.toy-element {
    cursor: pointer;
    user-select: none;
}

@keyframes toyPulse {
    0% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.4) rotate(180deg);
        filter: drop-shadow(0 8px 20px rgba(255, 255, 255, 1)) drop-shadow(0 0 30px rgba(255, 255, 255, 0.9));
    }
    50% {
        transform: scale(1.2) rotate(360deg);
    }
    75% {
        transform: scale(1.3) rotate(540deg);
    }
    100% {
        transform: scale(1) rotate(720deg);
    }
}

/* Efectos especiales para diferentes tipos de juguetes */
.toy-element:nth-child(1):hover, .toy-element:nth-child(7):hover {
    filter: drop-shadow(0 5px 15px rgba(251, 191, 36, 0.8)) drop-shadow(0 0 20px rgba(251, 191, 36, 0.6));
}

.toy-element:nth-child(2):hover, .toy-element:nth-child(8):hover {
    filter: drop-shadow(0 5px 15px rgba(59, 130, 246, 0.8)) drop-shadow(0 0 20px rgba(59, 130, 246, 0.6));
}

.toy-element:nth-child(3):hover, .toy-element:nth-child(9):hover {
    filter: drop-shadow(0 5px 15px rgba(239, 68, 68, 0.8)) drop-shadow(0 0 20px rgba(239, 68, 68, 0.6));
}

.toy-element:nth-child(4):hover, .toy-element:nth-child(10):hover {
    filter: drop-shadow(0 5px 15px rgba(34, 197, 94, 0.8)) drop-shadow(0 0 20px rgba(34, 197, 94, 0.6));
}

.toy-element:nth-child(5):hover, .toy-element:nth-child(11):hover {
    filter: drop-shadow(0 5px 15px rgba(168, 85, 247, 0.8)) drop-shadow(0 0 20px rgba(168, 85, 247, 0.6));
}

.toy-element:nth-child(6):hover, .toy-element:nth-child(12):hover {
    filter: drop-shadow(0 5px 15px rgba(236, 72, 153, 0.8)) drop-shadow(0 0 20px rgba(236, 72, 153, 0.6));
}

.toy-element:nth-child(1) { animation-delay: 0s; }
.toy-element:nth-child(2) { animation-delay: -2s; }
.toy-element:nth-child(3) { animation-delay: -4s; }
.toy-element:nth-child(4) { animation-delay: -6s; }
.toy-element:nth-child(5) { animation-delay: -8s; }
.toy-element:nth-child(6) { animation-delay: -10s; }
.toy-element:nth-child(7) { animation-delay: -12s; }
.toy-element:nth-child(8) { animation-delay: -14s; }

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    5% {
        opacity: 0.9;
    }
    95% {
        opacity: 0.9;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* Animación de movimiento lateral */
.toy-element:nth-child(odd) {
    animation-name: floatLeft;
}

.toy-element:nth-child(even) {
    animation-name: floatRight;
}

@keyframes floatLeft {
    0% {
        transform: translateY(100vh) translateX(-50px) rotate(0deg);
        opacity: 0;
    }
    5% {
        opacity: 0.9;
    }
    50% {
        transform: translateY(50vh) translateX(50px) rotate(180deg);
        opacity: 0.9;
    }
    95% {
        opacity: 0.9;
    }
    100% {
        transform: translateY(-100px) translateX(-50px) rotate(360deg);
        opacity: 0;
    }
}

@keyframes floatRight {
    0% {
        transform: translateY(100vh) translateX(50px) rotate(0deg);
        opacity: 0;
    }
    5% {
        opacity: 0.9;
    }
    50% {
        transform: translateY(50vh) translateX(-50px) rotate(180deg);
        opacity: 0.9;
    }
    95% {
        opacity: 0.9;
    }
    100% {
        transform: translateY(-100px) translateX(50px) rotate(360deg);
        opacity: 0;
    }
}

/* Estilos del contenedor principal */
.container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 2rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.header-logo {
    max-width: 300px;
    height: auto;
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    background: rgba(255, 255, 255, 0.9);
    padding: 1rem;
    border-radius: 1rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.main-title {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    color: white;
    margin-bottom: 1rem;
}

.header-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-item strong {
    font-size: 2rem;
    font-weight: bold;
    color: #fbbf24;
}

.stat-item span {
    font-size: 0.875rem;
    opacity: 0.9;
    text-align: center;
}

/* Indicadores de progreso */
.progress-indicators {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 400px;
    margin: 0 auto 4rem;
    gap: 1rem;
    padding: 2rem 0;
}

.step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.step-circle {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: all 0.3s ease;
    border: 2px solid;
    font-size: 1.125rem;
}

.step-circle.active {
    background-color: #4f46e5;
    border-color: #4f46e5;
    color: white;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.2);
}

.step-circle.completed {
    background-color: #059669;
    border-color: #059669;
    color: white;
}

.step-circle:not(.active):not(.completed) {
    background-color: white;
    border-color: #d1d5db;
    color: #6b7280;
}

.step-text {
    position: absolute;
    top: 4.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    white-space: nowrap;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    padding: 0 1rem;
    text-align: center;
    z-index: 10;
}

.progress-line {
    flex: 1;
    height: 2px;
    margin: 0 1rem;
    transition: all 0.3s ease;
    background-color: #d1d5db;
}

.progress-line:not(.inactive) {
    background-color: #4f46e5;
}

/* Formulario */
.form-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    margin-top: 2rem;
}

.form-section {
    padding: 2rem;
    transition: all 0.3s ease-in-out;
}

.form-section.hidden {
    display: none;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Campos de formulario */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

/* Asteriscos rojos para campos requeridos */
.form-label {
    position: relative;
}

/* Hacer que todos los asteriscos en labels sean rojos */
.form-label {
    color: #374151;
}

.form-label::before {
    content: '';
}

/* Estilo específico para asteriscos */
.form-label:contains('*') {
    color: #374151;
}

/* Usar JavaScript para cambiar color de asteriscos */
.asterisk-red {
    color: #dc2626 !important;
    font-weight: bold;
}

/* Modal de Bienvenida */
.welcome-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.95) 0%, rgba(55, 48, 163, 0.95) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    backdrop-filter: blur(10px);
}

.welcome-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.welcome-modal-content {
    background: white;
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.4s ease;
    position: relative;
}

.welcome-modal-overlay.show .welcome-modal-content {
    transform: scale(1) translateY(0);
}

.welcome-modal-header {
    background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
    color: white;
    padding: 2rem;
    border-radius: 1.5rem 1.5rem 0 0;
    text-align: center;
    position: relative;
}

.welcome-modal-logo {
    max-width: 120px;
    height: auto;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.75rem;
    border-radius: 0.75rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.welcome-modal-title {
    font-size: 1.75rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.welcome-modal-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0;
}

.welcome-modal-body {
    padding: 2rem;
}

.welcome-instructions {
    margin-bottom: 2rem;
}

.welcome-instructions h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.instruction-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.instruction-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background: #f8fafc;
    border-radius: 0.5rem;
    border-left: 4px solid #4f46e5;
    transition: all 0.2s ease;
}

.instruction-item:hover {
    background: #f1f5f9;
    transform: translateX(2px);
}

.instruction-icon {
    font-size: 1.25rem;
    margin-top: 0.125rem;
    flex-shrink: 0;
}

.instruction-text {
    font-size: 0.875rem;
    color: #374151;
    line-height: 1.5;
    margin: 0;
}

.instruction-text strong {
    color: #1f2937;
    font-weight: 600;
}

.welcome-modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.btn-accept {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(5, 150, 105, 0.3);
}

.btn-accept:hover {
    background: linear-gradient(135deg, #047857 0%, #065f46 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(5, 150, 105, 0.4);
}

.btn-cancel {
    background: #6b7280;
    color: white;
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel:hover {
    background: #4b5563;
}

/* Animación de entrada */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.welcome-modal-content.animate-in {
    animation: modalSlideIn 0.4s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
    .welcome-modal-content {
        width: 95%;
        margin: 1rem;
        max-height: 85vh;
    }
    
    .welcome-modal-header {
        padding: 1.5rem;
    }
    
    .welcome-modal-body {
        padding: 1.5rem;
    }
    
    .welcome-modal-title {
        font-size: 1.5rem;
    }
    
    .welcome-modal-logo {
        max-width: 100px;
    }
    
    .instruction-item {
        padding: 0.5rem 0.75rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .instruction-icon {
        font-size: 1rem;
    }
    
    .instruction-text {
        font-size: 0.8rem;
        line-height: 1.4;
    }
    
    .welcome-modal-footer {
        padding: 1rem 1.5rem;
        flex-direction: column;
    }
    
    .btn-accept {
        width: 100%;
        justify-content: center;
        padding: 1rem 2rem;
    }
}

/* Dispositivos móviles pequeños */
@media (max-width: 480px) {
    .welcome-modal-content {
        width: 98%;
        margin: 0.5rem;
        max-height: 90vh;
        border-radius: 1rem;
    }
    
    .welcome-modal-header {
        padding: 1rem;
        border-radius: 1rem 1rem 0 0;
    }
    
    .welcome-modal-body {
        padding: 1rem;
    }
    
    .welcome-modal-title {
        font-size: 1.25rem;
        margin-bottom: 0.25rem;
    }
    
    .welcome-modal-subtitle {
        font-size: 0.875rem;
    }
    
    .welcome-modal-logo {
        max-width: 80px;
        margin-bottom: 0.75rem;
        padding: 0.5rem;
    }
    
    .welcome-instructions h3 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .instruction-item {
        padding: 0.5rem;
        margin-bottom: 0.375rem;
        border-radius: 0.375rem;
    }
    
    .instruction-text {
        font-size: 0.75rem;
        line-height: 1.3;
    }
    
    .welcome-modal-footer {
        padding: 0.75rem 1rem;
    }
    
    .btn-accept {
        font-size: 0.875rem;
        padding: 0.875rem 1.5rem;
    }
}

/* Ajustes para pantallas muy pequeñas */
@media (max-width: 360px) {
    .welcome-modal-content {
        width: 100%;
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
    }
    
    .welcome-modal-header {
        border-radius: 0;
    }
    
    .instruction-text {
        font-size: 0.7rem;
    }
}

/* Ajustes para orientación horizontal en móviles */
@media (max-width: 768px) and (orientation: landscape) {
    .welcome-modal-content {
        max-height: 95vh;
        width: 90%;
    }
    
    .welcome-modal-header {
        padding: 1rem;
    }
    
    .welcome-modal-body {
        padding: 1rem;
    }
    
    .welcome-modal-logo {
        max-width: 70px;
        margin-bottom: 0.5rem;
    }
    
    .welcome-modal-title {
        font-size: 1.25rem;
    }
    
    .instruction-item {
        padding: 0.375rem 0.5rem;
        margin-bottom: 0.25rem;
    }
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-input.error {
    border-color: #ef4444;
}

/* Estilos específicos para campos de fecha */
.form-input[type="date"] {
    position: relative;
    background-color: #ffffff;
    cursor: pointer;
}

.form-input[type="date"]::-webkit-calendar-picker-indicator {
    background: transparent;
    bottom: 0;
    color: transparent;
    cursor: pointer;
    height: auto;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    width: auto;
}

.form-input[type="date"]::-webkit-inner-spin-button,
.form-input[type="date"]::-webkit-clear-button {
    display: none;
}

/* Estilos específicos para campos de email */
.form-input[type="email"] {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="%236b7280" viewBox="0 0 16 16"><path d="M2 2a2 2 0 0 0-2 2v8.01A2 2 0 0 0 2 14h5.5a.5.5 0 0 0 0-1H2a1 1 0 0 1-.966-.741l5.64-3.471L8 9.583l1.326-.795 5.64 3.47A1 1 0 0 1 14 13h-2.5a.5.5 0 0 0 0 1H14a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H2Zm3.708 6.208L1 11.105V5.383l4.708 2.825ZM1 4.217V4a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v.217l-7 4.2-7-4.2Z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
}

.form-input[type="email"]:focus {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="%234f46e5" viewBox="0 0 16 16"><path d="M2 2a2 2 0 0 0-2 2v8.01A2 2 0 0 0 2 14h5.5a.5.5 0 0 0 0-1H2a1 1 0 0 1-.966-.741l5.64-3.471L8 9.583l1.326-.795 5.64 3.47A1 1 0 0 1 14 13h-2.5a.5.5 0 0 0 0 1H14a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H2Zm3.708 6.208L1 11.105V5.383l4.708 2.825ZM1 4.217V4a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v.217l-7 4.2-7-4.2Z"/></svg>');
}

/* Área de carga de archivos */
.file-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: #4f46e5;
    background-color: #f8fafc;
}

.file-upload-area.dragover {
    border-color: #4f46e5;
    background-color: #eff6ff;
}

.file-upload-icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 1rem;
    color: #9ca3af;
}

.file-upload-text {
    color: #6b7280;
    font-size: 0.875rem;
}

.file-upload-link {
    color: #4f46e5;
    font-weight: 500;
    text-decoration: none;
}

.file-upload-link:hover {
    color: #3730a3;
}

.file-selected {
    margin-top: 0.5rem;
    color: #059669;
    font-size: 0.875rem;
}

/* Botones */
.btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #3730a3 0%, #312e81 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(79, 70, 229, 0.4);
}

.btn-secondary {
    background-color: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background-color: #4b5563;
}

.btn-danger {
    background-color: #dc2626;
    color: white;
}

.btn-danger:hover {
    background-color: #b91c1c;
}

.btn-text {
    background: none;
    color: #6b7280;
    padding: 0.5rem 1rem;
}

.btn-text:hover {
    color: #374151;
}

/* Tabla de beneficiarios */
.table-container {
    overflow-x: auto;
    margin: 1.5rem 0;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

.beneficiarios-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.beneficiarios-table th {
    background-color: #f9fafb;
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e5e7eb;
}

.beneficiarios-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.beneficiarios-table tr:hover {
    background-color: #f9fafb;
}

.table-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.table-input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

.table-checkbox {
    width: 1rem;
    height: 1rem;
    color: #4f46e5;
    border-radius: 0.25rem;
}

/* Utilidades */
.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-end {
    justify-content: flex-end;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.text-center {
    text-align: center;
}

/* Contadores por edad */
.age-counters-section {
    margin: 2rem 0;
}

.age-counters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.age-counter {
    background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
    color: white;
    padding: 1.5rem 1rem;
    border-radius: 0.75rem;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
    transition: transform 0.2s ease;
}

.age-counter:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px -1px rgba(79, 70, 229, 0.3);
}

.age-counter-number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: #fbbf24;
    margin-bottom: 0.5rem;
}

.age-counter-label {
    font-size: 0.875rem;
    opacity: 0.9;
    font-weight: 500;
}



/* Controles de paginación */
.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.5rem 0;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1);
}

.pagination-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.pagination-buttons {
    display: flex;
    gap: 0.5rem;
}

.total-records {
    font-weight: 500;
    color: #374151;
}

/* Modales */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.5rem 0;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
}

.modal-close {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.modal-body {
    padding: 0 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
    margin-top: 1.5rem;
}

.form-help {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* Notificaciones */
.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    color: white;
    font-weight: 500;
    z-index: 1001;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 400px;
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    background-color: #059669;
}

.notification-error {
    background-color: #dc2626;
}

.notification-info {
    background-color: #2563eb;
}

/* Modal de Agradecimiento */
.modal-overlay-thanks {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.95) 0%, rgba(55, 48, 163, 0.95) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    backdrop-filter: blur(10px);
}

.modal-overlay-thanks.show {
    opacity: 1;
    visibility: visible;
}

.modal-content-thanks {
    background: white;
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 500px;
    width: 90%;
    padding: 3rem 2rem;
    text-align: center;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.4s ease;
    position: relative;
    overflow: hidden;
}

.modal-overlay-thanks.show .modal-content-thanks {
    transform: scale(1) translateY(0);
}

.modal-content-thanks::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4f46e5 0%, #7c3aed 50%, #ec4899 100%);
}

.thanks-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.thanks-title {
    font-size: 2.5rem;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.thanks-message {
    font-size: 1.125rem;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.thanks-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.btn-thanks-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 0.75rem;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-thanks-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-thanks-primary:hover::before {
    left: 100%;
}

.btn-thanks-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.6);
    background: linear-gradient(135deg, #3730a3 0%, #6d28d9 100%);
}

/* Clases de utilidad adicionales */
.hidden {
    display: none !important;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Estilos para formularios directos de beneficiarios */
.beneficiarios-form-container {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
    border: 1px solid #e2e8f0;
}

.beneficiario-form-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    position: relative;
    transition: all 0.2s ease;
}

.beneficiario-form-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.beneficiario-form-item h4 {
    margin: 0 0 1rem 0;
    color: #1e293b;
    font-size: 1.1rem;
    font-weight: 600;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.btn-save {
    background: #10b981;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-save:hover {
    background: #059669;
    transform: translateY(-1px);
}

.btn-delete {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-delete:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-add-beneficiario {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0;
    width: 100%;
    justify-content: center;
}

.btn-add-beneficiario:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Responsive */
@media (max-width: 1024px) {
    .progress-indicators {
        max-width: 380px;
    }
    
    .step-text {
        font-size: 0.75rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .header-logo {
        max-width: 250px;
        padding: 0.75rem;
    }
    
    .main-title {
        font-size: 2rem;
    }
    
    .form-section {
        padding: 1.5rem;
    }
    
    /* Indicadores de progreso responsive */
    .progress-indicators {
        max-width: 350px;
        margin: 0 auto 3rem;
        gap: 0.5rem;
    }
    
    .step-circle {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }
    
    .step-text {
        font-size: 0.7rem;
        top: 3.5rem;
        padding: 0 0.5rem;
    }
    
    .progress-line {
        margin: 0 0.5rem;
    }
    
    /* Título de sección responsive */
    .section-title {
        font-size: 1.25rem;
        margin-bottom: 1.25rem;
        text-align: center;
    }
    
    .table-container {
        font-size: 0.875rem;
    }
    
    .btn {
        padding: 0.625rem 1.5rem;
        font-size: 0.875rem;
    }
    
    .age-counters {
        grid-template-columns: repeat(2, 1fr);
    }
    

    
    .pagination-controls {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .header-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .beneficiario-form-item {
        padding: 1rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-save,
    .btn-delete {
        width: 100%;
        justify-content: center;
    }
    
    /* Modal de agradecimiento responsive */
    .modal-content-thanks {
        padding: 2rem 1.5rem;
        margin: 1rem;
    }
    
    .thanks-title {
        font-size: 2rem;
    }
    
    .thanks-message {
        font-size: 1rem;
    }
    
    .thanks-icon {
        font-size: 3rem;
    }
    
    .btn-thanks-primary {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .header-logo {
        max-width: 200px;
        padding: 0.5rem;
    }
    
    .main-title {
        font-size: 1.5rem;
    }
    
    /* Indicadores de progreso para móviles pequeños */
    .progress-indicators {
        max-width: 280px;
        margin: 0 auto 2.5rem;
        gap: 0.25rem;
        flex-direction: column;
        align-items: center;
    }
    
    .step-indicator {
        margin-bottom: 1rem;
    }
    
    .step-circle {
        width: 2rem;
        height: 2rem;
        font-size: 0.875rem;
    }
    
    .step-text {
        font-size: 0.65rem;
        top: 2.75rem;
        white-space: normal;
        max-width: 120px;
        line-height: 1.2;
    }
    
    .progress-line {
        display: none;
    }
    
    /* Título de sección para móviles pequeños */
    .section-title {
        font-size: 1.125rem;
        margin-bottom: 1rem;
        text-align: center;
        line-height: 1.3;
    }
    
    /* Formulario más compacto */
    .form-section {
        padding: 1rem;
    }
    
    .form-group {
        margin-bottom: 1.25rem;
    }
    
    .form-label {
        font-size: 0.8rem;
        margin-bottom: 0.4rem;
    }
    
    .form-input {
        padding: 0.75rem;
        font-size: 0.875rem;
    }
}

/* =====================================================
   ESTILOS PARA TABLA EDITABLE DE BENEFICIARIOS
   ===================================================== */

.beneficiarios-table td {
    padding: 0.5rem;
    vertical-align: middle;
}

.beneficiarios-table td input,
.beneficiarios-table td select,
.beneficiarios-table td textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.875rem;
    transition: all 0.2s;
    box-sizing: border-box;
}

.beneficiarios-table td input:focus,
.beneficiarios-table td select:focus,
.beneficiarios-table td textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.beneficiarios-table td textarea {
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
}

.beneficiarios-table td .checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.beneficiarios-table td .checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.beneficiarios-table td .checkbox-group label {
    margin: 0;
    font-size: 0.875rem;
    font-weight: normal;
    cursor: pointer;
}

.beneficiarios-table td .btn {
    padding: 0.375rem 0.5rem;
    font-size: 0.75rem;
    min-width: auto;
    transition: all 0.3s ease;
}

.beneficiarios-table td .btn svg {
    width: 0.875rem;
    height: 0.875rem;
}

/* Estilos para filas guardadas automáticamente */
.beneficiario-row.auto-saved {
    background-color: #f0f9ff !important;
    border-left: 4px solid #10b981;
    transition: all 0.3s ease;
}

.beneficiario-row.auto-saved:hover {
    background-color: #e0f2fe !important;
}

/* Indicador visual de guardado automático */
.auto-save-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #10b981;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.auto-save-indicator.show {
    opacity: 1;
}

.auto-save-indicator svg {
    width: 0.875rem;
    height: 0.875rem;
}

/* Header de beneficiarios con título y botón */
.beneficiarios-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.beneficiarios-header .section-title {
    margin-bottom: 0;
    flex: 1;
}

.btn-add-beneficiario {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
    flex-shrink: 0;
}

.btn-add-beneficiario:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.btn-add-beneficiario:active {
    transform: translateY(0);
}

/* Estilos para paginación dentro de tabla */
.table-container .pagination-controls {
    margin: 1rem 0 0 0;
    border-top: 1px solid #e5e7eb;
    padding-top: 1rem;
    background: transparent;
    box-shadow: none;
}

/* Responsive para tabla */
@media (max-width: 768px) {
    .beneficiarios-table {
        font-size: 0.75rem;
    }
    
    .beneficiarios-table td {
        padding: 0.25rem;
    }
    
    .beneficiarios-table td input,
    .beneficiarios-table td select,
    .beneficiarios-table td textarea {
        padding: 0.375rem;
        font-size: 0.75rem;
    }
    
    .beneficiarios-table td textarea {
        min-height: 50px;
    }
    
    .beneficiarios-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .beneficiarios-header .section-title {
        margin-bottom: 1rem;
    }
    
    .btn-add-beneficiario {
        width: 100%;
        justify-content: center;
    }
}

/* ===== LOADING OVERLAY ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-content {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #059669;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== PROGRESS OVERLAY PARA OPERACIONES MASIVAS ===== */
.progress-content {
    background: white;
    padding: 2.5rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    margin: 0 auto;
}



/* ===== ESTILOS PARA INTERFAZ DE OPERACIONES MASIVAS ===== */
.beneficiarios-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.beneficiarios-stats {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    font-size: 0.9rem;
    font-weight: 500;
    color: #475569;
}

.stat-item i {
    color: #059669;
}

#contador-beneficiarios {
    font-weight: bold;
    color: #059669;
}

.beneficiarios-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn-secondary {
    padding: 0.5rem 1rem;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    color: #475569;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
    color: #334155;
}

.btn-secondary i {
    font-size: 0.8rem;
}

/* ===== INFORMACIÓN DE PROCESAMIENTO ===== */
.envio-info {
    margin-bottom: 1.5rem;
}

.info-card {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.info-card h4 {
    color: #059669;
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.info-item .label {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
}

.info-item .value {
    font-size: 0.9rem;
    color: #1e293b;
    font-weight: 600;
}

.info-warning {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #92400e;
}

.info-warning i {
    color: #f59e0b;
}

/* ===== ESTADOS DEL BOTÓN DE ENVÍO ===== */
#btn-enviar {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

#btn-enviar:disabled {
    background-color: #94a3b8 !important;
    cursor: not-allowed;
    opacity: 0.7;
}

#btn-enviar.processing {
    background-color: #f59e0b !important;
}

#btn-enviar.processing::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: processing-shimmer 1.5s infinite;
}

@keyframes processing-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* ===== ALERTAS DE LÍMITES ===== */
.limite-warning {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: pulse-warning 2s infinite;
}

.limite-warning.danger {
    background: #fee2e2;
    border-color: #ef4444;
    color: #991b1b;
}

.limite-warning i {
    font-size: 1.2rem;
    color: #f59e0b;
}

.limite-warning.danger i {
    color: #ef4444;
}

/* ===== RESPONSIVO PARA OPERACIONES MASIVAS ===== */
@media (max-width: 768px) {
    .beneficiarios-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .beneficiarios-stats {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .stat-item {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .beneficiarios-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-secondary {
        justify-content: center;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .info-card {
        padding: 1rem;
    }
    
    .info-card h4 {
        font-size: 1rem;
    }
}



.async-progress-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.4em;
    font-weight: 600;
}

.async-progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.progress-stat {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.85em;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
}

.async-progress-bar {
    width: 100%;
    height: 12px;
    background: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 15px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 6px;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.async-progress-text {
    text-align: center;
    color: #666;
    font-size: 0.9em;
    font-style: italic;
}

/* Modal de Errores Asíncronos */
.async-error-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    backdrop-filter: blur(5px);
}

.async-error-content {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideInUp 0.3s ease-out;
}

.async-error-header {
    background: #dc3545;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.async-error-header h3 {
    margin: 0;
    font-size: 1.3em;
}

.async-error-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.async-error-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.async-error-body {
    padding: 25px;
    max-height: 60vh;
    overflow-y: auto;
}

.failed-items-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin: 15px 0;
}

.failed-item {
    padding: 12px 15px;
    border-bottom: 1px solid #f1f3f4;
    background: #fff;
    transition: background-color 0.2s;
}

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

.failed-item:hover {
    background: #f8f9fa;
}

.failed-item-info strong {
    color: #dc3545;
}

.failed-item-info small {
    color: #666;
    font-size: 0.85em;
}

.async-error-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: center;
}

.btn-retry-failed,
.btn-export-failed {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    font-size: 0.9em;
}

.btn-retry-failed {
    background: #28a745;
    color: white;
}

.btn-retry-failed:hover {
    background: #218838;
    transform: translateY(-1px);
}

.btn-export-failed {
    background: #6c757d;
    color: white;
}

.btn-export-failed:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

/* Responsive para procesamiento asíncrono */
@media (max-width: 768px) {
    .async-panel {
        margin: 15px 0;
        padding: 15px;
    }
    
    .async-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .async-benefits {
        grid-template-columns: 1fr;
    }
    
    .async-progress-content,
    .async-error-content {
        width: 95%;
        margin: 10px;
    }
    
    .async-progress-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .async-error-actions {
         flex-direction: column;
     }
 }

/* ===== SISTEMA DE NOTIFICACIONES POR EMAIL ===== */
.email-panel {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: white;
    position: relative;
    overflow: hidden;
}

.email-panel::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: emailShimmer 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes emailShimmer {
    0%, 100% { transform: rotate(0deg) scale(1); opacity: 0.3; }
    50% { transform: rotate(180deg) scale(1.1); opacity: 0.1; }
}

.email-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.email-header h4 {
    margin: 0;
    font-size: 1.4em;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.email-status {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 15px;
    border-radius: 20px;
    backdrop-filter: blur(5px);
}

.email-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    position: relative;
}

.email-indicator.enabled {
    background: #4CAF50;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.6);
    animation: emailPulse 2s infinite;
}

.email-indicator.disabled {
    background: #f44336;
    box-shadow: 0 0 10px rgba(244, 67, 54, 0.6);
}

@keyframes emailPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
}

.email-status-text {
    font-size: 0.9em;
    font-weight: 500;
}

.email-info {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
    align-items: start;
}

.email-config {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 12px;
    backdrop-filter: blur(5px);
}

.config-item {
    margin-bottom: 20px;
}

.config-item label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.95em;
}

.config-item input[type="email"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.95em;
    transition: all 0.3s ease;
}

.config-item input[type="email"]:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.config-item input[type="email"]::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.notification-types h5 {
    margin: 0 0 15px 0;
    font-size: 1.1em;
    font-weight: 600;
}

.notification-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notification-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
}

.notification-checkbox:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.notification-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #4CAF50;
    cursor: pointer;
}

.notification-checkbox span {
    font-size: 0.9em;
    font-weight: 500;
    user-select: none;
}

.email-queue-info {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 12px;
    backdrop-filter: blur(5px);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.queue-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.queue-label {
    font-size: 0.9em;
    opacity: 0.8;
    font-weight: 500;
}

.queue-value {
    font-size: 2em;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.btn-test-email {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-test-email:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
    background: linear-gradient(135deg, #45a049, #4CAF50);
}

.btn-test-email:disabled {
    background: #666;
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}

.btn-test-email:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(76, 175, 80, 0.3);
}

/* Responsive para email */
@media (max-width: 768px) {
    .email-panel {
        margin: 10px;
        padding: 15px;
    }
    
    .email-info {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .email-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .email-header h4 {
        font-size: 1.2em;
    }
    
    .notification-checkboxes {
        gap: 8px;
    }
    
    .notification-checkbox {
        padding: 6px 10px;
        font-size: 0.85em;
    }
    
    .config-item input[type="email"] {
        font-size: 0.9em;
        padding: 10px 12px;
    }
    
    .btn-test-email {
        width: 100%;
        padding: 10px 15px;
        font-size: 0.85em;
    }
}

/* ===== SNAPSHOT CONTROLS INLINE ===== */
.snapshot-controls-inline {
    margin-left: auto;
    position: relative;
}

.snapshot-dropdown {
    position: relative;
    display: inline-block;
}

.btn-snapshot-toggle {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-snapshot-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.dropdown-arrow {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.snapshot-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    z-index: 1000;
    min-width: 280px;
    margin-top: 5px;
}

.snapshot-menu-header {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.btn-create-snapshot {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
}

.btn-create-snapshot:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.snapshot-list-compact {
    max-height: 200px;
    overflow-y: auto;
    padding: 8px;
}

.no-snapshots-compact {
    text-align: center;
    color: #666;
    font-size: 12px;
    padding: 20px;
    margin: 0;
}

.snapshot-item-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-radius: 5px;
    margin-bottom: 4px;
    background: #f8f9fa;
    transition: background-color 0.2s ease;
}

.snapshot-item-compact:hover {
    background: #e9ecef;
}

.snapshot-info-compact {
    flex: 1;
    min-width: 0;
}

.snapshot-description-compact {
    font-size: 12px;
    font-weight: 500;
    color: #333;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.snapshot-meta-compact {
    display: flex;
    gap: 8px;
    font-size: 10px;
    color: #666;
}

.snapshot-actions-compact {
    display: flex;
    gap: 4px;
    margin-left: 8px;
}

.btn-snapshot-restore-compact,
.btn-snapshot-delete-compact {
    background: none;
    border: none;
    padding: 4px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s ease;
}

.btn-snapshot-restore-compact:hover {
    background: #e3f2fd;
}

.btn-snapshot-delete-compact:hover {
    background: #ffebee;
}