/* ============================================================
   ALPHAVAULT CRM ANALYTICS — crm-analytics.css v1.0
   Light mode default · Dark mode via body.crm-dark-mode
   100% responsive PC/Mobile · Matching CRM Dashboard design
   ============================================================ */

/* ════════════════════════════════════════════════════════════
   1. CSS VARIABLES — Héritage + Analytics-specific
════════════════════════════════════════════════════════════ */
:root {
    /* ── Réutilise toutes les variables crm-dashboard.css ──── */
    /* (--crm-bg, --crm-surface, --crm-border, --crm-text…)    */

    /* ── Analytics-specific ─────────────────────────────────── */
    --an-radius:        12px;
    --an-radius-lg:     16px;
    --an-radius-xl:     20px;

    --an-widget-bg:     #ffffff;
    --an-widget-border: rgba(0, 0, 0, 0.06);
    --an-widget-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);

    --an-surface:       rgba(241, 245, 249, 0.8);
    --an-surface-hover: rgba(241, 245, 249, 0.95);
    --an-input-bg:      rgba(0, 0, 0, 0.04);

    --an-text:          #1e293b;
    --an-text-muted:    #64748b;
    --an-text-faint:    #94a3b8;

    --an-primary:       #667eea;
    --an-green:         #10b981;
    --an-amber:         #f59e0b;
    --an-red:           #ef4444;
    --an-purple:        #8b5cf6;
    --an-cyan:          #06b6d4;
    --an-pink:          #ec4899;
    --an-orange:        #f97316;

    --an-transition:    all 0.2s ease;
}

/* ── Dark mode overrides analytics ───────────────────────── */
body.crm-dark-mode {
    --an-widget-bg:     rgba(30, 41, 59, 0.95);
    --an-widget-border: rgba(255, 255, 255, 0.06);
    --an-widget-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);

    --an-surface:       rgba(15, 23, 42, 0.6);
    --an-surface-hover: rgba(30, 41, 59, 0.8);
    --an-input-bg:      rgba(255, 255, 255, 0.05);

    --an-text:          #f0f4f8;
    --an-text-muted:    #94a3b8;
    --an-text-faint:    #64748b;
}

/* ════════════════════════════════════════════════════════════
   2. ANALYTICS LAYOUT — Grid & Rows
════════════════════════════════════════════════════════════ */

/* ── 2-column bento row ─────────────────────────────────── */
.analytics-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

/* ── KPI cards row (auto-fit) ───────────────────────────── */
.analytics-kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

/* ── AI tabs 2-col grid ─────────────────────────────────── */
.analytics-ai-tabs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

/* ════════════════════════════════════════════════════════════
   3. ANALYTICS WIDGET — Base
════════════════════════════════════════════════════════════ */
.analytics-widget {
    background: var(--an-widget-bg);
    border: 1px solid var(--an-widget-border);
    border-radius: var(--an-radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--an-widget-shadow);
    transition: box-shadow 0.2s ease;
}

.analytics-widget:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

body.crm-dark-mode .analytics-widget:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.analytics-widget-full    { width: 100%; }
.analytics-widget-mini    { margin-bottom: 0; }

/* ── AI gradient widget ─────────────────────────────────── */
.analytics-widget-ai {
    background: linear-gradient(
        135deg,
        rgba(139, 92, 246, 0.05) 0%,
        rgba(102, 126, 234, 0.05) 100%
    );
    border-color: rgba(139, 92, 246, 0.15);
}

.analytics-widget-global {
    background: linear-gradient(
        135deg,
        rgba(139, 92, 246, 0.08) 0%,
        rgba(102, 126, 234, 0.06) 100%
    );
    border-color: rgba(139, 92, 246, 0.2);
}

/* ── Success state ──────────────────────────────────────── */
.analytics-widget--success {
    border-color: rgba(16, 185, 129, 0.2);
    background: linear-gradient(
        135deg,
        rgba(16, 185, 129, 0.03) 0%,
        var(--an-widget-bg) 100%
    );
}

/* ── Widget header ──────────────────────────────────────── */
.analytics-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.analytics-widget-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 800;
    color: var(--an-text);
}

.analytics-widget-title i { font-size: 12px; flex-shrink: 0; }

.analytics-widget-subtitle {
    font-size: 11px;
    color: var(--an-text-muted);
    font-weight: 500;
}

/* ════════════════════════════════════════════════════════════
   4. HERO METRICS BAR
════════════════════════════════════════════════════════════ */
#analyticsHeroMetrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.analytics-hero-metric {
    background: var(--an-widget-bg);
    border: 1px solid var(--an-widget-border);
    border-radius: var(--an-radius-lg);
    padding: 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    box-shadow: var(--an-widget-shadow);
    transition: var(--an-transition);
}

.analytics-hero-metric:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

body.crm-dark-mode .analytics-hero-metric:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.analytics-hero-metric-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.analytics-hero-metric-body { flex: 1; min-width: 0; }

.analytics-hero-metric-label {
    font-size: 10px;
    color: var(--an-text-faint);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}

.analytics-hero-metric-value {
    font-size: 18px;
    font-weight: 900;
    color: var(--an-text);
    line-height: 1.1;
}

.analytics-hero-metric-sub {
    font-size: 10px;
    color: var(--an-text-faint);
    margin-top: 3px;
}

.analytics-hero-delta {
    font-size: 10px;
    font-weight: 700;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 3px;
}

.analytics-hero-delta i { font-size: 8px; }

/* ════════════════════════════════════════════════════════════
   5. CONTROLS BAR & TIME RANGE SELECTOR
════════════════════════════════════════════════════════════ */

/* ── Time range bar ─────────────────────────────────────── */
.analytics-range-bar {
    display: flex;
    align-items: center;
    gap: 3px;
    background: var(--an-surface);
    border-radius: 10px;
    padding: 3px;
}

.analytics-range-btn {
    padding: 6px 12px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 700;
    color: var(--an-text-muted);
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    transition: var(--an-transition);
    font-family: inherit;
}

.analytics-range-btn:hover {
    background: rgba(102, 126, 234, 0.08);
    color: var(--an-primary);
}

.analytics-range-btn.active {
    background: rgba(102, 126, 234, 0.12);
    color: var(--an-primary);
    border-color: rgba(102, 126, 234, 0.25);
}

body.crm-dark-mode .analytics-range-btn.active {
    background: rgba(102, 126, 234, 0.2);
}

/* ── Benchmark label (inline) ───────────────────────────── */
.analytics-benchmark-label {
    font-size: 11px;
    color: var(--an-text-faint);
    font-weight: 500;
}

/* ════════════════════════════════════════════════════════════
   6. TAB NAVIGATION
════════════════════════════════════════════════════════════ */
.analytics-tabs-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--an-widget-bg);
    border: 1px solid var(--an-widget-border);
    border-radius: var(--an-radius-lg);
    padding: 6px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    box-shadow: var(--an-widget-shadow);
}

.analytics-tab-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    color: var(--an-text-muted);
    border: none;
    background: transparent;
    cursor: pointer;
    transition: var(--an-transition);
    white-space: nowrap;
    font-family: inherit;
}

.analytics-tab-btn i { font-size: 11px; }

.analytics-tab-btn:hover {
    background: rgba(102, 126, 234, 0.08);
    color: var(--an-primary);
}

