/* =====================================================
   CRM MODULE - Typeform Leads Dashboard
   AiMindloop Call Manager
   ===================================================== */

/* CRM Stats Grid */
.crm-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.crm-stat-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.crm-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.crm-stat-card.highlight {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    color: white;
    border: none;
}

.crm-stat-card.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
}

.crm-stat-card.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: none;
}

.crm-stat-value {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
}

.crm-stat-label {
    font-size: 14px;
    opacity: 0.9;
}

/* CRM Controls Bar */
.crm-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    margin-bottom: 25px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.crm-search-box {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.crm-search-box input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s;
}

.crm-search-box input:focus {
    outline: none;
    border-color: #0891b2;
    box-shadow: 0 0 0 4px rgba(8, 145, 178, 0.1);
}

.crm-search-box::before {
    content: '🔍';
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
}

.crm-filter-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.crm-filter-group select {
    padding: 10px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    min-width: 140px;
}

.crm-filter-group select:focus {
    outline: none;
    border-color: #0891b2;
}

.crm-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.crm-btn-primary {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    color: white;
}

.crm-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.4);
}

.crm-btn-secondary {
    background: #f1f5f9;
    color: #475569;
}

.crm-btn-secondary:hover {
    background: #e2e8f0;
}

.crm-btn-danger {
    background: #ef4444;
    color: white;
}

.crm-btn-danger:hover {
    background: #dc2626;
}

.crm-btn-success {
    background: #10b981;
    color: white;
}

.crm-btn-success:hover {
    background: #059669;
}

/* CRM Leads Table */
.crm-table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.crm-table {
    width: 100%;
    border-collapse: collapse;
}

.crm-table th {
    background: #f8fafc;
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    color: #334155;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
}

.crm-table td {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    color: #475569;
}

.crm-table tr:hover {
    background: #f8fafc;
}

.crm-table tr:last-child td {
    border-bottom: none;
}

/* Lead Status Badge */
.crm-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.crm-status.new {
    background: #dbeafe;
    color: #1d4ed8;
}

.crm-status.contacted {
    background: #fef3c7;
    color: #92400e;
}

.crm-status.qualified {
    background: #dcfce7;
    color: #166534;
}

.crm-status.converted {
    background: #d1fae5;
    color: #065f46;
}

.crm-status.lost {
    background: #fee2e2;
    color: #991b1b;
}

/* Lead Contact Info */
.crm-contact {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.crm-contact-name {
    font-weight: 600;
    color: #1e293b;
}

.crm-contact-email {
    font-size: 13px;
    color: #64748b;
}

.crm-contact-phone {
    font-size: 13px;
    color: #64748b;
}

/* Lead Actions */
.crm-actions {
    display: flex;
    gap: 8px;
}

.crm-action-btn {
    padding: 6px 10px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    background: #f1f5f9;
    color: #475569;
}

.crm-action-btn:hover {
    background: #e2e8f0;
}

.crm-action-btn.edit {
    background: #dbeafe;
    color: #1d4ed8;
}

.crm-action-btn.delete {
    background: #fee2e2;
    color: #991b1b;
}

/* CRM Pagination */
.crm-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.crm-pagination-info {
    font-size: 14px;
    color: #64748b;
}

.crm-pagination-buttons {
    display: flex;
    gap: 8px;
}

.crm-pagination-btn {
    padding: 8px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    color: #475569;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.crm-pagination-btn:hover:not(:disabled) {
    border-color: #0891b2;
    color: #0891b2;
}

.crm-pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.crm-pagination-btn.active {
    background: #0891b2;
    border-color: #0891b2;
    color: white;
}

/* CRM Lead Detail Modal */
.crm-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.crm-modal-overlay.active {
    display: flex;
}

.crm-modal {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    animation: crmModalSlide 0.3s ease;
}

@keyframes crmModalSlide {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.crm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.crm-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.crm-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #64748b;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.crm-modal-close:hover {
    color: #1e293b;
}

.crm-modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(90vh - 160px);
}

.crm-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

/* CRM Form */
.crm-form-group {
    margin-bottom: 20px;
}

.crm-form-group label {
    display: block;
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
    font-size: 14px;
}

.crm-form-group input,
.crm-form-group select,
.crm-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s;
}

.crm-form-group input:focus,
.crm-form-group select:focus,
.crm-form-group textarea:focus {
    outline: none;
    border-color: #0891b2;
}

.crm-form-group textarea {
    min-height: 100px;
    resize: vertical;
}

/* Lead Info Display */
.crm-lead-info {
    display: grid;
    gap: 16px;
}

.crm-lead-info-row {
    display: flex;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 12px;
}

.crm-lead-info-label {
    width: 140px;
    font-weight: 600;
    color: #64748b;
    font-size: 13px;
}

.crm-lead-info-value {
    flex: 1;
    color: #1e293b;
    font-size: 14px;
    word-break: break-all;
}

/* Empty State */
.crm-empty-state {
    text-align: center;
    padding: 60px 40px;
    color: #64748b;
}

.crm-empty-state-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.crm-empty-state h3 {
    font-size: 20px;
    color: #334155;
    margin-bottom: 10px;
}

.crm-empty-state p {
    font-size: 15px;
}

/* Recent Leads List */
.crm-recent-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.crm-recent-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 10px;
    transition: all 0.2s;
}

.crm-recent-item:hover {
    background: #f1f5f9;
}

.crm-recent-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    font-weight: 700;
}

.crm-recent-info {
    flex: 1;
}

.crm-recent-name {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.crm-recent-form {
    font-size: 13px;
    color: #64748b;
}

.crm-recent-time {
    font-size: 12px;
    color: #94a3b8;
}

/* Top Forms List */
.crm-forms-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.crm-form-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 8px;
}

.crm-form-name {
    font-weight: 500;
    color: #334155;
    font-size: 14px;
}

.crm-form-count {
    background: #0891b2;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .crm-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .crm-stat-card {
        padding: 16px;
    }
    
    .crm-stat-value {
        font-size: 28px;
    }
    
    .crm-controls {
        flex-direction: column;
        padding: 15px;
    }
    
    .crm-search-box {
        width: 100%;
    }
    
    .crm-filter-group {
        width: 100%;
        flex-direction: column;
    }
    
    .crm-filter-group select {
        width: 100%;
    }
    
    .crm-btn {
        width: 100%;
        justify-content: center;
    }
    
    .crm-table-container {
        overflow-x: auto;
    }
    
    .crm-table {
        min-width: 700px;
    }
    
    .crm-modal {
        width: 95%;
        max-height: 85vh;
    }
    
    .crm-modal-body {
        max-height: calc(85vh - 160px);
    }
    
    .crm-pagination {
        flex-direction: column;
        gap: 15px;
    }
}

/* Loading Skeleton */
.crm-skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.crm-skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.crm-skeleton-text.short {
    width: 60%;
}

.crm-skeleton-text.long {
    width: 90%;
}

/* =====================================================
   WEBINARJAM MODULE STYLES
   ===================================================== */

/* WebinarJam Webinar Cards */
.wj-webinar-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wj-webinar-card:hover {
    border-color: #8b5cf6;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
    transform: translateX(4px);
}

.wj-webinar-name {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.wj-webinar-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}

.wj-stat-live {
    color: #dc2626;
}

.wj-stat-replay {
    color: #7c3aed;
}

/* WebinarJam Attendance Badge */
.wj-attendance-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.wj-attendance-badge.live {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.wj-attendance-badge.replay {
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    color: #7c3aed;
    border: 1px solid #c4b5fd;
}

.wj-attendance-badge.pending {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #cbd5e1;
}

/* WebinarJam Stat Cards */
.crm-stat-card.wj-purple {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    border: none;
}

.crm-stat-card.wj-red {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
}

/* WebinarJam Sync Button */
.wj-sync-btn {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.wj-sync-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.wj-sync-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* WebinarJam Header */
.wj-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

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

/* =====================================================
   CRM PIPELINE MODULE - Unified Leads
   ===================================================== */

/* CRM Pipeline Tabs */
.crm-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border-color, #2a2a3e);
    padding-bottom: 10px;
    flex-wrap: wrap;
}

.crm-tab {
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: var(--text-muted, #888);
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: all 0.3s ease;
    font-size: 14px;
}

.crm-tab:hover {
    background: rgba(14, 165, 233, 0.1);
    color: var(--primary-color, #0ea5e9);
}

.crm-tab.active {
    background: var(--primary-color, #0ea5e9);
    color: white;
}

/* CRM Pipeline Views */
.crm-pipeline-view {
    padding: 20px 0;
}

/* CRM Pipeline Filters */
.crm-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.crm-filters input,
.crm-filters select {
    padding: 10px 15px;
    border: 1px solid var(--border-color, #2a2a3e);
    border-radius: 8px;
    background: var(--card-bg, #1e1e2e);
    color: var(--text-color, #fff);
    font-size: 14px;
}

.crm-filters input {
    min-width: 250px;
}

.crm-filters select {
    min-width: 150px;
}

/* CRM Select */
.crm-select {
    padding: 10px 15px;
    border: 1px solid var(--border-color, #2a2a3e);
    border-radius: 8px;
    background: var(--card-bg, #1e1e2e);
    color: var(--text-color, #fff);
    font-size: 14px;
    cursor: pointer;
}

/* CRM Header */
.crm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.crm-header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* CRM Loading */
.crm-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted, #888);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color, #2a2a3e);
    border-top-color: var(--primary-color, #0ea5e9);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* CRM Pipeline Empty State Icon */
.crm-empty-state .empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    display: block;
}

/* ============================================== */
/* CRM PIPELINE - IMPROVED STYLES */
/* High contrast, readable, responsive */
/* ============================================== */

/* Pipeline Dashboard Container */
#crmPipelineDashboardSection {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    min-height: 100vh;
    padding: 20px;
}

#crmPipelineDashboardSection .page-header h1 {
    color: #ffffff;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

#crmPipelineDashboardSection .page-header p {
    color: #94a3b8;
    font-size: 14px;
}

/* CRM Tabs - High Contrast */
.crm-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    flex-wrap: wrap;
}

.crm-tab {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.crm-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.crm-tab.active {
    background: #0ea5e9;
    color: #ffffff;
    font-weight: 600;
}

/* Settings Sections - FIXED CONTRAST */
.settings-section {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.settings-section h3 {
    color: #1e293b;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
}

.settings-section label {
    color: #334155;
    font-size: 14px;
    font-weight: 500;
}

.settings-section p {
    color: #475569;
}

/* Form Groups in Settings */
.settings-section .form-group {
    margin-bottom: 16px;
}

.settings-section .form-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #1e293b;
    font-weight: 500;
}

.settings-section input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #0ea5e9;
}

.settings-section input[type="range"] {
    width: 100%;
    max-width: 300px;
    accent-color: #0ea5e9;
}

.settings-section input[type="number"],
.settings-section input[type="text"],
.settings-section select {
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    color: #1e293b;
    font-size: 14px;
}

/* Table in Settings - Light Background */
.settings-section .crm-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

.settings-section .crm-table th {
    background: #f1f5f9;
    color: #475569;
    font-weight: 600;
    text-align: left;
    padding: 12px 16px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.settings-section .crm-table td {
    background: #ffffff;
    color: #1e293b;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
}

.settings-section .crm-table tr:hover td {
    background: #f8fafc;
}

/* Settings Actions */
.settings-actions {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-actions .btn {
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
}

/* AI Percent Display */
#ai-percent-display {
    display: inline-block;
    min-width: 50px;
    text-align: center;
    font-weight: 600;
    color: #0ea5e9;
    font-size: 16px;
}

/* Leads Table - Dark Theme with White Text */
.crm-pipeline-view .crm-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
}

.crm-pipeline-view .crm-table th {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-weight: 600;
    text-align: left;
    padding: 16px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.crm-pipeline-view .crm-table td {
    color: #ffffff;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
}

.crm-pipeline-view .crm-table tr:hover td {
    background: rgba(255, 255, 255, 0.05);
}

.crm-pipeline-view .text-muted {
    color: #94a3b8;
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
}

/* Queue Cards */
.crm-queue-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.queue-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.queue-card h4 {
    color: #1e293b;
    font-size: 18px;
    margin-bottom: 12px;
}

.queue-card p {
    color: #475569;
    font-size: 14px;
    margin-bottom: 8px;
}

.queue-card .btn {
    margin-top: 12px;
}

/* Duplicate Cards */
.crm-duplicates-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.duplicate-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

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

.confidence-badge {
    background: #0ea5e9;
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.match-reason {
    color: #64748b;
    font-size: 13px;
}

.duplicate-comparison {
    display: flex;
    gap: 16px;
    align-items: stretch;
    margin-bottom: 16px;
}

.lead-box {
    flex: 1;
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px;
}

.lead-box h4 {
    color: #1e293b;
    font-size: 16px;
    margin-bottom: 12px;
}

.lead-box p {
    color: #475569;
    font-size: 13px;
    margin-bottom: 6px;
}

.lead-box strong {
    color: #334155;
}

.vs-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #94a3b8;
    font-size: 14px;
}

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

/* Dashboard Stats Grid */
.crm-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.crm-stat-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.crm-stat-card h4 {
    color: #64748b;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.crm-stat-value {
    color: #1e293b;
    font-size: 36px;
    font-weight: 700;
}

.crm-stat-card.highlight {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
}

.crm-stat-card.highlight h4,
.crm-stat-card.highlight .crm-stat-value {
    color: #ffffff;
}

/* Filters - High Contrast */
.crm-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.crm-filters input,
.crm-filters select {
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 14px;
}

.crm-filters input::placeholder {
    color: #94a3b8;
}

.crm-filters select option {
    background: #1e293b;
    color: #ffffff;
}

/* Buttons - Better visibility */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #0ea5e9;
    color: #ffffff;
}

.btn-primary:hover {
    background: #0284c7;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #475569;
    color: #ffffff;
}

.btn-secondary:hover {
    background: #334155;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Empty States */
.crm-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}

.crm-empty-state .empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    display: block;
}

.crm-empty-state p {
    font-size: 16px;
    color: #64748b;
}

/* Loading State */
.crm-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #94a3b8;
}

.crm-loading p {
    color: #94a3b8;
    font-size: 14px;
}

/* Tenant Selector */
#crm-pipeline-tenant-select {
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 14px;
    min-width: 180px;
}

#crm-pipeline-tenant-select option {
    background: #1e293b;
    color: #ffffff;
}

/* ============================================== */
/* MOBILE RESPONSIVE */
/* ============================================== */

@media (max-width: 768px) {
    #crmPipelineDashboardSection {
        padding: 12px;
    }
    
    #crmPipelineDashboardSection .page-header h1 {
        font-size: 22px;
    }
    
    .crm-tabs {
        gap: 4px;
        padding: 4px;
    }
    
    .crm-tab {
        padding: 10px 14px;
        font-size: 12px;
    }
    
    .settings-section {
        padding: 16px;
    }
    
    .settings-section h3 {
        font-size: 16px;
    }
    
    .crm-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .crm-stat-card {
        padding: 16px;
    }
    
    .crm-stat-value {
        font-size: 28px;
    }
    
    .crm-filters {
        flex-direction: column;
    }
    
    .crm-filters input,
    .crm-filters select {
        width: 100%;
    }
    
    /* Table responsive */
    .crm-pipeline-view .crm-table {
        display: block;
        overflow-x: auto;
    }
    
    .settings-section .crm-table {
        display: block;
        overflow-x: auto;
    }
    
    .duplicate-comparison {
        flex-direction: column;
    }
    
    .vs-divider {
        padding: 8px 0;
    }
    
    .crm-queue-list {
        grid-template-columns: 1fr;
    }
    
    .duplicate-actions {
        flex-direction: column;
    }
    
    .duplicate-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .crm-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .crm-tab {
        padding: 8px 10px;
        font-size: 11px;
    }
    
    .crm-stat-card h4 {
        font-size: 11px;
    }
    
    .crm-stat-value {
        font-size: 24px;
    }
}

/* ============================================== */
/* CRM PIPELINE SETTINGS - URGENT FIX */
/* Ensure ALL text is visible */
/* ============================================== */

/* Settings container - force white background */
#crm-pipeline-settings-form {
    background: transparent;
}

