/* =====================================================
   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 Pipeline: filtre pe 2 rânduri ── */
.crm-filters-pipeline {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.crm-filters-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.crm-filters-row input[type="text"],
.crm-filters-row select {
    padding: 9px 13px;
    border: 1px solid var(--border-color, #2a2a3e);
    border-radius: 8px;
    background: var(--card-bg, #1e1e2e);
    color: var(--text-color, #fff);
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.crm-filters-row input[type="text"] {
    min-width: 240px;
    flex: 1;
    max-width: 320px;
}

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

.crm-filters-row input[type="text"]:focus,
.crm-filters-row select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99,102,241,0.15);
}

/* Rândul secundar (mai compact) */
.crm-filters-row-secondary select {
    min-width: 155px;
    font-size: 12px;
    padding: 8px 10px;
}

/* Buton resetare toate filtrele */
.btn-crm-reset-all {
    padding: 8px 14px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #f87171;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s;
}

.btn-crm-reset-all:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #ef4444;
}

/* Badge activ pe select când are filtru setat */
select.crm-filter-active {
    border-color: #6366f1 !important;
    background: rgba(99,102,241,0.08) !important;
    color: #a5b4fc !important;
    font-weight: 500;
}

/* Badge prezență webinar pe card lead */
.wj-attendance-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-right: 4px;
    vertical-align: middle;
    white-space: nowrap;
}
.wj-live    { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.wj-replay  { background: #ede9fe; color: #6d28d9; border: 1px solid #ddd6fe; }
.wj-absent  { background: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; }
.wj-typeform{ background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

/* Dropdown prezență dezactivat */
select:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Grup filtru dată în CRM Pipeline */
.crm-date-filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.crm-date-filter-group select {
    min-width: 200px;
    padding: 10px 12px;
    border: 1px solid var(--border-color, #2a2a3e);
    border-radius: 8px;
    background: var(--card-bg, #1e1e2e);
    color: var(--text-color, #fff);
    font-size: 13px;
    cursor: pointer;
}

.crm-date-filter-group input[type="date"] {
    padding: 9px 10px;
    border: 1px solid var(--border-color, #2a2a3e);
    border-radius: 8px;
    background: var(--card-bg, #1e1e2e);
    color: var(--text-color, #fff);
    font-size: 13px;
    min-width: 140px;
    cursor: pointer;
}

.crm-date-filter-group input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1) opacity(0.6);
    cursor: pointer;
}

.crm-date-sep {
    color: var(--text-muted, #888);
    font-size: 13px;
    padding: 0 2px;
}

.btn-crm-date-reset {
    padding: 8px 10px;
    background: transparent;
    border: 1px solid var(--border-color, #2a2a3e);
    border-radius: 8px;
    color: var(--text-muted, #888);
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    transition: all 0.2s;
}

.btn-crm-date-reset:hover {
    background: rgba(231, 76, 60, 0.15);
    border-color: #e74c3c;
    color: #e74c3c;
}

/* Responsive date filter */
@media (max-width: 768px) {
    .crm-date-filter-group {
        width: 100%;
    }
    .crm-date-filter-group select,
    .crm-date-filter-group input[type="date"] {
        flex: 1;
        min-width: 120px;
    }
}

/* Badge tip dată în coloana Data din tabelul de leads */
.date-label-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    margin-right: 4px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}


.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%;
    }
    
    /* Mobile CRM Filters Revamp */
    .crm-mobile-filter-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        padding: 9px 13px;
        background: rgba(99, 102, 241, 0.15);
        border: 1px solid rgba(99, 102, 241, 0.3);
        color: #818cf8;
        border-radius: 8px;
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
        flex: 1 1 calc(50% - 5px);
    }
    
    .crm-filters-row {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .crm-filters-row > input[type="text"] {
        flex: 1 1 100%;
        max-width: none !important;
        min-width: 100% !important;
    }
    
    .crm-filters-row > select#crm-pipeline-status-filter {
        flex: 1 1 calc(50% - 5px);
        min-width: 0 !important;
    }
    
    .crm-advanced-filter, .crm-advanced-filter-row {
        display: none !important;
    }
    
    .crm-advanced-filter.show-on-mobile, .crm-advanced-filter-row.show-on-mobile {
        display: flex !important;
    }
    
    select.crm-advanced-filter {
        flex: 1 1 calc(50% - 5px);
        min-width: 0 !important;
    }
    
    .crm-date-filter-group {
        flex: 1 1 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        width: 100%;
    }
    
    .crm-date-filter-group select,
    .crm-date-filter-group input {
        flex: 1 1 calc(50% - 5px);
        min-width: 0 !important;
    }
    
    .btn-crm-reset-all {
        flex: 1 1 100% !important;
        margin-top: 5px;
    }
    
    /* Table responsive */
    .crm-pipeline-view .crm-table {
        display: table;
        min-width: 600px;
        width: 100%;
    }
    
    .settings-section .crm-table {
        display: table;
        min-width: 500px;
        width: 100%;
    }
    
    .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.
   Wrapped in :where() so this acts as a LOW-PRIORITY fallback (specificity 0)
   instead of out-competing normal component classes like `.some-class{color:...}`.
   Without :where(), ".sidebar-content *" (same specificity as any single-class
   component rule) wins ties by being the last one loaded, silently forcing
   every element inside the sidebar back to this pale, dark-sidebar-era color
   unless the component remembers to add !important (see .clinic-selector-name
   etc. in medical.css, which needed exactly that fix). :where() lets any
   future sidebar component's own color win naturally, with no !important
   needed. */
.sidebar-content,
:where(.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;
}

/* Ca și `.modal-body` de mai jos, `.modal-content` / `.modal-header` sunt clase
   generice, nu ale CRM-ului. Măsurat în pagină: toate cele 30 de `.modal-content`
   au fundal #ffffff și toate cele 14 `.modal-header` au #f9fafb — light-theme.css
   le impune deja cu `!important`. Fundalul închis de aici nu se mai vede nicăieri,
   dar culorile deschise de text SE MOȘTENEAU în copiii fără regulă proprie (același
   tipar ca bugul `.modal-body strong`). Aliniate la suprafața reală, ca să nu mai
   existe două fișiere care se contrazic. Varianta întunecată: css/backup-dark-theme/. */
.modal-content {
    background: #ffffff;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.18);
    color: #334155;
}

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

.modal-header h2 {
    margin: 0;
    color: #0f172a;
    font-size: 1.25rem;
}

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

.modal-close:hover {
    color: #0f172a;
}

/* `.modal-body` NU e o clasă a CRM-ului — o folosesc 12 modale din toată aplicația
   (configurare agent, clinici, Centrala, knowledge base, softphone). Culorile de mai
   jos erau scrise pentru un modal ÎNTUNECAT, dar toate cele 12 au azi fundal ALB:
   `strong` ieșea #f8fafc, adică invizibil. Simptomul a fost ocolit zeci de ori prin
   `style="color: …"` pus inline pe fiecare `<strong>` din index.html; cauza era aici.
   Varianta întunecată a rămas în css/backup-dark-theme/. */
.modal-body {
    padding: 20px;
    color: #334155;
}

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

.modal-body strong {
    color: #0f172a;
}

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

/* Idem: măsurat, toate cele 3 `.modal-footer` au azi #f9fafb (impus de light-theme.css). */
.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 15px 20px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 0 0 12px 12px;
}

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

   ATENȚIE: blocul acesta a fost scris când toate suprafețele de mai jos erau
   închise. Măsurat azi în pagină (culoarea calculată a fundalului efectiv):
     .pipeline-card / .pipeline-kpi-card / .settings-section / .lead-details-modal → #ffffff
     .crm-pipeline-settings / .crm-settings-sections                               → #f3f4f6
     .crm-table → #ffffff, .crm-table th → #f9fafb, .source-card → #f8fafc
     .assign-modal                                                                 → #1e293b (CHIAR închis)
   Deci doar `.assign-modal` mai merită text alb; pe restul, #f8fafc/#e2e8f0
   însemna contrast 1.0–1.5:1, adică text invizibil. Înainte de a readuce o culoare
   deschisă aici, măsoară fundalul — nu-l presupune.
   ======================================== */

/* Fundal ÎNCHIS (măsurat) - text alb */
.assign-modal {
    color: #f8fafc;
}

/* Fundal DESCHIS (măsurat) - text închis */
.pipeline-card,
.pipeline-kpi-card,
.settings-section,
.crm-pipeline-settings,
.crm-settings-sections,
.crm-table,
.lead-details-modal {
    color: #1e293b;
}

.pipeline-card h3,
.pipeline-card h4,
.settings-section h3,
.settings-section h4 {
    color: #0f172a;
}

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

/* Table text on light background */
.crm-table th {
    color: #334155;
    background: #f9fafb;
}

.crm-table td {
    color: #1e293b;
}

.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` măsurat: #ffffff (nu mai e cardul închis
   de altădată), deci text alb = invizibil. text-shadow-ul avea sens doar pe închis. */
.pipeline-kpi-card .kpi-number {
    color: #0f172a;
}

.pipeline-kpi-card .kpi-title {
    color: #4b5563;
}

/* Source cards — `.source-card` măsurat: #f8fafc. `color:#f8fafc !important` însemna
   contrast 1.00:1, text complet invizibil. */
.source-card .source-name,
.source-card .source-count {
    color: #0f172a;
}

/* Bar labels in pipeline — stau pe cardurile deschise de mai sus. */
.bar-label,
.bar-stats {
    color: #374151;
}

/* Empty states — `.crm-empty-state` / `.empty-state-mini` măsurate: #f9fafb.
   #94a3b8 dădea 2.5:1; #6b7280 dă 4.6:1 și rămâne text „secundar". */
.empty-state-mini p,
.crm-empty-state p {
    color: #6b7280;
}

/* 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.65);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease-out;
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    box-sizing: border-box;
}

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

.modal-content.assign-modal {
    --assign-surface: #1a2332;
    --assign-surface-2: #243044;
    --assign-text: #f1f5f9;
    --assign-muted: #cbd5e1;
    --assign-border: rgba(255, 255, 255, 0.12);
    background: linear-gradient(180deg, #243044 0%, #151c2c 100%) !important;
    border-radius: 16px;
    width: min(100%, 520px);
    max-width: 520px;
    max-height: min(88vh, 720px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.08);
    border: 1px solid var(--assign-border);
}

.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: clamp(1.05rem, 2.8vw, 1.35rem);
    font-weight: 700;
    line-height: 1.25;
    padding-right: 8px;
    letter-spacing: -0.02em;
}

.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: 20px 20px 8px;
    color: var(--assign-text, #f1f5f9) !important;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.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: 0;
}

.assign-modal .assign-section {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--assign-border, rgba(255, 255, 255, 0.12));
    border-radius: 14px;
    padding: 16px 16px 18px;
    margin-bottom: 14px;
}

.assign-modal .assign-section--quick {
    padding: 10px 12px 12px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1) 0%, rgba(245, 158, 11, 0.07) 55%, rgba(255, 255, 255, 0.03) 100%);
    border-color: rgba(255, 255, 255, 0.14);
}

.assign-modal .assign-section-title--inline {
    margin: 0 0 8px 0 !important;
    font-size: 0.6875rem;
    opacity: 0.92;
}

.assign-modal .assign-quick-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-items: stretch;
}

.assign-modal .assign-quick-cell {
    display: flex;
    flex-direction: column;
    text-align: center;
    min-width: 0;
}

.assign-modal .assign-section--operators {
    background: rgba(15, 23, 42, 0.45);
    margin-bottom: 0;
}

.assign-modal .assign-section-title {
    color: #f8fafc !important;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 12px 0 !important;
    text-shadow: none !important;
}

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

.assign-modal .btn-ai {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9) !important;
    color: #ffffff !important;
    border: none;
    padding: 16px 24px;
    font-size: 1.0625rem;
    border-radius: 12px;
    cursor: pointer;
    width: 100%;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    font-weight: 700;
    min-height: 52px;
    touch-action: manipulation;
    line-height: 1.3;
}

.assign-modal .btn-ai--compact {
    min-height: 42px;
    padding: 9px 8px;
    font-size: 0.8125rem;
    border-radius: 10px;
}

.assign-modal .btn-ai:hover {
    background: linear-gradient(135deg, #7c3aed, #5b21b6) !important;
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(124, 58, 237, 0.45);
}

.assign-modal .option-desc {
    color: var(--assign-muted, #cbd5e1) !important;
    font-size: 0.9375rem;
    line-height: 1.45;
    margin: 10px 0 0 0;
}

.assign-modal .option-desc--compact {
    font-size: 0.6875rem !important;
    margin: 5px 0 0 0 !important;
    line-height: 1.3 !important;
    color: #94a3b8 !important;
}

.assign-modal .assign-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 6px 0 14px;
    position: relative;
    min-height: 28px;
}

.assign-modal .assign-divider span {
    position: relative;
    z-index: 1;
    color: #e2e8f0 !important;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.assign-modal .assign-divider::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
}

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

.assign-modal .btn-user {
    background: linear-gradient(180deg, #334155 0%, #1e293b 100%) !important;
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: #ffffff !important;
    padding: 14px 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    min-height: 52px;
    touch-action: manipulation;
    position: relative;
}

.assign-modal .btn-user:hover:not(:disabled):not(.btn-inactive) {
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%) !important;
    border-color: #93c5fd;
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(59, 130, 246, 0.35);
}

.assign-modal .btn-user .user-icon {
    font-size: 26px;
    line-height: 1;
}

.assign-modal .btn-user .user-name {
    color: #ffffff !important;
    font-weight: 700;
    font-size: 0.9375rem;
    line-height: 1.25;
    word-break: break-word;
    max-width: 100%;
}

.assign-modal .btn-user .user-role {
    color: #bae6fd !important;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    background: rgba(59, 130, 246, 0.25);
    padding: 4px 8px;
    border-radius: 6px;
}

.assign-modal .user-inactive-badge {
    font-size: 0.625rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #fecaca !important;
    background: rgba(127, 29, 29, 0.55);
    border: 1px solid rgba(248, 113, 113, 0.35);
    padding: 3px 8px;
    border-radius: 999px;
    margin-top: 2px;
}

.assign-modal .btn-user.btn-inactive,
.assign-modal .btn-user:disabled {
    opacity: 1;
    cursor: pointer;
    background: linear-gradient(180deg, #293548 0%, #1a2332 100%) !important;
    border-color: rgba(100, 116, 139, 0.35);
    filter: grayscale(0.12);
}

.assign-modal .btn-user.btn-inactive:hover,
.assign-modal .btn-user:disabled:hover {
    transform: translateY(-1px) !important;
    border-color: rgba(148, 163, 184, 0.45) !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2) !important;
    background: linear-gradient(180deg, #334155 0%, #1e293b 100%) !important;
}

.assign-modal .btn-user.btn-inactive .user-name,
.assign-modal .btn-user:disabled .user-name {
    color: #e2e8f0 !important;
}

.assign-modal .btn-user.btn-inactive .user-role,
.assign-modal .btn-user:disabled .user-role {
    color: #94a3b8 !important;
    background: rgba(71, 85, 105, 0.4);
}

.assign-modal .no-users {
    color: var(--assign-muted, #cbd5e1) !important;
    text-align: center;
    padding: 16px 12px;
    font-size: 0.9375rem;
    line-height: 1.5;
    font-style: normal;
    margin: 0;
}

.assign-modal .btn-ai:focus-visible,
.assign-modal .btn-release:focus-visible,
.assign-modal .btn-user:focus-visible:not(:disabled):not(.btn-inactive),
.assign-modal .btn-user.btn-inactive:focus-visible,
.assign-modal .btn-cancel:focus-visible,
.assign-modal .modal-close-btn:focus-visible {
    outline: 2px solid #38bdf8;
    outline-offset: 2px;
}

.assign-modal .modal-footer {
    padding: 14px 20px calc(14px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: stretch;
    gap: 12px;
    flex-shrink: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.5) 0%, rgba(15, 23, 42, 0.92) 100%);
}

.assign-modal .modal-footer .btn {
    background: transparent !important;
    color: #e2e8f0 !important;
    border: 1px solid rgba(255, 255, 255, 0.22);
    padding: 14px 24px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.15s ease, border-color 0.15s ease;
    flex: 1;
    min-height: 50px;
    touch-action: manipulation;
}

.assign-modal .modal-footer .btn:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.35);
}

/* 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-content.assign-modal {
        width: 100% !important;
        max-width: none !important;
        max-height: min(92vh, 900px);
        border-radius: 14px;
    }

    .assign-modal .modal-header {
        padding: 14px 16px;
        border-radius: 14px 14px 0 0;
    }

    .assign-modal .modal-close {
        width: 32px;
        height: 32px;
        font-size: 20px;
    }

    .assign-modal .modal-body {
        padding: 16px 16px 8px;
    }

    .assign-modal .assign-section {
        padding: 14px;
        margin-bottom: 12px;
    }

    .assign-modal .assign-section--quick {
        padding: 8px 10px 10px;
        margin-bottom: 8px;
    }

    .assign-modal .btn-ai:not(.btn-ai--compact) {
        padding: 15px 20px;
        font-size: 1rem;
        min-height: 50px;
    }

    .assign-modal .btn-ai--compact,
    .assign-modal .btn-release--compact {
        min-height: 40px !important;
        padding: 8px 6px !important;
        font-size: 0.78rem !important;
    }

    .assign-modal .option-desc {
        font-size: 0.875rem;
    }

    .assign-modal .option-desc--compact {
        font-size: 0.65rem !important;
    }

    .assign-modal .users-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .assign-modal .btn-user {
        padding: 12px 10px;
        min-height: 48px;
    }

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

    .assign-modal .btn-user .user-name {
        font-size: 0.875rem;
    }

    .assign-modal .modal-footer {
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    }

    .assign-modal .modal-footer .btn {
        padding: 14px 18px;
        font-size: 1rem;
    }
    
    /* 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) {
    #assign-lead-modal.modal-overlay {
        align-items: flex-end !important;
        padding-bottom: 0;
        padding-left: 0;
        padding-right: 0;
    }

    .modal-content.assign-modal {
        width: 100% !important;
        margin: 0;
        border-radius: 20px 20px 0 0;
        max-height: min(92vh, 100dvh);
        max-height: min(92vh, 100vh);
    }

    .assign-modal .modal-header {
        padding: 16px 18px;
        border-radius: 20px 20px 0 0;
    }

    .assign-modal .modal-body {
        padding: 14px 14px 6px;
    }

    .assign-modal .assign-section {
        padding: 14px 12px;
    }

    .assign-modal .assign-section--quick {
        padding: 8px 10px;
    }

    .assign-modal .assign-quick-row {
        gap: 6px;
    }

    .assign-modal .btn-ai:not(.btn-ai--compact),
    .assign-modal .btn-release:not(.btn-release--compact) {
        min-height: 52px;
        font-size: 1.02rem;
    }

    .assign-modal .btn-ai--compact,
    .assign-modal .btn-release--compact {
        min-height: 44px !important;
        font-size: 0.8rem !important;
    }

    .assign-modal .users-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .assign-modal .btn-user {
        flex-direction: column;
        align-items: stretch;
        padding: 16px 14px;
        text-align: center;
        min-height: 56px;
    }

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

    .assign-modal .btn-user .user-name {
        font-size: 1rem;
    }

    .assign-modal .btn-user .user-role {
        align-self: center;
    }

    .assign-modal .user-inactive-badge {
        align-self: center;
        margin-top: 6px;
    }

    .assign-modal .modal-footer {
        padding: 12px 14px calc(14px + env(safe-area-inset-bottom, 0px));
    }

    .assign-modal .modal-footer .btn {
        min-height: 52px;
        font-size: 1.05rem;
    }
    
    /* 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 .btn-release,
    .assign-modal .modal-footer .btn,
    .assign-modal .modal-close-btn {
        min-height: 48px;
    }

    .assign-modal .btn-user:active:not(:disabled),
    .assign-modal .btn-ai:active,
    .assign-modal .btn-release:active,
    .assign-modal .modal-footer .btn:active {
        transform: scale(0.98);
        opacity: 0.95;
    }
}

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

/* ============================================
   Assign modal: close, cancel, contrast (single source)
   ============================================ */

.assign-modal .modal-close-btn {
    background: rgba(255, 255, 255, 0.22) !important;
    border: 2px solid rgba(255, 255, 255, 0.45) !important;
    color: #ffffff !important;
    font-size: 26px !important;
    font-weight: 700 !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: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease !important;
    line-height: 1 !important;
    padding: 0 !important;
    flex-shrink: 0;
    touch-action: manipulation;
}

.assign-modal .modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.35) !important;
    border-color: rgba(255, 255, 255, 0.65) !important;
}

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

.assign-modal .btn-user .user-name {
    color: #ffffff !important;
    font-weight: 700 !important;
}

.assign-modal .btn-user:hover:not(:disabled):not(.btn-inactive) {
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%) !important;
    border-color: #93c5fd !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 10px 26px rgba(59, 130, 246, 0.38) !important;
}

.assign-modal .btn-cancel {
    background: rgba(255, 255, 255, 0.06) !important;
    color: #f1f5f9 !important;
    border: 1px solid rgba(255, 255, 255, 0.28) !important;
    padding: 14px 24px !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    cursor: pointer !important;
    transition: background 0.15s ease, border-color 0.15s ease !important;
    width: 100% !important;
    min-height: 50px;
    touch-action: manipulation;
}

.assign-modal .btn-cancel:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.45) !important;
    transform: none !important;
    box-shadow: none !important;
}

.assign-modal .assign-section-title {
    color: #f8fafc !important;
}

.assign-modal .option-desc {
    color: #cbd5e1 !important;
}

@media screen and (max-width: 480px) {
    .assign-modal .modal-close-btn {
        width: 42px !important;
        height: 42px !important;
        font-size: 22px !important;
    }

    .assign-modal .btn-cancel {
        min-height: 52px;
        font-size: 1.05rem !important;
    }
}

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

.assign-modal .btn-release {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    color: #0f172a !important;
    border: none !important;
    padding: 16px 24px !important;
    font-size: 1.0625rem !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    width: 100% !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease !important;
    font-weight: 700 !important;
    min-height: 52px;
    touch-action: manipulation;
    line-height: 1.3;
}

.assign-modal .btn-release--compact {
    min-height: 42px !important;
    padding: 9px 8px !important;
    font-size: 0.8125rem !important;
    border-radius: 10px !important;
}

.assign-modal .btn-release:hover {
    background: linear-gradient(135deg, #fbbf24, #d97706) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 10px 26px rgba(245, 158, 11, 0.42) !important;
}

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

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

/* Modal content general */
.modal-content.lead-details-modal,
.modal-content.edit-lead-modal,
.modal-content.new-lead-modal,
.modal-content.new-lead-type-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,
.new-lead-modal .modal-header,
.new-lead-type-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,
.new-lead-modal .modal-header h2,
.new-lead-type-modal .modal-header h2 {
    color: #ffffff !important;
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

/* Măsurat: cele 4 modale de lead au azi corp ALB (`.lead-details-modal` → #ffffff,
   `.edit-lead-modal`/`.new-lead-modal` → #f3f4f6). `color:#ffffff !important` = text
   invizibil (contrast 1.00:1) și, fiind mai specific, anula și corectura de pe
   `.modal-body`. Aliniat la aceeași culoare ca `.modal-body`. */
.lead-details-modal .modal-body,
.edit-lead-modal .modal-body,
.new-lead-modal .modal-body,
.new-lead-type-modal .modal-body {
    padding: 24px;
    color: #334155;
}

/* 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;
}

/* Măsurat: corpul modalului e alb, iar `rgba(59,130,246,.2)` peste alb dă #d8e6fd —
   text alb pe el = 1.26:1, iar `#e2e8f0` pe alb = 1.23:1. Ambele erau invizibile. */
.lead-details-modal .crm-table th {
    background: rgba(59, 130, 246, 0.12);
    color: #0f172a;
    padding: 10px;
    text-align: left;
    font-weight: 600;
}

.lead-details-modal .crm-table td {
    padding: 10px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    color: #1e293b;
}

/* 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.full-width {
    grid-column: 1 / -1;
}

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

/* `.form-group` NU e o clasă a CRM-ului — o folosesc 130+ de câmpuri din toată
   aplicația (login, configurare agent, clinici, tenants, batch calls, Centrala).
   `#94a3b8 !important` era culoarea de label pentru formularul ÎNTUNECAT; măsurat
   azi, TOATE cele 133 de label-uri stau pe fundal deschis (alb, #f8fafc, #ecfeff)
   → contrast 2.45–2.56:1, adică sub pragul de citit. Nici măcar `label {…!important}`
   din light-theme.css nu îl putea corecta, pentru că `!important`-ul de aici era mai
   specific. Fără `!important`, orice componentă cu fundal chiar închis (ex. .assign-modal)
   își poate impune propria culoare în mod natural. */
.form-group label {
    display: block;
    color: #374151;
    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,
.new-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,
.new-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,
.new-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,
.new-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,
.new-lead-modal .btn-secondary,
.new-lead-modal .btn-cancel {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    color: #ffffff !important;
}

.lead-details-modal .btn-secondary:hover,
.edit-lead-modal .btn-secondary:hover,
.new-lead-modal .btn-secondary:hover,
.new-lead-modal .btn-cancel: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,
    .modal-content.new-lead-modal,
    .modal-content.new-lead-type-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,
    .new-lead-modal .modal-footer {
        flex-direction: column;
    }
    
    .lead-details-modal .modal-footer .btn,
    .edit-lead-modal .modal-footer .btn,
    .new-lead-modal .modal-footer .btn {
        width: 100%;
    }
}

/* New Lead modals — type selector & manual create forms */
.modal-content.new-lead-type-modal {
    max-width: 440px;
}

.new-lead-type-desc {
    color: #94a3b8;
    margin: 0 0 24px 0;
    text-align: center;
}

.new-lead-type-options {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.new-lead-type-btn {
    flex: 1;
    border: none;
    border-radius: 12px;
    padding: 20px 16px;
    cursor: pointer;
    color: #ffffff;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.new-lead-type-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.new-lead-type-btn--person {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.new-lead-type-btn--person:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.new-lead-type-btn--company {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.new-lead-type-btn--company:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.3);
}

.new-lead-type-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.new-lead-type-label {
    font-weight: 600;
}

.new-lead-modal .modal-header .modal-close-btn,
.new-lead-type-modal .modal-header .modal-close-btn {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.new-lead-modal .modal-header .modal-close-btn:hover,
.new-lead-type-modal .modal-header .modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.modal-content.new-lead-modal {
    max-width: 600px;
}

.nl-contact-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.nl-contact-row input {
    flex: 1;
}

.nl-add-field-btn,
.nl-remove-field-btn {
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    transition: all 0.2s;
}

.nl-add-field-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #ffffff;
}

.nl-add-field-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.nl-remove-field-btn {
    background: #fee2e2;
    color: #b91c1c;
}

.nl-remove-field-btn:hover {
    background: #fecaca;
}

.nl-company-results {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    max-height: 150px;
    overflow-y: auto;
    display: none;
    margin-top: 4px;
}

.nl-company-result-item {
    padding: 10px 12px;
    cursor: pointer;
    color: #e2e8f0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: background 0.15s;
}

.nl-company-result-item:hover {
    background: rgba(59, 130, 246, 0.2);
}

.nl-company-result-item .nl-company-cui {
    color: #94a3b8;
}

.nl-company-selected {
    display: none;
    margin-top: 8px;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
}

.nl-company-selected input {
    margin-top: 8px;
}

.nl-company-selected-name {
    color: #60a5fa;
}

.nl-company-clear {
    color: #94a3b8;
    cursor: pointer;
    float: right;
}

.nl-company-clear:hover {
    color: #f1f5f9;
}

.nl-input-with-btn {
    display: flex;
    gap: 8px;
}

.nl-input-with-btn input {
    flex: 1;
}

.btn-anaf {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    cursor: pointer;
    white-space: nowrap;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-anaf:hover {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    transform: translateY(-1px);
}

.nl-anaf-status {
    margin-top: 6px;
    font-size: 0.85rem;
    color: #94a3b8;
    display: none;
}

.nl-checkbox-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nl-checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.nl-checkbox-group label {
    margin-bottom: 0 !important;
    cursor: pointer;
}

.nl-error-box {
    display: none;
    background: #7f1d1d;
    color: #fca5a5;
    padding: 10px 14px;
    border-radius: 8px;
    margin-top: 16px;
    font-size: 0.9rem;
}

/* ============================================
   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;
    }
}

/* ========== ANALIZĂ APEL — header responsive (oglindă după crmPipeline) ========== */
/* Fără aceste reguli, ambele titluri (.desktop-title + .mobile-title) se afișau
   simultan, iar antetul rămânea pe layout de desktop pe mobil → titlul/subtitlul se
   suprapuneau peste selectorul de firmă și peste tab-uri. */
#crmCallAnalysisSection .desktop-title { display: inline; }
#crmCallAnalysisSection .mobile-title { display: none; }

@media (max-width: 768px) {
    #crmCallAnalysisSection .page-header {
        padding: 0 !important;
        margin: 0 0 8px 0 !important;
    }
    #crmCallAnalysisSection .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;
    }
    #crmCallAnalysisSection .crm-header-title {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }
    #crmCallAnalysisSection .crm-header-title h1 {
        font-size: 18px !important;
        font-weight: 700 !important;
        margin: 0 !important;
        padding: 0 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        line-height: 1.3 !important;
    }
    #crmCallAnalysisSection .desktop-title { display: none !important; }
    #crmCallAnalysisSection .mobile-title { display: inline !important; }
    #crmCallAnalysisSection .crm-subtitle { display: none !important; }
    #crmCallAnalysisSection .crm-header-actions {
        flex: 0 0 auto !important;
        width: auto !important;
        max-width: 190px !important;
    }
    #crmCallAnalysisSection #cca-tenant-select {
        width: 100% !important;
        padding: 10px 32px 10px 12px !important;
        font-size: 13px !important;
        font-weight: 600 !important;
        border-radius: 10px !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: 4px !important;
        padding-top: 4px !important;
        padding-bottom: 100px !important;
        margin-top: 0 !important;
    }
    
    /* PAGE HEADER - Remove ALL spacing */
    #crmPipelineDashboardSection .page-header {
        padding: 0 !important;
        margin: 0 0 8px 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 16px;
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    border-radius: 8px;
    margin-top: 15px;
}

.sync-card.unified-card .sync-status-indicator {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.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: #ffffff;
    font-weight: 500;
}

.sync-status-indicator .status-text {
    color: #ffffff;
}

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

/* ========================================================================
   BULK SELECTION & ASSIGNMENT (Lead-uri Unificate)
   - Checkbox-uri în tabel + bară sticky de bulk-actions
   - Modal de atribuire în masă reutilizează stilurile .assign-modal existente
   - Responsive desktop + tablet + mobile (cu fallback la <table-card> pe mobile)
   ======================================================================== */

/* Wrapper pentru tabel — necesar pentru bara sticky și scroll orizontal pe mobile */
.crm-table-wrapper {
    position: relative;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Bara de bulk-actions — sticky deasupra tabelului */
.crm-bulk-bar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 16px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border: 1px solid #c7d2fe;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.08);
    flex-wrap: wrap;
}

.crm-bulk-bar-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

.crm-bulk-count {
    font-size: 14px;
    color: #1e293b;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.crm-bulk-count strong {
    color: #4f46e5;
    font-weight: 700;
    font-size: 16px;
}

.crm-bulk-mode-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #4f46e5;
    color: #fff;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.crm-bulk-link {
    background: transparent;
    border: 1px dashed #6366f1;
    color: #4338ca;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.crm-bulk-link:hover {
    background: #4f46e5;
    color: #fff;
    border-color: #4f46e5;
}