.analytics-tab-btn.active {
    background: linear-gradient(135deg, var(--an-primary), #764ba2);
    color: #fff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
}

/* ── Tab panels ─────────────────────────────────────────── */
.analytics-tab-panel { display: none; }

/* ════════════════════════════════════════════════════════════
   7. METRIC CARDS (KPI cards dans les tabs)
════════════════════════════════════════════════════════════ */
.analytics-metric-card {
    background: var(--an-widget-bg);
    border: 1px solid var(--an-widget-border);
    border-radius: var(--an-radius-lg);
    padding: 16px;
    position: relative;
    overflow: hidden;
    transition: var(--an-transition);
    cursor: default;
}

.analytics-metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    border-color: rgba(102, 126, 234, 0.2);
}

body.crm-dark-mode .analytics-metric-card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.analytics-metric-card--alert {
    border-color: rgba(239, 68, 68, 0.25) !important;
    background: rgba(239, 68, 68, 0.02);
}

body.crm-dark-mode .analytics-metric-card--alert {
    background: rgba(239, 68, 68, 0.05);
}

/* Alert dot */
.analytics-metric-alert-dot {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--an-red);
    animation: crmPulse 1.5s ease-in-out infinite;
}

.analytics-metric-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.analytics-metric-value {
    font-size: 22px;
    font-weight: 900;
    color: var(--an-text);
    line-height: 1;
    margin-bottom: 4px;
}

.analytics-metric-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--an-text);
    margin-bottom: 3px;
}

.analytics-metric-sub {
    font-size: 10px;
    color: var(--an-text-faint);
}

.analytics-metric-benchmark {
    font-size: 10px;
    color: var(--an-text-faint);
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.analytics-metric-delta {
    font-size: 10px;
    font-weight: 700;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 3px;
}

.analytics-metric-delta i { font-size: 8px; }

/* ════════════════════════════════════════════════════════════
   8. DEAL FUNNEL BARS (Dealflow Tab)
════════════════════════════════════════════════════════════ */
.analytics-funnel-wrap  { padding: 4px 0; }

.analytics-funnel-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 6px;
    border-bottom: 1px solid var(--an-widget-border);
    transition: background 0.15s ease;
    border-radius: 8px;
}

.analytics-funnel-row:last-child { border-bottom: none; }

.analytics-funnel-row:hover { background: var(--an-surface); }

/* ── Stage label pair ───────────────────────────────────── */
.analytics-funnel-stages {
    min-width: 210px;
    display: flex;
    align-items: center;
    gap: 0;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.analytics-funnel-from,
.analytics-funnel-to { font-weight: 700; font-size: 12px; }

.analytics-funnel-count {
    font-size: 10px;
    font-weight: 500;
    color: var(--an-text-faint);
    margin-left: 4px;
}

/* ── Bar ────────────────────────────────────────────────── */
.analytics-funnel-bar-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.analytics-funnel-bar-track {
    flex: 1;
    height: 10px;
    border-radius: 6px;
    background: var(--an-input-bg);
    position: relative;
    overflow: visible;
}

.analytics-funnel-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-width: 4px;
}

/* Benchmark marker line */
.analytics-funnel-benchmark-line {
    position: absolute;
    top: -4px;
    width: 2px;
    height: 18px;
    background: #f59e0b;
    border-radius: 1px;
    transform: translateX(-50%);
}

.analytics-funnel-rate-wrap {
    min-width: 130px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.analytics-funnel-rate  { font-size: 13px; font-weight: 800; }
.analytics-funnel-delta { font-size: 10px; font-weight: 700; }
.analytics-funnel-conv  { font-size: 10px; font-weight: 700; margin-left: auto; }

/* ════════════════════════════════════════════════════════════
   9. LP CONVERSION FUNNEL (Fundraising Tab)
════════════════════════════════════════════════════════════ */
.analytics-lp-funnel-wrap  { padding: 4px 0; }
.analytics-lp-funnel-grid  { display: flex; flex-direction: column; gap: 10px; }

.analytics-lp-funnel-stage {
    display: grid;
    grid-template-columns: 160px 1fr 130px;
    gap: 14px;
    align-items: center;
    padding: 6px 8px;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.analytics-lp-funnel-stage:hover { background: var(--an-surface); }

.analytics-lp-funnel-label {
    font-size: 11px;
    font-weight: 700;
}

.analytics-lp-funnel-bar-track {
    height: 8px;
    border-radius: 5px;
    background: var(--an-input-bg);
    overflow: hidden;
}

.analytics-lp-funnel-bar-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.6s ease;
    min-width: 2px;
}

.analytics-lp-funnel-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.analytics-lp-funnel-count   { font-size: 13px; font-weight: 900; }
.analytics-lp-funnel-rate    { font-size: 10px; color: var(--an-text-faint); }
.analytics-lp-funnel-dropoff { font-size: 10px; color: var(--an-red); font-weight: 700; }

/* ════════════════════════════════════════════════════════════
   10. LEGEND COMPONENT
════════════════════════════════════════════════════════════ */
.analytics-legend-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.analytics-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    color: var(--an-text-muted);
}

.analytics-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.analytics-legend-label { font-weight: 600; }
.analytics-legend-val   { color: var(--an-text-faint); }

/* ════════════════════════════════════════════════════════════
   11. HOT PROSPECTS ALERT WIDGET
════════════════════════════════════════════════════════════ */
.analytics-alert-widget {
    border-color: rgba(239, 68, 68, 0.2) !important;
    background: rgba(239, 68, 68, 0.03) !important;
}

body.crm-dark-mode .analytics-alert-widget {
    background: rgba(239, 68, 68, 0.06) !important;
}

.analytics-hot-prospects-list { display: flex; flex-direction: column; gap: 8px; }

.analytics-hot-prospect-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 12px;
    border-radius: var(--crm-radius, 10px);
    background: var(--an-surface);
    transition: var(--an-transition);
}

.analytics-hot-prospect-row:hover { background: var(--an-surface-hover); }

.analytics-hot-prospect-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--an-text);
    flex: 1;
}

.analytics-hot-prospect-days {
    font-size: 11px;
    color: var(--an-red);
    font-weight: 700;
    white-space: nowrap;
}