#crm-pipeline-settings-form .crm-settings-sections {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Each settings section - WHITE background, DARK text */
#crm-pipeline-settings-form .settings-section {
    background: #ffffff !important;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

#crm-pipeline-settings-form .settings-section h3 {
    color: #1e293b !important;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
}

/* Form labels - DARK text */
#crm-pipeline-settings-form .settings-section label {
    color: #1e293b !important;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

#crm-pipeline-settings-form .settings-section p {
    color: #475569 !important;
}

/* Form group spacing */
#crm-pipeline-settings-form .form-group {
    margin-bottom: 16px;
}

/* Checkboxes */
#crm-pipeline-settings-form input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #0ea5e9;
    cursor: pointer;
}

/* Range slider */
#crm-pipeline-settings-form input[type="range"] {
    width: 100%;
    max-width: 400px;
    height: 8px;
    accent-color: #0ea5e9;
    cursor: pointer;
}

/* Percent display */
#crm-pipeline-settings-form #ai-percent-display {
    color: #0ea5e9 !important;
    font-size: 18px;
    font-weight: 700;
    margin-left: 12px;
}

/* Tables in settings */
#crm-pipeline-settings-form .crm-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
}

#crm-pipeline-settings-form .crm-table th {
    background: #f1f5f9 !important;
    color: #475569 !important;
    font-weight: 600;
    text-align: left;
    padding: 14px 16px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
}

#crm-pipeline-settings-form .crm-table td {
    background: #ffffff !important;
    color: #1e293b !important;
    padding: 14px 16px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
}

#crm-pipeline-settings-form .crm-table tr:hover td {
    background: #f8fafc !important;
}

/* Select dropdowns in settings */
#crm-pipeline-settings-form select,
#crm-pipeline-settings-form .role-select {
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff !important;
    color: #1e293b !important;
    font-size: 14px;
    cursor: pointer;
}

/* Number inputs in settings */
#crm-pipeline-settings-form input[type="number"],
#crm-pipeline-settings-form input[type="text"] {
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff !important;
    color: #1e293b !important;
    font-size: 14px;
}

/* Empty state message */
#crm-pipeline-settings-form .crm-table td[colspan] {
    text-align: center;
    color: #64748b !important;
    font-style: italic;
    padding: 24px 16px;
}

/* Settings actions button area */
#crm-pipeline-settings-form .settings-actions {
    margin-top: 24px;
    padding-top: 20px;
}

#crm-pipeline-settings-form .settings-actions .btn-primary {
    background: #0ea5e9;
    color: #ffffff;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

#crm-pipeline-settings-form .settings-actions .btn-primary:hover {
    background: #0284c7;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
}

/* Access denied message */
#crm-pipeline-settings-form .crm-access-denied {
    background: #ffffff;
    border-radius: 16px;
    padding: 40px;
    text-align: center;
}

#crm-pipeline-settings-form .crm-access-denied p {
    color: #64748b !important;
    font-size: 18px;
}

/* Add program button */
#crm-pipeline-settings-form .btn-primary {
    background: #0ea5e9;
    color: #ffffff !important;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

/* Mobile responsive for settings */
@media (max-width: 768px) {
    #crm-pipeline-settings-form .settings-section {
        padding: 16px;
    }
    
    #crm-pipeline-settings-form .settings-section h3 {
        font-size: 16px;
    }
    
    #crm-pipeline-settings-form .crm-table {
        display: block;
        overflow-x: auto;
    }
    
    #crm-pipeline-settings-form .crm-table th,
    #crm-pipeline-settings-form .crm-table td {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* ============================================== */
/* MODERN SIDEBAR & MOBILE NAV IMPROVEMENTS */
/* Better readability and modern look */
/* ============================================== */

/* Desktop Sidebar Improvements */
@media (min-width: 769px) {
    .sidebar {
        background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%) !important;
    }
    
    .sidebar .nav-item {
        color: #e2e8f0 !important;
        font-size: 14px;
        font-weight: 500;
        padding: 12px 16px;
        border-radius: 8px;
        margin: 2px 8px;
        transition: all 0.2s ease;
    }
    
    .sidebar .nav-item:hover {
        background: rgba(255, 255, 255, 0.1) !important;
        color: #ffffff !important;
    }
    
    .sidebar .nav-item.active {
        background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%) !important;
        color: #ffffff !important;
    }
    
    /* Nav Groups */
    .nav-group {
        margin: 8px 0;
    }
    
    .nav-group-header {
        color: #94a3b8 !important;
        font-weight: 600;
        padding: 12px 16px;
        margin: 0 8px;
        border-radius: 8px;
        transition: all 0.2s ease;
    }
    
    .nav-group-header:hover {
        background: rgba(255, 255, 255, 0.05);
        color: #e2e8f0 !important;
    }
    
    .nav-group-items .nav-item {
        padding-left: 32px !important;
        font-size: 13px;
    }
}

/* Mobile Bottom Nav - Modern Style */
@media (max-width: 768px) {
    .mobile-bottom-nav {
        background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%) !important;
        box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.3) !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding: 12px 8px !important;
        padding-bottom: max(12px, env(safe-area-inset-bottom)) !important;
    }
    
    .mobile-nav-item {
        color: #94a3b8 !important;
        padding: 8px 4px !important;
        border-radius: 12px;
        transition: all 0.2s ease;
    }
    
    .mobile-nav-item:hover,
    .mobile-nav-item:active {
        background: rgba(255, 255, 255, 0.1) !important;
    }
    
    .mobile-nav-item.active {
        color: #ffffff !important;
        background: rgba(14, 165, 233, 0.2) !important;
    }
    
    .mobile-nav-item.active::before {
        background: #0ea5e9 !important;
        width: 30px !important;
        height: 3px !important;
    }
    
    .mobile-nav-item .icon {
        font-size: 24px !important;
        margin-bottom: 4px;
    }
    
    .mobile-nav-item .label {
        font-size: 11px !important;
        font-weight: 600 !important;
        color: inherit !important;
        letter-spacing: 0.3px;
    }
    
    /* Mobile Bottom Sheet - Modern */
    .mobile-nav-group-sheet {
        background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%) !important;
        border-radius: 24px 24px 0 0 !important;
        padding: 24px !important;
        box-shadow: 0 -10px 50px rgba(0, 0, 0, 0.5) !important;
    }
    
    .mobile-nav-group-sheet-header {
        margin-bottom: 20px !important;
        padding-bottom: 16px !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
    }
    
    .mobile-nav-group-sheet-header h3 {
        font-size: 20px !important;
        font-weight: 700 !important;
        color: #ffffff !important;
    }
    
    .mobile-nav-group-sheet-close {
        width: 40px !important;
        height: 40px !important;
        background: rgba(255, 255, 255, 0.1) !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
        color: #ffffff !important;
        font-size: 20px !important;
    }
    
    .mobile-nav-group-sheet-close:active {
        background: rgba(255, 255, 255, 0.2) !important;
        transform: scale(0.95);
    }
    
    .sheet-nav-item {
        background: rgba(255, 255, 255, 0.05) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        border-radius: 12px !important;
        padding: 16px 20px !important;
        margin-bottom: 8px !important;
        color: #ffffff !important;
        font-size: 16px !important;
        font-weight: 500 !important;
        display: flex;
        align-items: center;
        gap: 12px;
        transition: all 0.2s ease;
    }
    
    .sheet-nav-item:hover,
    .sheet-nav-item:active {
        background: rgba(14, 165, 233, 0.2) !important;
        border-color: rgba(14, 165, 233, 0.4) !important;
        transform: translateX(4px);
    }
    
    /* Mobile Overlay */
    .mobile-nav-overlay {
        background: rgba(0, 0, 0, 0.6) !important;
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
    }
}

/* General text visibility fixes */
.sidebar-content,
.sidebar-content * {
    color: #e2e8f0;
}

.sidebar-header h2 {
    color: #ffffff !important;
}