.crm-bulk-bar-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* Coloana checkbox în tabel */
.crm-leads-table--selectable th.crm-bulk-th,
.crm-leads-table--selectable td.crm-bulk-td {
    width: 44px;
    text-align: center;
    padding-left: 12px;
    padding-right: 4px;
}

/* Checkbox custom — accesibil + consistent cu UI-ul */
.crm-bulk-checkbox {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    line-height: 0;
}

.crm-bulk-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.crm-bulk-checkbox-box {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 5px;
    background: #fff;
    transition: all 0.15s ease;
    position: relative;
}

.crm-bulk-checkbox:hover .crm-bulk-checkbox-box {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.crm-bulk-checkbox input[type="checkbox"]:checked + .crm-bulk-checkbox-box {
    background: #4f46e5;
    border-color: #4f46e5;
}

.crm-bulk-checkbox input[type="checkbox"]:checked + .crm-bulk-checkbox-box::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Stare indeterminate (unele bifate, altele nu) */
.crm-bulk-checkbox input[type="checkbox"]:indeterminate + .crm-bulk-checkbox-box {
    background: #4f46e5;
    border-color: #4f46e5;
}

.crm-bulk-checkbox input[type="checkbox"]:indeterminate + .crm-bulk-checkbox-box::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 7px;
    width: 10px;
    height: 2px;
    background: #fff;
    border-radius: 1px;
}