.analytics-stage-pill {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.analytics-action-link {
    font-size: 11px;
    font-weight: 700;
    color: var(--an-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: var(--an-transition);
    white-space: nowrap;
}

.analytics-action-link:hover { opacity: 0.75; }

/* ════════════════════════════════════════════════════════════
   12. CONTACTS TABLE (Relationship Tab)
════════════════════════════════════════════════════════════ */
.analytics-contacts-table { width: 100%; overflow-x: auto; }

.analytics-table-header {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1fr 1fr 1fr 60px;
    gap: 8px;
    padding: 8px 12px;
    background: var(--an-surface);
    border-radius: 8px;
    margin-bottom: 4px;
    font-size: 10px;
    font-weight: 800;
    color: var(--an-text-faint);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 640px;
}

.analytics-table-row {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1fr 1fr 1fr 60px;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.15s ease;
    align-items: center;
    min-width: 640px;
}

.analytics-table-row:hover { background: var(--an-surface); }

/* ── Contact cell ───────────────────────────────────────── */
.analytics-table-contact {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.analytics-contact-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    position: relative;
}

.analytics-contact-health-dot {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 2px solid var(--an-widget-bg);
}

.analytics-contact-name  {
    font-size: 12px;
    font-weight: 700;
    color: var(--an-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.analytics-contact-title {
    font-size: 10px;
    color: var(--an-text-faint);
}

/* ── Table cells ────────────────────────────────────────── */
.analytics-table-cell  { font-size: 12px; color: var(--an-text); }
.analytics-date-cell   { font-size: 11px; color: var(--an-text-muted); }

.analytics-table-action-btn {
    padding: 5px 8px;
    border-radius: 6px;
    border: 1px solid var(--an-widget-border);
    background: transparent;
    color: var(--an-primary);
    cursor: pointer;
    transition: var(--an-transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.analytics-table-action-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.25);
}

/* ── Health badge ───────────────────────────────────────── */
.analytics-health-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

/* ── Interaction count bar ──────────────────────────────── */
.analytics-interaction-count-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.analytics-interaction-bar {
    height: 4px;
    border-radius: 3px;
    transition: width 0.5s ease;
    max-width: 60px;
}

.analytics-interaction-count {
    font-size: 11px;
    font-weight: 800;
}

/* ════════════════════════════════════════════════════════════
   13. DORMANT CONTACTS GRID
════════════════════════════════════════════════════════════ */
.analytics-dormant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

.analytics-dormant-card {
    background: var(--an-widget-bg);
    border: 1px solid var(--an-widget-border);
    border-radius: var(--an-radius);
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--an-transition);
}

.analytics-dormant-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

body.crm-dark-mode .analytics-dormant-card:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.analytics-dormant-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    position: relative;
}

.analytics-dormant-ice {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--an-widget-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--an-widget-border);
}

.analytics-dormant-info { flex: 1; min-width: 0; }
.analytics-dormant-name { font-size: 12px; font-weight: 700; color: var(--an-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.analytics-dormant-company { font-size: 10px; color: var(--an-text-faint); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.analytics-dormant-days { font-size: 10px; font-weight: 700; margin-top: 4px; display: flex; align-items: center; gap: 3px; }

.analytics-dormant-actions { flex-shrink: 0; }

.analytics-dormant-btn {
    padding: 5px 10px;
    border-radius: 7px;
    font-size: 10px;
    font-weight: 700;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    transition: var(--an-transition);
    white-space: nowrap;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.analytics-dormant-btn:hover { opacity: 0.8; }

/* ════════════════════════════════════════════════════════════
   14. HEALTH SCORE DISTRIBUTION PILLS
════════════════════════════════════════════════════════════ */
.analytics-health-breakdown {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.analytics-health-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

.analytics-health-pill-count { font-size: 14px; font-weight: 900; }
.analytics-health-pill-label { font-weight: 700; }
.analytics-health-pill-pct   { font-size: 10px; opacity: 0.8; }

/* ════════════════════════════════════════════════════════════
   15. TEAM COVERAGE LIST
════════════════════════════════════════════════════════════ */
.analytics-coverage-list { display: flex; flex-direction: column; gap: 8px; }

.analytics-coverage-row {
    display: grid;
    grid-template-columns: 200px 1fr 200px;
    gap: 16px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--an-surface);
    border: 1px solid var(--an-widget-border);
    transition: var(--an-transition);
}

.analytics-coverage-row:hover { background: var(--an-surface-hover); }

body.crm-dark-mode .analytics-coverage-row {
    background: rgba(15, 23, 42, 0.4);
    border-color: rgba(255, 255, 255, 0.04);
}

body.crm-dark-mode .analytics-coverage-row:hover {
    background: rgba(30, 41, 59, 0.7);
}

.analytics-coverage-member { display: flex; align-items: center; gap: 10px; min-width: 0; }

.analytics-coverage-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    position: relative;
}

.analytics-top-performer-crown {
    position: absolute;
    top: -4px;
    right: -4px;
}

.analytics-coverage-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--an-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.analytics-coverage-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 20px;
    font-size: 9px;
    font-weight: 700;
    margin-top: 3px;
}

.analytics-coverage-stats { display: flex; gap: 14px; flex-wrap: wrap; }

.analytics-coverage-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--an-text-muted);
    white-space: nowrap;
}

.analytics-coverage-bar-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.analytics-coverage-bar-track {
    flex: 1;
    height: 6px;
    border-radius: 4px;
    background: var(--an-input-bg);
    overflow: hidden;
}

.analytics-coverage-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
    min-width: 2px;
}

.analytics-coverage-score {
    font-size: 11px;
    font-weight: 800;
    min-width: 24px;
    text-align: right;
}

/* ════════════════════════════════════════════════════════════
   16. DEALS SOURCING TABLE (Team Tab)
════════════════════════════════════════════════════════════ */
.analytics-sourcing-table { width: 100%; }

.analytics-sourcing-row {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1.5fr 80px 100px;
    gap: 12px;
    align-items: center;
    padding: 10px 8px;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.analytics-sourcing-row:hover { background: var(--an-surface); }

.analytics-sourcing-member {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.analytics-member-rank {
    font-size: 10px;
    font-weight: 800;
    color: var(--an-text-faint);
    min-width: 18px;
    flex-shrink: 0;
}

.analytics-sourcing-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    color: #fff;
}

.analytics-sourcing-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--an-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.analytics-sourcing-bar-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.analytics-mini-bar-track {
    flex: 1;
    height: 5px;
    border-radius: 3px;
    background: var(--an-input-bg);
    overflow: hidden;
    min-width: 30px;
}

.analytics-mini-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
    min-width: 2px;
}

.analytics-sourcing-num {
    font-size: 11px;
    font-weight: 800;
    min-width: 40px;
    white-space: nowrap;
}

.analytics-sourcing-cell { font-size: 12px; color: var(--an-text); }