.sidebar-header p {
    color: #94a3b8 !important;
}

/* ============================================== */
/* CRM TYPEFORM DASHBOARD - MODERN RESPONSIVE */
/* Full-width, scrollable, mobile-friendly */
/* ============================================== */

/* Main CRM Section - Full Width */
#crmDashboardSection,
#crmLeadsSection {
    width: 100%;
    max-width: 100%;
    padding: 24px;
    box-sizing: border-box;
    min-height: calc(100vh - 60px);
    overflow-y: auto;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

#crmDashboardSection .page-header,
#crmLeadsSection .page-header {
    margin-bottom: 24px;
}

#crmDashboardSection .page-header h1,
#crmLeadsSection .page-header h1 {
    color: #1e293b;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

#crmDashboardSection .page-header p,
#crmLeadsSection .page-header p {
    color: #64748b;
    font-size: 15px;
}

/* Stats Grid - Improved */
#crmDashboardSection .crm-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

#crmDashboardSection .crm-stat-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

#crmDashboardSection .crm-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

#crmDashboardSection .crm-stat-card.highlight {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
}

#crmDashboardSection .crm-stat-card.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

#crmDashboardSection .crm-stat-card.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

#crmDashboardSection .crm-stat-card.highlight .crm-stat-value,
#crmDashboardSection .crm-stat-card.highlight .crm-stat-label,
#crmDashboardSection .crm-stat-card.success .crm-stat-value,
#crmDashboardSection .crm-stat-card.success .crm-stat-label,
#crmDashboardSection .crm-stat-card.warning .crm-stat-value,
#crmDashboardSection .crm-stat-card.warning .crm-stat-label {
    color: #ffffff;
}

#crmDashboardSection .crm-stat-value {
    font-size: 42px;
    font-weight: 800;
    color: #1e293b;
    line-height: 1;
    margin-bottom: 8px;
}

#crmDashboardSection .crm-stat-label {
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Two Column Layout */
#crmDashboardSection .card {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: none;
}

#crmDashboardSection .card h3 {
    color: #1e293b;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Recent Leads List */
#crmDashboardSection .crm-recent-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
}

#crmDashboardSection .crm-recent-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
    transition: all 0.2s;
    border: 1px solid transparent;
}

#crmDashboardSection .crm-recent-item:hover {
    background: #f1f5f9;
    border-color: #e2e8f0;
}

#crmDashboardSection .crm-lead-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0ea5e9 0%, #8b5cf6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

#crmDashboardSection .crm-lead-info {
    flex: 1;
    min-width: 0;
}

#crmDashboardSection .crm-lead-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 15px;
    margin-bottom: 4px;
}

#crmDashboardSection .crm-lead-detail {
    color: #64748b;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#crmDashboardSection .crm-lead-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

#crmDashboardSection .crm-lead-badge.new {
    background: #dcfce7;
    color: #166534;
}

#crmDashboardSection .crm-lead-badge.contacted {
    background: #fef3c7;
    color: #92400e;
}

#crmDashboardSection .crm-lead-badge.qualified {
    background: #dbeafe;
    color: #1e40af;
}

#crmDashboardSection .crm-lead-time {
    color: #94a3b8;
    font-size: 12px;
    white-space: nowrap;
}

/* Forms List */
#crmDashboardSection .crm-forms-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#crmDashboardSection .crm-form-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
    transition: all 0.2s;
}

#crmDashboardSection .crm-form-item:hover {
    background: #f1f5f9;
}

#crmDashboardSection .crm-form-name {
    font-weight: 500;
    color: #1e293b;
    font-size: 14px;
}

#crmDashboardSection .crm-form-count {
    background: #0ea5e9;
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

/* Webhook Section */
#crmDashboardSection .webhook-card {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #0ea5e9;
    border-radius: 16px;
    padding: 24px;
    margin-top: 24px;
}

#crmDashboardSection .webhook-card h3 {
    color: #0369a1;
}

#crmDashboardSection .webhook-card p {
    color: #0c4a6e;
}

/* CRM Controls - Leads List */
#crmLeadsSection .crm-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    margin-bottom: 24px;
    padding: 20px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

#crmLeadsSection .crm-search-box {
    flex: 1;
    min-width: 280px;
}

#crmLeadsSection .crm-search-box input {
    width: 100%;
    padding: 14px 18px 14px 48px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    background: #f8fafc;
    color: #1e293b;
    transition: all 0.2s;
}

#crmLeadsSection .crm-search-box input:focus {
    outline: none;
    border-color: #0ea5e9;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
}

#crmLeadsSection .crm-search-box input::placeholder {
    color: #94a3b8;
}

#crmLeadsSection .crm-filter-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

#crmLeadsSection .crm-filter-group select {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    color: #1e293b;
    font-size: 14px;
    cursor: pointer;
    min-width: 160px;
}

#crmLeadsSection .crm-filter-group select:focus {
    outline: none;
    border-color: #0ea5e9;
}

#crmLeadsSection .crm-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

#crmLeadsSection .crm-btn-primary {
    background: #0ea5e9;
    color: #ffffff;
}

#crmLeadsSection .crm-btn-primary:hover {
    background: #0284c7;
    transform: translateY(-2px);
}

#crmLeadsSection .crm-btn-secondary {
    background: #f1f5f9;
    color: #475569;
}

#crmLeadsSection .crm-btn-secondary:hover {
    background: #e2e8f0;
}

/* Leads Table */
#crmLeadsSection .crm-table-container {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

#crmLeadsSection .crm-table {
    width: 100%;
    border-collapse: collapse;
}

#crmLeadsSection .crm-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    text-align: left;
    padding: 16px 20px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
}

#crmLeadsSection .crm-table td {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
    font-size: 14px;
}

#crmLeadsSection .crm-table tr:hover td {
    background: #f8fafc;
}

/* MOBILE RESPONSIVE - CRM Typeform */
@media (max-width: 1200px) {
    #crmDashboardSection .crm-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    #crmDashboardSection > div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 768px) {
    #crmDashboardSection,
    #crmLeadsSection {
        padding: 16px;
    }
    
    #crmDashboardSection .page-header h1,
    #crmLeadsSection .page-header h1 {
        font-size: 22px;
    }
    
    #crmDashboardSection .crm-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    #crmDashboardSection .crm-stat-card {
        padding: 18px;
    }
    
    #crmDashboardSection .crm-stat-value {
        font-size: 32px;
    }
    
    #crmDashboardSection .crm-stat-label {
        font-size: 12px;
    }
    
    #crmLeadsSection .crm-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    #crmLeadsSection .crm-search-box {
        min-width: 100%;
    }
    
    #crmLeadsSection .crm-filter-group {
        width: 100%;
    }
    
    #crmLeadsSection .crm-filter-group select {
        flex: 1;
        min-width: 0;
    }
    
    #crmLeadsSection .crm-table-container {
        overflow-x: auto;
    }
}

@media (max-width: 480px) {
    #crmDashboardSection .crm-stats-grid {
        grid-template-columns: 1fr;
    }
    
    #crmDashboardSection .crm-recent-item {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    #crmDashboardSection .crm-lead-badge {
        order: -1;
    }
}

/* Scrollbar styling */
#crmDashboardSection .crm-recent-list::-webkit-scrollbar,
#crmLeadsSection::-webkit-scrollbar {
    width: 8px;
}

#crmDashboardSection .crm-recent-list::-webkit-scrollbar-track,
#crmLeadsSection::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

#crmDashboardSection .crm-recent-list::-webkit-scrollbar-thumb,
#crmLeadsSection::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

#crmDashboardSection .crm-recent-list::-webkit-scrollbar-thumb:hover,
#crmLeadsSection::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* CRM Dashboard Grid - Two columns responsive */
.crm-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-top: 24px;
}

@media (max-width: 992px) {
    .crm-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Loading state */
.crm-loading-state {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
}

.crm-loading-state .loading-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.crm-loading-state p {
    font-size: 14px;
    color: #64748b;
}

/* Webhook card styles */
.webhook-card {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%) !important;
    border: 2px solid #0ea5e9 !important;
    margin-top: 24px;
}

.webhook-card h3 {
    color: #0369a1 !important;
}

.webhook-card > p {
    color: #0c4a6e;
    margin-bottom: 12px;
}

.webhook-url-box {
    background: white;
    padding: 16px;
    border-radius: 10px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 13px;
    word-break: break-all;
    border: 1px solid #bae6fd;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.webhook-url-box span {
    color: #0369a1;
    flex: 1;
    min-width: 200px;
}

.btn-copy {
    padding: 8px 16px;
    background: #0891b2;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-copy:hover {
    background: #0e7490;
    transform: translateY(-1px);
}

.webhook-instructions {
    color: #64748b !important;
    margin-top: 12px;
    font-size: 13px;
}

.webhook-instructions strong {
    color: #475569;
}