.crm-bulk-checkbox input[type="checkbox"]:focus-visible + .crm-bulk-checkbox-box {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* Rând selectat — highlight subtil */
.crm-leads-table tr.crm-row-selected {
    background-color: #eef2ff !important;
}

.crm-leads-table tr.crm-row-selected td {
    background-color: #eef2ff !important;
}

/* Loading overlay pentru atribuirea bulk */
.crm-bulk-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.crm-bulk-loading-content {
    background: #fff;
    padding: 24px 32px;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    text-align: center;
    min-width: 240px;
}

.crm-bulk-loading-content p {
    margin: 12px 0 0 0;
    color: #1e293b;
    font-weight: 500;
}

.crm-bulk-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e0e7ff;
    border-top-color: #4f46e5;
    border-radius: 50%;
    margin: 0 auto;
    animation: crm-bulk-spin 0.8s linear infinite;
}

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

/* ── Tablet ── */
@media (max-width: 992px) {
    .crm-bulk-bar {
        padding: 10px 12px;
        gap: 10px;
    }
    .crm-bulk-bar-actions .btn {
        font-size: 13px;
    }
}

/* ── Mobile ── */
@media (max-width: 768px) {
    .crm-bulk-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px;
        border-radius: 8px;
    }

    .crm-bulk-bar-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .crm-bulk-bar-actions {
        width: 100%;
        justify-content: stretch;
    }

    .crm-bulk-bar-actions .btn {
        flex: 1;
        justify-content: center;
        min-height: 40px; /* touch target */
    }

    .crm-bulk-link {
        width: 100%;
        text-align: center;
    }

    /* Coloana checkbox pe mobile — mai compactă */
    .crm-leads-table--selectable th.crm-bulk-th,
    .crm-leads-table--selectable td.crm-bulk-td {
        width: 36px;
        padding-left: 8px;
        padding-right: 2px;
    }

    /* Checkbox-ul devine puțin mai mare pe touch-uri */
    .crm-bulk-checkbox-box {
        width: 22px;
        height: 22px;
    }

    .crm-bulk-checkbox input[type="checkbox"]:checked + .crm-bulk-checkbox-box::after {
        left: 6px;
        top: 2px;
    }

    /* Pe mobile tabelul de lead-uri este tip card acum, deci checkbox-ul a devenit absolut in coltul dreapta-sus */
    .crm-leads-table--selectable th.crm-bulk-th,
    .crm-leads-table--selectable td.crm-bulk-td {
        position: absolute !important;
        top: 12px;
        right: 12px;
        left: auto;
        background: transparent !important;
        box-shadow: none !important;
    }

    .crm-leads-table--selectable thead th.crm-bulk-th {
        display: none;
    }

    /* Rândurile selectate trebuie să păstreze fundalul */
    .crm-leads-table tr.crm-row-selected td.crm-bulk-td {
        background-color: transparent !important;
    }
}

/* ── Mobile mic ── */
@media (max-width: 480px) {
    .crm-bulk-count strong {
        font-size: 15px;
    }
    .crm-bulk-bar-actions .btn {
        font-size: 12px;
        padding: 8px 10px;
    }
}

/* =====================================================
   CRM CALL ANALYSIS (AlinaI) — Faza 0
   ===================================================== */

/* --- Butoane: .crm-btn-primary/.crm-btn-secondary sunt folosite în acest
   modul FĂRĂ clasa de bază .crm-btn (fără padding / sub 44px tap-size).
   Le dăm dimensiuni proprii + accentul albastru al aplicației, scopat DOAR
   pe modul + modalele cca ca să nu afectăm alte ecrane CRM. --- */
#crmCallAnalysisSection .crm-btn-primary,
#crmCallAnalysisSection .crm-btn-secondary,
.cca-modal .crm-btn-primary,
.cca-modal .crm-btn-secondary {
    padding: 10px 18px;
    min-height: 44px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
#crmCallAnalysisSection .crm-btn-primary,
.cca-modal .crm-btn-primary {
    background: var(--primary-600);
    color: #fff;
}
#crmCallAnalysisSection .crm-btn-primary:hover:not(:disabled),
.cca-modal .crm-btn-primary:hover:not(:disabled) {
    background: var(--primary-700);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}
#crmCallAnalysisSection .crm-btn-secondary,
.cca-modal .crm-btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
}
#crmCallAnalysisSection .crm-btn-secondary:hover:not(:disabled),
.cca-modal .crm-btn-secondary:hover:not(:disabled) {
    background: var(--gray-200);
    color: var(--gray-900);
}
#crmCallAnalysisSection .crm-btn-primary:disabled,
.cca-modal .crm-btn-primary:disabled,
#crmCallAnalysisSection .crm-btn-secondary:disabled,
.cca-modal .crm-btn-secondary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Focus vizibil consistent pe toate elementele interactive din modul */
#crmCallAnalysisSection .crm-btn-primary:focus-visible,
#crmCallAnalysisSection .crm-btn-secondary:focus-visible,
#crmCallAnalysisSection .cca-call-card:focus-visible,
#crmCallAnalysisSection .cca-filters input:focus-visible,
#crmCallAnalysisSection .cca-filters select:focus-visible,
.cca-modal .crm-btn-primary:focus-visible,
.cca-modal .crm-btn-secondary:focus-visible,
.cca-modal .cca-modal-close:focus-visible,
.cca-modal .cca-template-card:focus-visible,
.cca-modal .cca-standard-card:focus-visible,
.cca-modal .cca-standard-actions button:focus-visible,
.cca-modal .cca-form-row input:focus-visible,
.cca-modal .cca-form-row textarea:focus-visible,
.cca-modal .cca-form-row select:focus-visible {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
    border-color: var(--primary-500);
}

.cca-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    align-items: center;
}
.cca-filters input[type="text"],
.cca-filters select {
    padding: 10px 14px;
    min-height: 44px;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    font-size: 0.9rem;
    background: #fff;
    color: var(--gray-800);
    min-width: 180px;
}
.cca-filters input[type="text"] {
    flex: 1;
    min-width: 240px;
}

.cca-calls-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cca-call-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: 14px 18px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    align-items: center;
    cursor: pointer;
    transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.cca-call-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-300);
    transform: translateY(-1px);
}
.cca-call-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cca-call-name { font-weight: 600; color: var(--gray-900); font-size: 1rem; overflow-wrap: anywhere; }
.cca-call-meta { color: var(--gray-500); font-size: 0.85rem; display: flex; gap: 12px; flex-wrap: wrap; }
.cca-call-meta-item { display: inline-flex; align-items: center; gap: 4px; }
.cca-call-status { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.cca-call-score {
    font-size: 1.4rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: var(--border-radius-sm);
    min-width: 60px;
    text-align: center;
}
.cca-score-good { background: #dcfce7; color: #166534; }
.cca-score-mid { background: #fef3c7; color: #854d0e; }
.cca-score-bad { background: #fee2e2; color: #991b1b; }
.cca-call-badge {
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 600;
}
.cca-badge-analyzed { background: var(--primary-100); color: var(--primary-800); }
.cca-badge-unanalyzed { background: var(--gray-100); color: var(--gray-600); }
.cca-badge-failed { background: #fee2e2; color: #991b1b; }
.cca-badge-unreliable { background: #fef3c7; color: #854d0e; }

/* === Empty / loading states === */
.cca-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    padding: 40px 24px;
    background: #fff;
    border: 1px dashed var(--gray-300);
    border-radius: var(--border-radius-lg);
    color: var(--gray-600);
}
.cca-empty-icon { font-size: 2.6rem; line-height: 1; }
.cca-empty-title { font-size: 1.05rem; font-weight: 700; color: var(--gray-900); }
.cca-empty-text { font-size: 0.9rem; max-width: 460px; line-height: 1.5; }
.cca-empty-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }

/* === Modal === */
.cca-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    overflow-y: auto;
}
.cca-modal {
    background: #fff;
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 720px;
    max-height: 92vh;
    overflow: hidden;
    display: flex; flex-direction: column;
    box-shadow: var(--shadow-xl);
}
.cca-modal-large { max-width: 1100px; }
.cca-modal-header {
    padding: 16px 22px;
    border-bottom: 1px solid var(--gray-200);
    display: flex; justify-content: space-between; align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, var(--gray-50), var(--gray-100));
}
.cca-modal-header h3 { margin: 0; font-size: 1.1rem; color: var(--gray-900); }
.cca-modal-close {
    background: transparent; border: none;
    font-size: 1.25rem; cursor: pointer;
    color: var(--gray-500);
    width: 44px; height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--border-radius-sm);
    flex-shrink: 0;
    transition: background 0.15s ease, color 0.15s ease;
}
.cca-modal-close:hover { background: var(--gray-200); color: var(--gray-900); }
.cca-modal-body {
    padding: 20px 22px;
    overflow-y: auto;
    flex: 1;
}

/* === Detaliu apel === */
.cca-detail-section {
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--gray-100);
}
.cca-detail-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.cca-detail-section h4 {
    margin: 0 0 12px 0; font-size: 1.02rem; font-weight: 700;
    color: var(--gray-900); letter-spacing: -0.01em;
    display: flex; align-items: center; gap: 8px;
}
.cca-detail-meta {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px; font-size: 0.88rem;
}
.cca-detail-meta-item { display: flex; flex-direction: column; gap: 2px; }
.cca-detail-meta-label { color: var(--gray-500); font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.cca-detail-meta-value { color: var(--gray-800); font-weight: 500; overflow-wrap: anywhere; }
.cca-call-dir-tag { color: var(--gray-400); font-weight: normal; font-size: 0.85rem; }

.cca-transcript {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    padding: 12px 14px;
    max-height: 280px;
    overflow-y: auto;
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--gray-700);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}
mark.cca-quote-highlight {
    background: #fef3c7;
    color: #713f12;
    padding: 1px 3px;
    border-radius: 3px;
}

.cca-analysis-summary {
    background: var(--primary-50);
    border-left: 3px solid var(--primary-500);
    padding: 12px 16px;
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
    color: var(--gray-800);
    font-size: 0.92rem;
    line-height: 1.55;
}