.analytics-winrate-pill {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

/* ════════════════════════════════════════════════════════════
   17. ACTIVITY HEATMAP (Team Tab)
════════════════════════════════════════════════════════════ */
.analytics-heatmap-wrap {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.analytics-heatmap-days {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    font-size: 9px;
    color: var(--an-text-faint);
    font-weight: 700;
    padding-top: 20px;
    flex-shrink: 0;
}

.analytics-heatmap-day-label {
    height: 16px;
    display: flex;
    align-items: center;
    padding-right: 6px;
    white-space: nowrap;
}

.analytics-heatmap-grid-wrap { flex: 1; min-width: 0; }

.analytics-heatmap-hours {
    display: flex;
    justify-content: space-between;
    font-size: 8px;
    color: var(--an-text-faint);
    margin-bottom: 3px;
}

.analytics-heatmap-hour-label { flex: 1; text-align: center; }

.analytics-heatmap-grid {
    display: grid;
    grid-template-columns: repeat(24, 1fr);
    grid-template-rows: repeat(7, 16px);
    gap: 2px;
}

.analytics-heatmap-cell {
    border-radius: 3px;
    cursor: default;
    transition: opacity 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.analytics-heatmap-cell:hover { opacity: 0.75; }

.analytics-heatmap-count {
    font-size: 7px;
    font-weight: 800;
    color: #fff;
    pointer-events: none;
}

.analytics-heatmap-legend {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 10px;
    font-size: 9px;
    color: var(--an-text-faint);
}

.analytics-heatmap-legend-cell {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════
   18. BENCHMARK CARDS GRID (AI Tab)
════════════════════════════════════════════════════════════ */
.analytics-benchmark-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
    gap: 12px;
    margin-bottom: 4px;
}

.analytics-benchmark-card {
    border-radius: var(--an-radius);
    padding: 14px;
    transition: var(--an-transition);
}

.analytics-benchmark-card:hover { transform: translateY(-1px); }

.analytics-benchmark-card-label {
    font-size: 10px;
    font-weight: 800;
    color: var(--an-text-faint);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.analytics-benchmark-card-values {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.analytics-benchmark-yours {
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
}

.analytics-benchmark-yours-label,
.analytics-benchmark-industry-label {
    font-size: 9px;
    color: var(--an-text-faint);
    margin-top: 2px;
}

.analytics-benchmark-industry {
    font-size: 14px;
    font-weight: 700;
    color: var(--an-text-muted);
}

.analytics-benchmark-vs {
    font-size: 9px;
    color: var(--an-text-faint);
    font-weight: 600;
}

.analytics-benchmark-delta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
}

/* Inline badge used in funnel rows */
.analytics-benchmark-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════
   19. EMPTY & SUCCESS STATES
════════════════════════════════════════════════════════════ */
.analytics-empty {
    text-align: center;
    padding: 32px 20px;
    color: var(--an-text-faint);
    font-size: 12px;
    font-weight: 600;
}

.analytics-empty i {
    font-size: 28px;
    margin-bottom: 10px;
    display: block;
    opacity: 0.4;
}

.analytics-success-state {
    text-align: center;
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ════════════════════════════════════════════════════════════
   20. DARK MODE — Widget backgrounds (Part 1)
════════════════════════════════════════════════════════════ */
body.crm-dark-mode .analytics-hero-metric,
body.crm-dark-mode .analytics-metric-card,
body.crm-dark-mode .analytics-tabs-bar,
body.crm-dark-mode .analytics-dormant-card,
body.crm-dark-mode .analytics-custom-live-widget {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(255, 255, 255, 0.06);
}

body.crm-dark-mode #analyticsHeroMetrics .analytics-hero-metric {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

body.crm-dark-mode .analytics-funnel-bar-track,
body.crm-dark-mode .analytics-lp-funnel-bar-track,
body.crm-dark-mode .analytics-mini-bar-track,
body.crm-dark-mode .analytics-coverage-bar-track {
    background: rgba(255, 255, 255, 0.06);
}

body.crm-dark-mode .analytics-table-header { background: rgba(15, 23, 42, 0.5); }
body.crm-dark-mode .analytics-table-row:hover { background: rgba(255, 255, 255, 0.03); }
body.crm-dark-mode .analytics-sourcing-row:hover { background: rgba(255, 255, 255, 0.03); }
body.crm-dark-mode .analytics-funnel-row:hover { background: rgba(255, 255, 255, 0.03); }
body.crm-dark-mode .analytics-lp-funnel-stage:hover { background: rgba(255, 255, 255, 0.03); }

/* ════════════════════════════════════════════════════════════
   21. RESPONSIVE — TABLET (≤ 1200px)
════════════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
    .analytics-kpi-row { grid-template-columns: repeat(3, 1fr); }
    #analyticsHeroMetrics { grid-template-columns: repeat(3, 1fr); }
    .analytics-coverage-row { grid-template-columns: 1fr 1fr; }
    .analytics-coverage-bar-wrap { display: none; }
    .analytics-benchmark-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ════════════════════════════════════════════════════════════
   22. RESPONSIVE — MOBILE (≤ 768px)
════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    /* Layout */
    .analytics-row-2col      { grid-template-columns: 1fr; }
    .analytics-ai-tabs-grid  { grid-template-columns: 1fr; }
    .analytics-kpi-row       { grid-template-columns: repeat(2, 1fr); }
    #analyticsHeroMetrics    { grid-template-columns: repeat(2, 1fr); gap: 8px; }

    /* Widgets */
    .analytics-widget { padding: 14px; }
    .analytics-metric-value { font-size: 18px; }

    /* Tabs */
    .analytics-tabs-bar { gap: 2px; padding: 4px; }
    .analytics-tab-btn  { padding: 7px 10px; font-size: 11px; }
    .analytics-tab-btn span { display: none; }

    /* Funnel */
    .analytics-funnel-stages { min-width: 140px; font-size: 11px; }
    .analytics-funnel-rate-wrap { min-width: 90px; }

    /* LP Funnel */
    .analytics-lp-funnel-stage { grid-template-columns: 120px 1fr; }
    .analytics-lp-funnel-meta { display: none; }

    /* Contacts table */
    .analytics-table-header,
    .analytics-table-row {
        grid-template-columns: 1.5fr 1fr 60px;
        min-width: 0;
    }
    .analytics-table-header span:nth-child(2),
    .analytics-table-row .analytics-table-cell:nth-child(2),
    .analytics-table-header span:nth-child(4),
    .analytics-table-row .analytics-table-cell:nth-child(4),
    .analytics-table-header span:nth-child(5),
    .analytics-table-row .analytics-date-cell { display: none; }

    /* Dormant */
    .analytics-dormant-grid { grid-template-columns: 1fr; }

    /* Coverage */
    .analytics-coverage-row { grid-template-columns: 1fr; gap: 8px; }
    .analytics-coverage-stats { gap: 10px; }

    /* Sourcing */
    .analytics-sourcing-row { grid-template-columns: 1.5fr 1fr 80px; }
    .analytics-sourcing-row > div:nth-child(3),
    .analytics-sourcing-row > div:nth-child(4) { display: none; }

    /* Benchmark */
    .analytics-benchmark-grid { grid-template-columns: repeat(2, 1fr); }

    /* Hero */
    .analytics-hero-metric { padding: 10px; }
    .analytics-hero-metric-value { font-size: 16px; }
    .analytics-hero-delta { display: none; }

    /* Range bar */
    .analytics-range-btn { padding: 5px 8px; font-size: 10px; }
}

/* ════════════════════════════════════════════════════════════
   23. RESPONSIVE — SMALL MOBILE (≤ 480px)
════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
    .analytics-kpi-row    { grid-template-columns: 1fr 1fr; gap: 8px; }
    #analyticsHeroMetrics { grid-template-columns: 1fr 1fr; }
    .analytics-benchmark-grid { grid-template-columns: 1fr; }
    .analytics-metric-value { font-size: 16px; }
    .analytics-hero-metric-value { font-size: 14px; }

    .analytics-tab-btn { padding: 6px 8px; font-size: 10px; gap: 4px; }

    /* Heatmap scrollable */
    .analytics-heatmap-wrap { min-width: 0; }
}

/* ════════════════════════════════════════════════════════════
   24. PRINT
════════════════════════════════════════════════════════════ */
@media print {
    .analytics-tabs-bar,
    .analytics-ai-fab,
    #crmHeader,
    #crmSidebar,
    .analytics-range-bar { display: none !important; }

    .analytics-widget { break-inside: avoid; box-shadow: none; border: 1px solid #e2e8f0; }
    .analytics-tab-panel { display: block !important; }
    #analyticsHeroMetrics { grid-template-columns: repeat(3, 1fr); }
}

/* ════════════════════════════════════════════════════════════
   END — crm-analytics.css Part 1/2
   © AlphaVault AI — All rights reserved
════════════════════════════════════════════════════════════ */

/* ============================================================
   ALPHAVAULT CRM ANALYTICS — crm-analytics.css v1.0
   PART 2/2 — AI Widgets, Custom Dashboard, Dark Mode, Utils
   ============================================================ */

/* ════════════════════════════════════════════════════════════
   25. AI LOADING & THINKING STATE
════════════════════════════════════════════════════════════ */

/* ── Container de chargement AI ─────────────────────────── */
.analytics-ai-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 4px;
    color: var(--an-text-faint);
}

.analytics-ai-thinking {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 0;
    color: var(--an-text-faint);
}

.analytics-ai-thinking-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--an-text-faint);
}

/* ── Thinking dots (réutilise animation crm-dashboard.css) ─ */
.analytics-ai-loading .crm-ai-thinking-dots,
.analytics-ai-thinking .crm-ai-thinking-dots {
    display: inline-flex;
    gap: 5px;
    align-items: center;
    flex-shrink: 0;
}

.analytics-ai-loading .crm-ai-thinking-dots span,
.analytics-ai-thinking .crm-ai-thinking-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--an-purple);
    animation: crmPulse 0.8s ease-in-out infinite;
    display: inline-block;
}