/* Global content section improvements */
.content-section {
    width: 100%;
    max-width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

.content-section.active {
    display: block;
}

/* ============================================== */
/* CRM PIPELINE DASHBOARD - MODERN DESIGN */
/* ============================================== */

/* KPI Row */
.pipeline-kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.pipeline-kpi-card {
    position: relative;
    border-radius: 20px;
    padding: 24px;
    color: #ffffff;
    overflow: hidden;
    min-height: 120px;
    display: flex;
    align-items: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pipeline-kpi-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
}

.pipeline-kpi-card.gradient-blue {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 50%, #0369a1 100%);
}

.pipeline-kpi-card.gradient-purple {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 50%, #6d28d9 100%);
}

.pipeline-kpi-card.gradient-green {
    background: linear-gradient(135deg, #10b981 0%, #059669 50%, #047857 100%);
}

.pipeline-kpi-card.gradient-orange {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 50%, #b45309 100%);
}

.kpi-content {
    position: relative;
    z-index: 2;
}

.kpi-number {
    font-size: 48px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.kpi-title {
    font-size: 14px;
    font-weight: 600;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.kpi-icon-bg {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 80px;
    opacity: 0.2;
    z-index: 1;
}

/* Main Dashboard Grid */
.pipeline-main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 24px;
}

.pipeline-card {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.pipeline-card:hover {
    box-shadow: 0 8px 35px rgba(0, 0, 0, 0.12);
}

.pipeline-status-card {
    grid-column: 1;
    grid-row: 1 / 3;
}

.pipeline-sources-card {
    grid-column: 2;
    grid-row: 1;
}

.pipeline-operators-card {
    grid-column: 2;
    grid-row: 2;
}

/* Card Header */
.pipeline-card .card-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f1f5f9;
    background: #fafbfc;
}

.pipeline-card .card-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-icon {
    font-size: 20px;
}

/* Card Body */
.pipeline-card .card-body {
    padding: 24px;
}

/* Pipeline Bars */
.pipeline-bars {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pipeline-bar-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bar-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bar-label {
    font-size: 14px;
    font-weight: 500;
    color: #334155;
}

.bar-stats {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}

.bar-stats small {
    font-weight: 500;
    color: #64748b;
    margin-left: 4px;
}

.bar-track {
    height: 10px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
    min-width: 4px;
}

/* Sources Grid */
.sources-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.source-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.source-card:hover {
    background: #f1f5f9;
    transform: translateX(4px);
}

.source-icon {
    font-size: 28px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.source-info {
    flex: 1;
}

.source-info .source-name {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 2px;
}

.source-info .source-count {
    font-size: 13px;
    color: #64748b;
}

/* Operators Table */
.operators-table-wrapper {
    overflow-x: auto;
}

.operators-table {
    width: 100%;
    border-collapse: collapse;
}

.operators-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
    background: #f8fafc;
}

.operators-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
    font-size: 14px;
}

.operators-table tr:hover td {
    background: #f8fafc;
}

.operator-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.operator-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0ea5e9, #8b5cf6);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.stat-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    background: #f1f5f9;
    color: #475569;
}

.stat-badge.new {
    background: #dbeafe;
    color: #1e40af;
}

.stat-badge.qualified {
    background: #dcfce7;
    color: #166534;
}

/* Empty State Mini */
.empty-state-mini {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
}

.empty-state-mini span {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state-mini p {
    font-size: 14px;
    color: #64748b;
}

/* Mobile Responsive */
@media (max-width: 1200px) {
    .pipeline-kpi-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .pipeline-main-grid {
        grid-template-columns: 1fr;
    }
    
    .pipeline-status-card {
        grid-column: 1;
        grid-row: auto;
    }
    
    .pipeline-sources-card,
    .pipeline-operators-card {
        grid-column: 1;
        grid-row: auto;
    }
}

@media (max-width: 768px) {
    .pipeline-kpi-row {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .pipeline-kpi-card {
        padding: 18px;
        min-height: 100px;
    }
    
    .kpi-number {
        font-size: 36px;
    }
    
    .kpi-title {
        font-size: 12px;
    }
    
    .kpi-icon-bg {
        font-size: 60px;
        right: 10px;
    }
    
    .pipeline-card .card-header {
        padding: 16px 20px;
    }
    
    .pipeline-card .card-body {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .pipeline-kpi-row {
        grid-template-columns: 1fr;
    }
    
    .kpi-number {
        font-size: 42px;
    }
}

/* ========================================
   USER ALLOCATION SETTINGS
   ======================================== */

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #374151;
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #10b981;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* User Info in Settings Table */
.user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-name {
    font-weight: 600;
    color: #f8fafc;
}

.user-email {
    font-size: 0.8rem;
    color: #94a3b8;
}

/* Allocation Input */
.allocation-input {
    display: flex;
    align-items: center;
    gap: 5px;
}

.allocation-input input {
    width: 70px !important;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #374151;
    background: #1e293b;
    color: #f8fafc;
    text-align: center;
}

.allocation-input span {
    color: #94a3b8;
}

/* User Row States */
.user-active {
    background-color: rgba(16, 185, 129, 0.1);
}

.user-inactive {
    opacity: 0.6;
}

.user-inactive .user-name {
    color: #64748b;
}

/* Role Select in Settings */
.crm-pipeline-settings .role-select {
    min-width: 120px;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #374151;
    background: #1e293b;
    color: #f8fafc;
}

/* Empty State in Settings */
.crm-pipeline-settings .empty-state {
    padding: 40px !important;
}

.crm-pipeline-settings .empty-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.crm-pipeline-settings .empty-message .empty-icon {
    font-size: 48px;
}

.crm-pipeline-settings .empty-message p {
    color: #94a3b8;
    margin: 0;
}

.crm-pipeline-settings .empty-message .hint {
    font-size: 0.85rem;
    color: #64748b;
}

/* Settings Actions */
.settings-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #374151;
    display: flex;
    justify-content: flex-end;
}

/* Mobile Responsiveness for Settings */
@media (max-width: 768px) {
    .crm-pipeline-settings .crm-table th:nth-child(3),
    .crm-pipeline-settings .crm-table td:nth-child(3) {
        /* Keep all columns visible but compact */
        padding: 8px 5px;
    }
    
    .user-info {
        max-width: 120px;
    }
    
    .user-email {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .allocation-input input {
        width: 55px !important;
    }
    
    .toggle-switch {
        width: 40px;
        height: 22px;
    }
    
    .toggle-slider:before {
        height: 16px;
        width: 16px;
    }
    
    .toggle-switch input:checked + .toggle-slider:before {
        transform: translateX(18px);
    }
}

/* Settings Form Control */
.crm-pipeline-settings .form-control {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #374151;
    background: #1e293b;
    color: #f8fafc;
}

.crm-pipeline-settings .form-control:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* ========================================
   LEAD ASSIGN MODAL
   ======================================== */

.assign-modal {
    max-width: 500px;
}

.assign-modal .modal-body {
    padding: 20px;
}

.assign-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.assign-options h4 {
    color: #f8fafc;
    margin: 0 0 10px 0;
    font-size: 1rem;
}

.assign-option {
    text-align: center;
    padding: 20px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.btn-lg.btn-ai {
    padding: 15px 30px;
    font-size: 1.1rem;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    border: none;
    color: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-lg.btn-ai:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(59, 130, 246, 0.4);
}

.option-desc {
    color: #94a3b8;
    margin: 10px 0 0 0;
    font-size: 0.9rem;
}

.assign-divider {
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
    position: relative;
}

.assign-divider::before,
.assign-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: #374151;
}

.assign-divider::before {
    left: 0;
}

.assign-divider::after {
    right: 0;
}

.assign-users {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 10px;
    padding: 15px;
}

.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.btn-user {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 12px 10px;
    background: #1e293b;
    border: 1px solid #374151;
    border-radius: 8px;
    color: #f8fafc;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-user:hover {
    background: #334155;
    border-color: #3b82f6;
}

.btn-user.btn-inactive {
    opacity: 0.5;
    border-style: dashed;
}

.btn-user .user-icon {
    font-size: 1.5rem;
}

.btn-user .user-name {
    font-weight: 600;
    font-size: 0.85rem;
    text-align: center;
    word-break: break-word;
}

.btn-user .user-role {
    font-size: 0.7rem;
    color: #94a3b8;
    text-transform: uppercase;
}

.no-users {
    color: #94a3b8;
    text-align: center;
    padding: 20px;
    font-style: italic;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .assign-modal {
        margin: 10px;
        max-width: calc(100vw - 20px);
    }
    
    .users-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .btn-user {
        padding: 10px 8px;
    }
    
    .btn-user .user-name {
        font-size: 0.75rem;
    }
}

/* ========================================
   GLOBAL MODAL STYLES (Standard modals)
   Text alb pe fundal închis
   ======================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.modal-content {
    background: #1e293b;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    color: #f8fafc; /* Text alb pe fundal închis */
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #374151;
    background: #0f172a;
    border-radius: 12px 12px 0 0;
}

.modal-header h2 {
    margin: 0;
    color: #f8fafc; /* Text alb */
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.2s;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #f8fafc;
}

.modal-body {
    padding: 20px;
    color: #e2e8f0; /* Text deschis pe fundal închis */
}

.modal-body p {
    color: #cbd5e1;
}

.modal-body strong {
    color: #f8fafc;
}

.modal-body h3, 
.modal-body h4 {
    color: #f8fafc;
    margin-top: 0;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 15px 20px;
    border-top: 1px solid #374151;
    background: #0f172a;
    border-radius: 0 0 12px 12px;
}

/* ========================================
   HIGH CONTRAST TEXT RULES
   Fundal închis = text alb
   Fundal deschis = text negru
   ======================================== */

/* Dark backgrounds - white text */
.pipeline-card,
.pipeline-kpi-card,
.settings-section,
.crm-pipeline-settings,
.crm-settings-sections,
.crm-table,
.assign-modal,
.lead-details-modal {
    color: #f8fafc;
}

.pipeline-card h3,
.pipeline-card h4,
.settings-section h3,
.settings-section h4 {
    color: #f8fafc !important;
}

.pipeline-card p,
.pipeline-card span,
.settings-section p,
.settings-section label {
    color: #e2e8f0;
}

/* Table text on dark background */
.crm-table th {
    color: #f8fafc !important;
    background: #0f172a !important;
}

.crm-table td {
    color: #e2e8f0 !important;
}

.crm-table td a,
.crm-table td .lead-name {
    color: #60a5fa !important;
}

/* Form elements on dark background */
.crm-pipeline-settings input,
.crm-pipeline-settings select,
.crm-pipeline-settings textarea {
    color: #f8fafc !important;
    background: #1e293b !important;
    border-color: #374151 !important;
}

.crm-pipeline-settings input::placeholder {
    color: #64748b !important;
}

/* Light backgrounds - dark text (if any) */
.light-bg,
.white-bg {
    color: #1e293b !important;
}

.light-bg h1, .light-bg h2, .light-bg h3, .light-bg h4,
.white-bg h1, .white-bg h2, .white-bg h3, .white-bg h4 {
    color: #0f172a !important;
}

.light-bg p, .light-bg span,
.white-bg p, .white-bg span {
    color: #374151 !important;
}

/* Ensure buttons have good contrast */
.btn {
    font-weight: 500;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff !important;
}

.btn-secondary {
    background: #374151;
    color: #f8fafc !important;
}

.btn-secondary:hover {
    background: #4b5563;
}

/* Status badges - ensure readable */
.status-badge {
    color: #ffffff !important;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* KPI cards text */
.pipeline-kpi-card .kpi-number {
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.pipeline-kpi-card .kpi-title {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Source cards */
.source-card .source-name,
.source-card .source-count {
    color: #f8fafc !important;
}

/* Bar labels in pipeline */
.bar-label,
.bar-stats {
    color: #e2e8f0 !important;
}

/* Empty states */
.empty-state-mini p,
.crm-empty-state p {
    color: #94a3b8 !important;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .modal-content {
        margin: 10px;
        max-width: calc(100vw - 20px);
    }
    
    .modal-header h2 {
        font-size: 1.1rem;
    }
}

/* ========================================
   TENANT SELECTOR IMPROVEMENTS
   ======================================== */

#crm-pipeline-tenant-select {
    min-width: 200px;
    padding: 10px 15px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #f8fafc !important;
    background: #1e293b !important;
    border: 2px solid #3b82f6 !important;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#crm-pipeline-tenant-select:hover {
    border-color: #60a5fa !important;
    background: #334155 !important;
}

#crm-pipeline-tenant-select:focus {
    outline: none;
    border-color: #60a5fa !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

#crm-pipeline-tenant-select option {
    background: #1e293b;
    color: #f8fafc;
    padding: 10px;
}

/* Single tenant indicator */
.single-tenant-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border-radius: 8px;
    font-weight: 500;
}

.single-tenant-badge::before {
    content: '🏢';
}

/* ========================================
   ASSIGN MODAL - HIGH CONTRAST FIX
   Text ALB pe fundal ÎNCHIS
   ======================================== */

/* Modal overlay și content */
.assign-modal {
    background: #1e293b !important;
    color: #f8fafc !important;
}

.assign-modal .modal-header {
    background: #0f172a !important;
    border-bottom: 1px solid #374151 !important;
}

.assign-modal .modal-header h2 {
    color: #f8fafc !important;
}

.assign-modal .modal-body {
    background: #1e293b !important;
    color: #f8fafc !important;
}

.assign-modal .modal-footer {
    background: #0f172a !important;
    border-top: 1px solid #374151 !important;
    padding: 15px 20px !important;
}

/* Titluri și text în modal */
.assign-options h4 {
    color: #f8fafc !important;
    font-size: 1rem;
    margin-bottom: 15px;
}

.assign-option {
    background: rgba(59, 130, 246, 0.1) !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
}

.option-desc {
    color: #94a3b8 !important;
}

.assign-divider {
    color: #64748b !important;
}

.assign-users {
    background: rgba(30, 41, 59, 0.8) !important;
}

.assign-users h4 {
    color: #f8fafc !important;
}

/* User buttons - TEXT ALB */
.btn-user {
    background: #1e293b !important;
    border: 1px solid #374151 !important;
    color: #f8fafc !important;
}

.btn-user:hover {
    background: #334155 !important;
    border-color: #3b82f6 !important;
}

.btn-user .user-icon {
    font-size: 1.5rem;
}

.btn-user .user-name {
    color: #f8fafc !important;
    font-weight: 600;
    font-size: 0.9rem;
}

.btn-user .user-role {
    color: #94a3b8 !important;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.btn-user.btn-inactive {
    opacity: 0.5;
    border-style: dashed !important;
}

.btn-user.btn-inactive .user-name {
    color: #64748b !important;
}

/* No users message */
.no-users {
    color: #94a3b8 !important;
    text-align: center;
    padding: 20px;
    font-style: italic;
}

/* Footer buttons */
.assign-modal .modal-footer .btn {
    padding: 10px 25px !important;
    font-size: 0.95rem !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

/* Buton Anulează - vizibil */
.assign-modal .modal-footer .btn:not(.btn-primary) {
    background: #374151 !important;
    color: #f8fafc !important;
    border: 1px solid #4b5563 !important;
}

.assign-modal .modal-footer .btn:not(.btn-primary):hover {
    background: #4b5563 !important;
}

/* Close button X */
.assign-modal .modal-close {
    color: #94a3b8 !important;
    font-size: 1.8rem !important;
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    padding: 0 !important;
    line-height: 1 !important;
    transition: color 0.2s !important;
}

.assign-modal .modal-close:hover {
    color: #f8fafc !important;
}

/* Loading state when assigning */
.btn-user.assigning {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-user.assigning::after {
    content: '⏳';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
}

/* Success state */
.btn-user.assigned {
    background: #10b981 !important;
    border-color: #10b981 !important;
}

.btn-user.assigned::before {
    content: '✓ ';
}

/* ============================================
   TOAST NOTIFICATIONS & MODAL FIXES
   ============================================ */

/* Toast Animation */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Assign Modal - High Contrast Fix */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content.assign-modal {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.assign-modal .modal-header {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    padding: 20px 24px;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.assign-modal .modal-header h2 {
    color: #ffffff !important;
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.assign-modal .modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #ffffff !important;
    font-size: 24px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.assign-modal .modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.assign-modal .modal-body {
    padding: 24px;
    color: #ffffff !important;
}

.assign-modal .modal-body h4 {
    color: #e2e8f0 !important;
    margin: 0 0 16px 0;
    font-size: 1rem;
    font-weight: 500;
}

.assign-modal .assign-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.assign-modal .assign-option {
    text-align: center;
}

.assign-modal .btn-ai {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed) !important;
    color: #ffffff !important;
    border: none;
    padding: 16px 32px;
    font-size: 1.1rem;
    border-radius: 12px;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s;
    font-weight: 600;
}

.assign-modal .btn-ai:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.4);
}

.assign-modal .option-desc {
    color: #94a3b8 !important;
    font-size: 0.85rem;
    margin: 8px 0 0 0;
}

.assign-modal .assign-divider {
    text-align: center;
    color: #64748b !important;
    font-size: 0.9rem;
    position: relative;
}

.assign-modal .assign-divider::before,
.assign-modal .assign-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.2), transparent);
}

.assign-modal .assign-divider::before {
    left: 0;
}

.assign-modal .assign-divider::after {
    right: 0;
}

.assign-modal .users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.assign-modal .btn-user {
    background: linear-gradient(135deg, #334155, #1e293b) !important;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff !important;
    padding: 16px 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}

.assign-modal .btn-user:hover {
    background: linear-gradient(135deg, #475569, #334155) !important;
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.assign-modal .btn-user .user-icon {
    font-size: 28px;
}

.assign-modal .btn-user .user-name {
    color: #ffffff !important;
    font-weight: 600;
    font-size: 0.95rem;
}

.assign-modal .btn-user .user-role {
    color: #94a3b8 !important;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.assign-modal .btn-user.btn-inactive {
    opacity: 0.5;
    background: linear-gradient(135deg, #1e293b, #0f172a) !important;
}

.assign-modal .btn-user.btn-inactive:hover {
    transform: none;
    box-shadow: none;
    border-color: rgba(255, 255, 255, 0.15);
}

.assign-modal .no-users {
    color: #94a3b8 !important;
    text-align: center;
    padding: 20px;
    font-style: italic;
}

.assign-modal .modal-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.assign-modal .modal-footer .btn {
    background: linear-gradient(135deg, #475569, #334155) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.assign-modal .modal-footer .btn:hover {
    background: linear-gradient(135deg, #64748b, #475569) !important;
}

/* Toast Container */
#crm-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.crm-toast {
    color: #ffffff !important;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    max-width: 400px;
    animation: slideIn 0.3s ease-out;
    font-weight: 500;
}

/* ============================================
   MOBILE RESPONSIVE - ASSIGN MODAL
   ============================================ */

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Mobile First - Base styles already defined above */
/* Now add responsive breakpoints */

@media screen and (max-width: 768px) {
    /* Modal takes full width on mobile */
    .modal-content.assign-modal {
        width: 95% !important;
        max-width: none !important;
        margin: 10px;
        max-height: 90vh;
        border-radius: 12px;
    }
    
    .assign-modal .modal-header {
        padding: 16px 18px;
        border-radius: 12px 12px 0 0;
    }
    
    .assign-modal .modal-header h2 {
        font-size: 1.1rem;
    }
    
    .assign-modal .modal-close {
        width: 32px;
        height: 32px;
        font-size: 20px;
    }
    
    .assign-modal .modal-body {
        padding: 16px;
    }
    
    .assign-modal .modal-body h4 {
        font-size: 0.9rem;
        margin-bottom: 12px;
    }
    
    .assign-modal .btn-ai {
        padding: 14px 20px;
        font-size: 1rem;
        border-radius: 10px;
    }
    
    .assign-modal .option-desc {
        font-size: 0.8rem;
    }
    
    .assign-modal .assign-divider {
        font-size: 0.85rem;
        margin: 16px 0;
    }
    
    .assign-modal .assign-divider::before,
    .assign-modal .assign-divider::after {
        width: 35%;
    }
    
    /* User grid - 2 columns on tablet/large mobile */
    .assign-modal .users-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .assign-modal .btn-user {
        padding: 14px 10px;
        border-radius: 10px;
    }
    
    .assign-modal .btn-user .user-icon {
        font-size: 24px;
    }
    
    .assign-modal .btn-user .user-name {
        font-size: 0.85rem;
    }
    
    .assign-modal .btn-user .user-role {
        font-size: 0.7rem;
    }
    
    .assign-modal .modal-footer {
        padding: 14px 16px;
    }
    
    .assign-modal .modal-footer .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
        width: 100%;
    }
    
    /* Toast notifications - smaller on mobile */
    #crm-toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .crm-toast {
        min-width: auto;
        max-width: none;
        width: 100%;
        padding: 12px 16px;
        font-size: 0.9rem;
    }
}

@media screen and (max-width: 480px) {
    /* Very small screens - single column */
    .modal-content.assign-modal {
        width: 100% !important;
        margin: 0;
        border-radius: 16px 16px 0 0;
        max-height: 85vh;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
    }
    
    .modal-overlay {
        align-items: flex-end !important;
    }
    
    .assign-modal .modal-header {
        padding: 14px 16px;
        border-radius: 16px 16px 0 0;
    }
    
    .assign-modal .modal-header h2 {
        font-size: 1rem;
    }
    
    .assign-modal .modal-body {
        padding: 14px;
    }
    
    .assign-modal .modal-body h4 {
        font-size: 0.85rem;
    }
    
    .assign-modal .btn-ai {
        padding: 12px 16px;
        font-size: 0.95rem;
    }
    
    /* User grid - single column on small phones */
    .assign-modal .users-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .assign-modal .btn-user {
        flex-direction: row;
        justify-content: flex-start;
        gap: 12px;
        padding: 12px 16px;
        text-align: left;
    }
    
    .assign-modal .btn-user .user-icon {
        font-size: 20px;
    }
    
    .assign-modal .btn-user .user-name {
        font-size: 0.9rem;
        flex: 1;
    }
    
    .assign-modal .btn-user .user-role {
        font-size: 0.7rem;
        background: rgba(255,255,255,0.1);
        padding: 4px 8px;
        border-radius: 4px;
    }
    
    .assign-modal .modal-footer {
        padding: 12px 14px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }
    
    .assign-modal .modal-footer .btn {
        padding: 12px 24px;
        font-size: 1rem;
    }
    
    /* Toast - full width on small screens */
    .crm-toast {
        padding: 10px 14px;
        font-size: 0.85rem;
        gap: 10px;
    }
    
    .crm-toast span:first-child {
        font-size: 16px !important;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .assign-modal .btn-user,
    .assign-modal .btn-ai,
    .assign-modal .modal-footer .btn,
    .assign-modal .modal-close {
        min-height: 44px;
    }
    
    .assign-modal .btn-user:active,
    .assign-modal .btn-ai:active,
    .assign-modal .modal-footer .btn:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .modal-content.assign-modal {
        background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
    }
}

/* ============================================
   FIX: HIGH CONTRAST TEXT & CLOSE BUTTON
   ============================================ */

/* Buton X mare și vizibil */
.assign-modal .modal-close-btn {
    background: rgba(255, 255, 255, 0.2) !important;
    border: 2px solid rgba(255, 255, 255, 0.4) !important;
    color: #ffffff !important;
    font-size: 28px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s !important;
    line-height: 1 !important;
    padding: 0 !important;
}

.assign-modal .modal-close-btn:hover {
    background: rgba(239, 68, 68, 0.8) !important;
    border-color: #ef4444 !important;
    transform: scale(1.1) !important;
}

.assign-modal .modal-close-btn:active {
    transform: scale(0.95) !important;
}

/* TEXT ALB FORȚAT pentru utilizatori */
.assign-modal .btn-user .user-name {
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 0.95rem !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5) !important;
}

.assign-modal .btn-user .user-role {
    color: #93c5fd !important;
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    font-weight: 600 !important;
    background: rgba(59, 130, 246, 0.3) !important;
    padding: 3px 8px !important;
    border-radius: 4px !important;
}

.assign-modal .btn-user .user-icon {
    font-size: 32px !important;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3)) !important;
}

/* Buton utilizator mai vizibil */
.assign-modal .btn-user {
    background: linear-gradient(135deg, #334155, #1e293b) !important;
    border: 2px solid rgba(147, 197, 253, 0.3) !important;
    color: #ffffff !important;
    padding: 16px 12px !important;
    border-radius: 12px !important;
}

.assign-modal .btn-user:hover {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    border-color: #60a5fa !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.4) !important;
}

/* Buton Anulează mai vizibil */
.assign-modal .btn-cancel {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    color: #ffffff !important;
    border: none !important;
    padding: 14px 28px !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    width: 100% !important;
}

.assign-modal .btn-cancel:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4) !important;
}

/* Headers mai vizibili */
.assign-modal .modal-body h4 {
    color: #ffffff !important;
    font-weight: 600 !important;
    font-size: 1.1rem !important;
    margin-bottom: 16px !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3) !important;
}

/* Descriere sub AI */
.assign-modal .option-desc {
    color: #cbd5e1 !important;
    font-size: 0.9rem !important;
}

/* Divider */
.assign-modal .assign-divider {
    color: #94a3b8 !important;
    font-weight: 500 !important;
    font-size: 1rem !important;
    margin: 20px 0 !important;
}

/* Mobile: text și mai mare */
@media screen and (max-width: 480px) {
    .assign-modal .btn-user .user-name {
        font-size: 1rem !important;
    }
    
    .assign-modal .btn-user .user-role {
        font-size: 0.7rem !important;
    }
    
    .assign-modal .modal-close-btn {
        width: 40px !important;
        height: 40px !important;
        font-size: 24px !important;
    }
    
    .assign-modal .btn-cancel {
        padding: 16px !important;
        font-size: 1.1rem !important;
    }
}

/* ============================================
   BUTON ELIBEREAZĂ LEAD
   ============================================ */

.assign-modal .btn-release {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    color: #ffffff !important;
    border: none !important;
    padding: 14px 28px !important;
    font-size: 1rem !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    width: 100% !important;
    transition: all 0.2s !important;
    font-weight: 600 !important;
}

.assign-modal .btn-release:hover {
    background: linear-gradient(135deg, #d97706, #b45309) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.4) !important;
}

.assign-modal .btn-release:active {
    transform: scale(0.98) !important;
}

/* ============================================
   EDIT LEAD MODAL & DETAILS MODAL
   ============================================ */

/* Modal content general */
.modal-content.lead-details-modal,
.modal-content.edit-lead-modal {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
    border-radius: 16px;
    width: 95%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.lead-details-modal .modal-header,
.edit-lead-modal .modal-header {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    padding: 20px 24px;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lead-details-modal .modal-header h2,
.edit-lead-modal .modal-header h2 {
    color: #ffffff !important;
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.lead-details-modal .modal-body,
.edit-lead-modal .modal-body {
    padding: 24px;
    color: #ffffff !important;
}

/* Detail sections */
.lead-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.detail-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.detail-section.full-width {
    grid-column: 1 / -1;
}

.detail-section h3 {
    color: #60a5fa !important;
    font-size: 1rem;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.detail-section h4 {
    color: #94a3b8 !important;
    font-size: 0.85rem;
    margin: 12px 0 8px 0;
}

.detail-section p {
    color: #e2e8f0 !important;
    margin: 8px 0;
    font-size: 0.95rem;
}

.detail-section p strong {
    color: #94a3b8 !important;
}

/* Contact list */
.contact-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.contact-list li {
    color: #e2e8f0 !important;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.contact-source {
    color: #64748b !important;
    font-size: 0.8rem;
}

/* Audit list */
.audit-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.audit-list li {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.85rem;
}

.audit-time {
    color: #64748b !important;
}

.audit-action {
    color: #60a5fa !important;
    font-weight: 500;
}

.audit-user {
    color: #94a3b8 !important;
}

/* CRM Table in modal */
.lead-details-modal .crm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.lead-details-modal .crm-table th {
    background: rgba(59, 130, 246, 0.2) !important;
    color: #ffffff !important;
    padding: 10px;
    text-align: left;
    font-weight: 600;
}

.lead-details-modal .crm-table td {
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #e2e8f0 !important;
}

/* Edit form styles */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.form-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.form-section.full-width {
    grid-column: 1 / -1;
}

.form-section h3 {
    color: #60a5fa !important;
    font-size: 1rem;
    margin: 0 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.form-group {
    margin-bottom: 16px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    color: #94a3b8 !important;
    font-size: 0.85rem;
    margin-bottom: 6px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    background: rgba(15, 23, 42, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 8px;
    color: #ffffff !important;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #64748b !important;
}

.form-group select option {
    background: #1e293b;
    color: #ffffff;
}

/* Modal footer */
.lead-details-modal .modal-footer,
.edit-lead-modal .modal-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.lead-details-modal .modal-footer .btn,
.edit-lead-modal .modal-footer .btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.lead-details-modal .btn-primary,
.edit-lead-modal .btn-primary {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: #ffffff !important;
}

.lead-details-modal .btn-primary:hover,
.edit-lead-modal .btn-primary:hover {
    background: linear-gradient(135deg, #059669, #047857) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

.lead-details-modal .btn-secondary,
.edit-lead-modal .btn-secondary {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    color: #ffffff !important;
}

.lead-details-modal .btn-secondary:hover,
.edit-lead-modal .btn-secondary:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
    transform: translateY(-2px);
}

/* Mobile responsive */
@media screen and (max-width: 768px) {
    .modal-content.lead-details-modal,
    .modal-content.edit-lead-modal {
        width: 100%;
        max-width: none;
        margin: 0;
        border-radius: 16px 16px 0 0;
        max-height: 95vh;
    }
    
    .modal-overlay {
        align-items: flex-end;
    }
    
    .lead-detail-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .lead-details-modal .modal-footer,
    .edit-lead-modal .modal-footer {
        flex-direction: column;
    }
    
    .lead-details-modal .modal-footer .btn,
    .edit-lead-modal .modal-footer .btn {
        width: 100%;
    }
}

/* ============================================
   CRM CALL OVERLAY & QUALIFICATION MODAL
   ============================================ */

/* Call Overlay - Fixed position over everything */
.crm-call-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 100px;
    z-index: 10002;
    animation: fadeIn 0.3s ease-out;
}

.crm-call-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 20px;
    padding: 30px;
    min-width: 320px;
    max-width: 400px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(59, 130, 246, 0.3);
    text-align: center;
}

.crm-call-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.crm-call-icon {
    font-size: 32px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.crm-call-title {
    color: #ffffff;
    font-size: 1.3rem;
    font-weight: 600;
}

.crm-call-info {
    margin-bottom: 24px;
}

.crm-call-name {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.crm-call-phone {
    color: #94a3b8;
    font-size: 1.1rem;
    font-family: monospace;
}

.crm-call-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: blink 1s infinite;
}

.status-indicator.connecting {
    background: #f59e0b;
}

.status-indicator.ringing {
    background: #3b82f6;
    animation: ring 0.5s infinite alternate;
}

@keyframes ring {
    from { transform: scale(1); }
    to { transform: scale(1.3); }
}

.status-indicator.connected {
    background: #10b981;
    animation: none;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.status-text {
    color: #e2e8f0;
    font-size: 1rem;
    font-weight: 500;
}

.crm-call-timer {
    color: #ffffff;
    font-size: 2.5rem;
    font-weight: 700;
    font-family: monospace;
    margin-bottom: 24px;
    text-shadow: 0 2px 10px rgba(59, 130, 246, 0.3);
}

.crm-call-actions {
    display: flex;
    justify-content: center;
}

.btn-hangup {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    color: #ffffff !important;
    border: none;
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 200px;
}

.btn-hangup:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

.btn-hangup:active {
    transform: scale(0.98);
}

/* Qualification Modal */
.modal-content.qualification-modal {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
    border-radius: 16px;
    width: 95%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.qualification-modal .modal-header {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    padding: 20px 24px;
    border-radius: 16px 16px 0 0;
}

.qualification-modal .modal-header h2 {
    color: #ffffff !important;
    margin: 0;
    font-size: 1.3rem;
}

.qualification-modal .modal-body {
    padding: 24px;
}

.qual-lead-info {
    text-align: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 24px;
}

.qual-lead-name {
    color: #ffffff !important;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.qual-call-duration {
    color: #94a3b8 !important;
    font-size: 1rem;
}

.qual-section {
    margin-bottom: 24px;
}

.qual-section h4 {
    color: #e2e8f0 !important;
    font-size: 1rem;
    margin-bottom: 12px;
    font-weight: 500;
}

.qual-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.qual-option {
    cursor: pointer;
}

.qual-option input {
    display: none;
}

.qual-option-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: all 0.2s;
}

.qual-option input:checked + .qual-option-content {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
}

.qual-option:hover .qual-option-content {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.qual-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.qual-label {
    color: #ffffff !important;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.qual-desc {
    color: #94a3b8 !important;
    font-size: 0.75rem;
    text-align: center;
}

.qual-section textarea {
    width: 100%;
    padding: 14px;
    background: rgba(15, 23, 42, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 10px;
    color: #ffffff !important;
    font-size: 0.95rem;
    resize: vertical;
}

.qual-section textarea:focus {
    outline: none;
    border-color: #3b82f6 !important;
}

.qual-section textarea::placeholder {
    color: #64748b !important;
}

.callback-section input[type="datetime-local"] {
    width: 100%;
    padding: 14px;
    background: rgba(15, 23, 42, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 10px;
    color: #ffffff !important;
    font-size: 0.95rem;
}

.qualification-modal .modal-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 12px;
}

.qualification-modal .modal-footer .btn {
    flex: 1;
    padding: 14px 20px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.qualification-modal .btn-primary {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: #ffffff !important;
}

.qualification-modal .btn-primary:hover {
    background: linear-gradient(135deg, #059669, #047857) !important;
    transform: translateY(-2px);
}

.qualification-modal .btn-secondary {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #94a3b8 !important;
}

.qualification-modal .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
}

/* Mobile responsive */
@media screen and (max-width: 600px) {
    .crm-call-overlay {
        padding-top: 50px;
        align-items: flex-start;
    }
    
    .crm-call-card {
        margin: 10px;
        padding: 24px 20px;
    }
    
    .crm-call-timer {
        font-size: 2rem;
    }
    
    .qual-options {
        grid-template-columns: 1fr;
    }
    
    .qual-option-content {
        flex-direction: row;
        justify-content: flex-start;
        gap: 12px;
        padding: 14px 16px;
    }
    
    .qual-icon {
        font-size: 24px;
        margin-bottom: 0;
    }
    
    .qual-label {
        text-align: left;
    }
    
    .qual-desc {
        text-align: left;
    }
    
    .qualification-modal .modal-footer {
        flex-direction: column;
    }
}

/* =====================================================
   EXTENDED CALL OVERLAY - MODERN WHITE THEME
   Design curat, fundal alb, text închis
   100% Mobile Responsive
   ===================================================== */

/* Extended overlay - fundal semi-transparent */
.crm-call-overlay.crm-call-overlay-extended {
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.5);
}

/* Extended card - FUNDAL ALB, design modern */
.crm-call-card.crm-call-card-extended {
    background: #ffffff !important;
    border-radius: 20px;
    min-width: 340px;
    max-width: 420px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: none;
}

/* Header apel - fundal gradient subtil */
.crm-call-card-extended .crm-call-header {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    margin: -24px -24px 20px -24px;
    padding: 20px 24px;
    border-radius: 20px 20px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.crm-call-card-extended .crm-call-icon {
    font-size: 28px;
    animation: pulse 1.5s infinite;
}

.crm-call-card-extended .crm-call-title {
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 600;
}

/* Info lead - text închis */
.crm-call-card-extended .crm-call-info {
    text-align: center;
    margin-bottom: 16px;
}

.crm-call-card-extended .crm-call-name {
    color: #1e293b !important;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.crm-call-card-extended .crm-call-phone {
    color: #64748b !important;
    font-size: 1rem;
    font-family: monospace;
}

/* Status row - fundal gri deschis */
.crm-call-status-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 20px;
    padding: 14px 20px;
    background: #f1f5f9;
    border-radius: 12px;
}

.crm-call-status-row .crm-call-status {
    margin-bottom: 0;
    padding: 0;
    background: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.crm-call-status-row .status-text {
    color: #475569 !important;
    font-weight: 500;
}

.crm-call-status-row .crm-call-timer {
    margin-bottom: 0;
    font-size: 1.6rem;
    font-weight: 700;
    color: #0f172a !important;
    text-shadow: none;
}

/* Secțiunea de calificare */
.crm-call-qualification-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
}

.crm-call-qual-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1e293b;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.crm-call-qual-header span {
    font-size: 1.1rem;
}

.crm-call-qual-header small {
    color: #64748b;
    font-weight: 400;
    font-size: 0.8rem;
}

/* Grid de opțiuni - design modern */
.crm-call-qual-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.crm-call-qual-option {
    cursor: pointer;
}

.crm-call-qual-option input[type="radio"] {
    display: none;
}

.crm-call-qual-btn {
    display: block;
    padding: 12px 10px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s ease;
}

.crm-call-qual-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #1e293b;
}

.crm-call-qual-option input[type="radio"]:checked + .crm-call-qual-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #10b981;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transform: scale(1.02);
}

/* Callback section */
.crm-call-callback-section {
    margin-bottom: 12px;
}

.crm-call-callback-section label,
.crm-call-notes-section label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #475569;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 8px;
}

/* Input-uri - fundal alb, bordură subtilă */
.crm-call-input,
.crm-call-textarea {
    width: 100%;
    padding: 12px 14px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    color: #1e293b;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.crm-call-input:focus,
.crm-call-textarea:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.crm-call-textarea {
    resize: vertical;
    min-height: 70px;
}

.crm-call-textarea::placeholder {
    color: #94a3b8;
}

/* Notes section */
.crm-call-notes-section {
    margin-top: 12px;
}

/* Buton hangup - roșu modern */
.crm-call-card-extended .crm-call-actions {
    margin-top: 8px;
}

.crm-call-card-extended .btn-hangup {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    color: #ffffff !important;
    border: none;
    padding: 16px 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.crm-call-card-extended .btn-hangup:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.35);
}

.crm-call-card-extended .btn-hangup:active {
    transform: scale(0.98);
}

/* Prefilled notice în modal de confirmare */
.qual-prefilled-notice {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border: 1px solid #10b981;
    border-radius: 10px;
    padding: 12px 16px;
    margin: 0 24px;
    margin-top: -8px;
    margin-bottom: 16px;
    color: #047857;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
}

.qualification-modal.has-prefilled .modal-header {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
}

/* =====================================================
   MOBILE RESPONSIVE - Extended Call Overlay (White Theme)
   ===================================================== */

@media screen and (max-width: 600px) {
    .crm-call-overlay.crm-call-overlay-extended {
        padding: 0;
        align-items: stretch;
        background: rgba(0, 0, 0, 0.4);
    }
    
    .crm-call-card.crm-call-card-extended {
        min-width: 100%;
        max-width: 100%;
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        box-shadow: none;
    }
    
    .crm-call-card-extended .crm-call-header {
        margin: 0;
        padding: 16px 20px;
        border-radius: 0;
        flex-shrink: 0;
    }
    
    .crm-call-card-extended .crm-call-info {
        padding: 16px 20px 8px;
        margin-bottom: 0;
    }
    
    .crm-call-card-extended .crm-call-name {
        font-size: 1.3rem;
    }
    
    .crm-call-card-extended .crm-call-phone {
        font-size: 0.95rem;
    }
    
    .crm-call-status-row {
        margin: 0 16px 12px;
        padding: 12px 16px;
        flex-direction: row;
        justify-content: space-between;
    }
    
    .crm-call-status-row .crm-call-timer {
        font-size: 1.5rem;
    }
    
    .crm-call-qualification-section {
        flex: 1;
        overflow-y: auto;
        margin: 0 16px 12px;
        padding: 14px;
        border-radius: 14px;
    }
    
    .crm-call-qual-header {
        font-size: 0.9rem;
        margin-bottom: 12px;
        padding-bottom: 10px;
    }
    
    .crm-call-qual-options {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .crm-call-qual-btn {
        padding: 8px 10px;
        font-size: 0.8rem;
    }
    
    .crm-call-textarea {
        min-height: 50px;
    }
    
    .crm-call-card-extended .crm-call-actions {
        margin: 0;
        padding: 16px;
        background: #ffffff;
        flex-shrink: 0;
    }
    
    .crm-call-card-extended .btn-hangup {
        width: 100%;
        padding: 16px 24px;
        font-size: 1rem;
        border-radius: 12px;
    }
    
    /* Fix pentru label-uri pe mobile */
    .crm-call-callback-section label,
    .crm-call-notes-section label {
        font-size: 0.85rem;
    }
    
    .crm-call-input,
    .crm-call-textarea {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
}

/* Tablet adjustments */
@media screen and (min-width: 601px) and (max-width: 900px) {
    .crm-call-card.crm-call-card-extended {
        min-width: 380px;
        max-width: 440px;
    }
    
    .crm-call-qual-options {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .crm-call-qual-btn {
        padding: 11px 10px;
        font-size: 0.85rem;
    }
}

/* Queue card - unassigned leads styling */
.crm-queue-card.unassigned {
    border-left: 4px solid #f59e0b;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, transparent 100%);
}

.crm-queue-card .lead-assigned-to {
    font-size: 0.85rem;
    color: #94a3b8;
    margin: 4px 0;
}

.crm-queue-card .lead-assigned-to strong {
    color: #e2e8f0;
}

.crm-queue-card .btn-outline {
    background: transparent;
    border: 1px solid #64748b;
    color: #94a3b8;
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.crm-queue-card .btn-outline:hover {
    background: #334155;
    border-color: #8b5cf6;
    color: #ffffff;
}

/* Responsive queue cards */
@media (max-width: 768px) {
    .crm-queue-card .queue-card-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .crm-queue-card .queue-card-actions button {
        width: 100%;
    }
}

/* ============================================== */
/* CRM PIPELINE DASHBOARD - MOBILE FIRST REDESIGN */
/* Modern, Touch-Friendly, 100% Responsive */
/* Version: 2.4.0 - January 2026 - COMPLETE HEADER FIX + NO TOP SPACE */
/* ============================================== */

/* ========== MOBILE - REMOVE TOP SPACE GLOBALLY ========== */
@media (max-width: 768px) {
    /* CRM Pipeline Section - FORCE NO TOP SPACE */
    #crmPipelineDashboardSection {
        margin-top: 0 !important;
        padding-top: 8px !important;
        position: relative !important;
    }
    
    #crmPipelineDashboardSection.content-section {
        margin-top: 0 !important;
        padding-top: 8px !important;
    }
    
    /* Page header inside CRM Pipeline */
    #crmPipelineDashboardSection > .page-header {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    /* First child of CRM Pipeline should have no top margin */
    #crmPipelineDashboardSection > *:first-child {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
}

/* ========== DESKTOP/MOBILE TITLE SWITCHING ========== */
/* Desktop: Show full title, hide mobile title */
#crmPipelineDashboardSection .desktop-title {
    display: inline;
}
#crmPipelineDashboardSection .mobile-title {
    display: none;
}

/* ========== MOBILE COMPLETE OVERRIDE ========== */
@media (max-width: 768px) {
    /* SECTION CONTAINER - Remove top padding/margin */
    #crmPipelineDashboardSection {
        padding: 12px !important;
        padding-top: 12px !important;
        padding-bottom: 100px !important;
        margin-top: 0 !important;
    }
    
    /* PAGE HEADER - Remove ALL spacing */
    #crmPipelineDashboardSection .page-header {
        padding: 0 !important;
        margin: 0 0 12px 0 !important;
        padding-top: 0 !important;
        margin-top: 0 !important;
    }
    
    /* CRM HEADER - Horizontal layout on mobile */
    #crmPipelineDashboardSection .crm-header {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 12px !important;
        flex-wrap: nowrap !important;
    }
    
    /* TITLE CONTAINER - Flex grow, single line */
    #crmPipelineDashboardSection .crm-header-title {
        flex: 1 !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }
    
    /* H1 TITLE - Single line, ellipsis */
    #crmPipelineDashboardSection .crm-header-title h1 {
        font-size: 18px !important;
        font-weight: 700 !important;
        color: #1e293b !important;
        margin: 0 !important;
        padding: 0 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        line-height: 1.3 !important;
    }
    
    /* Desktop title hide, mobile title show */
    #crmPipelineDashboardSection .desktop-title {
        display: none !important;
    }
    #crmPipelineDashboardSection .mobile-title {
        display: inline !important;
    }
    
    /* SUBTITLE - Hide on mobile to save space */
    #crmPipelineDashboardSection .crm-subtitle {
        display: none !important;
    }
    
    /* HEADER ACTIONS - Fixed width for select */
    #crmPipelineDashboardSection .crm-header-actions {
        flex: 0 0 auto !important;
        width: auto !important;
        max-width: 180px !important;
    }
    
    /* TENANT SELECT - Compact */
    #crmPipelineDashboardSection #crm-pipeline-tenant-select {
        width: 100% !important;
        padding: 10px 32px 10px 12px !important;
        font-size: 13px !important;
        font-weight: 600 !important;
        border-radius: 10px !important;
        background: #f1f5f9 !important;
        border: 1px solid #e2e8f0 !important;
        color: #1e293b !important;
        appearance: none !important;
        -webkit-appearance: none !important;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") !important;
        background-repeat: no-repeat !important;
        background-position: right 10px center !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
}