.cca-analyze-bar {
    display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.cca-analyze-hint { color: var(--gray-500); font-size: 0.85rem; }

.cca-overall-score {
    display: flex; align-items: center; gap: 18px;
    background: linear-gradient(135deg, var(--gray-50), var(--gray-100));
    padding: 18px 20px; border-radius: var(--border-radius);
    margin-bottom: 16px;
}
.cca-overall-score-meta { display: flex; flex-direction: column; gap: 3px; }
.cca-overall-score-title { font-weight: 700; color: var(--gray-900); font-size: 1.05rem; }
.cca-overall-score-label { color: var(--gray-500); font-size: 0.85rem; }

/* Radial gauge (conic-gradient ring) pentru scorul global */
.cca-gauge {
    --cca-gauge-deg: 0deg;
    --cca-gauge-color: var(--gray-300);
    width: 108px; height: 108px; border-radius: 50%;
    flex-shrink: 0;
    background: conic-gradient(var(--cca-gauge-color) var(--cca-gauge-deg), var(--gray-200) 0);
    display: flex; align-items: center; justify-content: center;
}
.cca-gauge-inner {
    width: 82px; height: 82px; border-radius: 50%; background: #fff;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    box-shadow: var(--shadow-sm);
}
.cca-gauge-value { font-size: 1.95rem; font-weight: 800; line-height: 1; color: var(--gray-900); }
.cca-gauge-max { font-size: 0.68rem; color: var(--gray-500); margin-top: 2px; font-weight: 600; letter-spacing: 0.03em; }
.cca-gauge.cca-score-good .cca-gauge-value { color: #15803d; }
.cca-gauge.cca-score-mid .cca-gauge-value { color: #b45309; }
.cca-gauge.cca-score-bad .cca-gauge-value { color: #b91c1c; }

.cca-criteria-list { display: flex; flex-direction: column; gap: 8px; }
.cca-criterion {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
}
.cca-criterion-title { font-weight: 600; color: var(--gray-900); font-size: 0.92rem; overflow-wrap: anywhere; }
.cca-criterion-note { color: var(--gray-600); font-size: 0.85rem; margin-top: 3px; }
.cca-criterion-quote {
    font-style: italic; color: var(--gray-500);
    background: var(--gray-50); padding: 6px 10px;
    border-left: 2px solid var(--gray-300); margin-top: 6px;
    font-size: 0.82rem;
    border-radius: 0 4px 4px 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.cca-criterion-unverified::before {
    content: "⚠️ ";
    font-size: 0.85rem;
}
.cca-criterion-score {
    font-weight: 700; font-size: 1rem;
    padding: 4px 10px; border-radius: 6px;
    min-width: 50px; text-align: center; align-self: flex-start;
}

.cca-strengths, .cca-improvements, .cca-suggestions {
    display: flex; flex-direction: column; gap: 8px;
}
.cca-bullet {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    padding: 12px 14px;
}
.cca-bullet-strength { border-left: 3px solid var(--success); }
.cca-bullet-improvement { border-left: 3px solid var(--warning); }
.cca-bullet-suggestion { border-left: 3px solid var(--primary-500); }
.cca-bullet-text { font-size: 0.9rem; color: var(--gray-800); line-height: 1.5; overflow-wrap: anywhere; word-break: break-word; }
.cca-bullet-example {
    background: var(--primary-50); border-radius: 6px;
    padding: 6px 10px; margin-top: 6px;
    font-size: 0.85rem; color: #0c4a6e;
    overflow-wrap: anywhere;
}
.cca-bullet-example::before { content: "💡 "; }

/* === Standarde list === */
.cca-standards-toolbar {
    display: flex; gap: 10px; flex-wrap: wrap;
    margin-bottom: 16px;
}
.cca-standard-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: 14px 18px;
    margin-bottom: 10px;
    display: grid;
    grid-template-columns: 40px 1fr auto;
    gap: 14px;
    align-items: start;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.cca-standard-card:hover { box-shadow: var(--shadow-sm); border-color: var(--gray-300); }
.cca-standard-card.inactive { opacity: 0.55; }
.cca-standard-order {
    background: var(--primary-50);
    color: var(--primary-700);
    border-radius: 50%;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem;
}
.cca-standard-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cca-standard-title { font-weight: 600; color: var(--gray-900); overflow-wrap: anywhere; }
.cca-standard-desc { color: var(--gray-600); font-size: 0.88rem; overflow-wrap: anywhere; }
.cca-standard-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: 0.8rem; color: var(--gray-500); margin-top: 4px; }
.cca-standard-tag {
    background: var(--primary-100); color: var(--primary-800);
    padding: 2px 8px; border-radius: 6px;
    font-size: 0.75rem;
}
.cca-standard-actions { display: flex; gap: 6px; }
.cca-standard-actions button {
    background: transparent; border: 1px solid var(--gray-300);
    padding: 6px 12px; border-radius: 6px;
    cursor: pointer; font-size: 0.82rem;
    color: var(--gray-600);
    min-height: 36px;
    display: inline-flex; align-items: center; justify-content: center; gap: 4px;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.cca-standard-actions button:hover { background: var(--gray-100); color: var(--gray-900); }
.cca-standard-actions .cca-btn-danger { color: #dc2626; }
.cca-standard-actions .cca-btn-danger:hover { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }

/* === Form general === */
.cca-form-row {
    display: flex; flex-direction: column; gap: 6px;
    margin-bottom: 16px;
}
.cca-form-row label {
    font-size: 0.85rem; color: var(--gray-700); font-weight: 600;
}
.cca-form-row input[type="text"],
.cca-form-row input[type="number"],
.cca-form-row textarea,
.cca-form-row select {
    padding: 10px 12px;
    min-height: 44px;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    font-size: 0.9rem;
    background: #fff;
    color: var(--gray-800);
    font-family: inherit;
}
.cca-form-row textarea { resize: vertical; min-height: 64px; }
.cca-form-row-check { display: flex; gap: 6px; align-items: center; font-weight: normal; }
.cca-form-row-checks { display: flex; gap: 18px; flex-wrap: wrap; }
.cca-form-row-2col {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.cca-form-actions {
    display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap;
    margin-top: 18px; padding-top: 16px;
    border-top: 1px solid var(--gray-200);
}

.cca-template-card {
    background: #fff;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: 16px 18px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.cca-template-card:hover {
    border-color: var(--primary-500);
    box-shadow: var(--shadow-md);
}
.cca-template-label { font-weight: 700; color: var(--gray-900); font-size: 1rem; }
.cca-template-desc { color: var(--gray-600); font-size: 0.88rem; margin-top: 4px; }
.cca-template-meta { color: var(--gray-500); font-size: 0.82rem; margin-top: 8px; }

.cca-info-banner {
    background: var(--primary-50);
    border-left: 3px solid var(--primary-500);
    padding: 12px 16px;
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
    margin-bottom: 14px;
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--gray-800);
}
.cca-warn-banner {
    background: var(--warning-bg);
    border-left: 3px solid var(--warning);
    padding: 12px 16px;
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
    margin-bottom: 14px;
    font-size: 0.88rem;
    line-height: 1.5;
    color: #78350f;
}
.cca-err-banner {
    background: var(--error-bg);
    border-left: 3px solid var(--error);
    padding: 12px 16px;
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
    margin-bottom: 14px;
    font-size: 0.88rem;
    line-height: 1.5;
    color: #7f1d1d;
}

/* =====================================================
   CCA — Responsive (tablet + phone)
   ===================================================== */
@media (max-width: 768px) {
    /* Ultima acțiune/close să nu stea sub bara de navigare de jos (80px) */
    .cca-modal-body { padding-bottom: 88px; }
    .cca-overall-score { gap: 14px; padding: 16px; }
    .cca-gauge { width: 92px; height: 92px; }
    .cca-gauge-inner { width: 70px; height: 70px; }
    .cca-gauge-value { font-size: 1.7rem; }
}

@media (max-width: 640px) {
    .cca-modal-overlay { padding: 6px; align-items: flex-start; }
    .cca-modal { max-width: 100%; max-height: 100vh; border-radius: 0; }
    .cca-call-card { grid-template-columns: 1fr; }
    .cca-call-status { align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
    .cca-detail-meta { grid-template-columns: 1fr; }
    .cca-form-row-2col { grid-template-columns: 1fr; }

    /* Criteriu: scorul coboară sub text */
    .cca-criterion { grid-template-columns: 1fr; }
    .cca-criterion-score { align-self: flex-start; }

    /* Standard: numărul + text pe un rând, acțiuni pe rândul de jos, full-width */
    .cca-standard-card { grid-template-columns: 32px 1fr; }
    .cca-standard-actions { grid-column: 1 / -1; flex-wrap: wrap; }
    .cca-standard-actions button { flex: 1 1 auto; min-height: 44px; }
}

@media (max-width: 480px) {
    .cca-filters { flex-direction: column; align-items: stretch; }
    .cca-filters input[type="text"],
    .cca-filters select {
        width: 100%;
        min-width: 0;
        flex: none;
    }
    #crmCallAnalysisSection .crm-btn-primary,
    #crmCallAnalysisSection .crm-btn-secondary { width: 100%; }
    .cca-standards-toolbar { flex-direction: column; align-items: stretch; }
    .cca-overall-score { flex-direction: column; text-align: center; align-items: center; }
    .cca-form-actions { flex-direction: column-reverse; }
    .cca-form-actions .crm-btn-primary,
    .cca-form-actions .crm-btn-secondary { width: 100%; }
}


/* =====================================================
   QUEUE FILTERS PANEL — Coada Mea filtre
   Light theme — integrat cu designul existent
   ===================================================== */

.queue-filters-panel {
    background: #ffffff;
    border-radius: var(--border-radius, 12px);
    padding: 16px 18px;
    margin-bottom: 16px;
    border: 1px solid var(--gray-200, #e5e7eb);
    box-shadow: var(--shadow, 0 1px 3px rgba(0,0,0,0.1));
}

/* ── Rândul 1: Search + meta ── */
.queue-filters-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.queue-filters-row--top {
    margin-bottom: 10px;
}

.queue-filter-search-wrap {
    flex: 1;
    min-width: 200px;
    position: relative;
    display: flex;
    align-items: center;
}

.queue-filter-search-icon {
    position: absolute;
    left: 10px;
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 1;
    color: var(--gray-400, #9ca3af);
}

.queue-filter-search {
    width: 100%;
    padding: 9px 36px 9px 34px;
    background: #ffffff !important;
    border: 1px solid var(--gray-300, #d1d5db) !important;
    border-radius: var(--border-radius-sm, 8px) !important;
    color: var(--gray-900, #111827) !important;
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.queue-filter-search:focus {
    border-color: var(--primary-400, #60a5fa) !important;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1) !important;
}

.queue-filter-search::placeholder {
    color: var(--gray-400, #9ca3af) !important;
}

.queue-filter-search-clear {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: var(--gray-400, #9ca3af);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 2px 4px;
    line-height: 1;
    border-radius: 4px;
    transition: color 0.15s;
}
.queue-filter-search-clear:hover { color: var(--error, #ef4444); }

.queue-filters-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.queue-count-badge {
    background: var(--primary-50, #eff6ff);
    color: var(--primary-700, #1d4ed8);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    border: 1px solid var(--primary-200, #bfdbfe);
    white-space: nowrap;
}

.queue-filter-reset-btn {
    background: var(--error-bg, #fee2e2);
    color: var(--error, #ef4444);
    border: 1px solid var(--error, #ef4444);
    border-radius: var(--border-radius-sm, 8px);
    padding: 5px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.queue-filter-reset-btn:hover {
    background: var(--error, #ef4444);
    color: #ffffff;
}

/* ── Toggle expand ── */
.queue-filters-row--toggle {
    margin-bottom: 0;
}

.queue-filter-expand-btn {
    background: var(--gray-50, #f9fafb);
    border: 1px solid var(--gray-300, #d1d5db);
    border-radius: var(--border-radius-sm, 8px);
    color: var(--gray-600, #4b5563);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 6px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
}
.queue-filter-expand-btn:hover {
    background: var(--primary-50, #eff6ff);
    border-color: var(--primary-400, #60a5fa);
    color: var(--primary-600, #2563eb);
}

.queue-filter-active-dot {
    width: 7px;
    height: 7px;
    background: var(--primary-500, #3b82f6);
    border-radius: 50%;
    display: inline-block;
}

/* ── Panel avansat colapsabil ── */
.queue-filters-advanced {
    display: none;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--gray-200, #e5e7eb);
    flex-direction: column;
    gap: 14px;
}

.queue-filters-advanced.expanded {
    display: flex;
}

/* ── Grup de filtru ── */
.queue-filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.queue-filter-label {
    color: var(--gray-500, #6b7280);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Grid 3 coloane pentru select-uri ── */
.queue-filter-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 640px) {
    .queue-filter-grid {
        grid-template-columns: 1fr;
    }
}

.queue-filter-select {
    background: #ffffff !important;
    border: 1px solid var(--gray-300, #d1d5db) !important;
    border-radius: var(--border-radius-sm, 8px) !important;
    color: var(--gray-900, #111827) !important;
    font-size: 0.85rem;
    padding: 8px 10px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
    width: 100%;
}
.queue-filter-select:focus {
    border-color: var(--primary-400, #60a5fa) !important;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1) !important;
}

/* ── Chips status ── */
.queue-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.queue-filter-chip {
    background: var(--gray-100, #f3f4f6);
    border: 1px solid var(--gray-300, #d1d5db);
    border-radius: 20px;
    color: var(--gray-700, #374151);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 11px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.queue-filter-chip:hover {
    background: var(--primary-50, #eff6ff);
    border-color: var(--primary-400, #60a5fa);
    color: var(--primary-700, #1d4ed8);
}

.queue-filter-chip.active {
    font-weight: 700;
    /* culoarea vine din JS inline style cu culoarea statusului */
}

/* ── Date range ── */
.queue-filter-date-range {
    display: flex;
    align-items: center;
    gap: 8px;
}

.queue-filter-date {
    background: #ffffff !important;
    border: 1px solid var(--gray-300, #d1d5db) !important;
    border-radius: var(--border-radius-sm, 8px) !important;
    color: var(--gray-900, #111827) !important;
    font-size: 0.85rem;
    padding: 8px 10px;
    outline: none;
    transition: border-color 0.2s;
    flex: 1;
    min-width: 0;
}
.queue-filter-date:focus {
    border-color: var(--primary-400, #60a5fa) !important;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1) !important;
}

.queue-filter-date-sep {
    color: var(--gray-400, #9ca3af);
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* ── Card callback depășit ── */
.crm-queue-card.overdue {
    border-color: var(--error, #ef4444) !important;
    box-shadow: 0 0 0 2px rgba(239,68,68,0.12) !important;
}

.overdue-text {
    color: var(--error, #ef4444) !important;
    font-weight: 600;
}

/* ── CRM Reminders (Apelurile mele programate) ── */
.crm-reminders-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.crm-reminders-pill {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #64748b;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.crm-reminders-pill:hover {
    border-color: #cbd5e1;
    color: #475569;
}

.crm-reminders-pill.active {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #2563eb;
    font-weight: 600;
}

.crm-reminders-list-panel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px;
    min-height: 200px;
}

.crm-reminders-group {
    margin-bottom: 24px;
}

.crm-reminders-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.crm-reminders-group-header.overdue { color: #dc2626; }
.crm-reminders-group-header.today { color: #2563eb; }
.crm-reminders-group-header.future { color: #475569; }
.crm-reminders-group-header.neutral { color: #64748b; }

.crm-reminders-group-count {
    background: #e2e8f0;
    color: #64748b;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
}

.crm-reminders-week-label {
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 600;
    margin: 12px 0 8px;
    padding-left: 4px;
}

.crm-reminders-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.crm-reminder-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-left: 3px solid var(--reminder-accent, #64748b);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.crm-reminder-card.is-overdue {
    border-color: #fecaca;
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.15);
}

.crm-reminder-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.crm-reminder-card-main {
    flex: 1;
    min-width: 200px;
}

.crm-reminder-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.crm-reminder-type-badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.crm-reminder-time {
    color: #475569;
    font-weight: 600;
    font-size: 0.9rem;
}

.crm-reminder-time.overdue {
    color: #dc2626;
}

.crm-reminder-tenant-tag {
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

.crm-reminder-lead-name {
    color: #1e293b;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 2px;
}

.crm-reminder-phone,
.crm-reminder-notes {
    color: #64748b;
    font-size: 0.85rem;
}

.crm-reminder-notes {
    margin-top: 6px;
    font-style: italic;
}

.crm-reminder-ai-tag {
    color: #2563eb;
    font-size: 0.7rem;
    margin-top: 4px;
}

.crm-reminder-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.crm-reminder-action-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: none;
}

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

.crm-reminder-action-btn.call {
    background: #059669;
    border-color: #059669;
    color: #fff;
    font-weight: 600;
}

.crm-reminder-action-btn.call:hover {
    background: #047857;
}

.crm-reminder-action-btn.done {
    background: #eff6ff;
    border: 1px solid #3b82f6;
    color: #2563eb;
}

.crm-reminder-action-btn.icon-only {
    padding: 6px 8px;
    min-width: 32px;
}

.crm-reminder-status-line {
    color: #64748b;
    font-size: 0.8rem;
}

.crm-reminder-status-line strong {
    color: #1e293b;
    font-weight: 600;
}

.crm-reminders-empty {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.crm-reminders-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.crm-reminders-empty-title {
    color: #1e293b;
    font-size: 1rem;
    margin-bottom: 6px;
    font-weight: 600;
}

.crm-reminders-empty-desc {
    font-size: 0.85rem;
    max-width: 420px;
    margin: 0 auto;
    color: #64748b;
}

.crm-reminder-snooze-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.crm-reminder-snooze-preset {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.crm-reminder-snooze-preset:hover {
    border-color: #cbd5e1;
    background: #e2e8f0;
}

.crm-reminder-snooze-preset.active {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #2563eb;
    font-weight: 600;
}

/* ── CRM Reminders — Mobile responsive ── */
@media (max-width: 640px) {
    .crm-reminders-list-panel {
        padding: 10px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        border-radius: 8px;
    }

    .crm-reminders-pills {
        gap: 4px;
    }

    .crm-reminders-pill {
        padding: 9px 12px;
        font-size: 0.85rem;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .crm-reminder-card {
        padding: 12px 10px;
        width: 100%;
        box-sizing: border-box;
    }

    .crm-reminder-card-top {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .crm-reminder-card-main {
        min-width: 0;
    }

    .crm-reminder-card-meta {
        gap: 6px;
    }

    .crm-reminder-lead-name {
        font-size: 1rem;
    }

    .crm-reminder-time {
        font-size: 0.85rem;
    }

    .crm-reminder-phone,
    .crm-reminder-notes {
        font-size: 0.85rem;
    }

    .crm-reminder-actions {
        width: 100%;
        justify-content: flex-start;
        gap: 8px;
    }

    .crm-reminder-action-btn {
        min-height: 44px;
        min-width: 44px;
        font-size: 0.9rem;
        padding: 10px 14px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
    }

    .crm-reminder-action-btn.icon-only {
        padding: 10px;
        min-width: 44px;
    }

    .crm-reminder-action-btn.call {
        flex: 1 1 auto;
        justify-content: center;
    }

    .crm-reminders-group-header {
        font-size: 0.8rem;
    }

    .crm-reminder-snooze-presets {
        gap: 6px;
    }

    .crm-reminder-snooze-preset {
        min-height: 44px;
        display: flex;
        align-items: center;
        padding: 10px 14px;
        font-size: 0.9rem;
    }
}

/* ── CRM Formulare (admin) — light theme, scoped ── */
#crmFormsSection {
    background: #f8fafc !important;
}

#crmFormsSection .crm-forms-root {
    max-width: 1200px;
    margin: 0 auto;
}

#crmFormsSection .crm-forms-loading {
    text-align: center;
    color: #64748b;
    padding: 40px 20px;
    font-size: 0.9rem;
}

#crmFormsSection .crm-forms-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
}

#crmFormsSection .crm-forms-header--compact {
    margin-bottom: 16px;
}

#crmFormsSection .crm-forms-title {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: #1e293b !important;
    line-height: 1.3;
}

#crmFormsSection .crm-forms-subtitle {
    margin: 6px 0 0;
    color: #64748b !important;
    font-size: 0.85rem;
    max-width: 560px;
    line-height: 1.5;
}

#crmFormsSection .crm-forms-readonly-hint {
    color: #64748b !important;
    font-size: 0.85rem;
    align-self: center;
}

#crmFormsSection .crm-forms-header-btn,
#crmFormsSection .crm-forms-save-btn,
#crmFormsSection .crm-forms-empty-cta {
    min-height: 44px;
}

#crmFormsSection .crm-forms-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 14px 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

#crmFormsSection .crm-forms-toolbar-label {
    color: #475569 !important;
    font-size: 0.85rem;
    font-weight: 600;
    flex-shrink: 0;
}

#crmFormsSection .crm-forms-select,
#crmFormsSection .crm-forms-input {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #1e293b !important;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.9rem;
    width: 100%;
    min-height: 44px;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}

#crmFormsSection .crm-forms-select {
    flex: 1;
    min-width: 200px;
    max-width: 360px;
    cursor: pointer;
}

#crmFormsSection .crm-forms-input:focus,
#crmFormsSection .crm-forms-select:focus {
    outline: none;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

#crmFormsSection .crm-forms-input:disabled,
#crmFormsSection .crm-forms-select:disabled {
    background: #f8fafc !important;
    color: #64748b !important;
    cursor: not-allowed;
}

#crmFormsSection .crm-forms-input[readonly] {
    background: #f8fafc !important;
    color: #475569 !important;
}

#crmFormsSection .crm-forms-list-panel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    min-height: 120px;
}

#crmFormsSection .crm-forms-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#crmFormsSection .crm-forms-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

#crmFormsSection .crm-forms-card-main {
    flex: 1;
    min-width: 200px;
}

#crmFormsSection .crm-forms-card-top {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

#crmFormsSection .crm-forms-card-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b !important;
}

#crmFormsSection .crm-forms-card-slug {
    margin: 0 0 6px;
    font-size: 0.8rem;
    color: #64748b !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

#crmFormsSection .crm-forms-card-meta {
    margin: 0;
    font-size: 0.85rem;
    color: #64748b !important;
}

#crmFormsSection .crm-forms-status {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

#crmFormsSection .crm-forms-status--active {
    background: #dcfce7;
    color: #15803d !important;
    border: 1px solid #bbf7d0;
}

#crmFormsSection .crm-forms-status--draft {
    background: #fef9c3;
    color: #a16207 !important;
    border: 1px solid #fde68a;
}

#crmFormsSection .crm-forms-status--closed {
    background: #f1f5f9;
    color: #64748b !important;
    border: 1px solid #e2e8f0;
}

#crmFormsSection .crm-forms-category-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    background: #eef2ff;
    color: #4338ca !important;
    border: 1px solid #c7d2fe;
}

#crmFormsSection .crm-forms-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

#crmFormsSection .crm-forms-action-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569 !important;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    min-height: 44px;
    transition: background 0.15s, border-color 0.15s;
}

#crmFormsSection .crm-forms-action-btn:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

#crmFormsSection .crm-forms-action-btn--danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626 !important;
}

#crmFormsSection .crm-forms-action-btn--danger:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

#crmFormsSection .crm-forms-empty {
    text-align: center;
    padding: 48px 20px;
}

#crmFormsSection .crm-forms-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

#crmFormsSection .crm-forms-empty-title {
    color: #1e293b !important;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 6px;
}

#crmFormsSection .crm-forms-empty-desc {
    color: #64748b !important;
    font-size: 0.85rem;
    max-width: 420px;
    margin: 0 auto 16px;
    line-height: 1.5;
}

#crmFormsSection .crm-forms-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

#crmFormsSection .crm-forms-editor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

#crmFormsSection .crm-forms-panel {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

#crmFormsSection .crm-forms-panel--share {
    position: sticky;
    top: 16px;
}

/* Secțiunea stă ÎN .main-content (care derulează). `.content-section` o face container de scroll
   (overflow: hidden auto) fără înălțime limitată ⇒ `sticky` de mai sus s-ar raporta la ea și n-ar mai
   „ține”. `clip` taie tot orizontal, dar nu creează container de scroll. */
#crmFormsSection {
    overflow-x: clip;
    overflow-y: visible;
}

#crmFormsSection .crm-forms-panel-title {
    margin: 0 0 16px;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b !important;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

#crmFormsSection .crm-forms-panel-title--sub {
    margin-top: 20px;
}

#crmFormsSection .crm-forms-field {
    margin-bottom: 14px;
}

#crmFormsSection .crm-forms-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #475569 !important;
}

#crmFormsSection .crm-forms-field--checkbox label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    color: #1e293b !important;
}

#crmFormsSection .crm-forms-field--inline {
    display: flex;
    align-items: center;
    gap: 12px;
}

#crmFormsSection .crm-forms-field--inline label {
    margin-bottom: 0;
    flex-shrink: 0;
}

#crmFormsSection .crm-forms-color {
    width: 56px;
    height: 44px;
    padding: 4px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    background: #ffffff;
}

#crmFormsSection .crm-forms-hint {
    color: #64748b !important;
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.5;
}

#crmFormsSection .crm-forms-copy-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

#crmFormsSection .crm-forms-copy-row .crm-forms-input {
    flex: 1;
    min-width: 160px;
}

#crmFormsSection .crm-forms-copy-row .crm-btn {
    min-height: 44px;
    flex-shrink: 0;
    text-decoration: none;
    justify-content: center;
}

#crmFormsSection .crm-forms-save-row {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

#crmFormsSection .crm-forms-save-btn {
    width: 100%;
    justify-content: center;
}

#crmFormsSection .crm-forms-fields-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

#crmFormsSection .crm-forms-field-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px;
}

#crmFormsSection .crm-forms-field-card-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto auto;
    gap: 8px;
    align-items: center;
}

#crmFormsSection .crm-forms-field-req-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #475569 !important;
    white-space: nowrap;
    cursor: pointer;
    min-height: 44px;
}

#crmFormsSection .crm-forms-field-del {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626 !important;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    flex-shrink: 0;
    transition: background 0.15s;
}

#crmFormsSection .crm-forms-field-del:hover {
    background: #fee2e2;
}

#crmFormsSection .crm-forms-field-move-up,
#crmFormsSection .crm-forms-field-move-down {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
    width: 36px;
    height: 44px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    flex-shrink: 0;
    transition: background 0.15s;
}

#crmFormsSection .crm-forms-field-move-up:hover,
#crmFormsSection .crm-forms-field-move-down:hover {
    background: #eef2f7;
}

#crmFormsSection .crm-forms-field-move-up:disabled,
#crmFormsSection .crm-forms-field-move-down:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

#crmFormsSection .crm-forms-field-card .cf-field-options {
    margin-top: 8px;
}

#crmFormsSection .crm-forms-add-field-btn {
    width: 100%;
    justify-content: center;
    min-height: 44px;
}

#crmFormsSection .crm-btn {
    min-height: 44px;
}

#crmFormsSection .error-text {
    color: #dc2626 !important;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 12px 16px;
}

/* Submissions */
#crmFormsSection .crm-forms-subs-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#crmFormsSection .crm-forms-subs-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
}

#crmFormsSection .crm-forms-subs-card-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid #f1f5f9;
}

#crmFormsSection .crm-forms-subs-card-row:last-child {
    border-bottom: none;
}

