/* Módulo CRM: Diseño tipo Apple Glassmorphism */

.crm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.crm-title-group {
    display: flex;
    align-items: center;
    gap: 16px;
}

.crm-icon {
    background: linear-gradient(135deg, #0071e3, #4ea8de);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 15px rgba(0, 113, 227, 0.3);
}

.crm-title-group h2 { margin: 0; font-size: 22px; font-weight: 700; }
.crm-title-group p { margin: 0; opacity: 0.6; font-size: 14px; }

.crm-actions { display: flex; gap: 12px; }

/* Tarjetas Blur (Glass) */
.blur-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    padding: 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body.dark-mode .blur-card {
    background: rgba(40, 40, 40, 0.7);
    border: 1px solid rgba(255,255,255,0.05);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* Métricas Superiores */
.crm-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.crm-metric-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 24px;
}

.cm-icon {
    font-size: 28px;
    background: rgba(0,0,0,0.03);
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}
body.dark-mode .cm-icon { background: rgba(255,255,255,0.05); }

.cm-info h3 { margin: 0; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.6; }
.cm-val { font-size: 32px; font-weight: 800; font-family: 'Inter', sans-serif; letter-spacing: -1px; margin-top: 4px; }

/* Visual Grid (Map + Kanban) */
.crm-visual-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

/* KANBAN BOARD */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    min-height: 500px;
}

.kanban-column {
    background: rgba(0,0,0,0.02);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

body.dark-mode .kanban-column { background: rgba(255,255,255,0.02); }

.kanban-col-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(0,0,0,0.05);
    margin-bottom: 4px;
}

body.dark-mode .kanban-col-header { border-bottom-color: rgba(255,255,255,0.1); }

.kanban-col-title { font-weight: 600; font-size: 14px; text-transform: uppercase; letter-spacing: 0.5px; }
.kanban-col-count { background: var(--apple-blue); color: white; padding: 2px 8px; border-radius: 12px; font-size: 12px; font-weight: 700; }

.kanban-cards-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 100px;
}

/* Kanban Cards */
.k-card {
    background: white;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.04);
    cursor: grab;
    transition: all 0.2s ease;
    position: relative;
    border-left: 4px solid transparent;
}

.k-card:active { cursor: grabbing; transform: scale(0.98); }

body.dark-mode .k-card {
    background: #2c2c2e;
    border-color: rgba(255,255,255,0.05);
}

.k-card.status-green { border-left-color: #34c759; }
.k-card.status-yellow { border-left-color: #ffcc00; }
.k-card.status-red { border-left-color: #ff3b30; }

.kc-title { font-weight: 600; font-size: 15px; margin-bottom: 6px; line-height: 1.3; }
.kc-client { font-size: 13px; opacity: 0.6; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }

.kc-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(0,0,0,0.05);
    padding-top: 10px;
    margin-top: 10px;
}
body.dark-mode .kc-footer { border-top-color: rgba(255,255,255,0.05); }

.kc-val { font-weight: 700; color: var(--apple-blue); font-size: 15px; }
.kc-actions { display: flex; gap: 8px; }

.kc-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: inherit;
    transition: background 0.2s;
}

body.dark-mode .kc-btn { background: rgba(255,255,255,0.1); }
.kc-btn:hover { background: rgba(0,0,0,0.1); }
.kc-btn.whatsapp { background: rgba(52, 199, 89, 0.1); color: #34c759; }
.kc-btn.whatsapp:hover { background: rgba(52, 199, 89, 0.2); }

/* Overlays & Modals for CRM */
.crm-modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
