/* 👤 Modal Employee Profile Styles */

.profile-modal {
    max-width: 700px;
    padding: 0;
    overflow: hidden;
    border-radius: 16px;
}

.profile-header-gradient {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    padding: 32px 24px;
    position: relative;
    border-bottom: 1px solid #334155;
}

.profile-header-info {
    display: flex;
    align-items: center;
    gap: 24px;
}

.profile-avatar-box {
    width: 90px;
    height: 90px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 800;
    color: white;
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
    border: 2px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}

.profile-stats-row {
    display: flex;
    flex-direction: row !important;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: nowrap !important;
    width: 100%;
}

.profile-stat-card {
    flex: 1;
    background: #1e293b;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid #334155;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: center;
}

.profile-stat-card span {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 600;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.profile-stat-card strong {
    font-size: 1.25rem;
    color: #f1f5f9;
    font-weight: 800;
}

.profile-earnings-row {
    flex-direction: column;
    display: flex;
    gap: 12px;
}

.profile-gross-card, .profile-net-card {
    padding: 18px;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    display:flex;
    justify-content: space-between;
    align-items: center;
}

.profile-gross-card {
    background: #1e293b;
    border: 1px solid #334155;
}

.profile-net-card {
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    color: white;
}

.profile-earnings-label {
    font-size: 0.8rem;
    font-weight: 700;
    opacity: 0.8;
}

.profile-earnings-val {
    font-size: 1.6rem;
    font-weight: 900;
}

@media (max-width: 500px) {
    .profile-stats-row {
        flex-direction: row; /* Mantener al lado en móviles si los textos son cortos, o si no caben: flex-wrap: wrap */
        gap: 8px;
    }
    .profile-stat-card {
        padding: 10px;
    }
    .profile-stat-card span {
        font-size: 0.65rem;
    }
    .profile-stat-card strong {
        font-size: 1.1rem;
    }
}

/* 🏦 Advances & Loans Module (Option 1) */
.advances-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.advance-card {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 16px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.advance-card:hover {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(245, 158, 11, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.advance-row-inputs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.advance-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.advance-input-group label {
    font-size: 0.65rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-left: 4px;
}

.advance-input-group input {
    background: rgba(15, 23, 42, 0.6) !important;
    border: 1px solid #334155 !important;
    color: #f1f5f9 !important;
    padding: 10px 12px !important;
    border-radius: 8px !important;
    font-size: 0.85rem !important;
    width: 100%;
    transition: all 0.2s;
}

.advance-input-group input:focus {
    border-color: #f59e0b !important;
    outline: none;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.advance-row-note input {
    width: 100%;
    background: rgba(15, 23, 42, 0.4) !important;
    border: 1px dashed #334155 !important;
    color: #94a3b8 !important;
    padding: 8px 12px !important;
    border-radius: 8px !important;
    font-size: 0.8rem !important;
}

.advance-row-math {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 0.85rem;
    color: #94a3b8;
}

.advance-math-text strong {
    color: #f1f5f9;
}

.advance-math-total {
    color: #f59e0b;
    font-weight: 800;
}

.btn-delete-advance {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-delete-advance:hover {
    background: #ef4444;
    color: white;
    transform: rotate(90deg);
}

.btn-save-advance {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-save-advance:hover {
    background: #10b981;
    color: white;
    transform: scale(1.1);
}

.advance-actions {
    display: flex;
    gap: 8px;
}

/* 📏 Reduced View Styles (Dual-Layer) */
.advance-row-reduced {
    background: rgba(30, 41, 59, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    padding: 10px 14px;
    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.advance-row-reduced:hover {
    background: rgba(30, 41, 59, 0.5);
    border-color: rgba(245, 158, 11, 0.2);
    transform: translateX(4px);
}

.advance-reduced-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.advance-reduced-data {
    display: flex;
    align-items: center;
    gap: 12px;
}

.advance-reduced-date {
    font-size: 0.75rem;
    font-weight: 700;
    color: #475569;
    background: rgba(71, 85, 105, 0.1);
    padding: 2px 8px;
    border-radius: 6px;
}

.advance-reduced-amount {
    font-size: 0.95rem;
    font-weight: 800;
    color: #f59e0b;
}

.advance-reduced-interest {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
}

.advance-reduced-note {
    font-size: 0.75rem !important;
    color: #64748b !important;
    font-style: italic;
    padding-left: 12px;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80%;
}

.advance-reduced-note::before {
    content: '└─ 📝';
    margin-right: 6px;
    opacity: 0.5;
    font-style: normal;
}

.btn-edit-advance {
    background: rgba(99, 102, 241, 0.1);
    color: #818cf8;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-edit-advance:hover {
    background: #6366f1;
    color: white;
}

/* Responsive Adelantos */
@media (max-width: 600px) {
    .advance-row-inputs {
        grid-template-columns: 1fr;
    }
    
    .advance-row-math {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .btn-delete-advance {
        align-self: flex-end;
        width: 100%;
        height: 40px;
    }

    .advance-reduced-note {
        max-width: 100%;
    }
}

/* 📱 Ajustes responsivos para las pestañas y cabecera del Perfil de Empleado */
@media (max-width: 480px) {
    /* Cabecera del perfil: distribuir verticalmente para evitar colisiones */
    .profile-modal .modal-header,
    .modal-overlay .modal-header {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
        padding: 12px 16px !important;
    }

    .profile-modal .modal-header .modal-title,
    .modal-overlay .modal-header .modal-title {
        font-size: 1.15rem !important;
        margin: 0 !important;
        text-align: center !important;
        width: 100% !important;
    }

    /* Pestañas de navegación del perfil: permitir scroll horizontal flexible sin deformar los botones */
    .modal-content > div[style*="overflow-x: auto"] {
        display: flex !important;
        gap: 8px !important;
        padding: 0 12px !important;
        scrollbar-width: none !important; /* Ocultar scrollbar en Firefox */
    }

    .modal-content > div[style*="overflow-x: auto"]::-webkit-scrollbar {
        display: none !important; /* Ocultar scrollbar en Chrome/Safari */
    }

    .modal-content > div[style*="overflow-x: auto"] button {
        flex-shrink: 0 !important; /* Evitar que el flex comprima los textos/iconos */
        padding: 10px 14px !important;
        font-size: 0.8rem !important;
    }
}