#crmFormsSection .crm-forms-subs-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b !important;
    flex-shrink: 0;
}

#crmFormsSection .crm-forms-subs-value {
    font-size: 0.9rem;
    color: #1e293b !important;
    text-align: right;
    word-break: break-word;
}

#crmFormsSection .crm-forms-subs-lead-link {
    color: #2563eb !important;
    font-weight: 600;
    text-decoration: none;
}

#crmFormsSection .crm-forms-subs-lead-link:hover {
    text-decoration: underline;
}

#crmFormsSection .crm-forms-subs-muted {
    color: #94a3b8 !important;
}

/* Header actions (formulare primite nav + buton nou) */
#crmFormsSection .crm-forms-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Inbox formulare primite */
#crmFormsSection .crm-forms-inbox-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

#crmFormsSection .crm-forms-inbox-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 20px;
    min-width: 90px;
}

#crmFormsSection .crm-forms-inbox-stat__value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e293b !important;
}

#crmFormsSection .crm-forms-inbox-stat__label {
    font-size: 0.75rem;
    color: #64748b !important;
}

#crmFormsSection .crm-forms-inbox-filters {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

#crmFormsSection .crm-forms-inbox-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

#crmFormsSection .crm-forms-inbox-tab {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569 !important;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

#crmFormsSection .crm-forms-inbox-tab:hover {
    background: #e2e8f0;
}

#crmFormsSection .crm-forms-inbox-tab--active {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff !important;
}

#crmFormsSection .crm-forms-inbox-today-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #475569 !important;
    cursor: pointer;
}

#crmFormsSection .crm-forms-inbox-category-filter {
    display: flex;
    align-items: center;
    gap: 6px;
}

#crmFormsSection .crm-forms-inbox-category-label {
    font-size: 0.8rem;
    color: #64748b !important;
    font-weight: 500;
}

#crmFormsSection .crm-forms-inbox-card .crm-forms-inbox-status-select {
    min-height: 32px;
    padding: 4px 8px;
    width: auto;
}

#crmFormsSection .crm-forms-inbox-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 16px;
}

#crmFormsSection .crm-forms-inbox-pagination__label {
    font-size: 0.85rem;
    color: #64748b !important;
}

@media (max-width: 900px) {
    #crmFormsSection .crm-forms-editor-grid {
        grid-template-columns: 1fr;
    }

    #crmFormsSection .crm-forms-panel--share {
        position: static;
    }
}

@media (max-width: 640px) {
    #crmFormsSection .crm-forms-header {
        flex-direction: column;
        align-items: stretch;
    }

    #crmFormsSection .crm-forms-header-btn,
    #crmFormsSection .crm-btn {
        width: 100%;
        justify-content: center;
    }

    #crmFormsSection .crm-forms-header-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    #crmFormsSection .crm-forms-inbox-filters {
        flex-direction: column;
        align-items: stretch;
    }

    #crmFormsSection .crm-forms-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    #crmFormsSection .crm-forms-select {
        max-width: none;
    }

    #crmFormsSection .crm-forms-card {
        flex-direction: column;
    }

    #crmFormsSection .crm-forms-card-actions {
        width: 100%;
    }

    #crmFormsSection .crm-forms-action-btn {
        flex: 1;
        min-width: calc(50% - 4px);
        justify-content: center;
        text-align: center;
    }

    #crmFormsSection .crm-forms-field-card-row {
        grid-template-columns: 1fr;
    }

    #crmFormsSection .crm-forms-copy-row {
        flex-direction: column;
    }

    #crmFormsSection .crm-forms-copy-row .crm-btn {
        width: 100%;
    }

    #crmFormsSection .crm-forms-subs-card-row {
        flex-direction: column;
        gap: 4px;
    }

    #crmFormsSection .crm-forms-subs-value {
        text-align: left;
    }
}

/* Jurnal activități — dark CRM surfaces (#crmLeadModal, pipeline compact body) */
#crmLeadModal .crm-lead-journal-card,
.lead-modal-body .crm-lead-journal-card {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}

#crmLeadModal .crm-lead-journal-card__type,
.lead-modal-body .crm-lead-journal-card__type {
    color: #f1f5f9;
}

