/* ============================================================
   ALPHAVAULT CRM DASHBOARD — crm-dashboard.css v1.0
   Light mode default · Dark mode via body.crm-dark-mode
   100% responsive PC/Mobile · Matching CRM Pipeline design
   ============================================================ */

/* ════════════════════════════════════════════════════════════
   1. CSS VARIABLES — LIGHT MODE (default)
════════════════════════════════════════════════════════════ */
:root {
    --crm-bg:             #f1f5f9;
    --crm-sidebar-bg:     #ffffff;
    --crm-header-bg:      rgba(255, 255, 255, 0.97);
    --crm-surface:        #ffffff;
    --crm-surface-hover:  #f8fafc;
    --crm-input-bg:       rgba(0, 0, 0, 0.04);
    --crm-card:           #ffffff;
  
    --crm-border:         rgba(0, 0, 0, 0.08);
    --crm-border-hover:   rgba(0, 0, 0, 0.15);
  
    --crm-text:           #1e293b;
    --crm-text-muted:     #475569;
    --crm-text-faint:     #94a3b8;
  
    --crm-primary:        #667eea;
    --crm-primary-dark:   #764ba2;
    --crm-green:          #10b981;
    --crm-amber:          #f59e0b;
    --crm-red:            #ef4444;
    --crm-purple:         #8b5cf6;
    --crm-cyan:           #06b6d4;
    --crm-orange:         #f97316;
  
    --crm-radius:         10px;
    --crm-radius-lg:      16px;
    --crm-radius-xl:      24px;
  
    --crm-shadow:         0 4px 24px rgba(0, 0, 0, 0.08);
    --crm-shadow-lg:      0 10px 50px rgba(0, 0, 0, 0.15);
    --crm-shadow-xl:      0 20px 60px rgba(0, 0, 0, 0.18);
  
    --crm-sidebar-w:      260px;
    --crm-header-h:       58px;
  
    --crm-transition:     all 0.2s ease;
  }
  
  /* ── Dark mode overrides ──────────────────────────────────── */
  body.crm-dark-mode {
    --crm-bg:             #0b1120;
    --crm-sidebar-bg:     #0f172a;
    --crm-header-bg:      rgba(11, 17, 32, 0.97);
    --crm-surface:        rgba(30, 41, 59, 0.92);
    --crm-surface-hover:  rgba(51, 65, 85, 0.9);
    --crm-input-bg:       rgba(255, 255, 255, 0.06);
    --crm-card:           rgba(30, 41, 59, 0.92);
    --crm-border:         rgba(255, 255, 255, 0.08);
    --crm-border-hover:   rgba(255, 255, 255, 0.15);
    --crm-text:           #f0f4f8;
    --crm-text-muted:     #cbd5e1;
    --crm-text-faint:     #94a3b8;
    --crm-shadow:         0 4px 24px rgba(0, 0, 0, 0.35);
    --crm-shadow-lg:      0 10px 50px rgba(0, 0, 0, 0.55);
    --crm-shadow-xl:      0 20px 60px rgba(0, 0, 0, 0.7);
  }
  
  /* ════════════════════════════════════════════════════════════
     2. RESET & BASE
  ════════════════════════════════════════════════════════════ */
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  
  html, body { height: 100%; overflow: hidden; }
  
  body.crm-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--crm-bg);
    color: var(--crm-text);
    font-size: 13px;
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
  }
  
  a  { color: inherit; text-decoration: none; }
  button { font-family: inherit; cursor: pointer; }
  select option { background: var(--crm-surface); color: var(--crm-text); }
  
  /* ════════════════════════════════════════════════════════════
     3. APP LAYOUT
  ════════════════════════════════════════════════════════════ */
  #crmApp {
    display: flex;
    height: 100vh;
    overflow: hidden;
    position: relative;
  }
  
  /* ════════════════════════════════════════════════════════════
     4. SIDEBAR
  ════════════════════════════════════════════════════════════ */
  #crmSidebar {
    width: var(--crm-sidebar-w);
    flex-shrink: 0;
    background: var(--crm-sidebar-bg);
    border-right: 1px solid var(--crm-border);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: visible;
    position: relative;
    z-index: 200;
    transition: width 0.25s ease, transform 0.3s ease;
  }
  
  body:not(.crm-dark-mode) #crmSidebar {
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.06);
  }
  
  /* ── Collapsed ──────────────────────────────────────────── */
  #crmSidebar.collapsed { width: 64px; }
  
  #crmSidebar.collapsed .crm-nav-item-text,
  #crmSidebar.collapsed .crm-nav-badge,
  #crmSidebar.collapsed .crm-nav-label,
  #crmSidebar.collapsed .crm-new-btn-text,
  #crmSidebar.collapsed .crm-new-chevron,
  #crmSidebar.collapsed .crm-platform-section,
  #crmSidebar.collapsed .crm-nav-divider,
  #crmSidebar.collapsed .crm-sidebar-user-name,
  #crmSidebar.collapsed .crm-sidebar-user-email,
  #crmSidebar.collapsed .crm-sidebar-plan-badge,
  #crmSidebar.collapsed #crmUserChevron,
  #crmSidebar.collapsed .crm-nav-tool-link .crm-nav-item-text { display: none; }
  
  #crmSidebar.collapsed .crm-nav-item {
    justify-content: center;
    padding: 10px;
  }
  
  #crmSidebar.collapsed .crm-nav-item-icon { margin: 0; }
  
  #crmSidebar.collapsed .crm-new-btn {
    justify-content: center;
    padding: 10px;
    min-width: 0;
  }
  
  #crmSidebar.collapsed .crm-nav-tool-link {
    justify-content: center;
    padding: 10px;
  }
  
  #crmSidebar.collapsed .crm-sidebar-footer { display: none; }
  
  /* ── Logo ───────────────────────────────────────────────── */
  .crm-sidebar-logo-wrap {
    display: flex;
    align-items: center;
    padding: 14px 14px 12px;
    min-height: 62px;
    text-decoration: none;
    flex-shrink: 0;
  }
  
  .crm-sidebar-logo-text {
    display: block;
    height: 38px;
    max-width: 180px;
    object-fit: contain;
  }
  
  .crm-sidebar-logo-icon {
    display: none;
    height: 36px;
    width: 36px;
    object-fit: contain;
  }
  
  #crmSidebar.collapsed .crm-sidebar-logo-text { display: none; }
  #crmSidebar.collapsed .crm-sidebar-logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 0;
  }
  
  /* ── Scroll area ────────────────────────────────────────── */
  .crm-sidebar-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; }
  .crm-sidebar-scroll::-webkit-scrollbar { width: 3px; }
  .crm-sidebar-scroll::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
  }
  body.crm-dark-mode .crm-sidebar-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
  }
  
  /* ════════════════════════════════════════════════════════════
     5. SIDEBAR TOGGLE (bouton cercle fermer/ouvrir)
  ════════════════════════════════════════════════════════════ */
  .crm-sidebar-toggle {
    position: absolute;
    right: -14px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--crm-surface);
    border: 1px solid var(--crm-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--crm-text-muted);
    font-size: 10px;
    z-index: 300;
    transition: var(--crm-transition);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
    user-select: none;
  }
  
  .crm-sidebar-toggle:hover {
    background: var(--crm-primary);
    color: #fff;
    border-color: var(--crm-primary);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.5);
    transform: translateY(-50%) scale(1.1);
  }
  
  /* ── Mobile close button ────────────────────────────────── */
  .crm-mobile-close-btn {
    display: none;
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.06);
    border: 1px solid var(--crm-border);
    color: var(--crm-text-muted);
    font-size: 14px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: var(--crm-transition);
  }
  
  body.crm-dark-mode .crm-mobile-close-btn { background: rgba(255, 255, 255, 0.08); }
  
  .crm-mobile-close-btn:hover {
    background: rgba(239, 68, 68, 0.12);
    color: var(--crm-red);
    border-color: rgba(239, 68, 68, 0.3);
  }
  
  /* ════════════════════════════════════════════════════════════
     6. MAIN CONTENT
  ════════════════════════════════════════════════════════════ */
  #crmMain {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    min-width: 0;
    transition: margin-left 0.25s ease;
  }
  
  /* ════════════════════════════════════════════════════════════
     7. HEADER
  ════════════════════════════════════════════════════════════ */
  #crmHeader {
    height: var(--crm-header-h);
    background: var(--crm-header-bg);
    border-bottom: 1px solid var(--crm-border);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 18px;
    flex-shrink: 0;
    backdrop-filter: blur(20px);
    position: relative;
    z-index: 100;
  }
  
  /* ── Breadcrumb ─────────────────────────────────────────── */
  .crm-breadcrumb { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
  
  .crm-breadcrumb-item {
    font-size: 12px;
    font-weight: 700;
    color: var(--crm-text-faint);
    white-space: nowrap;
    transition: color 0.15s;
  }
  
  .crm-breadcrumb-item.active { color: var(--crm-text); }
  .crm-breadcrumb-sep { font-size: 9px; color: var(--crm-text-faint); }
  
  /* ── Header Search ──────────────────────────────────────── */
  .crm-search-wrap {
    flex: 1;
    max-width: 400px;
    position: relative;
    display: flex;
    align-items: center;
  }
  
  .crm-search-icon {
    position: absolute;
    left: 12px;
    color: var(--crm-text-faint);
    font-size: 12px;
    pointer-events: none;
    z-index: 1;
  }
  
  .crm-search-input {
    width: 100%;
    background: var(--crm-input-bg);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    padding: 8px 12px 8px 34px;
    font-family: inherit;
    font-size: 12px;
    color: var(--crm-text);
    outline: none;
    transition: var(--crm-transition);
  }
  
  .crm-search-input::placeholder { color: var(--crm-text-faint); }
  
  .crm-search-input:focus {
    border-color: var(--crm-primary);
    background: rgba(102, 126, 234, 0.07);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
  }
  
  /* Search Dropdown */
  .crm-search-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--crm-surface);
    border: 1px solid var(--crm-border);
    border-radius: 14px;
    padding: 6px;
    z-index: 2000;
    box-shadow: var(--crm-shadow-lg);
  }
  
  .crm-search-section-label {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--crm-text-faint);
    padding: 4px 10px;
  }
  
  .crm-search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--crm-transition);
  }
  
  .crm-search-result-item:hover { background: var(--crm-input-bg); }
  
  .crm-search-result-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  
  .crm-search-result-icon.contact { background: rgba(102,126,234,0.12); color: var(--crm-primary); }
  .crm-search-result-icon.deal    { background: rgba(16,185,129,0.12);  color: var(--crm-green);   }
  
  .crm-search-result-name { font-size: 12px; font-weight: 700; color: var(--crm-text); }
  .crm-search-result-sub  { font-size: 10px; color: var(--crm-text-faint); margin-top: 1px; }
  
  /* ── Header Controls ────────────────────────────────────── */
  .crm-header-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    flex-shrink: 0;
  }
  
  .crm-header-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: var(--crm-input-bg);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    font-size: 13px;
    color: var(--crm-text-muted);
    cursor: pointer;
    transition: var(--crm-transition);
    flex-shrink: 0;
    position: relative;
  }
  
  .crm-header-btn:hover {
    background: rgba(0, 0, 0, 0.07);
    color: var(--crm-text);
    border-color: var(--crm-border-hover);
  }
  
  body.crm-dark-mode .crm-header-btn:hover { background: rgba(255, 255, 255, 0.08); }
  
  .crm-header-alert-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--crm-red);
    border: 2px solid var(--crm-header-bg);
    animation: crmPulse 2s ease-in-out infinite;
  }
  
  .crm-theme-toggle {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--crm-input-bg);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    cursor: pointer;
    color: var(--crm-text-muted);
    font-size: 14px;
    transition: var(--crm-transition);
    flex-shrink: 0;
  }
  
  .crm-theme-toggle:hover {
    background: rgba(102, 126, 234, 0.1);
    color: var(--crm-primary);
    border-color: rgba(102, 126, 234, 0.2);
  }
  
  body.crm-dark-mode .crm-theme-toggle:hover {
    background: rgba(245, 158, 11, 0.12);
    color: var(--crm-amber);
    border-color: rgba(245, 158, 11, 0.3);
  }
  
  .crm-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--crm-green);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
    flex-shrink: 0;
  }
  
  .crm-role-badge {
    font-size: 10px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(102, 126, 234, 0.12);
    color: var(--crm-primary);
    border: 1px solid rgba(102, 126, 234, 0.18);
    white-space: nowrap;
  }
  
  .crm-header-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--crm-primary), var(--crm-primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: var(--crm-transition);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
  }
  
  .crm-header-avatar:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
  }
  
  .crm-header-avatar-fallback { font-size: 13px; font-weight: 800; color: #fff; }
  
  /* Header User Menu */
  .crm-header-user-menu {
    position: absolute;
    top: calc(var(--crm-header-h) + 4px);
    right: 16px;
    background: var(--crm-surface);
    border: 1px solid var(--crm-border);
    border-radius: 14px;
    padding: 6px;
    min-width: 210px;
    z-index: 2000;
    box-shadow: var(--crm-shadow-lg);
    animation: crmFadeIn 0.15s ease;
  }
  
  .crm-header-user-menu-top {
    padding: 10px 12px;
    border-bottom: 1px solid var(--crm-border);
    margin-bottom: 4px;
  }
  
  .crm-header-user-menu-name  { font-size: 13px; font-weight: 800; color: var(--crm-text); }
  .crm-header-user-menu-email { font-size: 10px; color: var(--crm-text-faint); margin-top: 2px; }
  
  .crm-ctx-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--crm-text-muted);
    cursor: pointer;
    transition: var(--crm-transition);
  }
  
  .crm-ctx-item:hover { background: var(--crm-input-bg); color: var(--crm-text); }
  .crm-ctx-item.danger { color: var(--crm-red); }
  .crm-ctx-item.danger:hover { background: rgba(239, 68, 68, 0.08); }
  .crm-ctx-item i { font-size: 12px; width: 14px; text-align: center; }
  
  /* ════════════════════════════════════════════════════════════
     8. SIDEBAR NAV
  ════════════════════════════════════════════════════════════ */
  .crm-nav { padding: 4px 8px; }
  
  .crm-nav-label {
    padding: 10px 10px 5px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: var(--crm-text-faint);
  }
  
  .crm-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--crm-radius);
    cursor: pointer;
    transition: var(--crm-transition);
    color: var(--crm-text-muted);
    text-decoration: none;
    position: relative;
    margin-bottom: 2px;
  }
  
  .crm-nav-item:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--crm-text);
  }
  
  body.crm-dark-mode .crm-nav-item:hover { background: rgba(255, 255, 255, 0.05); }
  
  .crm-nav-item.active {
    background: rgba(102, 126, 234, 0.12);
    color: var(--crm-primary);
  }
  
  .crm-nav-item-icon {
    width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
  }
  
  .crm-nav-item-text {
    flex: 1;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .crm-nav-badge {
    font-size: 9px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    background: rgba(102, 126, 234, 0.15);
    color: var(--crm-primary);
    min-width: 22px;
    text-align: center;
    flex-shrink: 0;
  }
  
  .crm-badge-deal  { background: rgba(239, 68, 68, 0.12);  color: var(--crm-red);    }
  .crm-badge-green { background: rgba(16, 185, 129, 0.12); color: var(--crm-green);  }
  .crm-badge-ai    { background: rgba(139, 92, 246, 0.12); color: var(--crm-purple); }
  
  .crm-nav-divider {
    border: none;
    border-top: 1px solid var(--crm-border);
    margin: 8px 10px;
  }
  
  /* ════════════════════════════════════════════════════════════
     9. PLATFORM NAV
  ════════════════════════════════════════════════════════════ */
  .crm-platform-section { margin-bottom: 1px; }
  
  .crm-platform-folder {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 700;
    color: var(--crm-text-muted);
    cursor: pointer;
    border-radius: var(--crm-radius);
    margin: 0 2px;
    transition: var(--crm-transition);
    position: relative;
    background: none;
    border: none;
    width: calc(100% - 4px);
    text-align: left;
  }
  
  .crm-platform-folder:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--crm-text);
  }
  
  body.crm-dark-mode .crm-platform-folder:hover { background: rgba(255, 255, 255, 0.05); }
  .crm-platform-folder i:first-child { font-size: 13px; width: 16px; text-align: center; }
  
  .crm-arrow { margin-left: auto; font-size: 9px; transition: transform 0.2s; }
  .crm-platform-folder.open .crm-arrow { transform: rotate(180deg); }
  
  .crm-platform-submenu { display: none; padding: 2px 0; }
  .crm-platform-submenu.open { display: block; }
  
  .crm-platform-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px 6px 32px;
    font-size: 11px;
    font-weight: 600;
    color: var(--crm-text-faint);
    text-decoration: none;
    border-radius: 8px;
    margin: 0 2px;
    transition: var(--crm-transition);
  }
  
  .crm-platform-link:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--crm-text-muted);
  }
  
  body.crm-dark-mode .crm-platform-link:hover { background: rgba(255, 255, 255, 0.04); }
  .crm-platform-link i { font-size: 11px; width: 14px; text-align: center; }
  
  /* ── Nav Tool Links ─────────────────────────────────────── */
  .crm-nav-tool-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: var(--crm-radius);
    margin: 1px 2px;
    text-decoration: none;
    color: var(--crm-text-muted);
    font-size: 12px;
    font-weight: 600;
    transition: var(--crm-transition);
  }
  
  .crm-nav-tool-link:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--crm-text);
  }
  
  body.crm-dark-mode .crm-nav-tool-link:hover { background: rgba(255, 255, 255, 0.05); }
  
  .crm-nav-tool-icon {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
  }
  
  .crm-nav-tool-icon.drive { background: rgba(16, 185, 129, 0.12); color: var(--crm-green);   }
  .crm-nav-tool-icon.teams { background: rgba(102, 126, 234, 0.12); color: var(--crm-primary); }
  
  /* ════════════════════════════════════════════════════════════
     10. NEW BUTTON & DROPDOWN
  ════════════════════════════════════════════════════════════ */
  .crm-new-wrap { padding: 10px 10px 6px; position: relative; }
  
  .crm-new-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: linear-gradient(135deg, var(--crm-primary), var(--crm-primary-dark));
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    cursor: pointer;
    transition: var(--crm-transition);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.35);
  }
  
  .crm-new-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(102, 126, 234, 0.5);
  }
  
  .crm-new-btn-text { flex: 1; text-align: left; }
  
  .crm-new-dropdown {
    display: none;
    position: absolute;
    top: calc(100% - 4px);
    left: 10px;
    right: 10px;
    background: var(--crm-surface);
    border: 1px solid var(--crm-border);
    border-radius: 16px;
    padding: 8px;
    z-index: 600;
    box-shadow: var(--crm-shadow-lg);
    animation: crmFadeIn 0.15s ease;
  }
  
  .crm-new-dropdown.open { display: block; }
  
  .crm-new-drop-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--crm-radius);
    cursor: pointer;
    transition: var(--crm-transition);
  }
  
  .crm-new-drop-item:hover { background: var(--crm-input-bg); }
  
  .crm-new-drop-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
  }
  
  .crm-new-drop-icon.contact     { background: rgba(102, 126, 234, 0.12); color: var(--crm-primary); }
  .crm-new-drop-icon.deal        { background: rgba(16, 185, 129, 0.12);  color: var(--crm-green);   }
  .crm-new-drop-icon.interaction { background: rgba(245, 158, 11, 0.12);  color: var(--crm-amber);   }
  .crm-new-drop-icon.lp          { background: rgba(139, 92, 246, 0.12);  color: var(--crm-purple);  }
  
  .crm-new-drop-title { font-size: 12px; font-weight: 700; color: var(--crm-text); }
  .crm-new-drop-sub   { font-size: 10px; color: var(--crm-text-faint); margin-top: 1px; }
  
  .crm-new-drop-divider {
    border: none;
    border-top: 1px solid var(--crm-border);
    margin: 4px 0;
  }
  
  /* ════════════════════════════════════════════════════════════
     11. SIDEBAR FOOTER
  ════════════════════════════════════════════════════════════ */
  .crm-sidebar-footer {
    border-top: 1px solid var(--crm-border);
    position: relative;
    flex-shrink: 0;
  }
  
  .crm-sidebar-user-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: var(--crm-transition);
  }
  
  .crm-sidebar-user-trigger:hover { background: var(--crm-input-bg); }
  
  .crm-sidebar-user-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--crm-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .crm-sidebar-user-email {
    font-size: 10px;
    color: var(--crm-text-faint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .crm-sidebar-plan-badge {
    font-size: 9px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    background: rgba(102, 126, 234, 0.12);
    color: var(--crm-primary);
    flex-shrink: 0;
  }
  
  .crm-sidebar-user-chevron {
    font-size: 9px;
    color: var(--crm-text-faint);
    transition: transform 0.2s;
    flex-shrink: 0;
  }
  
  /* Sidebar User Dropdown */
  .crm-sidebar-user-dropdown {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: var(--crm-surface);
    border: 1px solid var(--crm-border);
    border-radius: 14px;
    padding: 8px;
    margin: 0 8px 6px;
    box-shadow: var(--crm-shadow-lg);
    z-index: 1000;
    animation: crmFadeIn 0.15s ease;
  }
  
  .crm-sidebar-user-dropdown.open { display: block; }
  
  .crm-sidebar-dropdown-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--crm-border);
    margin-bottom: 6px;
  }
  
  .crm-dropdown-name  { font-size: 12px; font-weight: 700; color: var(--crm-text); }
  .crm-dropdown-email { font-size: 10px; color: var(--crm-text-faint); margin-top: 1px; }
  
  .crm-sidebar-dropdown-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: var(--crm-text-muted);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px;
    transition: var(--crm-transition);
  }
  
  .crm-sidebar-dropdown-link:hover { background: var(--crm-input-bg); color: var(--crm-text); }
  .crm-sidebar-dropdown-link i { font-size: 13px; width: 16px; text-align: center; }
  
  .crm-sidebar-dropdown-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: var(--crm-red);
    font-size: 12px;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--crm-transition);
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    margin-top: 4px;
    border-top: 1px solid var(--crm-border);
  }
  
  .crm-sidebar-dropdown-logout:hover { background: rgba(239, 68, 68, 0.08); }
  
  /* ════════════════════════════════════════════════════════════
     12. CONTENT AREA
  ════════════════════════════════════════════════════════════ */
  #crmContent {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 22px 26px;
  }
  
  #crmContent::-webkit-scrollbar { width: 5px; }
  #crmContent::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
  }
  body.crm-dark-mode #crmContent::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
  }
  
  /* ════════════════════════════════════════════════════════════
     13. HERO SECTION
  ════════════════════════════════════════════════════════════ */
  .crm-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
    flex-wrap: wrap;
  }
  
  .crm-hero-left { flex: 1; min-width: 0; }
  
  .crm-hero-title {
    font-size: 22px;
    font-weight: 900;
    color: var(--crm-text);
    margin-bottom: 4px;
    line-height: 1.3;
  }
  
  .crm-hero-sub {
    font-size: 12px;
    color: var(--crm-text-muted);
    font-weight: 500;
  }
  
  .crm-hero-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
  }
  
  .crm-hero-date {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--crm-text-muted);
    font-weight: 600;
  }
  
  .crm-hero-sync {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--crm-green);
    font-weight: 600;
  }
  
  .crm-sync-dot {
    color: var(--crm-green);
    font-size: 8px;
    animation: crmPulse 2s ease-in-out infinite;
  }
  
  /* ════════════════════════════════════════════════════════════
     14. BUTTONS
  ════════════════════════════════════════════════════════════ */
  .crm-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--crm-radius);
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--crm-transition);
    border: 1px solid transparent;
    text-decoration: none;
    white-space: nowrap;
  }
  
  .crm-btn-primary {
    background: linear-gradient(135deg, var(--crm-primary), var(--crm-primary-dark));
    color: #fff;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.35);
  }
  
  .crm-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(102, 126, 234, 0.5);
  }
  
  .crm-btn-secondary {
    background: var(--crm-input-bg);
    border-color: var(--crm-border);
    color: var(--crm-text-muted);
  }
  
  .crm-btn-secondary:hover {
    background: rgba(0, 0, 0, 0.07);
    color: var(--crm-text);
  }
  
  body.crm-dark-mode .crm-btn-secondary:hover { background: rgba(255, 255, 255, 0.1); }
  
  .crm-btn-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--crm-red);
  }
  
  .crm-btn-danger:hover { background: rgba(239, 68, 68, 0.2); }
  .crm-btn-sm { padding: 5px 12px; font-size: 11px; }
  
  /* View All Link */
  .crm-view-all-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    color: var(--crm-primary);
    text-decoration: none;
    transition: var(--crm-transition);
    white-space: nowrap;
  }
  
  .crm-view-all-link:hover { opacity: 0.75; }
  
  /* Refresh Button */
  .crm-refresh-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: var(--crm-input-bg);
    border: 1px solid var(--crm-border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 10px;
    font-weight: 700;
    color: var(--crm-text-muted);
    cursor: pointer;
    transition: var(--crm-transition);
  }
  
  .crm-refresh-btn:hover { background: rgba(102, 126, 234, 0.1); color: var(--crm-primary); }
  
  /* ════════════════════════════════════════════════════════════
     15. QUICK ACTIONS BAR
  ════════════════════════════════════════════════════════════ */
  .crm-quick-actions-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
  }
  
  .crm-quick-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--crm-surface);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    color: var(--crm-text-muted);
    cursor: pointer;
    transition: var(--crm-transition);
    white-space: nowrap;
  }
  
  .crm-quick-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--crm-shadow);
    color: var(--crm-text);
    border-color: var(--crm-border-hover);
  }
  
  .crm-qa-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
  }
  
  .crm-qa-label { font-size: 12px; font-weight: 700; }
  
  /* ════════════════════════════════════════════════════════════
     16. KPI GRID & CARDS
  ════════════════════════════════════════════════════════════ */
  .crm-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 18px;
  }
  
  .crm-kpi-card {
    background: var(--crm-surface);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius-lg);
    padding: 18px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: var(--crm-transition);
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  
  .crm-kpi-card:hover {
    border-color: var(--crm-border-hover);
    transform: translateY(-2px);
    box-shadow: var(--crm-shadow);
  }
  
  .crm-kpi-pulse {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    opacity: 0.12;
    animation: crmPulse 2s ease-in-out infinite;
  }
  
  .crm-kpi-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
  }
  
  .crm-kpi-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-kpi-badge {
    font-size: 9px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    white-space: nowrap;
  }
  
  .crm-kpi-value {
    font-size: 22px;
    font-weight: 900;
    color: var(--crm-text);
    line-height: 1.2;
  }
  
  .crm-kpi-label { font-size: 11px; font-weight: 700; color: var(--crm-text-muted); }
  .crm-kpi-sub   { font-size: 10px; color: var(--crm-text-faint); }
  
  .crm-kpi-progress-bar {
    height: 3px;
    background: var(--crm-input-bg);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 6px;
  }
  
  .crm-kpi-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
  }
  
  /* KPI Skeleton loading */
  .crm-kpi-skeleton {
    background: var(--crm-surface);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius-lg);
    height: 120px;
    animation: crmSkeletonPulse 1.5s ease-in-out infinite;
  }
  
  @keyframes crmSkeletonPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
  }
  
  .crm-animate-glow { animation: crmKpiGlow 3s ease-in-out infinite; }
  
  @keyframes crmKpiGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.25); }
    50%       { box-shadow: 0 0 0 8px rgba(139, 92, 246, 0);  }
  }
  
  /* ════════════════════════════════════════════════════════════
     17. BENTO LAYOUT ROWS
  ════════════════════════════════════════════════════════════ */
  .crm-bento-row {
    display: grid;
    gap: 16px;
    margin-bottom: 16px;
  }
  
  .crm-row-split-7-5   { grid-template-columns: 7fr 5fr;   }
  .crm-row-split-6-6   { grid-template-columns: 1fr 1fr;   }
  .crm-row-split-5-4-3 { grid-template-columns: 5fr 4fr 3fr; }
  
  /* ════════════════════════════════════════════════════════════
     18. WIDGET BASE
  ════════════════════════════════════════════════════════════ */
  .crm-widget {
    background: var(--crm-surface);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius-lg);
    padding: 18px;
  }
  
  .crm-widget-full { grid-column: 1 / -1; margin-bottom: 16px; }
  .crm-widget-tall { min-height: 300px; display: flex; flex-direction: column; }
  
  .crm-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
  }
  
  .crm-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 800;
    color: var(--crm-text);
  }
  
  /* Widget Loading State */
  .crm-widget-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 12px;
    color: var(--crm-text-faint);
    font-size: 12px;
    font-weight: 600;
  }
  
  /* Empty State */
  .crm-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    text-align: center;
  }
  
  .crm-empty-link {
    font-size: 12px;
    font-weight: 700;
    color: var(--crm-primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }
  
  /* Spinner */
  .crm-spinner-ring {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 2px solid rgba(102, 126, 234, 0.15);
    border-top-color: var(--crm-primary);
    border-radius: 50%;
    animation: crmSpin 0.7s linear infinite;
    flex-shrink: 0;
  }
  
  /* Table Skeleton */
  .crm-table-skeleton {
    height: 44px;
    background: var(--crm-input-bg);
    border-radius: var(--crm-radius);
    margin-bottom: 6px;
    animation: crmSkeletonPulse 1.5s ease-in-out infinite;
  }
  
  /* ════════════════════════════════════════════════════════════
     19. DEAL FUNNEL WIDGET
  ════════════════════════════════════════════════════════════ */
  .crm-funnel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 16px;
  }
  
  .crm-funnel-stages { display: flex; flex-direction: column; gap: 8px; }
  
  .crm-funnel-stage {
    cursor: pointer;
    padding: 6px 8px;
    border-radius: var(--crm-radius);
    transition: var(--crm-transition);
  }
  
  .crm-funnel-stage:hover { background: var(--crm-input-bg); }
  
  .crm-funnel-stage-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
  }
  
  .crm-funnel-stage-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
  }
  
  .crm-funnel-stage-name {
    font-size: 11px;
    font-weight: 700;
    color: var(--crm-text);
    flex: 1;
  }
  
  .crm-funnel-conv {
    font-size: 9px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 2px;
  }
  
  .crm-funnel-count {
    font-size: 12px;
    font-weight: 800;
    min-width: 20px;
    text-align: right;
  }
  
  .crm-funnel-bar-wrap {
    height: 4px;
    background: var(--crm-input-bg);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 3px;
  }
  
  .crm-funnel-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-width: 4px;
  }
  
  .crm-funnel-value {
    font-size: 10px;
    font-weight: 700;
    color: var(--crm-text-faint);
    text-align: right;
  }
  
  /* ════════════════════════════════════════════════════════════
     20. FUNDRAISING WIDGET
  ════════════════════════════════════════════════════════════ */
  .crm-fundraising-body { display: flex; gap: 20px; align-items: flex-start; }
  
  .crm-fundraising-left {
    flex: 0 0 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
  
  .crm-fundraising-right { flex: 1; min-width: 0; }
  
  .crm-fundraising-fund-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--crm-text-muted);
    text-align: center;
  }
  
  /* Thermometer */
  .crm-thermometer-wrap { display: flex; align-items: flex-end; gap: 12px; }
  
  .crm-thermometer {
    width: 24px;
    height: 140px;
    background: var(--crm-input-bg);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--crm-border);
    flex-shrink: 0;
  }
  
  .crm-thermometer-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 0 0 12px 12px;
    transition: height 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  
  .crm-thermometer-markers { position: absolute; inset: 0; }
  
  .crm-thermometer-marker {
    position: absolute;
    left: 100%;
    width: 8px;
    height: 1px;
    background: var(--crm-border);
    margin-left: 2px;
    transform: translateY(-50%);
  }
  
  .crm-thermometer-marker span {
    position: absolute;
    left: 10px;
    top: -5px;
    font-size: 8px;
    color: var(--crm-text-faint);
    font-weight: 600;
    white-space: nowrap;
  }
  
  .crm-thermometer-info { display: flex; flex-direction: column; gap: 2px; }
  
  .crm-thermo-pct    { font-size: 22px; font-weight: 900; line-height: 1; }
  .crm-thermo-label  { font-size: 9px;  font-weight: 700; color: var(--crm-text-faint); text-transform: uppercase; letter-spacing: 0.5px; }
  .crm-thermo-amount { font-size: 13px; font-weight: 800; color: var(--crm-text); margin-top: 6px; }
  .crm-thermo-target { font-size: 10px; color: var(--crm-text-faint); font-weight: 600; }
  .crm-thermo-gap    { font-size: 10px; font-weight: 700; margin-top: 4px; }
  
  .crm-commits-row { display: flex; gap: 6px; flex-wrap: wrap; }
  
  .crm-commit-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 20px;
  }
  
  .crm-commit-badge.soft { background: rgba(245, 158, 11, 0.12); color: var(--crm-amber); }
  .crm-commit-badge.hard { background: rgba(16, 185, 129, 0.12); color: var(--crm-green); }
  
  /* LP Pipeline */
  .crm-fundraising-pipeline-title {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--crm-text-faint);
    margin-bottom: 10px;
  }
  
  .crm-lp-stage-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 6px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--crm-transition);
    margin-bottom: 4px;
  }
  
  .crm-lp-stage-row:hover { background: var(--crm-input-bg); }
  
  .crm-lp-stage-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
  
  .crm-lp-stage-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--crm-text-muted);
    min-width: 120px;
  }
  
  .crm-lp-stage-bar-wrap {
    flex: 1;
    height: 3px;
    background: var(--crm-input-bg);
    border-radius: 3px;
    overflow: hidden;
  }
  
  .crm-lp-stage-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
    min-width: 2px;
  }
  
  .crm-lp-stage-count {
    font-size: 11px;
    font-weight: 800;
    min-width: 20px;
    text-align: center;
  }
  
  .crm-lp-stage-amount {
    font-size: 10px;
    font-weight: 600;
    color: var(--crm-text-faint);
    min-width: 40px;
    text-align: right;
  }
  
  .crm-deadline-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    background: rgba(249, 115, 22, 0.12);
    color: var(--crm-orange);
    border: 1px solid rgba(249, 115, 22, 0.2);
  }
  
  /* ════════════════════════════════════════════════════════════
     21. AI PRESETS (inside widget)
  ════════════════════════════════════════════════════════════ */
  .crm-ai-presets { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--crm-border); }
  
  .crm-ai-preset-label {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--crm-text-faint);
    margin-bottom: 8px;
  }
  
  .crm-ai-preset-chips { display: flex; gap: 6px; flex-wrap: wrap; }
  
  .crm-ai-preset-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: var(--crm-input-bg);
    border: 1px solid var(--crm-border);
    border-radius: 20px;
    font-family: inherit;
    font-size: 10px;
    font-weight: 700;
    color: var(--crm-text-muted);
    cursor: pointer;
    transition: var(--crm-transition);
    white-space: nowrap;
  }
  
  .crm-ai-preset-chip:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.25);
    color: var(--crm-primary);
  }
  
  /* ════════════════════════════════════════════════════════════
     22. SCROLLBARS (global)
  ════════════════════════════════════════════════════════════ */
  * { scrollbar-width: thin; scrollbar-color: rgba(0, 0, 0, 0.1) transparent; }
  body.crm-dark-mode * { scrollbar-color: rgba(255, 255, 255, 0.08) transparent; }
  
  *::-webkit-scrollbar { width: 4px; height: 4px; }
  *::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.12); border-radius: 4px; }
  body.crm-dark-mode *::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); }
  
  /* ════════════════════════════════════════════════════════════
     23. ANIMATIONS
  ════════════════════════════════════════════════════════════ */
  @keyframes crmSpin    { to { transform: rotate(360deg); } }
  @keyframes crmFadeIn  { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
  @keyframes crmSlideIn { from { transform: translateX(-12px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
  @keyframes crmPulse   { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
  @keyframes crmCountUp { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }
  @keyframes crmGlow    { 0%, 100% { box-shadow: 0 0 0 0 rgba(102,126,234,0.4); } 50% { box-shadow: 0 0 0 8px rgba(102,126,234,0); } }
  
  .crm-fade-in  { animation: crmFadeIn  0.35s ease forwards; }
  .crm-slide-in { animation: crmSlideIn 0.3s  ease forwards; }
  .crm-pulse    { animation: crmPulse   2s    ease-in-out infinite; }
  .crm-count-up { animation: crmCountUp 0.4s  cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
  .crm-spin     { animation: crmSpin    0.7s  linear infinite; }
  
  /* ════════════════════════════════════════════════════════════
     24. DARK MODE — Adjustments Part 1
  ════════════════════════════════════════════════════════════ */
  body.crm-dark-mode .crm-kpi-card         { background: rgba(30, 41, 59, 0.85); }
  body.crm-dark-mode .crm-widget           { background: rgba(30, 41, 59, 0.85); }
  body.crm-dark-mode .crm-kpi-skeleton     { background: rgba(30, 41, 59, 0.7);  }
  body.crm-dark-mode .crm-table-skeleton   { background: rgba(255, 255, 255, 0.04); }
  body.crm-dark-mode .crm-new-dropdown     { background: #1a2235; }
  body.crm-dark-mode .crm-search-dropdown  { background: #1e293b; }
  body.crm-dark-mode .crm-header-user-menu { background: #1e293b; }
  body.crm-dark-mode .crm-sidebar-user-dropdown { background: #1e293b; }
  
  /* ════════════════════════════════════════════════════════════
     25. LIGHT MODE — Polish Part 1
  ════════════════════════════════════════════════════════════ */
  body:not(.crm-dark-mode) .crm-kpi-card:hover   { box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
  body:not(.crm-dark-mode) .crm-widget           { box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
  body:not(.crm-dark-mode) .crm-header-user-menu { box-shadow: 0 8px 32px rgba(0,0,0,0.12); }
  body:not(.crm-dark-mode) .crm-new-dropdown     { box-shadow: 0 8px 32px rgba(0,0,0,0.15); }
  body:not(.crm-dark-mode) .crm-sidebar-user-dropdown { box-shadow: 0 -8px 32px rgba(0,0,0,0.1); }
  
  /* ════════════════════════════════════════════════════════════
     26. RESPONSIVE — LARGE (≤ 1400px)
  ════════════════════════════════════════════════════════════ */
  @media (max-width: 1400px) {
    .crm-kpi-grid        { grid-template-columns: repeat(4, 1fr); }
    .crm-row-split-5-4-3 { grid-template-columns: 1fr 1fr 1fr; }
  }
  
  /* ════════════════════════════════════════════════════════════
     27. RESPONSIVE — TABLET (≤ 1200px)
  ════════════════════════════════════════════════════════════ */
  @media (max-width: 1200px) {
    :root { --crm-sidebar-w: 240px; }
  
    .crm-kpi-grid        { grid-template-columns: repeat(4, 1fr); }
    .crm-row-split-7-5   { grid-template-columns: 1fr; }
    .crm-row-split-5-4-3 { grid-template-columns: 1fr 1fr; }
  
    .crm-fundraising-body { flex-direction: column; }
    .crm-fundraising-left {
      flex: none;
      width: 100%;
      flex-direction: row;
      align-items: flex-start;
      justify-content: flex-start;
    }
  }
  
  /* ════════════════════════════════════════════════════════════
     28. RESPONSIVE — MOBILE (≤ 768px)
  ════════════════════════════════════════════════════════════ */
  @media (max-width: 768px) {
    html, body { overflow: hidden; }
  
    #crmSidebar {
      position: fixed;
      left: 0; top: 0; bottom: 0;
      z-index: 1000;
      transform: translateX(-100%);
      width: var(--crm-sidebar-w) !important;
      overflow-y: auto;
      overflow-x: hidden;
    }
  
    #crmSidebar.mobile-open {
      transform: translateX(0);
      box-shadow: 4px 0 40px rgba(0, 0, 0, 0.25);
    }
  
    .crm-sidebar-toggle    { display: none !important; }
    .crm-mobile-close-btn  { display: flex !important; }
  
    #crmMobileMenuBtn      { display: flex !important; }
  
    #crmHeader    { padding: 0 12px; gap: 8px; }
    .crm-breadcrumb { display: none; }
    .crm-search-wrap { max-width: none; flex: 1; }
    .crm-role-badge  { display: none; }
  
    #crmContent { padding: 14px; }
  
    .crm-kpi-grid  { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .crm-kpi-card  { padding: 14px; }
    .crm-kpi-value { font-size: 18px; }
    .crm-kpi-icon  { width: 32px; height: 32px; font-size: 14px; }
  
    .crm-hero            { flex-direction: column; align-items: flex-start; gap: 10px; }
    .crm-hero-title      { font-size: 18px; }
    .crm-hero-sub        { font-size: 11px; }
    .crm-hero-right      { width: 100%; }
  
    .crm-bento-row       { grid-template-columns: 1fr !important; gap: 12px; }
  
    .crm-quick-actions-bar { gap: 6px; }
    .crm-quick-action-btn  { padding: 7px 10px; font-size: 11px; }
  
    .crm-fundraising-body  { flex-direction: column; }
    .crm-fundraising-left  { flex: none; width: 100%; }
    .crm-lp-stage-label    { min-width: 80px; }
  
    .crm-ai-preset-chips   { gap: 4px; }
    .crm-ai-preset-chip    { font-size: 9px; padding: 4px 8px; }
  }
  
  /* ════════════════════════════════════════════════════════════
     29. RESPONSIVE — SMALL MOBILE (≤ 480px)
  ════════════════════════════════════════════════════════════ */
  @media (max-width: 480px) {
    :root { --crm-header-h: 52px; }
  
    #crmHeader  { padding: 0 10px; }
    #crmContent { padding: 10px; }
  
    .crm-kpi-grid  { grid-template-columns: 1fr 1fr; gap: 6px; }
    .crm-kpi-card  { padding: 12px; }
    .crm-kpi-value { font-size: 16px; }
    .crm-hero-title { font-size: 16px; }
  
    .crm-quick-action-btn .crm-qa-label { display: none; }
    .crm-quick-action-btn { padding: 10px; border-radius: 50%; width: 44px; height: 44px; justify-content: center; }
    .crm-quick-action-btn .crm-qa-icon { margin: 0; width: 22px; height: 22px; }
  }
  
  /* ════════════════════════════════════════════════════════════
     30. ULTRA WIDE (≥ 1600px)
  ════════════════════════════════════════════════════════════ */
  @media (min-width: 1600px) {
    :root { --crm-sidebar-w: 280px; }
    .crm-kpi-grid { grid-template-columns: repeat(4, 1fr); }
    #crmContent   { padding: 26px 32px; }
  }
  
  /* ════════════════════════════════════════════════════════════
     31. ACCESSIBILITY & PERFORMANCE
  ════════════════════════════════════════════════════════════ */
  .crm-btn:focus-visible,
  .crm-header-btn:focus-visible,
  .crm-nav-item:focus-visible,
  .crm-quick-action-btn:focus-visible {
    outline: 2px solid var(--crm-primary);
    outline-offset: 2px;
  }
  
  /* iOS zoom prevention */
  @media (max-width: 768px) {
    .crm-form-input,
    .crm-form-select,
    .crm-form-textarea,
    .crm-search-input,
    .crm-ai-chat-input { font-size: 16px; }
  
    .crm-form-input:not(:focus),
    .crm-form-select:not(:focus),
    .crm-form-textarea:not(:focus),
    .crm-search-input:not(:focus),
    .crm-ai-chat-input:not(:focus) { font-size: 12px; }
  }
  
  /* Reduce motion */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      transition-duration: 0.01ms !important;
    }
    .crm-sync-dot,
    .crm-status-dot,
    .crm-kpi-pulse,
    .crm-header-alert-dot { animation: none; }
  }
  
  /* GPU acceleration */
  .crm-kpi-card,
  .crm-widget,
  .crm-ai-chat-panel,
  #crmSidebar,
  #crmMain {
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }
  
  /* Safari touch scroll */
  #crmContent,
  .crm-sidebar-scroll,
  .crm-ai-chat-messages,
  .crm-team-members-list { -webkit-overflow-scrolling: touch; }
  
  /* Truncate utility */
  .crm-truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  
  /* Visually hidden (a11y) */
  .crm-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;
  }
  
  /* ════════════════════════════════════════════════════════════
     END — crm-dashboard.css Part 1/2
     © AlphaVault AI — All rights reserved
  ════════════════════════════════════════════════════════════ */

/* ============================================================
   ALPHAVAULT CRM DASHBOARD — crm-dashboard.css v1.0
   PART 2/2 — Widgets, Modals, AI Chat, Forms, Team Manager
   ============================================================ */

/* ════════════════════════════════════════════════════════════
   32. CONTACT CARDS GRID (Top Contacts Widget)
════════════════════════════════════════════════════════════ */
.crm-contacts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }
  
  .crm-contact-card {
    background: var(--crm-surface);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius-lg);
    padding: 14px;
    cursor: pointer;
    transition: var(--crm-transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  
  .crm-contact-card:hover {
    border-color: rgba(102, 126, 234, 0.3);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
  }
  
  body.crm-dark-mode .crm-contact-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  }
  
  /* Card Top Row */
  .crm-contact-card-top {
    display: flex;
    align-items: flex-start;
    gap: 10px;
  }
  
  /* Avatar */
  .crm-contact-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    position: relative;
  }
  
  .crm-contact-health-dot {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 2px solid var(--crm-surface);
    transition: var(--crm-transition);
  }
  
  /* Contact Info */
  .crm-contact-info { flex: 1; min-width: 0; }
  
  .crm-contact-name {
    font-size: 12px;
    font-weight: 800;
    color: var(--crm-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
  }
  
  .crm-contact-title {
    font-size: 10px;
    color: var(--crm-text-faint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
  }
  
  .crm-contact-company {
    font-size: 10px;
    color: var(--crm-text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  /* Health Score Badge */
  .crm-contact-score-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 7px;
    border-radius: 20px;
    flex-shrink: 0;
    white-space: nowrap;
  }
  
  /* Stats Row */
  .crm-contact-stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
  }
  
  .crm-contact-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: var(--crm-text-faint);
    font-weight: 600;
  }
  
  /* Tags */
  .crm-contact-tags { display: flex; gap: 4px; flex-wrap: wrap; }
  
  .crm-tag {
    display: inline-flex;
    align-items: center;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
    background: rgba(102, 126, 234, 0.1);
    color: var(--crm-primary);
    border: 1px solid rgba(102, 126, 234, 0.15);
  }
  
  /* Warm Path */
  .crm-warm-path {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    color: var(--crm-text-faint);
    background: var(--crm-input-bg);
    border-radius: 6px;
    padding: 5px 8px;
  }
  
  .crm-warm-path strong { color: var(--crm-text-muted); font-weight: 700; }
  
  /* Card Quick Actions */
  .crm-contact-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s;
    margin-top: 2px;
  }
  
  .crm-contact-card:hover .crm-contact-actions { opacity: 1; }
  
  .crm-contact-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    border: 1px solid var(--crm-border);
    background: var(--crm-input-bg);
    color: var(--crm-text-faint);
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--crm-transition);
  }
  
  .crm-contact-action-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: var(--crm-primary);
    border-color: rgba(102, 126, 234, 0.25);
  }
  
  /* ════════════════════════════════════════════════════════════
     33. RECENT ACTIVITY TIMELINE
  ════════════════════════════════════════════════════════════ */
  .crm-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 1;
  }
  
  .crm-timeline-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--crm-border);
    position: relative;
    animation: crmFadeIn 0.3s ease forwards;
  }
  
  .crm-timeline-item:last-child { border-bottom: none; }
  
  .crm-timeline-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
  }
  
  /* Vertical connector line */
  .crm-timeline-connector {
    position: absolute;
    left: 14px;
    top: 40px;
    bottom: 0;
    width: 1px;
    background: var(--crm-border);
  }
  
  .crm-timeline-body { flex: 1; min-width: 0; }
  
  .crm-timeline-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 3px;
  }
  
  .crm-timeline-type { font-size: 11px; font-weight: 700; }
  .crm-timeline-time { font-size: 10px; color: var(--crm-text-faint); white-space: nowrap; }
  
  .crm-timeline-contact {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--crm-text-muted);
    margin-bottom: 4px;
  }
  
  .crm-timeline-note {
    font-size: 11px;
    color: var(--crm-text-muted);
    line-height: 1.5;
    background: var(--crm-input-bg);
    border-radius: 6px;
    padding: 5px 8px;
  }
  
  .crm-timeline-actions-count {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: var(--crm-amber);
    font-weight: 600;
    margin-top: 4px;
  }
  
  /* ════════════════════════════════════════════════════════════
     34. FOLLOW-UPS WIDGET
  ════════════════════════════════════════════════════════════ */
  .crm-followup-count {
    font-size: 10px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(100, 116, 139, 0.1);
    color: var(--crm-text-faint);
  }
  
  .crm-followup-count.urgent {
    background: rgba(239, 68, 68, 0.12);
    color: var(--crm-red);
    animation: crmPulse 2s ease-in-out infinite;
  }
  
  .crm-followup-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 24px;
    text-align: center;
  }
  
  .crm-followup-list { display: flex; flex-direction: column; gap: 8px; flex: 1; }
  
  .crm-followup-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: var(--crm-radius);
    border: 1px solid var(--crm-border);
    transition: var(--crm-transition);
  }
  
  .crm-followup-item.overdue {
    background: rgba(239, 68, 68, 0.04);
    border-color: rgba(239, 68, 68, 0.15);
    border-left: 3px solid var(--crm-red);
  }
  
  .crm-followup-item.dormant {
    background: rgba(100, 116, 139, 0.04);
    border-color: rgba(100, 116, 139, 0.15);
    border-left: 3px solid #64748b;
  }
  
  .crm-followup-item:hover { box-shadow: var(--crm-shadow); }
  
  .crm-followup-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    position: relative;
  }
  
  .crm-followup-avatar.dormant { opacity: 0.7; }
  
  .crm-dormant-icon {
    position: absolute;
    bottom: -2px;
    right: -2px;
    font-size: 8px;
    color: #64748b;
    background: var(--crm-surface);
    border-radius: 50%;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--crm-border);
  }
  
  .crm-followup-info { flex: 1; min-width: 0; }
  
  .crm-followup-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--crm-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .crm-followup-company {
    font-size: 10px;
    color: var(--crm-text-faint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
  }
  
  .crm-followup-due {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    color: var(--crm-red);
    margin-top: 3px;
  }
  
  .crm-followup-due.dormant-label { color: #64748b; }
  
  .crm-followup-actions { display: flex; gap: 4px; flex-shrink: 0; }
  
  .crm-followup-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--crm-border);
    background: var(--crm-input-bg);
    color: var(--crm-text-faint);
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--crm-transition);
  }
  
  .crm-followup-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: var(--crm-primary);
    border-color: rgba(102, 126, 234, 0.25);
  }
  
  .crm-followup-btn.primary {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--crm-green);
  }
  
  .crm-followup-btn.primary:hover { background: rgba(16, 185, 129, 0.2); }
  
  /* ════════════════════════════════════════════════════════════
     35. AI INTELLIGENCE ALERTS PANEL
  ════════════════════════════════════════════════════════════ */
  .crm-ai-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 20px;
    font-size: 9px;
    font-weight: 800;
    background: linear-gradient(135deg, rgba(139,92,246,0.15), rgba(109,40,217,0.15));
    color: var(--crm-purple);
    border: 1px solid rgba(139, 92, 246, 0.2);
    letter-spacing: 0.5px;
  }
  
  .crm-ai-refresh-time {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: var(--crm-text-faint);
    font-weight: 600;
  }
  
  .crm-alerts-list { display: flex; flex-direction: column; gap: 10px; }
  
  /* Alert Card */
  .crm-alert-card {
    border-radius: var(--crm-radius-lg);
    padding: 14px;
    transition: var(--crm-transition);
    animation: crmFadeIn 0.3s ease forwards;
    border: 1px solid transparent;
  }
  
  .crm-alert-card:hover {
    transform: translateX(2px);
    box-shadow: var(--crm-shadow);
  }
  
  .crm-alert-top {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
  }
  
  .crm-alert-icon-wrap {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  
  .crm-alert-content { flex: 1; min-width: 0; }
  
  .crm-alert-title {
    font-size: 12px;
    font-weight: 800;
    color: var(--crm-text);
    margin-bottom: 4px;
    line-height: 1.3;
  }
  
  .crm-alert-message {
    font-size: 11px;
    color: var(--crm-text-muted);
    line-height: 1.5;
  }
  
  .crm-priority-badge {
    font-size: 9px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
    white-space: nowrap;
  }
  
  .crm-alert-action {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--crm-text-muted);
    background: rgba(102, 126, 234, 0.05);
    border-radius: 8px;
    padding: 6px 10px;
    margin-top: 4px;
  }
  
  .crm-alert-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    padding: 3px 10px;
    border-radius: 6px;
    border: 1px solid rgba(102, 126, 234, 0.25);
    background: rgba(102, 126, 234, 0.08);
    color: var(--crm-primary);
    font-family: inherit;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: var(--crm-transition);
    flex-shrink: 0;
  }
  
  .crm-alert-action-btn:hover { background: rgba(102, 126, 234, 0.15); }
  
  .crm-alert-ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 9px;
    font-weight: 700;
    color: var(--crm-purple);
    opacity: 0.8;
    margin-top: 6px;
  }
  
  .crm-ai-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 24px;
    text-align: center;
  }
  
  /* AI Thinking Dots */
  .crm-ai-thinking { text-align: center; }
  
  .crm-ai-thinking-dots {
    display: inline-flex;
    gap: 5px;
    align-items: center;
  }
  
  .crm-ai-thinking-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--crm-purple);
    animation: crmPulse 0.8s ease-in-out infinite;
    display: inline-block;
  }
  
  .crm-ai-thinking-dots span:nth-child(2) { animation-delay: 0.15s; }
  .crm-ai-thinking-dots span:nth-child(3) { animation-delay: 0.30s; }
  
  /* ════════════════════════════════════════════════════════════
     36. AI NARRATIVE INSIGHT WIDGET
  ════════════════════════════════════════════════════════════ */
  .crm-narrative-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    color: var(--crm-text-faint);
    font-size: 12px;
    font-weight: 600;
  }
  
  .crm-narrative-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  
  .crm-narrative-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(139, 92, 246, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  
  .crm-narrative-text {
    font-size: 12px;
    color: var(--crm-text-muted);
    line-height: 1.7;
    white-space: pre-wrap;
    background: var(--crm-input-bg);
    border-radius: 8px;
    padding: 12px;
  }
  
  .crm-narrative-footer {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    color: var(--crm-text-faint);
  }
  
  .crm-narrative-error {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--crm-amber);
    padding: 10px;
    background: rgba(245, 158, 11, 0.06);
    border-radius: 8px;
  }
  
  /* ════════════════════════════════════════════════════════════
     37. TEAM PRESENCE WIDGET
  ════════════════════════════════════════════════════════════ */
  .crm-team-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    background: rgba(6, 182, 212, 0.12);
    color: var(--crm-cyan);
    border: 1px solid rgba(6, 182, 212, 0.2);
  }
  
  .crm-online-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 700;
    color: var(--crm-green);
  }
  
  .crm-online-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--crm-green);
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
    animation: crmPulse 2s ease-in-out infinite;
  }
  
  /* Team Manage Button */
  .crm-team-manage-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: var(--crm-input-bg);
    border: 1px solid var(--crm-border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 10px;
    font-weight: 700;
    color: var(--crm-text-muted);
    cursor: pointer;
    transition: var(--crm-transition);
  }
  
  .crm-team-manage-btn:hover {
    background: rgba(6, 182, 212, 0.08);
    color: var(--crm-cyan);
    border-color: rgba(6, 182, 212, 0.2);
  }
  
  /* Team Grid (compact cards) */
  .crm-team-grid-new {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
  }
  
  .crm-team-card-new {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 10px 6px;
    border-radius: var(--crm-radius);
    background: var(--crm-input-bg);
    border: 1px solid var(--crm-border);
    cursor: default;
    transition: var(--crm-transition);
    text-align: center;
  }
  
  .crm-team-card-new:hover {
    border-color: var(--crm-border-hover);
    background: var(--crm-surface-hover);
    transform: translateY(-1px);
  }
  
  .crm-team-avatar-new {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
  }
  
  .crm-team-status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--crm-surface);
    transition: var(--crm-transition);
  }
  
  .crm-team-name-new {
    font-size: 10px;
    font-weight: 700;
    color: var(--crm-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
  
  .crm-team-role-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 8px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 20px;
    white-space: nowrap;
  }
  
  /* Full Manage Button */
  .crm-team-full-manage-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px;
    background: var(--crm-input-bg);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    color: var(--crm-text-muted);
    cursor: pointer;
    transition: var(--crm-transition);
  }
  
  .crm-team-full-manage-btn:hover {
    background: rgba(6, 182, 212, 0.08);
    color: var(--crm-cyan);
    border-color: rgba(6, 182, 212, 0.2);
  }
  
  .crm-team-empty-widget {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px;
    text-align: center;
  }
  
  /* ════════════════════════════════════════════════════════════
     38. DEAL MINI TABLE (Row 6)
  ════════════════════════════════════════════════════════════ */
  .crm-deal-mini-table { width: 100%; overflow-x: auto; }
  
  .crm-deal-mini-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1.2fr 0.8fr 0.8fr 0.6fr 0.8fr;
    gap: 8px;
    padding: 8px 12px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--crm-text-faint);
    background: var(--crm-input-bg);
    border-radius: var(--crm-radius);
    margin-bottom: 4px;
    min-width: 680px;
  }
  
  .crm-deal-mini-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1.2fr 0.8fr 0.8fr 0.6fr 0.8fr;
    gap: 8px;
    padding: 10px 12px;
    border-radius: var(--crm-radius);
    cursor: pointer;
    transition: var(--crm-transition);
    border: 1px solid transparent;
    align-items: center;
    min-width: 680px;
  }
  
  .crm-deal-mini-row:hover {
    background: var(--crm-input-bg);
    border-color: var(--crm-border);
  }
  
  .crm-deal-mini-row.stagnant {
    background: rgba(245, 158, 11, 0.04);
    border-left: 3px solid var(--crm-amber);
  }
  
  .crm-deal-mini-name {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 700;
    color: var(--crm-text);
    overflow: hidden;
  }
  
  .crm-deal-mini-name span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .crm-deal-mini-sector {
    font-size: 11px;
    color: var(--crm-text-faint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .crm-deal-stage-pill {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    white-space: nowrap;
  }
  
  .crm-deal-mini-ev,
  .crm-deal-mini-ticket { font-size: 11px; font-weight: 700; color: var(--crm-text); }
  
  .crm-deal-mini-irr  { font-size: 11px; font-weight: 800; }
  .crm-deal-mini-date { font-size: 10px; font-weight: 600; white-space: nowrap; }
  
  /* ════════════════════════════════════════════════════════════
     39. AI CHAT FAB & PANEL
  ════════════════════════════════════════════════════════════ */
  .crm-ai-fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--crm-purple), #6d28d9);
    border: none;
    border-radius: 50px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 6px 24px rgba(139, 92, 246, 0.5);
    transition: var(--crm-transition);
  }
  
  .crm-ai-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 36px rgba(139, 92, 246, 0.65);
  }
  
  .crm-ai-fab-text { font-size: 13px; font-weight: 800; }
  
  .crm-ai-fab-pulse {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--crm-green);
    border: 2px solid #fff;
    animation: crmPulse 2s ease-in-out infinite;
  }
  
  /* AI Chat Panel */
  .crm-ai-chat-panel {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 400px;
    max-height: 600px;
    background: var(--crm-sidebar-bg);
    border: 1px solid var(--crm-border);
    border-radius: 20px;
    z-index: 1001;
    flex-direction: column;
    box-shadow: var(--crm-shadow-xl);
    overflow: hidden;
  }
  
  /* Panel Header */
  .crm-ai-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--crm-border);
    background: linear-gradient(135deg, rgba(139,92,246,0.08), rgba(109,40,217,0.05));
    flex-shrink: 0;
  }
  
  .crm-ai-chat-header-left { display: flex; align-items: center; gap: 10px; }
  
  .crm-ai-chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--crm-purple), #6d28d9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: #fff;
    flex-shrink: 0;
  }
  
  .crm-ai-chat-title { font-size: 13px; font-weight: 800; color: var(--crm-text); }
  .crm-ai-chat-sub   { font-size: 10px; color: var(--crm-text-faint); margin-top: 1px; }
  
  .crm-ai-chat-header-actions { display: flex; gap: 5px; }
  
  .crm-ai-chat-header-btn {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    border: 1px solid var(--crm-border);
    background: var(--crm-input-bg);
    color: var(--crm-text-muted);
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--crm-transition);
  }
  
  .crm-ai-chat-header-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--crm-red);
    border-color: rgba(239, 68, 68, 0.2);
  }
  
  /* Presets */
  .crm-ai-chat-presets {
    display: flex;
    gap: 5px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--crm-border);
    overflow-x: auto;
    flex-shrink: 0;
  }
  
  .crm-ai-chat-presets::-webkit-scrollbar { height: 0; }
  
  .crm-ai-chat-preset {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 20px;
    border: 1px solid var(--crm-border);
    background: var(--crm-input-bg);
    font-family: inherit;
    font-size: 10px;
    font-weight: 700;
    color: var(--crm-text-muted);
    cursor: pointer;
    transition: var(--crm-transition);
    white-space: nowrap;
    flex-shrink: 0;
  }
  
  .crm-ai-chat-preset:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.25);
    color: var(--crm-purple);
  }
  
  /* Messages */
  .crm-ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 220px;
  }
  
  .crm-ai-chat-messages::-webkit-scrollbar { width: 3px; }
  .crm-ai-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.2);
    border-radius: 3px;
  }
  
  /* Chat Message */
  .crm-chat-msg {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    animation: crmFadeIn 0.2s ease;
  }
  
  .crm-chat-msg-user { flex-direction: row-reverse; }
  
  .crm-chat-ai-avatar {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--crm-purple), #6d28d9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #fff;
    flex-shrink: 0;
  }
  
  .crm-chat-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 12px;
    line-height: 1.6;
  }
  
  .crm-chat-bubble.ai {
    background: var(--crm-input-bg);
    color: var(--crm-text);
    border-radius: 4px 14px 14px 14px;
    border: 1px solid var(--crm-border);
  }
  
  .crm-chat-bubble.user {
    background: linear-gradient(135deg, var(--crm-primary), var(--crm-primary-dark));
    color: #fff;
    border-radius: 14px 4px 14px 14px;
  }
  
  /* Input Area */
  .crm-ai-chat-input-wrap {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--crm-border);
    background: var(--crm-input-bg);
    flex-shrink: 0;
  }
  
  .crm-ai-chat-input {
    flex: 1;
    background: var(--crm-surface);
    border: 1px solid var(--crm-border);
    border-radius: 10px;
    padding: 8px 12px;
    font-family: inherit;
    font-size: 12px;
    color: var(--crm-text);
    outline: none;
    resize: none;
    max-height: 100px;
    line-height: 1.5;
    transition: var(--crm-transition);
  }
  
  .crm-ai-chat-input::placeholder { color: var(--crm-text-faint); }
  
  .crm-ai-chat-input:focus {
    border-color: var(--crm-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
  }
  
  .crm-ai-chat-send {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, var(--crm-purple), #6d28d9);
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--crm-transition);
    box-shadow: 0 3px 10px rgba(139, 92, 246, 0.4);
  }
  
  .crm-ai-chat-send:hover {
    transform: scale(1.08);
    box-shadow: 0 5px 16px rgba(139, 92, 246, 0.55);
  }
  
  /* Chat Footer */
  .crm-ai-chat-footer {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    font-size: 9px;
    color: var(--crm-text-faint);
    border-top: 1px solid var(--crm-border);
    flex-shrink: 0;
  }
  
  /* ════════════════════════════════════════════════════════════
     40. MODALS (Generic CRM Modal)
  ════════════════════════════════════════════════════════════ */
  .crm-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: crmFadeIn 0.15s ease;
  }
  
  .crm-modal-overlay[style*="flex"] { display: flex !important; }
  
  .crm-modal {
    background: var(--crm-surface);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius-xl);
    max-width: 520px;
    width: 100%;
    box-shadow: var(--crm-shadow-xl);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: crmFadeIn 0.2s ease;
  }
  
  .crm-modal-wide { max-width: 680px; }
  
  .crm-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--crm-border);
    flex-shrink: 0;
  }
  
  .crm-modal-title-wrap { display: flex; align-items: center; gap: 12px; }
  
  .crm-modal-title-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--crm-primary), var(--crm-primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: #fff;
    flex-shrink: 0;
  }
  
  .crm-modal-close {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--crm-border);
    background: var(--crm-input-bg);
    color: var(--crm-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: var(--crm-transition);
  }
  
  .crm-modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--crm-red);
    border-color: rgba(239, 68, 68, 0.2);
  }
  
  .crm-modal-body {
    padding: 20px 22px;
    overflow-y: auto;
    flex: 1;
  }
  
  .crm-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 22px;
    border-top: 1px solid var(--crm-border);
    flex-shrink: 0;
    flex-wrap: wrap;
  }
  
  /* ════════════════════════════════════════════════════════════
     41. FORMS
  ════════════════════════════════════════════════════════════ */
  .crm-form-group { margin-bottom: 14px; }
  
  .crm-form-label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    color: var(--crm-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 6px;
  }
  
  .crm-form-input,
  .crm-form-select,
  .crm-form-textarea {
    width: 100%;
    background: var(--crm-input-bg);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    padding: 9px 12px;
    font-family: inherit;
    font-size: 12px;
    color: var(--crm-text);
    outline: none;
    transition: var(--crm-transition);
  }
  
  .crm-form-input::placeholder,
  .crm-form-textarea::placeholder { color: var(--crm-text-faint); }
  
  .crm-form-input:focus,
  .crm-form-select:focus,
  .crm-form-textarea:focus {
    border-color: var(--crm-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
  }
  
  .crm-form-textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
  }
  
  .crm-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  
  .crm-form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--crm-border);
  }
  
  /* Contact Search Suggestions */
  .crm-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--crm-surface);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    z-index: 100;
    box-shadow: var(--crm-shadow-lg);
    max-height: 180px;
    overflow-y: auto;
    margin-top: 2px;
  }
  
  .crm-suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    transition: var(--crm-transition);
    border-bottom: 1px solid var(--crm-border);
  }
  
  .crm-suggestion-item:last-child { border-bottom: none; }
  .crm-suggestion-item:hover { background: var(--crm-input-bg); }
  
  /* ════════════════════════════════════════════════════════════
     42. CRM TEAM MANAGER MODAL
  ════════════════════════════════════════════════════════════ */
  .crm-team-modal-section {
    padding: 16px 0;
    border-bottom: 1px solid var(--crm-border);
  }
  
  .crm-team-modal-section:last-child { border-bottom: none; }
  
  .crm-team-modal-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 800;
    color: var(--crm-text);
    margin-bottom: 14px;
  }
  
  /* Member List */
  .crm-team-members-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 280px;
    overflow-y: auto;
  }
  
  .crm-team-member-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    background: var(--crm-input-bg);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    transition: var(--crm-transition);
  }
  
  .crm-team-member-row:hover { border-color: var(--crm-border-hover); }
  
  .crm-team-member-row-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
  }
  
  .crm-team-avatar-wrap {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
  }
  
  .crm-team-member-info { flex: 1; min-width: 0; }
  
  .crm-team-member-name {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--crm-text);
    flex-wrap: wrap;
  }
  
  .crm-team-member-email {
    font-size: 10px;
    color: var(--crm-text-faint);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .crm-team-member-added {
    font-size: 9px;
    color: var(--crm-text-faint);
    margin-top: 2px;
  }
  
  /* Badges inside member rows */
  .crm-team-you-badge {
    font-size: 9px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 20px;
    background: rgba(102, 126, 234, 0.12);
    color: var(--crm-primary);
  }
  
  .crm-team-admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 9px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 20px;
    background: rgba(245, 158, 11, 0.12);
    color: var(--crm-amber);
  }
  
  /* Member Row Right */
  .crm-team-member-row-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }
  
  /* Role Selector */
  .crm-team-role-select {
    background: var(--crm-input-bg);
    border: 1px solid var(--crm-border);
    border-radius: 8px;
    padding: 5px 8px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    color: var(--crm-text-muted);
    cursor: pointer;
    outline: none;
    transition: var(--crm-transition);
  }
  
  .crm-team-role-select:focus { border-color: var(--crm-primary); }
  
  .crm-team-role-badge-static {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    white-space: nowrap;
  }
  
  /* Remove Button */
  .crm-team-remove-btn {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    border: 1px solid var(--crm-border);
    background: var(--crm-input-bg);
    color: var(--crm-text-faint);
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--crm-transition);
    flex-shrink: 0;
  }
  
  .crm-team-remove-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--crm-red);
    border-color: rgba(239, 68, 68, 0.2);
  }
  
  /* Invite Section */
  .crm-team-invite-wrap {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
  }
  
  /* Role Descriptions */
  .crm-team-role-descriptions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
    padding: 12px;
    background: var(--crm-input-bg);
    border-radius: var(--crm-radius);
  }
  
  .crm-team-role-desc-item {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
  .crm-team-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 80px;
  }
  
  .crm-team-role-desc-text {
    font-size: 11px;
    color: var(--crm-text-muted);
  }
  
  /* Empty States */
  .crm-team-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 24px;
    text-align: center;
    color: var(--crm-text-faint);
    font-size: 12px;
  }
  
  .crm-team-no-admin-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(100, 116, 139, 0.08);
    border-radius: var(--crm-radius);
    font-size: 12px;
    color: var(--crm-text-muted);
    margin-top: 12px;
  }
  
  /* ════════════════════════════════════════════════════════════
     43. CONTEXT MENU
  ════════════════════════════════════════════════════════════ */
  .crm-context-menu {
    position: fixed;
    background: var(--crm-surface);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius-lg);
    padding: 6px;
    min-width: 180px;
    z-index: 20000;
    box-shadow: var(--crm-shadow-lg);
    animation: crmFadeIn 0.15s ease;
  }
  
  .crm-context-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--crm-text-muted);
    cursor: pointer;
    transition: var(--crm-transition);
  }
  
  .crm-context-item:hover { background: var(--crm-input-bg); color: var(--crm-text); }
  .crm-context-item.danger { color: var(--crm-red); }
  .crm-context-item.danger:hover { background: rgba(239, 68, 68, 0.08); }
  .crm-context-item i { font-size: 12px; width: 14px; text-align: center; }
  
  .crm-context-divider {
    border: none;
    border-top: 1px solid var(--crm-border);
    margin: 4px 0;
  }
  
  /* ════════════════════════════════════════════════════════════
     44. TOAST NOTIFICATIONS
  ════════════════════════════════════════════════════════════ */
  #crmToastContainer {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
  }
  
  /* ════════════════════════════════════════════════════════════
     45. RESPONSIVE PART 2 — Widgets (≤ 768px)
  ════════════════════════════════════════════════════════════ */
  @media (max-width: 768px) {
  
    /* Contacts Grid */
    .crm-contacts-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .crm-contact-actions { opacity: 1; }
  
    /* Deal Mini Table */
    .crm-deal-mini-header,
    .crm-deal-mini-row {
      grid-template-columns: 2fr 1.2fr 0.8fr 0.8fr;
    }
    .crm-deal-mini-sector,
    .crm-deal-mini-irr { display: none; }
  
    /* AI Chat Panel */
    .crm-ai-chat-panel {
      left: 10px;
      right: 10px;
      bottom: 80px;
      width: auto;
      max-height: 70vh;
    }
  
    .crm-ai-fab         { bottom: 20px; right: 20px; }
    .crm-ai-fab-text    { display: none; }
    .crm-ai-fab         { padding: 14px; border-radius: 50%; }
  
    /* Modals */
    .crm-modal-overlay  { padding: 10px; align-items: flex-end; }
    .crm-modal          { border-radius: var(--crm-radius-lg); max-height: 95vh; }
    .crm-modal-wide     { max-width: 100%; }
  
    /* Forms */
    .crm-form-row { grid-template-columns: 1fr; }
  
    /* Team Widget */
    .crm-team-grid-new { grid-template-columns: repeat(4, 1fr); }
  
    /* Follow-ups */
    .crm-lp-stage-label { min-width: 80px; }
  
    /* Narrative */
    .crm-narrative-text { font-size: 11px; }
  
    /* Team Modal */
    .crm-team-invite-wrap { flex-direction: column; }
    .crm-team-member-row  { flex-direction: column; align-items: flex-start; gap: 8px; }
    .crm-team-member-row-right { width: 100%; justify-content: flex-start; }
  }
  
  /* ════════════════════════════════════════════════════════════
     46. RESPONSIVE PART 2 — Small Mobile (≤ 480px)
  ════════════════════════════════════════════════════════════ */
  @media (max-width: 480px) {
  
    /* Contacts: single column */
    .crm-contacts-grid { grid-template-columns: 1fr; }
  
    /* Team compact */
    .crm-team-grid-new { grid-template-columns: repeat(3, 1fr); }
  
    /* Deal Mini Table: 3 cols */
    .crm-deal-mini-header,
    .crm-deal-mini-row {
      grid-template-columns: 2fr 1.2fr 0.8fr;
      min-width: 340px;
    }
    .crm-deal-mini-ev { display: none; }
  
    /* AI Chat */
    .crm-ai-chat-panel { left: 6px; right: 6px; }
    .crm-ai-chat-presets { gap: 4px; }
    .crm-ai-chat-preset { font-size: 9px; padding: 4px 7px; }
  
    /* Follow-up items */
    .crm-followup-item { flex-wrap: wrap; }
  
    /* Forms: no grid */
    .crm-form-row { grid-template-columns: 1fr; }
  }
  
  /* ════════════════════════════════════════════════════════════
     47. LANDSCAPE MOBILE (≤ 768px landscape)
  ════════════════════════════════════════════════════════════ */
  @media (max-width: 768px) and (orientation: landscape) {
    #crmContent { padding: 10px 14px; }
    .crm-hero   { margin-bottom: 10px; }
    .crm-hero-title { font-size: 16px; }
    .crm-kpi-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
    .crm-ai-chat-panel { max-height: 80vh; }
  }
  
  /* ════════════════════════════════════════════════════════════
     48. DARK MODE — Adjustments Part 2
  ════════════════════════════════════════════════════════════ */
  body.crm-dark-mode .crm-contact-card        { background: rgba(30, 41, 59, 0.85); }
  body.crm-dark-mode .crm-contact-card:hover  { box-shadow: 0 6px 20px rgba(0,0,0,0.4); }
  body.crm-dark-mode .crm-timeline-note       { background: rgba(255, 255, 255, 0.04); }
  body.crm-dark-mode .crm-narrative-text      { background: rgba(255, 255, 255, 0.04); }
  body.crm-dark-mode .crm-alert-card          { border-color: rgba(255, 255, 255, 0.05); }
  body.crm-dark-mode .crm-followup-item       { background: rgba(30, 41, 59, 0.6); }
  body.crm-dark-mode .crm-team-card-new       { background: rgba(255, 255, 255, 0.04); }
  body.crm-dark-mode .crm-team-member-row     { background: rgba(255, 255, 255, 0.03); }
  body.crm-dark-mode .crm-team-role-descriptions { background: rgba(255, 255, 255, 0.03); }
  body.crm-dark-mode .crm-modal              { background: #1a2235; border-color: rgba(255,255,255,0.1); }
  body.crm-dark-mode .crm-context-menu       { background: #1e293b; }
  body.crm-dark-mode .crm-suggestions        { background: #1e293b; }
  body.crm-dark-mode .crm-suggestion-item:hover { background: rgba(255,255,255,0.05); }
  body.crm-dark-mode .crm-ai-chat-panel      { background: #0f172a; }
  body.crm-dark-mode .crm-ai-chat-input      { background: rgba(30, 41, 59, 0.9); }
  body.crm-dark-mode .crm-ai-chat-input-wrap { background: rgba(15, 23, 42, 0.6); }
  body.crm-dark-mode .crm-chat-bubble.ai     { background: rgba(30, 41, 59, 0.9); }
  body.crm-dark-mode .crm-deal-mini-row:hover { background: rgba(255, 255, 255, 0.04); }
  body.crm-dark-mode .crm-deal-mini-row.stagnant { background: rgba(245, 158, 11, 0.06); }
  body.crm-dark-mode .crm-form-input,
  body.crm-dark-mode .crm-form-select,
  body.crm-dark-mode .crm-form-textarea      { background: rgba(255, 255, 255, 0.06); }
  body.crm-dark-mode .crm-funnel-stage:hover { background: rgba(255, 255, 255, 0.04); }
  body.crm-dark-mode .crm-lp-stage-row:hover { background: rgba(255, 255, 255, 0.04); }
  body.crm-dark-mode .crm-followup-item.overdue { background: rgba(239,68,68,0.08); }
  body.crm-dark-mode .crm-thermometer        { background: rgba(255, 255, 255, 0.06); }
  body.crm-dark-mode .crm-team-role-select   { background: rgba(255, 255, 255, 0.06); color: var(--crm-text); }
  body.crm-dark-mode .crm-modal-footer       { background: rgba(15, 23, 42, 0.5); }
  
  /* ════════════════════════════════════════════════════════════
     49. LIGHT MODE — Polish Part 2
  ════════════════════════════════════════════════════════════ */
  body:not(.crm-dark-mode) .crm-contact-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
  body:not(.crm-dark-mode) .crm-modal              { box-shadow: 0 20px 60px rgba(0,0,0,0.15); }
  body:not(.crm-dark-mode) .crm-context-menu       { box-shadow: 0 8px 32px rgba(0,0,0,0.12); }
  body:not(.crm-dark-mode) .crm-ai-chat-panel      { box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
  body:not(.crm-dark-mode) .crm-team-member-row    { background: rgba(0,0,0,0.02); }
  body:not(.crm-dark-mode) .crm-suggestions        { box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
  
  /* ════════════════════════════════════════════════════════════
     50. PRINT
  ════════════════════════════════════════════════════════════ */
  @media print {
    #crmSidebar,
    #crmHeader,
    .crm-quick-actions-bar,
    .crm-hero-right,
    .crm-ai-fab,
    .crm-ai-chat-panel,
    .crm-sidebar-toggle,
    #crmQuickActions { display: none !important; }
  
    #crmApp     { display: block; }
    #crmMain    { width: 100%; }
    #crmContent { padding: 0; overflow: visible; }
  
    .crm-bento-row { display: grid !important; }
    .crm-widget    { page-break-inside: avoid; }
    .crm-kpi-card  { page-break-inside: avoid; }
  
    body { background: #fff !important; color: #000 !important; }
  }
  
  /* ════════════════════════════════════════════════════════════
     51. UTILITIES & MICRO-HELPERS
  ════════════════════════════════════════════════════════════ */
  
  /* AI Icon animated */
  .crm-ai-spin { animation: crmSpin 1s linear infinite; }
  
  /* Drag-over state for contact/deal cards */
  .crm-drag-over {
    border-color: rgba(102, 126, 234, 0.5) !important;
    background: rgba(102, 126, 234, 0.04) !important;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2) !important;
  }
  
  /* Score animation */
  .crm-score-up { animation: crmCountUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
  
  /* Glow on urgent KPI */
  .crm-kpi-card.crm-urgent {
    animation: crmGlow 2s ease-in-out infinite;
    border-color: rgba(239, 68, 68, 0.3) !important;
  }
  
  /* Tooltip (via title attribute — native) */
  [title] { cursor: help; }
  .crm-nav-item[title],
  .crm-quick-action-btn[title] { cursor: pointer; }
  
  /* Collapsed sidebar nav items → show tooltip-like effect via native title */
  #crmSidebar.collapsed .crm-nav-item { position: relative; }
  
  /* Hidden admin section */
  #crmAdminSection[style*="none"] { display: none !important; }
  
  /* Form group relative (for suggestions) */
  .crm-form-group { position: relative; }
  
  /* Scrollable modal body */
  .crm-modal-body { scrollbar-width: thin; }
  .crm-modal-body::-webkit-scrollbar { width: 4px; }
  .crm-modal-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
  }
  body.crm-dark-mode .crm-modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
  }
  
  /* Team members list scrollbar */
  .crm-team-members-list::-webkit-scrollbar { width: 3px; }
  .crm-team-members-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.08);
    border-radius: 3px;
  }
  
  /* AI Chat messages scrollbar */
  .crm-ai-chat-messages::-webkit-scrollbar { width: 3px; }
  .crm-ai-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.2);
    border-radius: 3px;
  }
  
  /* ════════════════════════════════════════════════════════════
     END — crm-dashboard.css v1.0 (Part 2/2)
     © AlphaVault AI — All rights reserved
  ════════════════════════════════════════════════════════════ */