.analytics-ai-loading .crm-ai-thinking-dots span:nth-child(2),
.analytics-ai-thinking .crm-ai-thinking-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.analytics-ai-loading .crm-ai-thinking-dots span:nth-child(3),
.analytics-ai-thinking .crm-ai-thinking-dots span:nth-child(3) {
    animation-delay: 0.30s;
}

/* ════════════════════════════════════════════════════════════
   26. AI HEADER BANNER (AI Insights Tab)
════════════════════════════════════════════════════════════ */
.analytics-ai-header-banner {
    background: linear-gradient(
        135deg,
        rgba(139, 92, 246, 0.1) 0%,
        rgba(102, 126, 234, 0.07) 100%
    );
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--an-radius-lg);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

body.crm-dark-mode .analytics-ai-header-banner {
    background: linear-gradient(
        135deg,
        rgba(139, 92, 246, 0.12) 0%,
        rgba(102, 126, 234, 0.08) 100%
    );
    border-color: rgba(139, 92, 246, 0.25);
}

.analytics-ai-banner-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}

/* ── Banner icon with glow ring ─────────────────────────── */
.analytics-ai-banner-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #8b5cf6, #667eea);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    position: relative;
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.analytics-ai-banner-pulse {
    position: absolute;
    inset: -3px;
    border-radius: 17px;
    border: 2px solid rgba(139, 92, 246, 0.35);
    animation: crmGlow 2.5s ease-in-out infinite;
}

.analytics-ai-banner-title {
    font-size: 16px;
    font-weight: 900;
    color: var(--an-text);
    margin-bottom: 3px;
}

.analytics-ai-banner-sub {
    font-size: 11px;
    color: var(--an-text-muted);
    line-height: 1.5;
}

.analytics-ai-banner-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* ── AI Refresh Button (main) ───────────────────────────── */
.analytics-ai-refresh-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    background: linear-gradient(135deg, #8b5cf6, #667eea);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: var(--an-transition);
    font-family: inherit;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
}

.analytics-ai-refresh-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
}

.analytics-ai-refresh-btn i { font-size: 11px; }

.analytics-ai-last-gen {
    font-size: 10px;
    color: var(--an-text-faint);
    font-weight: 500;
    white-space: nowrap;
}

/* ── AI Single Refresh (per widget) ────────────────────── */
.analytics-ai-single-refresh {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 8px;
    border: 1px solid var(--an-widget-border);
    background: transparent;
    color: var(--an-text-faint);
    cursor: pointer;
    transition: var(--an-transition);
    flex-shrink: 0;
}

.analytics-ai-single-refresh:hover {
    background: rgba(139, 92, 246, 0.1);
    color: var(--an-purple);
    border-color: rgba(139, 92, 246, 0.25);
}

.analytics-ai-single-refresh i { font-size: 10px; }

/* ════════════════════════════════════════════════════════════
   27. AI CONTENT AREA & NARRATIVE
════════════════════════════════════════════════════════════ */
.analytics-ai-content { min-height: 60px; }

.analytics-ai-narrative {
    font-size: 13px;
    line-height: 1.8;
    color: var(--an-text);
}

.analytics-ai-narrative--compact {
    font-size: 12px;
    line-height: 1.65;
}

/* ── Markdown formatting ────────────────────────────────── */
.analytics-ai-h2 {
    font-size: 14px;
    font-weight: 800;
    color: var(--an-text);
    margin: 16px 0 6px;
    display: block;
}

.analytics-ai-h3 {
    font-size: 11px;
    font-weight: 800;
    color: var(--an-text);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin: 12px 0 5px;
    display: block;
}

.analytics-ai-bullet {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 5px 0;
    font-size: 12.5px;
    color: var(--an-text);
}

.analytics-ai-bullet-dot {
    color: var(--an-purple);
    font-size: 10px;
    margin-top: 4px;
    flex-shrink: 0;
}

.analytics-ai-numbered {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 5px 0;
    font-size: 12.5px;
    color: var(--an-text);
}

.analytics-ai-num {
    color: var(--an-primary);
    font-weight: 800;
    font-size: 11px;
    min-width: 16px;
    flex-shrink: 0;
    padding-top: 2px;
}

.analytics-ai-paragraph-break { height: 10px; display: block; }

/* ── AI Footer ──────────────────────────────────────────── */
.analytics-ai-footer {
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid var(--an-widget-border);
    font-size: 10px;
    color: var(--an-text-faint);
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ── AI Error state ─────────────────────────────────────── */
.analytics-ai-error {
    padding: 12px 14px;
    border-radius: 8px;
    background: rgba(245, 158, 11, 0.07);
    border: 1px solid rgba(245, 158, 11, 0.2);
    font-size: 12px;
    color: var(--an-amber);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

body.crm-dark-mode .analytics-ai-error {
    background: rgba(245, 158, 11, 0.1);
}

/* ════════════════════════════════════════════════════════════
   28. DORMANT COUNT BADGE (Relationship widget header)
════════════════════════════════════════════════════════════ */
.analytics-dormant-badge {
    font-size: 10px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(100, 116, 139, 0.1);
    color: var(--an-text-faint);
    border: 1px solid rgba(100, 116, 139, 0.15);
    white-space: nowrap;
    flex-shrink: 0;
}

.analytics-dormant-badge--alert {
    background: rgba(239, 68, 68, 0.12) !important;
    color: var(--an-red) !important;
    border-color: rgba(239, 68, 68, 0.2) !important;
    animation: crmPulse 2s ease-in-out infinite;
}

/* ════════════════════════════════════════════════════════════
   29. CUSTOM DASHBOARD — Header
════════════════════════════════════════════════════════════ */
.analytics-custom-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    background: var(--an-widget-bg);
    border: 1px solid var(--an-widget-border);
    border-radius: var(--an-radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--an-widget-shadow);
}

body.crm-dark-mode .analytics-custom-header {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(255, 255, 255, 0.06);
}

.analytics-custom-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.analytics-custom-header-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #ec4899, #db2777);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    box-shadow: 0 4px 14px rgba(236, 72, 153, 0.35);
}