#crmLeadModal .crm-lead-journal-card__body,
.lead-modal-body .crm-lead-journal-card__body {
    background: rgba(15, 23, 42, 0.5);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

#crmLeadModal .crm-lead-journal-form,
.lead-modal-body .crm-lead-journal-form {
    background: rgba(15, 23, 42, 0.4);
    border-color: rgba(255, 255, 255, 0.12);
}

#crmLeadModal .crm-lead-journal-form__select,
#crmLeadModal .crm-lead-journal-form__textarea,
.lead-modal-body .crm-lead-journal-form__select,
.lead-modal-body .crm-lead-journal-form__textarea {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(255, 255, 255, 0.15);
    color: #f1f5f9;
}

#crmLeadModal .crm-lead-activity-section__title,
#crmLeadModal .crm-lead-activity-section__hint,
.lead-modal-body .crm-lead-activity-section__title {
    color: #e2e8f0;
}

/* Formulare completate — dark CRM surfaces (#crmLeadModal, pipeline compact body) */
#crmLeadModal .crm-lead-forms-card,
.lead-modal-body .crm-lead-forms-card {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}

#crmLeadModal .crm-lead-forms-card__name,
.lead-modal-body .crm-lead-forms-card__name {
    color: #f1f5f9;
}

#crmLeadModal .crm-lead-forms-card__date,
.lead-modal-body .crm-lead-forms-card__date {
    color: #94a3b8;
}
@media (max-width: 768px) {
    /* Table responsive - Card Layout for Leads */
    .crm-pipeline-view .crm-table.crm-leads-table {
        display: block;
        width: 100%;
        min-width: unset;
        border: none;
        background: transparent;
    }
    
    .crm-pipeline-view .crm-table.crm-leads-table thead {
        display: none;
    }
    
    .crm-pipeline-view .crm-table.crm-leads-table tbody {
        display: block;
    }
    
    .crm-pipeline-view .crm-table.crm-leads-table tr {
        display: flex;
        flex-direction: column;
        background: var(--card-bg, #fff);
        margin-bottom: 16px;
        border-radius: 12px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
        border: 1px solid var(--border-color, #e2e8f0);
        padding: 12px;
        position: relative;
    }
    
    .crm-pipeline-view .crm-table.crm-leads-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 4px;
        border-bottom: 1px solid var(--border-color, #f1f5f9);
        text-align: right;
        font-size: 14px;
        white-space: normal;
    }
    
    .crm-pipeline-view .crm-table.crm-leads-table td:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }
    
    .crm-pipeline-view .crm-table.crm-leads-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-color, #64748b);
        text-align: left;
        margin-right: 15px;
        text-transform: uppercase;
        font-size: 11px;
        letter-spacing: 0.5px;
    }

    /* Custom layout for specific columns in card view */
    .crm-pipeline-view .crm-table.crm-leads-table td.crm-bulk-td {
        justify-content: flex-end;
        position: absolute;
        top: 12px;
        right: 12px;
        border: none;
        padding: 0;
        width: auto;
        background: transparent !important;
        box-shadow: none !important;
    }
    .crm-pipeline-view .crm-table.crm-leads-table td.crm-bulk-td::before {
        display: none;
    }
    
    .crm-pipeline-view .crm-table.crm-leads-table td.lead-name {
        padding-top: 0;
        padding-right: 40px; /* space for absolute checkbox */
        justify-content: flex-start;
        font-size: 16px;
    }
    .crm-pipeline-view .crm-table.crm-leads-table td.lead-name::before {
        display: none;
    }

    .crm-pipeline-view .crm-table.crm-leads-table td.lead-actions {
        justify-content: flex-end;
        gap: 8px;
        flex-wrap: wrap;
    }
    .crm-pipeline-view .crm-table.crm-leads-table td.lead-actions::before {
        display: none; /* hide "Acțiuni" label */
    }
}

/* Refined Mobile Card Layout & Full Width Fixes */
@media (max-width: 768px) {
    /* Eliminate main-content padding when CRM is visible to get true edge-to-edge
       (`.active`, nu `:not(.hidden)` — vezi light-theme.css; jos rămâne locul barei de navigare) */
    body:has(#crmPipelineDashboardSection.active) .main-content {
        padding: 0 0 calc(80px + env(safe-area-inset-bottom, 0px)) !important;
    }

    /* SECTION CONTAINER - Remove top padding/margin and stretch edge to edge */
    #crmPipelineDashboardSection {
        margin: 0 !important;
        padding: 8px !important;
        padding-top: 4px !important;
        padding-bottom: 100px !important;
        min-height: 100vh;
        width: 100%;
        box-sizing: border-box;
    }
    
    .crm-pipeline-view .crm-table.crm-leads-table tr {
        margin-left: -8px !important;
        margin-right: -8px !important;
        margin-bottom: 8px !important;
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
        padding: 10px !important;
        gap: 2px; /* tighter spacing between rows inside the card */
    }
    
    .crm-pipeline-view .crm-table.crm-leads-table td {
        padding: 3px 0 !important;
        font-size: 13px !important;
    }
    
    .crm-pipeline-view .crm-table.crm-leads-table td.lead-name {
        font-size: 15px !important;
        padding-bottom: 4px !important;
        font-weight: 700;
    }
    
    .crm-pipeline-view .crm-table.crm-leads-table td::before {
        font-size: 10.5px !important;
        opacity: 0.8;
    }
    
    /* Make the action buttons span full width of the card */
    .crm-pipeline-view .crm-table.crm-leads-table td.lead-actions {
        padding-top: 10px !important;
        margin-top: 4px;
        border-top: 1px dashed var(--border-color, #e2e8f0);
        justify-content: stretch !important;
    }
    
    .crm-pipeline-view .crm-table.crm-leads-table td.lead-actions .btn {
        flex: 1;
        text-align: center;
        justify-content: center;
        padding: 10px !important;
    }

    /* Filters section */
    .crm-filters-pipeline {
        margin-bottom: 12px;
    }
}

.crm-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 188, 212, 0.12);
    border: 1px solid rgba(0, 188, 212, 0.28);
    color: #006064;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
    margin: 2px 4px 2px 0;
}

.crm-tag-chip-remove {
    border: none;
    background: transparent;
    color: #546e7a;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0 2px;
}

.crm-lead-tags-inline { margin-top: 4px; }
.crm-tags-editor-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; min-height: 24px; }

.crm-tag-filter-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex: 1 1 220px;
}

.crm-tag-filter-group input[type="text"] { flex: 1; min-width: 120px; }
.crm-tag-filter-group select { min-width: 130px; }

/* Filtre CRM Pipeline: categorie formular + formular neîncompletat */
.crm-form-category-filter-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.crm-form-category-filter-group select { min-width: 200px; }

.crm-pending-form-filter-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}

.crm-pending-form-filter-label input[type="checkbox"] {
    cursor: pointer;
}

.crm-pending-form-filter-label.crm-filter-active {
    border-color: #6366f1;
    background: rgba(99,102,241,0.08);
    color: #a5b4fc;
    font-weight: 500;
}

/* CRM CSV Import Wizard — fullscreen modal */
#crm-csv-import-modal.modal-overlay {
    padding: 16px;
    align-items: stretch;
    justify-content: stretch;
    overflow: hidden;
}

#crm-csv-import-modal .crm-csv-import-modal {
    max-width: none;
    width: 100%;
    max-height: none;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 12px;
}

#crm-csv-import-modal .crm-csv-import-modal .modal-header,
#crm-csv-import-modal .crm-csv-import-modal .modal-footer {
    flex-shrink: 0;
}

#crm-csv-import-modal .crm-csv-import-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

#crm-csv-import-modal .crm-csv-step-actions {
    margin-top: 12px;
}

#crm-csv-import-modal .crm-csv-upload-area input[type="file"] {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    font-size: 14px;
}

.crm-csv-mapping-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px 16px;
}

.crm-csv-mapping-grid .form-group {
    margin: 0;
}

.crm-csv-mapping-grid .form-group label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.crm-csv-mapping-grid .form-group select {
    width: 100%;
    min-height: 44px;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    color: #1e293b;
    box-sizing: border-box;
}

.crm-csv-preview-scroll {
    margin-top: 12px;
    overflow-x: auto;
    overflow-y: auto;
    max-height: min(320px, 38vh);
    -webkit-overflow-scrolling: touch;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
}

.crm-csv-preview-scroll .crm-table {
    min-width: 520px;
    margin: 0;
    display: table !important;
    width: 100%;
    border-collapse: collapse;
}

.crm-csv-preview-scroll .crm-table thead,
.crm-csv-preview-scroll .crm-table tbody {
    display: table-row-group !important;
}

.crm-csv-preview-scroll .crm-table tr {
    display: table-row !important;
}

.crm-csv-preview-scroll .crm-table th,
.crm-csv-preview-scroll .crm-table td {
    padding: 10px 12px;
    white-space: nowrap;
    font-size: 13px;
    display: table-cell !important;
}

.crm-csv-import-progress {
    margin-top: 12px;
}

.crm-csv-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #475569;
    margin-bottom: 8px;
}

.crm-csv-progress-track {
    background: #e2e8f0;
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
}

.crm-csv-progress-bar {
    background: #2563eb;
    height: 100%;
    width: 0%;
    transition: width 0.2s ease;
}

.crm-csv-report-stats {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.crm-csv-report-stats li {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 10px;
}

#crm-csv-import-modal .crm-csv-report-details {
    margin-top: 10px;
}

#crm-csv-import-modal .crm-csv-report-details summary {
    cursor: pointer;
    font-size: 14px;
    padding: 4px 0;
}


/* --- Import CSV: titluri de pas, note de encoding, atribuire ------------- */

#crm-csv-import-modal .crm-csv-section-title {
    margin: 20px 0 6px;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    padding-bottom: 6px;
    border-bottom: 1px solid #e2e8f0;
}

.crm-csv-note {
    margin: 8px 0;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.45;
    border: 1px solid transparent;
}

.crm-csv-note-info {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #334155;
}

/* Encoding non-UTF8: semnalul care previne 1330 de nume cu diacritice stricate.
   Trebuie sa se vada, nu sa se piarda printre hint-urile gri. */
.crm-csv-note-warn {
    background: #fffbeb;
    border-color: #fcd34d;
    color: #92400e;
    font-weight: 500;
}

/* "Alte informatii" nesalvate (coloana custom_data lipseste din baza mediului).
   E o PIERDERE DE DATE, nu un avertisment de formatare: se distinge de nota de
   encoding printr-o bara rosie in stanga, ca sa nu se piarda intre celelalte
   note galbene ale raportului. */
.crm-csv-customdata-skipped {
    border-left: 4px solid #dc2626;
    background: #fef2f2;
    border-color: #fecaca;
    color: #7f1d1d;
    margin-bottom: 14px;
}

.crm-csv-customdata-skipped code {
    background: rgba(127, 29, 29, 0.08);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 12px;
    word-break: break-all;
}

#crm-csv-import-modal .crm-csv-field-note {
    display: block;
    margin-top: 4px;
    font-size: 11.5px;
    line-height: 1.4;
    color: #64748b;
}

/* Regula reala e "cel putin unul din email/telefon", nu "ambele obligatorii" —
   badge-ul spune asta explicit, in locul unui `*` care minte. */
.crm-csv-oneof-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #075985;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .02em;
    vertical-align: middle;
}

#crm-csv-import-modal .crm-csv-mapping-grid input[type="text"] {
    width: 100%;
    min-height: 44px;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    color: #1e293b;
    box-sizing: border-box;
}

/* --- "Alte informatii": checkbox-uri, nu <select multiple> -------------- */
/* Ctrl+click e o capcana pe desktop si inutilizabil pe mobil; checkbox-urile
   arata permanent ce e bifat si intra natural in grid-ul care se colapseaza. */

.crm-csv-custom-section {
    margin-top: 8px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
}

.crm-csv-custom-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.crm-csv-custom-header .crm-csv-section-title {
    margin: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.crm-csv-custom-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

#crm-csv-import-modal .crm-csv-custom-actions .btn {
    padding: 6px 10px;
    font-size: 12px;
    min-height: 36px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #334155;
    border-radius: 8px;
    cursor: pointer;
}

.crm-csv-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 4px 12px;
    margin-top: 10px;
    max-height: min(240px, 30vh);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-right: 4px;
}

.crm-csv-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 4px 6px;
    border-radius: 6px;
    font-size: 13px;
    color: #334155;
    cursor: pointer;
}

.crm-csv-checkbox:hover {
    background: #eef2f7;
}

.crm-csv-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    margin: 0;
    cursor: pointer;
}

.crm-csv-checkbox-label {
    overflow-wrap: anywhere;
}

.crm-csv-custom-count {
    margin: 8px 0 0;
    font-size: 12.5px;
    font-weight: 600;
    color: #475569;
}

.crm-csv-custom-count.is-over {
    color: #b91c1c;
}

/* --- Raport: severitati separate, reluare dupa esec partial -------------- */

.crm-csv-applied {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f1f5f9;
    font-size: 13px;
    color: #334155;
}

.crm-csv-applied ul {
    margin: 4px 0 0;
    padding-left: 18px;
}

.crm-csv-issue-list {
    margin: 8px 0 0;
    padding-left: 0;
    list-style: none;
    max-height: min(260px, 32vh);
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.5;
}

.crm-csv-issue-list li {
    padding: 5px 8px;
    border-left: 3px solid transparent;
    border-radius: 0 6px 6px 0;
    margin-bottom: 3px;
    overflow-wrap: anywhere;
}

/* Rand SARIT (nu a intrat) vs rand IMPORTAT cu un camp pierdut: lucruri
   diferite pentru operator, deci si vizual diferite. */
.crm-csv-issue-list.is-error li {
    background: #fef2f2;
    border-left-color: #dc2626;
    color: #7f1d1d;
}

.crm-csv-issue-list.is-warning li {
    background: #fffbeb;
    border-left-color: #f59e0b;
    color: #92400e;
}

.crm-csv-issue-row {
    font-weight: 700;
    margin-right: 4px;
}

#crm-csv-import-modal #crm-csv-export-issues {
    margin-top: 10px;
    padding: 8px 12px;
    font-size: 13px;
    min-height: 40px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #334155;
    border-radius: 8px;
    cursor: pointer;
}

.crm-csv-resume {
    margin-top: 14px;
    padding: 12px;
    border: 1px solid #fcd34d;
    background: #fffbeb;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.5;
    color: #78350f;
}

.crm-csv-resume p {
    margin: 0 0 8px;
}

/* --- "Alte informatii" in fisa leadului (read-only) ---------------------- */

.crm-lead-custom-data .crm-custom-data-table {
    width: 100%;
    margin-top: 8px;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed;
}

.crm-lead-custom-data .crm-custom-data-table th,
.crm-lead-custom-data .crm-custom-data-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #eef2f7;
    text-align: left;
    vertical-align: top;
    overflow-wrap: anywhere;
}

.crm-lead-custom-data .crm-custom-data-table th {
    width: 42%;
    font-weight: 600;
    color: #475569;
    background: #f8fafc;
}