/* ========== TABS - MOBILE HORIZONTAL SCROLL ========== */
@media (max-width: 768px) {
    #crmPipelineDashboardSection .crm-tabs {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
        gap: 8px !important;
        padding: 8px !important;
        background: #f8fafc !important;
        border-radius: 12px !important;
        margin-bottom: 16px !important;
        border: 1px solid #e2e8f0 !important;
    }
    
    #crmPipelineDashboardSection .crm-tabs::-webkit-scrollbar {
        display: none !important;
    }
    
    #crmPipelineDashboardSection .crm-tab {
        flex: 0 0 auto !important;
        padding: 10px 14px !important;
        font-size: 13px !important;
        font-weight: 600 !important;
        white-space: nowrap !important;
        border-radius: 8px !important;
        min-width: fit-content !important;
        background: transparent !important;
        color: #64748b !important;
        border: none !important;
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
    }
    
    #crmPipelineDashboardSection .crm-tab.active {
        background: #0ea5e9 !important;
        color: #ffffff !important;
        box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3) !important;
    }
    
    #crmPipelineDashboardSection .tab-icon {
        font-size: 14px !important;
    }
    
    #crmPipelineDashboardSection .tab-text {
        font-size: 13px !important;
    }
}

/* ========== VERY SMALL SCREENS ========== */
@media (max-width: 400px) {
    #crmPipelineDashboardSection .crm-header-title h1 {
        font-size: 16px !important;
    }
    
    #crmPipelineDashboardSection .crm-header-actions {
        max-width: 140px !important;
    }
    
    #crmPipelineDashboardSection #crm-pipeline-tenant-select {
        padding: 8px 28px 8px 10px !important;
        font-size: 12px !important;
    }
    
    #crmPipelineDashboardSection .crm-tab {
        padding: 8px 10px !important;
        font-size: 12px !important;
        gap: 4px !important;
    }
    
    #crmPipelineDashboardSection .tab-icon {
        font-size: 12px !important;
    }
    
    #crmPipelineDashboardSection .tab-text {
        font-size: 12px !important;
    }
}

