/* CSS/clientes.css */

.crm-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.crm-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 15px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.crm-card:hover {
    border-color: rgb(0, 150, 136);
    box-shadow: var(--shadow-md);
}

.crm-avatar {
    background: rgba(0, 150, 136, 0.1);
    color: rgb(0, 150, 136);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    flex-shrink: 0;
}

.crm-profile-header {
    background: rgb(0, 150, 136);
    color: white;
    width: 55px;
    height: 55px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 900;
}

/* Ajustes para que la tabla dentro del perfil del cliente se vea perfecta en móvil */
.crm-table-wrapper {
    border: 1px solid var(--card-border);
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ========================================= */
/* === STICKERS DE LOGROS (CRM) ============ */
/* ========================================= */
.sticker-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 50px;
    font-weight: 900;
    font-size: 0.85rem;
    letter-spacing: 1px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
}

/* Efecto de brillo pasando por el sticker */
.sticker-badge::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transform: skewX(-20deg);
    animation: shine 3s infinite;
}

@keyframes shine { 
    0% { left: -100%; } 
    20% { left: 200%; } 
    100% { left: 200%; } 
}

.badge-diamante { 
    background: linear-gradient(135deg, #4facfe, #8e44ad); 
    color: white; 
    border: 2px solid #d2b4de; 
}
.badge-oro { 
    background: linear-gradient(135deg, #f1c40f, #f39c12); 
    color: #fff; 
    border: 2px solid #fff5b3; 
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2); 
}
.badge-plata { 
    background: linear-gradient(135deg, #bdc3c7, #95a5a6); 
    color: #fff; 
    border: 2px solid #ecf0f1; 
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2); 
}
.badge-nuevo { 
    background: linear-gradient(135deg, #2ecc71, #1abc9c); 
    color: white; 
    border: 2px solid #a3e4d7; 
}

/* =================================================================== */
/* FORZAR PERFIL Y EDICIÓN DE CLIENTE A PANTALLA COMPLETA              */
/* =================================================================== */
#crm-profile-modal,
#create-client-modal {
    padding: 0 !important;
    align-items: flex-end !important;
}

#crm-profile-modal .details-modal-container,
#create-client-modal .details-modal-container {
    height: 95dvh !important;       
    max-height: 95dvh !important;
    width: 100% !important;        
    max-width: 100% !important;  
    border-radius: 20px 20px 0 0 !important; 
    margin: 0 !important;
    background-color: #eef2f5 !important;
    position: relative;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

/* ========================================= */
/* === ESTILOS Y SOMBRAS PERFIL CRM ======== */
/* ========================================= */

/* Sombras mejoradas y corrección del cuadro blanco (ahora usa ID específico) */
#crm-profile-modal .daily-stat-card,
#crm-profile-modal .agenda-form-grid,
#crm-profile-modal .crm-table-wrapper,
#crm-fidelidad-grid > div { 
    background-color: #ffffff !important;
    border: 1px solid rgba(0,0,0,0.08) !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* 2. Estilos para la nueva tabla de "Hoja de Vida" */
.crm-modern-contact-list {
    display: flex;
    flex-direction: column;
    padding: 0;
}

.crm-contact-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #f1f5f9;
}

.crm-contact-item:last-child {
    border-bottom: none;
}

.crm-contact-label {
    width: 35%;
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

.crm-contact-value {
    width: 65%;
    font-size: 1.05rem;
    color: var(--text-primary);
    font-weight: 600;
}

/* 3. Nuevo Sticker Leyenda */
.badge-leyenda { 
    background: linear-gradient(135deg, #111111, #434343); 
    color: #ffd700; /* Letras doradas */
    border: 2px solid #555555; 
    text-shadow: 1px 1px 4px rgba(255, 215, 0, 0.4);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

/* 4. Colores Dinámicos para el Avatar/Cabecera */
.theme-nuevo { background: linear-gradient(135deg, #2ecc71, #1abc9c) !important; box-shadow: 0 4px 15px rgba(46, 204, 113, 0.4) !important; }
.theme-bronce { background: linear-gradient(135deg, #cd7f32, #a0522d) !important; box-shadow: 0 4px 15px rgba(205, 127, 50, 0.4) !important; }
.theme-plata { background: linear-gradient(135deg, #bdc3c7, #95a5a6) !important; box-shadow: 0 4px 15px rgba(149, 165, 166, 0.4) !important; }
.theme-oro { background: linear-gradient(135deg, #f1c40f, #f39c12) !important; box-shadow: 0 4px 15px rgba(241, 196, 15, 0.4) !important; }
.theme-diamante { background: linear-gradient(135deg, #4facfe, #8e44ad) !important; box-shadow: 0 4px 15px rgba(142, 68, 173, 0.4) !important; }
.theme-leyenda { background: linear-gradient(135deg, #111111, #434343) !important; color: #ffd700 !important; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6) !important; border: 2px solid #ffd700; }

/* ========================================= */
/* === FONDOS SUTILES PARA TARJETAS CRM ==== */
/* ========================================= */

.card-theme-nuevo { background-color: rgba(46, 204, 113, 0.05) !important; border: 1px solid rgba(46, 204, 113, 0.3) !important; }
.card-theme-bronce { background-color: rgba(205, 127, 50, 0.05) !important; border: 1px solid rgba(205, 127, 50, 0.3) !important; }
.card-theme-plata { background-color: rgba(149, 165, 166, 0.05) !important; border: 1px solid rgba(149, 165, 166, 0.3) !important; }
.card-theme-oro { background-color: rgba(241, 196, 15, 0.05) !important; border: 1px solid rgba(241, 196, 15, 0.4) !important; }
.card-theme-diamante { background-color: rgba(142, 68, 173, 0.05) !important; border: 1px solid rgba(142, 68, 173, 0.3) !important; }
.card-theme-leyenda { background-color: rgba(17, 17, 17, 0.05) !important; border: 1px solid rgba(255, 215, 0, 0.5) !important; }

/* Efecto hover para que el color brille un poquito más al pasar el mouse */
.card-theme-nuevo:hover { box-shadow: 0 8px 20px rgba(46, 204, 113, 0.15) !important; }
.card-theme-bronce:hover { box-shadow: 0 8px 20px rgba(205, 127, 50, 0.15) !important; }
.card-theme-plata:hover { box-shadow: 0 8px 20px rgba(149, 165, 166, 0.15) !important; }
.card-theme-oro:hover { box-shadow: 0 8px 20px rgba(241, 196, 15, 0.15) !important; }
.card-theme-diamante:hover { box-shadow: 0 8px 20px rgba(142, 68, 173, 0.15) !important; }
.card-theme-leyenda:hover { box-shadow: 0 8px 20px rgba(255, 215, 0, 0.15) !important; }

/* Forzar que las etiquetas de las tarjetas del CRM no tengan mayúsculas */
#crm-profile-modal .stat-label {
    text-transform: none !important;
    font-size: 0.95rem !important;
}