.crm-lead-custom-data .crm-custom-data-table td {
    color: #0f172a;
}

.crm-custom-data-note {
    margin: 8px 0 0;
    font-size: 11.5px;
    color: #64748b;
    font-style: italic;
}

@media (max-width: 767px) {
    #crm-csv-import-modal.modal-overlay {
        padding: 0;
    }

    #crm-csv-import-modal .crm-csv-import-modal {
        width: 100vw;
        max-width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
    }

    #crm-csv-import-modal .crm-csv-import-modal .modal-header {
        border-radius: 0;
        padding: 16px 18px;
    }

    #crm-csv-import-modal .crm-csv-import-modal .modal-footer {
        border-radius: 0;
        flex-direction: column;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    }

    #crm-csv-import-modal .crm-csv-import-body {
        padding: 16px;
    }

    .crm-csv-mapping-grid {
        grid-template-columns: 1fr;
    }

    .crm-csv-checkbox-grid {
        grid-template-columns: 1fr;
        max-height: min(200px, 26vh);
    }

    .crm-csv-custom-header {
        flex-direction: column;
        align-items: stretch;
    }

    .crm-lead-custom-data .crm-custom-data-table th {
        width: 45%;
    }

    .crm-csv-preview-scroll {
        max-height: min(220px, 28vh);
    }

    .crm-csv-progress-header {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }

    .crm-csv-progress-header #crm-csv-progress-count {
        font-size: 12px;
    }

    .crm-csv-report-stats {
        grid-template-columns: 1fr;
    }

    #crm-csv-import-modal .crm-csv-step-actions,
    #crm-csv-import-modal .modal-footer .btn {
        width: 100%;
        min-height: 48px;
    }
}

@media (hover: none) and (pointer: coarse) {
    #crm-csv-import-modal .crm-csv-mapping-grid .form-group select,
    #crm-csv-import-modal .crm-csv-step-actions .btn,
    #crm-csv-import-modal .modal-footer .btn,
    #crm-csv-import-modal .modal-close-btn {
        min-height: 48px;
    }
}

/* ============================================================================
   PDF Template Builder Modal
   ============================================================================ */

.pdf-builder-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.pdf-builder-modal {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    width: 720px;
    max-width: 100%;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pdf-builder-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.pdf-builder-modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #111827;
}

.pdf-builder-close-btn {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
}

.pdf-builder-close-btn:hover {
    background: #f3f4f6;
    color: #111827;
}

.pdf-builder-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 16px;
    flex-shrink: 0;
    background: #f9fafb;
}

.pdf-tab-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    margin-bottom: -1px;
}

.pdf-tab-btn:hover {
    color: #374151;
}

.pdf-tab-btn.active {
    color: #1d4ed8;
    border-bottom-color: #1d4ed8;
    background: none;
}

.pdf-builder-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    min-height: 0;
}

.pdf-tab-panel {
    display: none;
}

.pdf-tab-panel.active {
    display: block;
}

.pdf-builder-modal-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
    background: #f9fafb;
}

.pdf-logo-radios {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}

.pdf-logo-radios label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
}

.pdf-fields-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pdf-field-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.12s;
    font-size: 13px;
}

.pdf-field-item:hover {
    background: #f0f9ff;
    border-color: #bfdbfe;
}

.pdf-field-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.pdf-field-type-badge {
    font-size: 10px;
    background: #e0e7ff;
    color: #3730a3;
    border-radius: 4px;
    padding: 2px 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.pdf-field-label {
    color: #1f2937;
    font-weight: 500;
}

@media (max-width: 760px) {
    .pdf-builder-modal {
        width: 100%;
        max-height: 95vh;
    }

    .pdf-builder-tabs {
        padding: 0 8px;
    }

    .pdf-tab-btn {
        padding: 10px 10px;
        font-size: 12px;
    }

    .pdf-builder-body {
        padding: 14px;
    }
}

/* ============================================================================
   PDF Blocks Editor — layout vizual drag-and-drop
   ============================================================================ */

.pdf-add-block-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 12px;
}

.pdf-add-block-btn {
    font-size: 13px;
    padding: 7px 14px;
    white-space: nowrap;
}

.pdf-add-block-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 200;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.13);
    min-width: 220px;
    overflow: hidden;
}

.pdf-add-block-option {
    padding: 9px 14px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    transition: background 0.1s;
    border-bottom: 1px solid #f3f4f6;
    user-select: none;
}

.pdf-add-block-option:last-child {
    border-bottom: none;
}

.pdf-add-block-option:hover {
    background: #eff6ff;
    color: #1d4ed8;
}

.pdf-blocks-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pdf-block-item {
    display: flex;
    flex-direction: column;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    transition: box-shadow 0.12s, border-color 0.12s;
    overflow: hidden;
}

.pdf-block-item.dragging {
    opacity: 0.45;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.pdf-block-item.drag-over {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px #bfdbfe;
}

.pdf-block-main-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    min-height: 40px;
}

.pdf-block-handle {
    cursor: grab;
    color: #9ca3af;
    font-size: 15px;
    padding: 2px 4px;
    flex-shrink: 0;
    user-select: none;
    line-height: 1;
}

.pdf-block-handle:active {
    cursor: grabbing;
}

.pdf-block-label {
    flex: 1;
    font-size: 13px;
    color: #1f2937;
    font-weight: 500;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pdf-block-label em {
    font-style: italic;
    color: #6b7280;
    font-weight: 400;
}

.pdf-block-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.pdf-block-edit-btn,
.pdf-block-del-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 6px;
    border-radius: 4px;
    color: #6b7280;
    transition: background 0.12s, color 0.12s;
    line-height: 1;
}

.pdf-block-edit-btn:hover {
    background: #eff6ff;
    color: #2563eb;
}

.pdf-block-del-btn:hover {
    background: #fef2f2;
    color: #dc2626;
}

.pdf-block-editor {
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    padding: 10px 12px;
}

.pdf-block-editor-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pdf-block-editor-label {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 2px;
}

.pdf-block-editor-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin-bottom: 4px;
}

.pdf-block-editor-field-check {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #374151;
    cursor: pointer;
    white-space: nowrap;
}

.pdf-block-editor-field-check input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.pdf-block-editor-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

@media (max-width: 760px) {
    .pdf-block-label {
        font-size: 12px;
    }
    .pdf-add-block-dropdown {
        min-width: 180px;
    }
}

/* ==================================================================
 * RAPORT ACTIVITATE OPERATORI (task #215)
 * Folosește variabilele de temă ale aplicației (--card-bg, --text-color,
 * --text-muted, --border-color, --primary-color) ca să prindă light + dark.
 * Culorile categoriilor sunt semantice (nu decorative) și mid-tone, lizibile
 * pe ambele fundaluri.
 * ================================================================== */