.analytics-custom-header-title {
    font-size: 15px;
    font-weight: 900;
    color: var(--an-text);
    margin-bottom: 3px;
}

.analytics-custom-header-sub {
    font-size: 11px;
    color: var(--an-text-muted);
}

.analytics-custom-header-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* ── Custom buttons ─────────────────────────────────────── */
.analytics-custom-btn {
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--an-transition);
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    white-space: nowrap;
}

.analytics-custom-btn--primary {
    background: linear-gradient(135deg, #ec4899, #db2777);
    color: #fff;
    border: none;
    box-shadow: 0 4px 14px rgba(236, 72, 153, 0.3);
}

.analytics-custom-btn--primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.45);
}

.analytics-custom-btn--secondary {
    background: transparent;
    border: 1px solid var(--an-widget-border);
    color: var(--an-text-muted);
}

.analytics-custom-btn--secondary:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--an-text);
    border-color: rgba(0, 0, 0, 0.12);
}

body.crm-dark-mode .analytics-custom-btn--secondary:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

/* ════════════════════════════════════════════════════════════
   30. CUSTOM DASHBOARD — Widget Selector
════════════════════════════════════════════════════════════ */
.analytics-custom-cat-section { margin-bottom: 22px; }
.analytics-custom-cat-section:last-child { margin-bottom: 0; }

.analytics-custom-cat-label {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.analytics-custom-widgets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
}

/* ── Widget card (toggle) ───────────────────────────────── */
.analytics-custom-widget-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--an-widget-border);
    background: var(--an-widget-bg);
    cursor: pointer;
    transition: var(--an-transition);
    user-select: none;
}

.analytics-custom-widget-card:hover {
    border-color: var(--cat-color, #667eea);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.08);
    transform: translateY(-1px);
}

.analytics-custom-widget-card--active {
    border-color: var(--cat-color, #667eea) !important;
    background: rgba(102, 126, 234, 0.03);
}

body.crm-dark-mode .analytics-custom-widget-card {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(255, 255, 255, 0.06);
}

body.crm-dark-mode .analytics-custom-widget-card--active {
    background: rgba(102, 126, 234, 0.08);
}

/* ── Widget card inner elements ─────────────────────────── */
.analytics-custom-widget-check {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 2px solid;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--an-transition);
}

.analytics-custom-widget-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--an-transition);
}

.analytics-custom-widget-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--an-text);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.analytics-custom-widget-tag {
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════
   31. CUSTOM DASHBOARD — Preview Grid (Drag & Drop)
════════════════════════════════════════════════════════════ */
.analytics-custom-preview-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.analytics-custom-preview-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--an-surface);
    border: 1px solid var(--an-widget-border);
    cursor: grab;
    transition: var(--an-transition);
    user-select: none;
}

.analytics-custom-preview-item:hover {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    border-color: rgba(102, 126, 234, 0.2);
}

.analytics-custom-preview-item:active { cursor: grabbing; }

body.crm-dark-mode .analytics-custom-preview-item {
    background: rgba(15, 23, 42, 0.5);
    border-color: rgba(255, 255, 255, 0.05);
}

body.crm-dark-mode .analytics-custom-preview-item:hover {
    background: rgba(30, 41, 59, 0.7);
}

/* Drag over visual feedback */
.analytics-custom-preview-item[style*="background: rgba"] {
    border-color: rgba(102, 126, 234, 0.35);
}

.analytics-custom-preview-drag {
    cursor: grab;
    flex-shrink: 0;
    opacity: 0.5;
    transition: opacity 0.15s;
}

.analytics-custom-preview-item:hover .analytics-custom-preview-drag {
    opacity: 1;
}

.analytics-custom-preview-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.analytics-custom-preview-info { flex: 1; min-width: 0; }

.analytics-custom-preview-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--an-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.analytics-custom-preview-cat {
    font-size: 10px;
    font-weight: 600;
    margin-top: 1px;
}

.analytics-custom-preview-order {
    font-size: 10px;
    font-weight: 800;
    color: var(--an-text-faint);
    min-width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.analytics-custom-preview-remove {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    flex-shrink: 0;
    border: 1px solid var(--an-widget-border);
    background: transparent;
    color: var(--an-text-faint);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--an-transition);
    font-family: inherit;
}

.analytics-custom-preview-remove:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--an-red);
}

/* ════════════════════════════════════════════════════════════
   32. CUSTOM DASHBOARD — Live Widget Preview
════════════════════════════════════════════════════════════ */
.analytics-custom-live-section { margin-top: 16px; }

.analytics-custom-live-label {
    font-size: 12px;
    font-weight: 800;
    color: var(--an-text);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.analytics-custom-live-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.analytics-custom-live-widget {
    background: var(--an-widget-bg);
    border: 1px solid var(--an-widget-border);
    border-radius: var(--an-radius-lg);
    padding: 16px;
    box-shadow: var(--an-widget-shadow);
    transition: var(--an-transition);
}

.analytics-custom-live-widget:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

body.crm-dark-mode .analytics-custom-live-widget {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(255, 255, 255, 0.06);
}

/* ── Custom metric display ──────────────────────────────── */
.analytics-custom-metric-big {
    font-size: 28px;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 4px;
}

.analytics-custom-metric-sub {
    font-size: 11px;
    color: var(--an-text-muted);
}

/* ── Mini row list ──────────────────────────────────────── */
.analytics-custom-mini-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--an-widget-border);
    font-size: 12px;
    color: var(--an-text);
}

.analytics-custom-mini-row:last-child { border-bottom: none; }

/* ════════════════════════════════════════════════════════════
   33. DARK MODE — Overrides Part 2
════════════════════════════════════════════════════════════ */

/* ── AI widgets dark ────────────────────────────────────── */
body.crm-dark-mode .analytics-widget-ai {
    background: linear-gradient(
        135deg,
        rgba(139, 92, 246, 0.08) 0%,
        rgba(102, 126, 234, 0.05) 100%
    );
    border-color: rgba(139, 92, 246, 0.18);
}

body.crm-dark-mode .analytics-widget-global {
    background: linear-gradient(
        135deg,
        rgba(139, 92, 246, 0.12) 0%,
        rgba(102, 126, 234, 0.08) 100%
    );
}

body.crm-dark-mode .analytics-ai-narrative {
    color: #e2e8f0;
}

body.crm-dark-mode .analytics-ai-h2,
body.crm-dark-mode .analytics-ai-h3 {
    color: #f0f4f8;
}

body.crm-dark-mode .analytics-ai-bullet,
body.crm-dark-mode .analytics-ai-numbered {
    color: #cbd5e1;
}

body.crm-dark-mode .analytics-ai-footer {
    border-top-color: rgba(255, 255, 255, 0.06);
}

/* ── Custom dashboard dark ──────────────────────────────── */
body.crm-dark-mode .analytics-custom-widget-card {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(255, 255, 255, 0.06);
}

body.crm-dark-mode .analytics-custom-widget-card--active {
    background: rgba(102, 126, 234, 0.1);
}

