/* ============================================================
   CRM - GESTIÓN COMERCIAL - Estilos Responsive
   ============================================================ */

/* === TABS === */
.crm-tabs {
    display: flex;
    gap: 4px;
    background: var(--gray-light, #f3f4f6);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.crm-tabs::-webkit-scrollbar { display: none; }
.crm-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    background: transparent;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    white-space: nowrap;
    transition: all .2s;
}
.crm-tab:hover { background: #e2e8f0; color: #334155; }
.crm-tab.active {
    background: var(--white, #fff);
    color: var(--primary-blue, #1F6BA7);
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
    font-weight: 600;
}
.crm-tab i { font-size: 14px; }
.crm-tab-content { display: none; }
.crm-tab-content.active { display: block; }

/* === FILTROS BAR === */
.crm-filtros-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--white, #fff);
    border-radius: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.crm-filtro-grupo {
    display: flex;
    align-items: center;
    gap: 6px;
}
.crm-filtro-grupo label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
}

/* === KPI CARDS === */
.crm-kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}
.crm-kpi-card {
    background: var(--white, #fff);
    border-radius: 14px;
    padding: 18px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
    border-left: 4px solid transparent;
}
.crm-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,.1);
}
.crm-kpi-ventas { border-left-color: #22c55e; }
.crm-kpi-pipeline { border-left-color: #3b82f6; }
.crm-kpi-clientes { border-left-color: #f59e0b; }
.crm-kpi-conversion { border-left-color: #1F6BA7; }
.crm-kpi-actividad { border-left-color: #ef4444; }
.crm-kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    flex-shrink: 0;
}
.crm-kpi-ventas .crm-kpi-icon { background: linear-gradient(135deg, #22c55e, #16a34a); }
.crm-kpi-pipeline .crm-kpi-icon { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.crm-kpi-clientes .crm-kpi-icon { background: linear-gradient(135deg, #f59e0b, #d97706); }
.crm-kpi-conversion .crm-kpi-icon { background: linear-gradient(135deg, #1F6BA7, #1F6BA7); }
.crm-kpi-actividad .crm-kpi-icon { background: linear-gradient(135deg, #ef4444, #dc2626); }
.crm-kpi-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.crm-kpi-label { font-size: 11px; color: #94a3b8; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.crm-kpi-value { font-size: 22px; font-weight: 800; color: var(--dark, #1C304E); line-height: 1.2; }
.crm-kpi-sub { font-size: 11px; color: #64748b; margin-top: 2px; }
.crm-kpi-progress {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    margin-top: 6px;
    overflow: hidden;
}
.crm-kpi-progress-bar {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, #22c55e, #16a34a);
    transition: width .6s ease;
}

/* === CARDS GENÉRICAS === */
.crm-card {
    background: var(--white, #fff);
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    margin-bottom: 16px;
}
.crm-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.crm-card-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--dark, #1C304E);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}
.crm-card-header h3 i { color: var(--primary-blue, #1F6BA7); }
.crm-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.crm-card-half { margin-bottom: 0; }

/* Chart container - ensures Chart.js renders correctly */
.crm-chart-container {
    position: relative;
    width: 100%;
    min-height: 250px;
}
.crm-chart-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* === OBJETIVOS ESTRATÉGICOS === */
.crm-objetivos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}
.crm-objetivo-card {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px;
    border-left: 4px solid var(--obj-color, #1F6BA7);
    transition: transform .2s;
}
.crm-objetivo-card:hover { transform: translateY(-2px); }
.crm-objetivo-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}
.crm-objetivo-header h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.crm-objetivo-badge {
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
}
.crm-objetivo-desc {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 10px;
    line-height: 1.4;
}
.crm-objetivo-progress-container {
    margin-bottom: 6px;
}
.crm-objetivo-progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}
.crm-objetivo-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width .6s ease;
}
.crm-objetivo-stats {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #64748b;
    margin-top: 4px;
}
.crm-objetivo-pct {
    font-weight: 800;
    font-size: 20px;
}

/* === PIPELINE BOARD === */
.crm-pipeline-board {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    min-height: 400px;
}
.crm-pipeline-col {
    background: #f8fafc;
    border-radius: 12px;
    padding: 12px 10px;
    min-height: 300px;
}
.crm-pipeline-col-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-top: 3px solid;
    border-radius: 8px 8px 0 0;
    background: #fff;
    margin-bottom: 10px;
    font-weight: 700;
    font-size: 12px;
    color: var(--dark);
}
.crm-pipeline-count {
    background: var(--primary-blue, #1F6BA7);
    color: #fff;
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
}
.crm-pipeline-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.crm-pipe-card {
    background: #fff;
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    cursor: pointer;
    transition: box-shadow .2s, transform .2s;
    border-left: 3px solid transparent;
}
.crm-pipe-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
    transform: translateY(-1px);
}
.crm-pipe-card-prioridad-CRITICA { border-left-color: #ef4444; }
.crm-pipe-card-prioridad-ALTA { border-left-color: #f59e0b; }
.crm-pipe-card-prioridad-MEDIA { border-left-color: #3b82f6; }
.crm-pipe-card-prioridad-BAJA { border-left-color: #94a3b8; }
.crm-pipe-card-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 4px;
    line-height: 1.3;
}
.crm-pipe-card-client {
    font-size: 11px;
    color: #64748b;
    margin-bottom: 6px;
}
.crm-pipe-card-valor {
    font-size: 14px;
    font-weight: 800;
    color: var(--primary-blue);
}
.crm-pipe-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 10px;
    color: #94a3b8;
}
.crm-pipe-card-prob {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

/* === TABLA === */
.crm-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.crm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.crm-table thead th {
    background: #f8fafc;
    padding: 10px 12px;
    text-align: left;
    font-weight: 700;
    color: #64748b;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .3px;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}
.crm-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    color: var(--dark);
    vertical-align: middle;
}
.crm-table tbody tr:hover { background: #f8fafc; }
.crm-estado-badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    display: inline-block;
}
.crm-estado-ACTIVO { background: #dcfce7; color: #16a34a; }
.crm-estado-PROSPECTO { background: #dbeafe; color: #2563eb; }
.crm-estado-INACTIVO { background: #f1f5f9; color: #94a3b8; }
.crm-estado-PERDIDO { background: #fef2f2; color: #ef4444; }
.crm-estado-EN_PROGRESO { background: #fef9c3; color: #ca8a04; }
.crm-estado-CUMPLIDO { background: #dcfce7; color: #16a34a; }
.crm-estado-PENDIENTE { background: #fff7ed; color: #ea580c; }
.crm-estado-COMPLETADA { background: #dcfce7; color: #16a34a; }
.crm-estado-CANCELADA { background: #fef2f2; color: #ef4444; }

/* === RANKING === */
.crm-ranking-list { max-height: 360px; overflow-y: auto; }
.crm-ranking-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    transition: background .15s;
}
.crm-ranking-item:hover { background: #f8fafc; }
.crm-ranking-pos {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 12px;
    color: #fff;
    flex-shrink: 0;
}
.crm-ranking-pos-1 { background: linear-gradient(135deg, #f59e0b, #d97706); }
.crm-ranking-pos-2 { background: linear-gradient(135deg, #94a3b8, #64748b); }
.crm-ranking-pos-3 { background: linear-gradient(135deg, #d97706, #b45309); }
.crm-ranking-pos-default { background: #e2e8f0; color: #64748b; }
.crm-ranking-info { flex: 1; min-width: 0; }
.crm-ranking-name { font-size: 13px; font-weight: 600; color: var(--dark); }
.crm-ranking-equipo { font-size: 11px; color: #64748b; }
.crm-ranking-valor { font-weight: 800; font-size: 14px; color: var(--primary-blue); text-align: right; }
.crm-ranking-pct { font-size: 11px; color: #64748b; text-align: right; }
.crm-ranking-bar {
    width: 80px;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 2px;
}
.crm-ranking-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width .4s;
}

/* === TIMELINE === */
.crm-timeline-list { max-height: 400px; overflow-y: auto; }
.crm-timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
}
.crm-timeline-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
    color: #fff;
}
.crm-timeline-icon-LLAMADA { background: #3b82f6; }
.crm-timeline-icon-VISITA { background: #22c55e; }
.crm-timeline-icon-REUNION { background: #1F6BA7; }
.crm-timeline-icon-EMAIL { background: #f59e0b; }
.crm-timeline-icon-PRESENTACION { background: #2482B8; }
.crm-timeline-icon-SEGUIMIENTO { background: #06b6d4; }
.crm-timeline-icon-COTIZACION { background: #f97316; }
.crm-timeline-icon-CIERRE { background: #22c55e; }
.crm-timeline-info { flex: 1; min-width: 0; }
.crm-timeline-title { font-size: 13px; font-weight: 600; color: var(--dark); }
.crm-timeline-sub { font-size: 11px; color: #94a3b8; }
.crm-timeline-user { font-size: 11px; color: #64748b; font-weight: 500; }

/* === ACTIVIDADES LIST === */
.crm-actividades-timeline {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.crm-act-card {
    background: var(--white, #fff);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    transition: box-shadow .2s;
    border-left: 4px solid transparent;
}
.crm-act-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.crm-act-card-PENDIENTE { border-left-color: #f59e0b; }
.crm-act-card-COMPLETADA { border-left-color: #22c55e; }
.crm-act-card-CANCELADA { border-left-color: #ef4444; }
.crm-act-card-EN_CURSO { border-left-color: #3b82f6; }
.crm-act-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #fff;
    flex-shrink: 0;
}
.crm-act-body { flex: 1; min-width: 0; }
.crm-act-title { font-size: 14px; font-weight: 600; color: var(--dark); margin-bottom: 4px; }
.crm-act-meta { font-size: 12px; color: #64748b; display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.crm-act-meta span { display: flex; align-items: center; gap: 4px; }
.crm-act-meta i { font-size: 11px; }
.crm-act-desc { font-size: 12px; color: #94a3b8; line-height: 1.4; }
.crm-act-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.crm-act-btn {
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: 12px;
    color: #64748b;
    transition: all .2s;
}
.crm-act-btn:hover { background: var(--primary-blue); color: #fff; border-color: var(--primary-blue); }
.crm-act-btn-ok { color: #22c55e; border-color: #bbf7d0; }
.crm-act-btn-ok:hover { background: #22c55e; color: #fff; border-color: #22c55e; }

/* === METAS GRID === */
.crm-metas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
}
.crm-meta-card {
    background: var(--white, #fff);
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    border-top: 3px solid var(--meta-color, #1F6BA7);
    transition: transform .2s;
}
.crm-meta-card:hover { transform: translateY(-2px); }
.crm-meta-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}
.crm-meta-card-header h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--dark);
    margin: 0;
}
.crm-meta-tipo-badge {
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
}
.crm-meta-tipo-DINERO { background: #dcfce7; color: #16a34a; }
.crm-meta-tipo-ACTIVIDAD { background: #dbeafe; color: #2563eb; }
.crm-meta-card-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.crm-meta-big-pct {
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
}
.crm-meta-vals {
    text-align: right;
    font-size: 12px;
    color: #64748b;
}
.crm-meta-vals strong {
    display: block;
    font-size: 16px;
    color: var(--dark);
}
.crm-meta-progress {
    width: 100%;
    height: 10px;
    background: #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 8px;
}
.crm-meta-progress-fill {
    height: 100%;
    border-radius: 5px;
    transition: width .6s ease;
}
.crm-meta-card-footer {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #94a3b8;
}

/* === EQUIPO GRID === */
.crm-equipo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}
.crm-equipo-card {
    background: var(--white, #fff);
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.crm-equipo-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
}
.crm-equipo-avatar {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 800;
    color: #fff;
}
.crm-equipo-nombre { font-size: 16px; font-weight: 700; color: var(--dark); }
.crm-equipo-rol {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
}
.crm-rol-DIRECTOR { background: #fef3c7; color: #b45309; }
.crm-rol-COORDINADOR { background: #dbeafe; color: #2563eb; }
.crm-rol-VENDEDOR { background: #f0fdf4; color: #16a34a; }
.crm-equipo-miembros {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.crm-miembro-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: #f8fafc;
    border-radius: 10px;
    transition: background .15s;
}
.crm-miembro-item:hover { background: #f1f5f9; }
.crm-miembro-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.crm-miembro-info { flex: 1; min-width: 0; }
.crm-miembro-name { font-size: 13px; font-weight: 600; color: var(--dark); }
.crm-miembro-email { font-size: 11px; color: #94a3b8; }

/* === MODALES === */
.crm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: crmFadeIn .2s ease;
}
@keyframes crmFadeIn { from { opacity: 0; } to { opacity: 1; } }
.crm-modal {
    background: var(--white, #fff);
    border-radius: 18px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    animation: crmSlideUp .3s ease;
}
.crm-modal-lg { max-width: 900px; }
@keyframes crmSlideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.crm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid #f1f5f9;
}
.crm-modal-header h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}
.crm-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: background .15s;
}
.crm-modal-close:hover { background: #e2e8f0; }
.crm-modal-body { padding: 20px 24px; }
.crm-modal-footer {
    padding: 14px 24px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.crm-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.crm-form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 4px;
}
.crm-form-full { grid-column: 1 / -1; }

/* === DETALLE CLIENTE === */
.crm-det-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.crm-det-section h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--dark);
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.crm-det-field {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
    border-bottom: 1px solid #f8fafc;
}
.crm-det-field-label { color: #64748b; }
.crm-det-field-value { font-weight: 600; color: var(--dark); }
.crm-det-ops-list, .crm-det-timeline {
    max-height: 250px;
    overflow-y: auto;
}
.crm-det-op-item {
    padding: 8px 10px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.crm-det-tl-item {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 12px;
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

/* Tablets / medium screens */
@media (max-width: 1200px) {
    .crm-kpi-grid { grid-template-columns: repeat(3, 1fr); }
    .crm-pipeline-board { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1024px) {
    .crm-kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .crm-charts-row { grid-template-columns: 1fr; }
    .crm-pipeline-board { grid-template-columns: repeat(2, 1fr); }
    .crm-form-grid { grid-template-columns: 1fr 1fr; }
    .crm-det-grid { grid-template-columns: 1fr; }
}

/* Tablets portrait / small tablets */
@media (max-width: 768px) {
    .crm-tabs { gap: 2px; padding: 3px; }
    .crm-tab { padding: 8px 10px; font-size: 12px; }
    .crm-tab span { display: none; }
    .crm-tab i { font-size: 16px; }
    
    .crm-kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .crm-kpi-card { padding: 14px; gap: 10px; }
    .crm-kpi-value { font-size: 18px; }
    .crm-kpi-icon { width: 36px; height: 36px; font-size: 15px; }
    
    .crm-pipeline-board {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .crm-pipeline-col { min-height: auto; padding: 10px; }
    .crm-pipeline-cards { flex-direction: row; flex-wrap: wrap; }
    .crm-pipe-card { min-width: 200px; flex: 1; }
    
    .crm-filtros-bar { flex-direction: column; align-items: stretch; gap: 10px; }
    .crm-filtro-grupo { flex-direction: column; align-items: flex-start; }
    .crm-filtro-grupo select, .crm-filtro-grupo input { width: 100% !important; }
    
    .crm-modal { max-width: 100%; margin: 10px; border-radius: 14px; }
    .crm-form-grid { grid-template-columns: 1fr; }
    .crm-modal-body { padding: 16px; }
    
    .crm-metas-grid { grid-template-columns: 1fr; }
    .crm-equipo-grid { grid-template-columns: 1fr; }
    .crm-objetivos-grid { grid-template-columns: 1fr; }
    
    .crm-table { font-size: 12px; }
    .crm-table thead th { padding: 8px 6px; font-size: 10px; }
    .crm-table tbody td { padding: 8px 6px; }
}

/* Mobile phones - Small screens */
@media (max-width: 576px) {
    .crm-kpi-grid { grid-template-columns: 1fr; }
    .crm-kpi-card { flex-direction: row; align-items: center; }
    
    .crm-card { padding: 14px; border-radius: 12px; }
    .crm-card-header h3 { font-size: 14px; }
    
    .crm-ranking-item { gap: 8px; }
    .crm-ranking-valor { font-size: 12px; }
    
    .crm-act-card { flex-direction: column; gap: 10px; }
    .crm-act-actions { width: 100%; justify-content: flex-end; }
    
    .crm-pipe-card { min-width: 100%; }
    
    .crm-modal-header { padding: 14px 16px; }
    .crm-modal-header h3 { font-size: 15px; }
    .crm-modal-footer { flex-direction: column; }
    .crm-modal-footer button { width: 100%; }
    
    .crm-meta-big-pct { font-size: 26px; }
    .crm-meta-vals strong { font-size: 14px; }
}

/* Extra small screens (very small phones) */
@media (max-width: 400px) {
    .crm-tabs { padding: 2px; }
    .crm-tab { padding: 6px 8px; }
    .crm-kpi-icon { width: 32px; height: 32px; font-size: 13px; border-radius: 8px; }
    .crm-kpi-value { font-size: 16px; }
    .crm-kpi-label { font-size: 10px; }
}