/* ========== KPI CARDS - MOBILE ========== */
@media (max-width: 768px) {
    .pipeline-kpi-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        margin-bottom: 20px;
    }
    
    .pipeline-kpi-card {
        padding: 16px;
        min-height: 90px;
        border-radius: 16px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    }
    
    .kpi-content {
        width: 100%;
    }
    
    .kpi-number {
        font-size: 32px;
        font-weight: 800;
        margin-bottom: 4px;
        line-height: 1.1;
    }
    
    .kpi-title {
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        opacity: 0.9;
        line-height: 1.3;
        word-break: break-word;
    }
    
    .kpi-icon-bg {
        position: absolute;
        right: 8px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 40px;
        opacity: 0.2;
    }
}

@media (max-width: 400px) {
    .pipeline-kpi-row {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .pipeline-kpi-card {
        padding: 12px;
        min-height: 80px;
    }
    
    .kpi-number {
        font-size: 26px;
    }
    
    .kpi-title {
        font-size: 10px;
    }
    
    .kpi-icon-bg {
        font-size: 32px;
        right: 4px;
    }
}

/* ========== MAIN GRID - MOBILE ========== */
@media (max-width: 768px) {
    .pipeline-main-grid {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }
    
    .pipeline-card {
        border-radius: 16px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    }
    
    .pipeline-card .card-header {
        padding: 16px;
        background: #fafbfc;
        border-bottom: 1px solid #f1f5f9;
    }
    
    .pipeline-card .card-header h3 {
        font-size: 15px;
        font-weight: 700;
        color: #1e293b;
        gap: 8px;
    }
    
    .header-icon {
        font-size: 18px;
    }
    
    .pipeline-card .card-body {
        padding: 16px;
    }
    
    /* Full width cards on mobile */
    .pipeline-status-card,
    .pipeline-sources-card,
    .pipeline-operators-card,
    .pipeline-card.full-width {
        grid-column: 1 !important;
        grid-row: auto !important;
    }
}

/* ========== PIPELINE STATUS BARS - MOBILE ========== */
@media (max-width: 768px) {
    .pipeline-bars {
        gap: 14px;
    }
    
    .pipeline-bar-row {
        gap: 6px;
    }
    
    .bar-info {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .bar-label {
        font-size: 13px;
        font-weight: 500;
        color: #334155;
        display: flex;
        align-items: center;
        gap: 6px;
    }
    
    .bar-stats {
        font-size: 14px;
        font-weight: 700;
        color: #1e293b;
    }
    
    .bar-stats small {
        font-size: 12px;
        font-weight: 500;
        color: #64748b;
        margin-left: 4px;
    }
    
    .bar-track {
        height: 8px;
        border-radius: 8px;
    }
    
    .bar-fill {
        height: 100%;
        border-radius: 8px;
        min-width: 3px;
    }
}

/* ========== SOURCES GRID - MOBILE ========== */
@media (max-width: 768px) {
    .sources-grid {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .source-card {
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 14px;
        background: #f8fafc;
        border-radius: 12px;
        border-left-width: 4px;
        border-left-style: solid;
    }
    
    .source-icon {
        font-size: 24px;
        width: 44px;
        height: 44px;
        border-radius: 10px;
    }
    
    .source-info .source-name {
        font-size: 14px;
        font-weight: 600;
        color: #1e293b;
    }
    
    .source-info .source-count {
        font-size: 12px;
        color: #64748b;
    }
}

/* ========== OPERATORS & COMMISSIONS - MOBILE CARD STYLE ========== */
@media (max-width: 768px) {
    /* Hide table header on mobile */
    .pipeline-operators-card .operators-table thead {
        display: none;
    }
    
    /* Transform table rows into cards */
    .pipeline-operators-card .operators-table,
    .pipeline-operators-card .operators-table tbody {
        display: block;
        width: 100%;
    }
    
    .pipeline-operators-card .operators-table tr {
        display: block;
        background: #f8fafc;
        border-radius: 16px;
        padding: 16px;
        margin-bottom: 14px;
        border: 1px solid #e2e8f0;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    }
    
    .pipeline-operators-card .operators-table tr:hover {
        background: #f1f5f9;
        border-color: #cbd5e1;
    }
    
    .pipeline-operators-card .operators-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 0;
        border-bottom: 1px solid #e2e8f0;
        font-size: 14px;
    }
    
    .pipeline-operators-card .operators-table td:last-child {
        border-bottom: none;
    }
    
    .pipeline-operators-card .operators-table td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 12px;
        color: #64748b;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        flex-shrink: 0;
        margin-right: 12px;
    }
    
    /* First cell (Operator) - Full width header */
    .pipeline-operators-card .operators-table td:first-child {
        display: block;
        padding-bottom: 14px;
        margin-bottom: 6px;
        border-bottom: 2px solid #e2e8f0;
    }
    
    .pipeline-operators-card .operators-table td:first-child::before {
        display: none;
    }
    
    .pipeline-operators-card .operator-cell {
        display: flex;
        align-items: center;
        gap: 14px;
        width: 100%;
    }
    
    .pipeline-operators-card .operator-avatar {
        width: 48px;
        height: 48px;
        border-radius: 14px;
        font-size: 18px;
        background: linear-gradient(135deg, #0ea5e9, #8b5cf6);
        flex-shrink: 0;
    }
    
    .pipeline-operators-card .operator-cell span {
        font-size: 17px;
        font-weight: 700;
        color: #1e293b;
    }
    
    /* Actions cell - special styling */
    .pipeline-operators-card .operators-table td[data-label="Acțiuni"] {
        padding-top: 14px;
        margin-top: 6px;
        border-top: 2px solid #e2e8f0;
        border-bottom: none;
    }
    
    .pipeline-operators-card .operators-table td[data-label="Acțiuni"]::before {
        display: none;
    }
    
    /* Stat badges on mobile */
    .stat-badge {
        padding: 8px 16px;
        border-radius: 24px;
        font-size: 14px;
        font-weight: 600;
    }
    
    .stat-badge.muted {
        background: #f1f5f9;
        color: #94a3b8;
    }
    
    .stat-badge.new {
        background: linear-gradient(135deg, #dbeafe, #bfdbfe);
        color: #1e40af;
    }
    
    .stat-badge.qualified {
        background: linear-gradient(135deg, #dcfce7, #bbf7d0);
        color: #166534;
    }
    
    .stat-badge.sales {
        background: linear-gradient(135deg, #dcfce7, #bbf7d0);
        color: #166534;
    }
    
    .stat-badge.commission {
        background: linear-gradient(135deg, #dbeafe, #bfdbfe);
        color: #1e40af;
    }
    
    .stat-badge.unpaid {
        background: linear-gradient(135deg, #fef3c7, #fde68a);
        color: #92400e;
    }
    
    .stat-badge.paid-ok {
        background: linear-gradient(135deg, #d1fae5, #a7f3d0);
        color: #065f46;
    }
    
    /* Pay commission button */
    .btn-pay-commission {
        background: linear-gradient(135deg, #10b981, #059669);
        color: #ffffff;
        border: none;
        padding: 12px 20px;
        border-radius: 12px;
        font-size: 15px;
        font-weight: 600;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 8px;
        transition: all 0.2s ease;
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
        width: 100%;
        justify-content: center;
    }
    
    .btn-pay-commission:hover,
    .btn-pay-commission:active {
        background: linear-gradient(135deg, #059669, #047857);
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
    }
}

/* ========== MONTHLY TOTALS HEADER - MOBILE ========== */
@media (max-width: 768px) {
    .pipeline-operators-card .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .monthly-totals {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
    }
    
    .monthly-total-item {
        display: flex;
        align-items: center;
        gap: 6px;
        background: #f1f5f9;
        padding: 8px 14px;
        border-radius: 10px;
        flex: 1;
        min-width: fit-content;
        justify-content: center;
    }
    
    .monthly-total-item .total-label {
        font-size: 11px;
        font-weight: 500;
        color: #64748b;
        text-transform: uppercase;
    }
    
    .monthly-total-item .total-value {
        font-size: 14px;
        font-weight: 700;
        color: #1e293b;
    }
    
    .monthly-total-item.highlight {
        background: linear-gradient(135deg, #dcfce7, #bbf7d0);
        border: 1px solid #86efac;
    }
    
    .monthly-total-item.highlight .total-value {
        color: #166534;
    }
}

/* ========== EMPTY STATES - MOBILE ========== */
@media (max-width: 768px) {
    .empty-state-mini {
        padding: 32px 16px;
    }
    
    .empty-state-mini span {
        font-size: 40px;
        margin-bottom: 10px;
    }
    
    .empty-state-mini p {
        font-size: 14px;
    }
}

/* PAGE HEADER styles moved to top of mobile section */

/* ========== LOADING STATE - MOBILE ========== */
@media (max-width: 768px) {
    .crm-loading {
        padding: 40px 20px;
    }
    
    .loading-spinner {
        width: 32px;
        height: 32px;
        border-width: 3px;
    }
    
    .crm-loading p {
        font-size: 14px;
        color: #94a3b8;
    }
}

/* ========== TEXT MUTED - VISIBILITY FIX ========== */
.text-muted {
    color: #64748b !important;
}

.pipeline-operators-card .text-muted {
    color: #94a3b8 !important;
}

/* ========== TOUCH OPTIMIZATIONS ========== */
@media (max-width: 768px) {
    /* Better tap targets */
    .crm-tab,
    .btn-pay-commission,
    .stat-badge,
    .source-card {
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Prevent text selection during scrolling */
    .crm-tabs,
    .pipeline-bars {
        -webkit-user-select: none;
        user-select: none;
    }
    
    /* Smooth scrolling */
    .crm-tabs,
    .operators-table-wrapper {
        scroll-behavior: smooth;
        overscroll-behavior: contain;
    }
}

/* ============================================================ */
/* OPERATOR MOBILE CARDS - EXPANDABLE DESIGN */
/* Version: 1.0.0 - Modern Card-Based Layout for Mobile */
/* ============================================================ */

/* Desktop/Mobile visibility toggles */
.desktop-only {
    display: block;
}
.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
    .mobile-only {
        display: block !important;
    }
}

/* Mobile Cards Container */
.operators-mobile-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Individual Operator Card */
.operator-mobile-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.operator-mobile-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.operator-mobile-card.has-unpaid {
    border-left: 4px solid #f59e0b;
}

.operator-mobile-card.expanded {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Card Header - Always Visible */
.operator-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    cursor: pointer;
    background: #ffffff;
    transition: background 0.2s ease;
}

.operator-card-header:active {
    background: #f8fafc;
}

.operator-card-main {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

/* Avatar with Rank Badge */
.operator-card-avatar {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #64748b, #475569);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    position: relative;
    flex-shrink: 0;
}

.operator-card-avatar.has-sales {
    background: linear-gradient(135deg, #10b981, #059669);
}

.rank-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Operator Info */
.operator-card-info {
    flex: 1;
    min-width: 0;
}

.operator-card-name {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.operator-card-commission {
    margin-top: 4px;
}

.commission-amount {
    font-size: 15px;
    font-weight: 600;
    color: #10b981;
}

.no-commission {
    font-size: 13px;
    color: #94a3b8;
}

/* Toggle Section */
.operator-card-toggle {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.operator-quick-stats {
    display: flex;
    gap: 6px;
}

.quick-stat {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 8px;
}

.toggle-icon {
    font-size: 12px;
    color: #94a3b8;
    transition: transform 0.3s ease;
}

.operator-mobile-card.expanded .toggle-icon {
    transform: rotate(180deg);
}

/* Progress Bar */
.operator-card-progress {
    padding: 0 16px 12px;
}

.progress-bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Card Details - Hidden by default */
.operator-card-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.operator-mobile-card.expanded .operator-card-details {
    max-height: 500px;
    padding: 16px;
}

/* Details Grid */
.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: #ffffff;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.detail-item.highlight {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    border-color: #86efac;
}

.detail-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.detail-value {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
}

.detail-item.highlight .detail-value {
    color: #166534;
}

/* Unpaid Section */
.unpaid-section {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 1px solid #fcd34d;
    border-radius: 12px;
    padding: 16px;
}

.unpaid-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.unpaid-label {
    font-size: 14px;
    font-weight: 600;
    color: #92400e;
}

.unpaid-amount {
    font-size: 18px;
    font-weight: 700;
    color: #b45309;
}

.btn-pay-mobile {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transition: all 0.2s ease;
}

.btn-pay-mobile:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

/* Paid Section */
.paid-section {
    text-align: center;
    padding: 12px;
}

.paid-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #166534;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

/* Very Small Screens */
@media (max-width: 400px) {
    .operator-card-header {
        padding: 12px;
    }
    
    .operator-card-avatar {
        width: 42px;
        height: 42px;
        font-size: 18px;
        border-radius: 12px;
    }
    
    .operator-card-name {
        font-size: 14px;
    }
    
    .commission-amount {
        font-size: 14px;
    }
    
    .details-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .detail-item {
        padding: 10px;
    }
    
    .detail-value {
        font-size: 18px;
    }
    
    .btn-pay-mobile {
        padding: 12px 16px;
        font-size: 14px;
    }
}

/* =====================================================
   SYNC SECTION - Typeform & WebinarJam
   ===================================================== */

.sync-section {
    background: linear-gradient(135deg, #1e1e2e, #2d2d44) !important;
    border: 2px solid #3b82f6;
}

.sync-section h3 {
    color: #60a5fa;
    margin-bottom: 8px;
}

.section-desc {
    color: #94a3b8;
    font-size: 14px;
    margin-bottom: 20px;
}

.sync-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.sync-card {
    background: #1a1a2e;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #2d2d44;
    transition: all 0.3s ease;
}

.sync-card:hover {
    border-color: #3b82f6;
    transform: translateY(-2px);
}

.sync-card.typeform-card {
    border-left: 4px solid #0ea5e9;
}

.sync-card.webinarjam-card {
    border-left: 4px solid #8b5cf6;
}

.sync-card.unified-card {
    border-left: 4px solid #10b981;
}

.sync-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.sync-icon {
    font-size: 24px;
}

.sync-title {
    font-size: 16px;
    font-weight: 600;
    color: #f1f5f9;
}

.sync-card-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #f1f5f9;
}

.stat-label {
    font-size: 12px;
    color: #94a3b8;
}

.sync-card-actions {
    margin-top: 15px;
}

.btn-sync {
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-sync:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-typeform {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: white;
}

.btn-typeform:hover:not(:disabled) {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    transform: translateY(-1px);
}

.btn-webinarjam {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}

.btn-webinarjam:hover:not(:disabled) {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    transform: translateY(-1px);
}

.btn-icon {
    font-size: 16px;
}

.btn-icon.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.sync-status-msg {
    margin-top: 10px;
    font-size: 13px;
    min-height: 20px;
}

.status-syncing {
    color: #60a5fa;
}

.status-success {
    color: #10b981;
}

.status-error {
    color: #ef4444;
}

.sync-status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: #0d0d1a;
    border-radius: 8px;
    margin-top: 15px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-dot.ready {
    background: #10b981;
}

.status-dot.syncing {
    background: #f59e0b;
    animation: pulse 0.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-text {
    font-size: 13px;
    color: #94a3b8;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .sync-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .sync-card {
        padding: 16px;
    }
    
    .sync-card-stats {
        flex-wrap: wrap;
    }
}