body.crm-dark-mode .analytics-custom-live-section
    .analytics-custom-live-label { color: #e2e8f0; }

body.crm-dark-mode .analytics-custom-mini-row {
    border-bottom-color: rgba(255, 255, 255, 0.04);
    color: #cbd5e1;
}

/* ── Hot prospects dark ─────────────────────────────────── */
body.crm-dark-mode .analytics-hot-prospect-row {
    background: rgba(15, 23, 42, 0.5);
}

body.crm-dark-mode .analytics-hot-prospect-row:hover {
    background: rgba(30, 41, 59, 0.7);
}

/* ── Benchmark cards dark ───────────────────────────────── */
body.crm-dark-mode .analytics-benchmark-card {
    border-color: rgba(255, 255, 255, 0.08) !important;
}

/* ── Heatmap dark ───────────────────────────────────────── */
body.crm-dark-mode .analytics-heatmap-wrap::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
}

/* ── Funnel bars dark ───────────────────────────────────── */
body.crm-dark-mode .analytics-funnel-benchmark-line {
    background: #f59e0b;
    opacity: 0.85;
}

/* ── Sourcing table dark ────────────────────────────────── */
body.crm-dark-mode .analytics-sourcing-row:hover,
body.crm-dark-mode .analytics-table-row:hover,
body.crm-dark-mode .analytics-coverage-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* ── Range buttons dark ─────────────────────────────────── */
body.crm-dark-mode .analytics-range-bar {
    background: rgba(15, 23, 42, 0.5);
}

body.crm-dark-mode .analytics-range-btn.active {
    background: rgba(102, 126, 234, 0.2);
}

/* ── Metric cards dark ──────────────────────────────────── */
body.crm-dark-mode .analytics-metric-card--alert {
    background: rgba(239, 68, 68, 0.06) !important;
}

/* ── Success state dark ─────────────────────────────────── */
body.crm-dark-mode .analytics-widget--success {
    border-color: rgba(16, 185, 129, 0.15);
    background: rgba(16, 185, 129, 0.04) !important;
}

/* ── Table header dark ──────────────────────────────────── */
body.crm-dark-mode .analytics-table-header {
    background: rgba(15, 23, 42, 0.5);
    color: #64748b;
}

/* ── Contact health dot dark (contraste border) ─────────── */
body.crm-dark-mode .analytics-contact-health-dot {
    border-color: rgba(30, 41, 59, 0.95);
}

body.crm-dark-mode .analytics-dormant-ice {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(255, 255, 255, 0.08);
}

/* ════════════════════════════════════════════════════════════
   34. LIGHT MODE — Polish Part 2
════════════════════════════════════════════════════════════ */
body:not(.crm-dark-mode) .analytics-ai-header-banner {
    box-shadow: 0 2px 12px rgba(139, 92, 246, 0.08);
}

body:not(.crm-dark-mode) .analytics-custom-header {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

body:not(.crm-dark-mode) .analytics-custom-preview-item {
    background: rgba(241, 245, 249, 0.7);
}

body:not(.crm-dark-mode) .analytics-custom-preview-item:hover {
    background: rgba(241, 245, 249, 0.95);
}

body:not(.crm-dark-mode) .analytics-custom-widget-card:hover {
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.1);
}

body:not(.crm-dark-mode) .analytics-dormant-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

body:not(.crm-dark-mode) .analytics-coverage-row {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

/* ════════════════════════════════════════════════════════════
   35. RESPONSIVE — TABLET (≤ 1200px) Part 2
════════════════════════════════════════════════════════════ */
@media (max-width: 1200px) {

    /* AI Tabs grid */
    .analytics-ai-tabs-grid { grid-template-columns: 1fr 1fr; }

    /* Banner */
    .analytics-ai-banner-title { font-size: 14px; }
    .analytics-ai-banner-sub   { font-size: 10px; }

    /* Custom widgets grid */
    .analytics-custom-widgets-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    /* Live content */
    .analytics-custom-live-content {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

/* ════════════════════════════════════════════════════════════
   36. RESPONSIVE — MOBILE (≤ 768px) Part 2
════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

    /* AI Header Banner */
    .analytics-ai-header-banner {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px;
    }

    .analytics-ai-banner-icon { width: 40px; height: 40px; font-size: 17px; }
    .analytics-ai-banner-title { font-size: 14px; }
    .analytics-ai-banner-actions { width: 100%; justify-content: space-between; }

    .analytics-ai-refresh-btn { flex: 1; justify-content: center; }

    /* AI Tabs grid → single col */
    .analytics-ai-tabs-grid { grid-template-columns: 1fr; }

    /* Custom header */
    .analytics-custom-header { flex-direction: column; align-items: flex-start; }
    .analytics-custom-header-actions { width: 100%; }
    .analytics-custom-btn { flex: 1; justify-content: center; }

    /* Custom widgets grid */
    .analytics-custom-widgets-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Custom widget card — hide tag */
    .analytics-custom-widget-tag { display: none; }

    /* Live content */
    .analytics-custom-live-content { grid-template-columns: 1fr; }

    /* Preview list */
    .analytics-custom-preview-item { padding: 8px 10px; }
    .analytics-custom-preview-order { display: none; }

    /* Dormant badge */
    .analytics-dormant-badge { font-size: 9px; padding: 2px 8px; }

    /* AI narrative */
    .analytics-ai-narrative    { font-size: 12px; }
    .analytics-ai-h2           { font-size: 13px; }
    .analytics-ai-bullet,
    .analytics-ai-numbered     { font-size: 11.5px; }

    /* Heatmap */
    .analytics-heatmap-wrap    { overflow-x: scroll; }
    .analytics-heatmap-grid    {
        grid-template-rows: repeat(7, 14px);
        gap: 1px;
    }
    .analytics-heatmap-cell    { border-radius: 2px; }
    .analytics-heatmap-count   { display: none; }
    .analytics-heatmap-legend-cell { width: 10px; height: 10px; }

    /* Benchmark grid */
    .analytics-benchmark-grid  { grid-template-columns: repeat(2, 1fr); }

    /* Coverage row */
    .analytics-coverage-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    /* Sourcing table — hide less important cols */
    .analytics-sourcing-row {
        grid-template-columns: 1.5fr 1fr;
    }

    .analytics-sourcing-row > div:nth-child(3),
    .analytics-sourcing-row > div:nth-child(4),
    .analytics-sourcing-row > div:nth-child(5) { display: none; }

    /* AI single refresh */
    .analytics-ai-single-refresh { width: 26px; height: 26px; }

    /* Hot prospects */
    .analytics-hot-prospect-row { gap: 8px; }
    .analytics-hot-prospect-name { font-size: 12px; }
}

/* ════════════════════════════════════════════════════════════
   37. RESPONSIVE — SMALL MOBILE (≤ 480px) Part 2
════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {

    /* AI Banner */
    .analytics-ai-banner-left    { gap: 10px; }
    .analytics-ai-banner-icon    { width: 36px; height: 36px; font-size: 15px; }
    .analytics-ai-banner-title   { font-size: 13px; }
    .analytics-ai-banner-sub     { display: none; }

    /* Custom widgets grid → single col */
    .analytics-custom-widgets-grid { grid-template-columns: 1fr; }

    /* Benchmark → single col */
    .analytics-benchmark-grid { grid-template-columns: 1fr; }

    /* AI Tabs */
    .analytics-ai-tabs-grid { grid-template-columns: 1fr; }

    /* Dormant grid → single col */
    .analytics-dormant-grid { grid-template-columns: 1fr; }

    /* LP Funnel simplified */
    .analytics-lp-funnel-stage {
        grid-template-columns: 100px 1fr;
        gap: 8px;
    }

    /* Metric big */
    .analytics-custom-metric-big { font-size: 22px; }

    /* Coverage */
    .analytics-coverage-stats { gap: 8px; }
    .analytics-coverage-stat  { font-size: 10px; }

    /* Heatmap */
    .analytics-heatmap-days { display: none; }
}

/* ════════════════════════════════════════════════════════════
   38. LANDSCAPE MOBILE (≤ 768px landscape)
════════════════════════════════════════════════════════════ */
@media (max-width: 768px) and (orientation: landscape) {

    .analytics-ai-header-banner { padding: 12px 16px; }
    .analytics-ai-banner-sub    { display: none; }
    .analytics-ai-tabs-grid     { grid-template-columns: 1fr 1fr; }

    .analytics-benchmark-grid   { grid-template-columns: repeat(3, 1fr); }

    .analytics-heatmap-grid {
        grid-template-rows: repeat(7, 12px);
    }
}

/* ════════════════════════════════════════════════════════════
   39. SCROLLBARS — Analytics-specific
════════════════════════════════════════════════════════════ */
.analytics-heatmap-wrap::-webkit-scrollbar { height: 4px; }
.analytics-heatmap-wrap::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

body.crm-dark-mode .analytics-heatmap-wrap::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
}