.crm-activity-toolbar{
    display:flex;gap:14px;align-items:flex-end;flex-wrap:wrap;
    background:var(--card-bg,#1e1e2e);border:1px solid var(--border-color,#2a2a3e);
    border-radius:12px;padding:14px;margin-bottom:16px;
}
.crm-activity-field{display:flex;flex-direction:column;gap:5px;min-width:0}
.crm-activity-field > label{font-size:11px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--text-muted,#888)}
.crm-activity-presets{display:inline-flex;gap:2px;background:var(--input-bg,rgba(255,255,255,.04));border:1px solid var(--border-color,#2a2a3e);border-radius:9px;padding:3px}
.crm-activity-presets button{font:inherit;font-size:12.5px;font-weight:500;color:var(--text-muted,#888);background:transparent;border:0;padding:7px 13px;border-radius:6px;cursor:pointer}
.crm-activity-presets button.active{background:var(--primary-color,#0ea5e9);color:#fff}
.crm-activity-toolbar input[type=date],.crm-activity-toolbar select{
    font:inherit;font-size:13px;color:var(--text-color,#fff);background:var(--input-bg,rgba(255,255,255,.04));
    border:1px solid var(--border-color,#2a2a3e);border-radius:8px;padding:8px 11px;min-height:38px;
}
.crm-activity-spacer{flex:1 1 30px}
.crm-activity-export{font:inherit;font-size:12.5px;font-weight:600;color:var(--primary-color,#0ea5e9);
    background:transparent;border:1px solid var(--primary-color,#0ea5e9);border-radius:8px;padding:9px 14px;cursor:pointer}
.crm-activity-export:hover{background:var(--primary-color,#0ea5e9);color:#fff}

/* KPIs */
.crmact-kpis{display:grid;grid-template-columns:repeat(5,1fr);gap:12px;margin-bottom:16px}
.crmact-kpi{background:var(--card-bg,#1e1e2e);border:1px solid var(--border-color,#2a2a3e);border-radius:12px;
    padding:14px 15px;position:relative;overflow:hidden}
.crmact-kpi::before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:var(--kpi-ac,var(--primary-color,#0ea5e9))}
.crmact-ac-brand{--kpi-ac:var(--primary-color,#0ea5e9)}
.crmact-ac-sesiune{--kpi-ac:#1E9E6A}
.crmact-ac-followup{--kpi-ac:#3FA7A0}
.crmact-ac-callback{--kpi-ac:#D6952E}
.crmact-ac-muted{--kpi-ac:var(--text-muted,#888)}
.crmact-kpi-lab{font-size:11.5px;color:var(--text-muted,#888);font-weight:500}
.crmact-kpi-val{font-size:26px;font-weight:700;margin-top:6px;letter-spacing:-.02em;color:var(--text-color,#fff);font-variant-numeric:tabular-nums}
.crmact-kpi-sub{font-size:11.5px;color:var(--text-muted,#888);margin-top:2px}

/* Panels: trend + distribution */
.crmact-grid2{display:grid;grid-template-columns:1.15fr .85fr;gap:14px;margin-bottom:16px}
.crmact-panel{background:var(--card-bg,#1e1e2e);border:1px solid var(--border-color,#2a2a3e);border-radius:12px;padding:16px}
.crmact-panel-h{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin-bottom:14px}
.crmact-panel-h h3{font-size:14px;font-weight:600;margin:0;color:var(--text-color,#fff)}
.crmact-hint{font-size:11.5px;color:var(--text-muted,#888)}
.crmact-trend{display:flex;align-items:flex-end;gap:6px;height:150px;padding-top:6px;overflow-x:auto}
.crmact-col{flex:1;min-width:16px;display:flex;flex-direction:column;align-items:center;gap:5px}
.crmact-bar{width:100%;max-width:26px;background:linear-gradient(180deg,var(--primary-color,#0ea5e9),color-mix(in srgb,var(--primary-color,#0ea5e9) 55%,transparent));border-radius:5px 5px 0 0}
.crmact-bar.zero{background:var(--border-color,#2a2a3e);min-height:3px}
.crmact-col-cap{font-size:10px;color:var(--text-muted,#888);white-space:nowrap}
.crmact-col-val{font-size:10.5px;font-weight:600;color:var(--text-muted,#aaa)}

.crmact-dist{display:flex;flex-direction:column;gap:10px}
.crmact-dist-row{display:grid;grid-template-columns:130px 1fr auto;align-items:center;gap:10px}
.crmact-dname{font-size:12.5px;color:var(--text-color,#ddd);display:flex;align-items:center;gap:8px}
.crmact-track{height:9px;background:var(--input-bg,rgba(255,255,255,.05));border-radius:5px;overflow:hidden;border:1px solid var(--border-color,#2a2a3e)}
.crmact-fill{display:block;height:100%;border-radius:5px}
.crmact-dval{font-size:12.5px;font-weight:600;color:var(--text-color,#fff);min-width:64px;text-align:right;font-variant-numeric:tabular-nums}
.crmact-dval small{color:var(--text-muted,#888);font-weight:500}

/* Category color classes (dots + fills + chips) */
.crmact-dot{width:9px;height:9px;border-radius:3px;flex:none;display:inline-block}
.c-sesiune{background:#1E9E6A}
.c-followup{background:#3FA7A0}
.c-callback{background:#D6952E}
.c-necalif{background:#CF6553}
.c-fararasp{background:#6E7C93}
.c-numar{background:#9A8060}
.c-none{background:#AAB2BF}
.crmact-fill.c-sesiune{background:#1E9E6A}.crmact-fill.c-followup{background:#3FA7A0}
.crmact-fill.c-callback{background:#D6952E}.crmact-fill.c-necalif{background:#CF6553}
.crmact-fill.c-fararasp{background:#6E7C93}.crmact-fill.c-numar{background:#9A8060}.crmact-fill.c-none{background:#AAB2BF}

/* Report table */
.crmact-report{background:var(--card-bg,#1e1e2e);border:1px solid var(--border-color,#2a2a3e);border-radius:12px;overflow:hidden}
.crmact-report-h{padding:15px 18px;border-bottom:1px solid var(--border-color,#2a2a3e);display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.crmact-report-h h3{font-size:14px;font-weight:600;margin:0;color:var(--text-color,#fff)}
.crmact-meta{font-size:11.5px;color:var(--text-muted,#888)}
.crmact-tbl-wrap{overflow-x:auto}
.crmact-tbl{width:100%;border-collapse:collapse;font-size:13px;min-width:720px}
.crmact-tbl th,.crmact-tbl td{padding:10px 12px;text-align:right;white-space:nowrap}
.crmact-tbl th:first-child,.crmact-tbl td:first-child{text-align:left;position:sticky;left:0;background:var(--card-bg,#1e1e2e)}
.crmact-tbl thead th{font-size:11px;font-weight:600;letter-spacing:.02em;text-transform:uppercase;color:var(--text-muted,#888);border-bottom:1px solid var(--border-color,#2a2a3e)}
.crmact-th{display:inline-flex;align-items:center;gap:5px}
.crmact-tbl tbody td{border-bottom:1px solid var(--border-color,#2a2a3e);font-variant-numeric:tabular-nums;color:var(--text-color,#eee)}
.crmact-tbl tbody tr:hover td{background:var(--input-bg,rgba(255,255,255,.03))}
.crmact-tbl tbody tr:hover td:first-child{background:var(--card-bg,#1e1e2e)}
.crmact-op{font-weight:600;color:var(--text-color,#fff)}
.crmact-total{font-weight:700;color:var(--text-color,#fff)}
.crmact-chip{display:inline-block;min-width:24px;padding:2px 7px;border-radius:6px;font-weight:600;font-size:12px;color:#fff}
.crmact-chip.c-sesiune{background:rgba(30,158,106,.9)}.crmact-chip.c-followup{background:rgba(63,167,160,.9)}
.crmact-chip.c-callback{background:rgba(214,149,46,.92)}.crmact-chip.c-necalif{background:rgba(207,101,83,.92)}
.crmact-chip.c-fararasp{background:rgba(110,124,147,.92)}.crmact-chip.c-numar{background:rgba(154,128,96,.92)}
.crmact-chip.c-none{background:rgba(140,148,160,.5)}
.crmact-zero{color:var(--text-muted,#777)}
.crmact-tbl tr.crmact-totals td{border-top:2px solid var(--border-color,#3a3a4e);border-bottom:0;font-weight:700;background:var(--input-bg,rgba(255,255,255,.03));color:var(--text-color,#fff)}
.crmact-tbl tr.crmact-totals td:first-child{background:var(--input-bg,rgba(255,255,255,.03))}

/* Mobile cards (hidden on desktop) */
.crmact-cards{display:none;flex-direction:column;gap:10px;padding:14px}
.crmact-card{border:1px solid var(--border-color,#2a2a3e);border-radius:11px;overflow:hidden;background:var(--card-bg,#1e1e2e)}
.crmact-card summary{list-style:none;cursor:pointer;padding:12px 14px;display:flex;align-items:center;gap:11px}
.crmact-card summary::-webkit-details-marker{display:none}
.crmact-card-grow{flex:1;min-width:0;display:flex;flex-direction:column}
.crmact-card-nm{font-weight:600;font-size:14px;color:var(--text-color,#fff)}
.crmact-card-tot{font-size:12px;color:var(--text-muted,#888)}
.crmact-card-big{font-weight:700;font-size:20px;color:var(--text-color,#fff);font-variant-numeric:tabular-nums}
.crmact-chev{color:var(--text-muted,#888);transition:transform .2s}
.crmact-card[open] .crmact-chev{transform:rotate(180deg)}
.crmact-card-body{padding:2px 14px 12px;border-top:1px solid var(--border-color,#2a2a3e)}
.crmact-mrow{display:flex;align-items:center;gap:10px;padding:8px 0;border-bottom:1px solid var(--border-color,#2a2a3e)}
.crmact-mrow:last-child{border-bottom:0}
.crmact-ml{font-size:12.5px;color:var(--text-color,#ddd);display:flex;align-items:center;gap:8px;flex:1}
.crmact-mtrack{width:74px;height:7px;background:var(--input-bg,rgba(255,255,255,.05));border-radius:4px;overflow:hidden;border:1px solid var(--border-color,#2a2a3e)}
.crmact-mv{font-weight:700;font-size:13.5px;color:var(--text-color,#fff);font-variant-numeric:tabular-nums;min-width:26px;text-align:right}

@media (max-width:768px){
    .crmact-kpis{grid-template-columns:1fr 1fr}
    .crmact-grid2{grid-template-columns:1fr}
    .crmact-tbl-wrap{display:none}
    .crmact-cards{display:flex}
    .crm-activity-field{flex:1 1 40%}
    .crm-activity-export{width:100%}
}

/* ==================================================================
 * AutoEmailuri + vedere pe zile (task #215 / Faza 5)
 * ================================================================== */
.crm-activity-autoemail{font:inherit;font-size:12.5px;font-weight:600;color:#fff;background:var(--primary-color,#0ea5e9);
    border:1px solid var(--primary-color,#0ea5e9);border-radius:8px;padding:9px 14px;cursor:pointer}
.crm-activity-autoemail:hover{filter:brightness(1.08)}

/* Vederea pe zile */
.crmact-day-block{border-top:1px solid var(--border-color,#2a2a3e)}
.crmact-day-block:first-child{border-top:0}
.crmact-day-h{display:flex;align-items:center;justify-content:space-between;padding:11px 18px;background:var(--input-bg,rgba(255,255,255,.03));font-weight:600;font-size:13px;color:var(--text-color,#fff)}
.crmact-day-tot{font-size:12px;color:var(--text-muted,#888);font-weight:500}

/* Cardul AutoEmailuri */
.crmsub-card{background:var(--card-bg,#1e1e2e);border:1px solid var(--border-color,#2a2a3e);border-radius:12px;padding:18px;margin-top:16px}
.crmsub-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;flex-wrap:wrap;margin-bottom:14px}
.crmsub-head h3{font-size:15px;font-weight:700;margin:0;color:var(--text-color,#fff)}
.crmsub-head p{margin:5px 0 0;font-size:12.5px;color:var(--text-muted,#888)}
.crmsub-empty{font-size:12.5px;color:var(--text-muted,#888);padding:6px 0}
.crmsub-list{display:flex;flex-direction:column;gap:10px}
.crmsub-item{display:flex;align-items:center;gap:12px;border:1px solid var(--border-color,#2a2a3e);border-radius:11px;padding:12px 14px;background:var(--input-bg,rgba(255,255,255,.02))}
.crmsub-item.off{opacity:.55}
.crmsub-ico{width:34px;height:34px;border-radius:9px;background:var(--input-bg,rgba(255,255,255,.06));display:grid;place-items:center;flex:none;font-size:16px}
.crmsub-main{flex:1;min-width:0}
.crmsub-title{font-weight:600;font-size:13.5px;color:var(--text-color,#fff)}
.crmsub-sub{font-size:11.5px;color:var(--text-muted,#888);margin-top:2px;overflow:hidden;text-overflow:ellipsis}
.crmsub-btn{background:transparent;border:0;cursor:pointer;font-size:15px;padding:4px;opacity:.75}
.crmsub-btn:hover{opacity:1}
.crmsub-switch{position:relative;width:38px;height:22px;flex:none;cursor:pointer}
.crmsub-switch input{opacity:0;width:0;height:0}
.crmsub-track{position:absolute;inset:0;background:var(--border-color,#3a3a4e);border-radius:20px;transition:.2s}
.crmsub-knob{position:absolute;top:3px;left:3px;width:16px;height:16px;background:#fff;border-radius:50%;transition:.2s}
.crmsub-switch input:checked + .crmsub-track{background:var(--primary-color,#0ea5e9)}
.crmsub-switch input:checked + .crmsub-track + .crmsub-knob{transform:translateX(16px)}

/* Modal AutoEmail */
.crmsub-overlay{position:fixed;inset:0;background:rgba(0,0,0,.55);z-index:9000;display:flex;align-items:center;justify-content:center;padding:18px}
.crmsub-modal{background:var(--card-bg,#1e1e2e);border:1px solid var(--border-color,#2a2a3e);border-radius:16px;width:min(480px,100%);max-height:92vh;overflow:auto;box-shadow:0 20px 60px rgba(0,0,0,.4)}
.crmsub-modal-head{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid var(--border-color,#2a2a3e)}
.crmsub-modal-head h3{font-size:15px;font-weight:700;margin:0;color:var(--text-color,#fff)}
.crmsub-x{background:transparent;border:0;font-size:24px;line-height:1;color:var(--text-muted,#888);cursor:pointer}
.crmsub-modal-body{padding:16px 20px;display:flex;flex-direction:column;gap:14px}
.crmsub-modal-foot{display:flex;justify-content:flex-end;gap:10px;padding:14px 20px;border-top:1px solid var(--border-color,#2a2a3e)}
.crmsub-sec{border:1px solid var(--border-color,#2a2a3e);border-radius:11px;padding:14px;display:flex;flex-direction:column;gap:12px;background:var(--input-bg,rgba(255,255,255,.02))}
.crmsub-sec-h{font-size:10.5px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--primary-color,#0ea5e9)}
.crmsub-f{display:flex;flex-direction:column;gap:6px}
.crmsub-f > label{font-size:11px;font-weight:600;letter-spacing:.03em;text-transform:uppercase;color:var(--text-muted,#888)}
.crmsub-f select,.crmsub-f input[type=text]{font:inherit;font-size:13px;color:var(--text-color,#fff);background:var(--card-bg,#1e1e2e);border:1px solid var(--border-color,#2a2a3e);border-radius:8px;padding:9px 11px}
.crmsub-row2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.crmsub-chk{display:flex;align-items:center;gap:8px;font-size:12.5px;color:var(--text-color,#ddd)}
@media (max-width:520px){.crmsub-row2{grid-template-columns:1fr}}

/* === CRM Email SMTP === */
/* Secțiunea „✉️ Emailuri automate — SMTP propriu" (#crm-email-section) + blocul „Trimitere (SMTP)"
   din formularul de inbox-uri. Mobile-first: o coloană, butoane full-width și fără overflow
   orizontal sub 768px; grila auto-fit doar de la 768px în sus. Secțiunile de setări au fond alb
   forțat (vezi „CRM PIPELINE SETTINGS - URGENT FIX"), deci culorile de aici sunt pentru fond deschis. */
.crm-email-steps { display: flex; flex-direction: column; gap: 16px; }
.crm-email-step { border: 1px solid #e2e8f0; border-radius: 10px; padding: 14px; background: #ffffff; min-width: 0; }
.crm-email-step-head { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; flex-wrap: wrap; }
.crm-email-step-head h4 { margin: 0; font-size: 15px; color: #334155; }
.crm-email-step-num {
    width: 26px; height: 26px; border-radius: 50%; background: #0ea5e9; color: #ffffff;
    font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; flex: none;
}
#crm-email-section .crm-email-help,
.crm-email-inbox-form .crm-email-help { font-size: 12px; color: #64748b; margin: 0 0 10px; line-height: 1.55; }
#crm-email-section .crm-email-help a { color: #0369a1; text-decoration: underline; }
.crm-email-help-box {
    font-size: 12px; color: #475569; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px;
    padding: 10px 12px; margin: 10px 0; line-height: 1.6;
}
.crm-email-help-box ul { margin: 6px 0 0; padding-left: 18px; }
.crm-email-help-box li { margin-bottom: 4px; }
.crm-email-help-box code, #crm-email-section code { font-size: 11px; background: #eef2f7; padding: 1px 4px; border-radius: 3px; }

/* Grilă de câmpuri: 1 coloană pe mobil, auto-fit pe desktop */
.crm-email-grid { display: grid; grid-template-columns: 1fr; gap: 10px; min-width: 0; }
.crm-email-field { min-width: 0; }
.crm-email-field > label { display: block; font-size: 12px; color: #64748b; margin-bottom: 4px; font-weight: 500; }
.crm-email-field .form-control,
#crm-email-section textarea.form-control { width: 100%; max-width: 100%; box-sizing: border-box; }
#crm-email-section textarea.form-control {
    min-height: 72px; resize: vertical; padding: 8px 12px; border: 1px solid #cbd5e1; border-radius: 6px;
    font: inherit; font-size: 14px; color: #1e293b; background: #ffffff; line-height: 1.45;
}
#crm-email-section input[type="url"],
#crm-email-section input[type="email"],
.crm-email-inbox-form input[type="email"] {
    padding: 8px 12px; border: 1px solid #cbd5e1; border-radius: 6px; background: #ffffff; color: #1e293b; font-size: 14px;
}
.crm-email-color-row { display: flex; align-items: center; gap: 8px; }
.crm-email-color-row input[type="color"] {
    width: 44px; height: 38px; padding: 2px; border: 1px solid #cbd5e1; border-radius: 6px; background: #ffffff; cursor: pointer; flex: none;
}
.crm-email-color-row .form-control { flex: 1; min-width: 0; }
.settings-section label.crm-email-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #334155; margin: 0; cursor: pointer; }
.crm-email-check input[type="checkbox"] { width: 18px; height: 18px; accent-color: #0ea5e9; flex: none; }

/* Butoane și rânduri de acțiuni */
.crm-email-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.crm-email-actions .btn { width: auto; min-height: 0; padding: 8px 16px; font-size: 13px; }
.crm-email-inline-input { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; flex: 1 1 320px; min-width: 0; }
.crm-email-inline-input .form-control { flex: 1 1 200px; min-width: 0; }

/* Banner de stare (activ / blocat / inactiv / eroare) */
.crm-email-banner { border-radius: 8px; padding: 10px 12px; font-size: 13px; line-height: 1.5; margin: 0 0 14px; border: 1px solid #e2e8f0; }
.crm-email-banner.ok { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.crm-email-banner.warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.crm-email-banner.err { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.crm-email-banner.off { background: #f8fafc; border-color: #e2e8f0; color: #475569; }

/* Badge-uri IMAP ✓ / SMTP ✓|✗ în lista de inbox-uri */
.crm-email-badge {
    display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .3px; padding: 1px 6px; border-radius: 4px;
    border: 1px solid #e2e8f0; margin-right: 4px; vertical-align: middle; white-space: nowrap; cursor: help;
}
.crm-email-badge.ok { color: #166534; background: #dcfce7; border-color: #bbf7d0; }
.crm-email-badge.warn { color: #92400e; background: #fef3c7; border-color: #fde68a; }
.crm-email-badge.off { color: #64748b; background: #f1f5f9; border-color: #e2e8f0; }

/* Blocul pliabil „Trimitere (SMTP)" din formularul de inbox */
.crm-email-smtp-details { margin-top: 12px; border: 1px solid #e2e8f0; border-radius: 8px; background: #f8fafc; }
.crm-email-smtp-details > summary { cursor: pointer; padding: 10px 14px; font-size: 13px; font-weight: 600; color: #334155; }
.crm-email-smtp-details[open] > summary { border-bottom: 1px solid #e2e8f0; }
.crm-email-smtp-body { padding: 12px 14px 14px; }

/* Ultimele trimiteri: tabelul derulează în containerul lui, nu pagina */
.crm-email-sends-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.crm-email-sends-wrap .crm-table { min-width: 560px; margin-bottom: 0; }
.crm-email-sends-wrap .crm-table th,
.crm-email-sends-wrap .crm-table td { font-size: 12px; padding: 8px 10px; vertical-align: top; }
.crm-email-state { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }

/* Rândurile grilei de legături pe canalul smtp (pasul 4) */
#crm-email-section .crm-email-rsm-row { min-width: 0; }

@media (max-width: 767px) {
    .crm-email-step { padding: 12px; }
    /* Butoane full-width, select-uri/inputuri mari (16px evită zoom-ul automat pe iOS) */
    #crm-email-section .crm-email-actions .btn,
    .crm-email-smtp-body .crm-email-actions .btn { width: 100%; justify-content: center; }
    .crm-email-inline-input { flex-basis: 100%; }
    .crm-email-inline-input .form-control { flex-basis: 100%; }
    #crm-email-section .crm-email-field .form-control,
    #crm-email-section select.form-control,
    .crm-email-smtp-body .form-control { font-size: 16px; min-height: 42px; }
    .crm-email-step-head .btn { width: 100%; margin-left: 0 !important; }
    /* Grila de legături: fiecare control pe rândul lui */
    #crm-email-section .crm-email-rsm-row { flex-direction: column; align-items: stretch !important; }
    #crm-email-section .crm-email-rsm-row > select,
    #crm-email-section .crm-email-rsm-row > input,
    #crm-email-section .crm-email-rsm-row > span,
    #crm-email-section .crm-email-rsm-row > label { width: 100% !important; box-sizing: border-box; }
    #crm-email-section .crm-email-rsm-row > span > input.form-control { flex: 1 1 auto; width: auto !important; min-width: 0; }
    #crm-email-section .crm-email-rsm-row > select,
    #crm-email-section .crm-email-rsm-row > input.form-control,
    #crm-email-section .crm-email-rsm-row > span > input.form-control { font-size: 16px !important; min-height: 42px; }
    #crm-email-section .crm-email-rsm-row .btn { width: 100% !important; justify-content: center; }
}

@media (min-width: 768px) {
    .crm-email-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
    .crm-email-inbox-form .crm-email-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}