.analytics-contacts-table::-webkit-scrollbar { height: 4px; }
.analytics-contacts-table::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.08);
    border-radius: 4px;
}

/* ════════════════════════════════════════════════════════════
   40. ANIMATIONS — Analytics-specific
════════════════════════════════════════════════════════════ */

/* ── Bar fill entrance (utilisé via JS width transitions) ─ */
@keyframes analyticsBarGrow {
    from { width: 0 !important; }
    to   { width: var(--bar-width, 100%); }
}

/* ── Metric card entrance ───────────────────────────────── */
@keyframes analyticsCardIn {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.analytics-metric-card,
.analytics-hero-metric {
    animation: analyticsCardIn 0.4s ease forwards;
}

/* Stagger via nth-child (jusqu'à 6 cols) */
.analytics-kpi-row > *:nth-child(1) { animation-delay: 0ms;  }
.analytics-kpi-row > *:nth-child(2) { animation-delay: 40ms; }
.analytics-kpi-row > *:nth-child(3) { animation-delay: 80ms; }
.analytics-kpi-row > *:nth-child(4) { animation-delay: 120ms; }
.analytics-kpi-row > *:nth-child(5) { animation-delay: 160ms; }
.analytics-kpi-row > *:nth-child(6) { animation-delay: 200ms; }

#analyticsHeroMetrics > *:nth-child(1) { animation-delay: 0ms;  }
#analyticsHeroMetrics > *:nth-child(2) { animation-delay: 50ms; }
#analyticsHeroMetrics > *:nth-child(3) { animation-delay: 100ms; }
#analyticsHeroMetrics > *:nth-child(4) { animation-delay: 150ms; }
#analyticsHeroMetrics > *:nth-child(5) { animation-delay: 200ms; }
#analyticsHeroMetrics > *:nth-child(6) { animation-delay: 250ms; }

/* ── Widget slide up ────────────────────────────────────── */
@keyframes analyticsWidgetIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.analytics-widget { animation: analyticsWidgetIn 0.4s ease forwards; }

/* ── AI banner entrance ─────────────────────────────────── */
.analytics-ai-header-banner {
    animation: analyticsCardIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* ── Dormant card stagger ───────────────────────────────── */
@keyframes analyticsDormantIn {
    from { opacity: 0; transform: translateX(-8px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ── Coverage row stagger ───────────────────────────────── */
@keyframes analyticsCoverageIn {
    from { opacity: 0; transform: translateX(8px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ── Glow pulse for AI banner icon ─────────────────────── */
/* (réutilise crmGlow défini dans crm-dashboard.css)        */

/* ════════════════════════════════════════════════════════════
   41. ACCESSIBILITY & PERFORMANCE
════════════════════════════════════════════════════════════ */

/* ── Focus states ───────────────────────────────────────── */
.analytics-tab-btn:focus-visible,
.analytics-range-btn:focus-visible,
.analytics-custom-btn:focus-visible,
.analytics-ai-refresh-btn:focus-visible,
.analytics-dormant-btn:focus-visible {
    outline: 2px solid var(--an-primary);
    outline-offset: 2px;
}

/* ── Reduce motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .analytics-metric-card,
    .analytics-hero-metric,
    .analytics-widget,
    .analytics-ai-header-banner {
        animation: none !important;
    }

    .analytics-funnel-bar-fill,
    .analytics-lp-funnel-bar-fill,
    .analytics-mini-bar-fill,
    .analytics-coverage-bar-fill {
        transition: none !important;
    }

    .analytics-dormant-badge--alert,
    .analytics-metric-alert-dot {
        animation: none !important;
    }

    .analytics-ai-banner-pulse { animation: none !important; }
}

/* ── GPU acceleration ───────────────────────────────────── */
.analytics-widget,
.analytics-metric-card,
.analytics-hero-metric,
.analytics-dormant-card,
.analytics-custom-widget-card,
.analytics-custom-preview-item {
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* ── iOS touch scroll ───────────────────────────────────── */
.analytics-heatmap-wrap,
.analytics-contacts-table,
.analytics-custom-live-content {
    -webkit-overflow-scrolling: touch;
}

/* ── iOS font-size zoom prevention ─────────────────────── */
@media (max-width: 768px) {
    .analytics-range-btn,
    .analytics-tab-btn,
    .analytics-custom-btn { font-size: 16px; }

    .analytics-range-btn:not(:focus),
    .analytics-tab-btn:not(:focus),
    .analytics-custom-btn:not(:focus) { font-size: 12px; }
}

/* ── Utility — truncate ─────────────────────────────────── */
.analytics-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Utility — sr-only ──────────────────────────────────── */
.analytics-sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ════════════════════════════════════════════════════════════
   42. PRINT — Part 2
════════════════════════════════════════════════════════════ */
@media print {

    .analytics-ai-header-banner,
    .analytics-ai-refresh-btn,
    .analytics-ai-single-refresh,
    .analytics-custom-btn,
    .analytics-custom-header-actions,
    .analytics-dormant-btn,
    .analytics-table-action-btn,
    .analytics-action-link { display: none !important; }

    .analytics-ai-narrative { font-size: 11px; line-height: 1.6; }

    .analytics-widget-ai {
        background: #f8f0ff !important;
        border-color: #e9d5ff !important;
    }

    .analytics-metric-card {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #e2e8f0 !important;
    }

    .analytics-dormant-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .analytics-benchmark-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .analytics-kpi-row {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    #analyticsHeroMetrics {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .analytics-ai-tabs-grid {
        grid-template-columns: 1fr 1fr !important;
    }

    .analytics-heatmap-count { display: flex !important; }
}

/* ════════════════════════════════════════════════════════════
   END — crm-analytics.css v1.0 (Part 2/2)
   © AlphaVault AI — All rights reserved
════════════════════════════════════════════════════════════ */