/* EF WA CRM - Left Sidebar */

.ef-wa-crm-sidebar {
    width: 30%;
    min-width: 300px;
    background: var(--surface-color);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ef-wa-crm-sidebar-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--surface-color);
    flex-shrink: 0;
}

.ef-wa-crm-sidebar-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.ef-wa-crm-sidebar-search {
    position: relative;
    margin-bottom: 10px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.ef-wa-crm-sidebar-search input {
    flex: 1;
    padding: 8px 35px 8px 12px;
    background: var(--surface-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    transition: all var(--transition-normal);
}

.ef-wa-crm-sidebar-search input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--surface-light);
}

.ef-wa-crm-sidebar-search::after {
    content: '🔍';
    position: absolute;
    right: 50px; /* Moved to account for add contact button */
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
}

/* Add Contact Button */
.ef-wa-crm-add-contact-btn {
    width: 36px;
    height: 36px;
    background: var(--primary-color);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    flex-shrink: 0;
}

.ef-wa-crm-add-contact-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.ef-wa-crm-add-contact-btn:active {
    transform: scale(0.95);
}

.ef-wa-crm-add-contact-icon {
    width: 18px;
    height: 18px;
    filter: brightness(0) invert(1);
    transition: filter 0.2s ease;
}

.ef-wa-crm-sidebar-stats {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.ef-wa-crm-sidebar-stat {
    flex: 1;
    background: var(--surface-dark);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    text-align: center;
    border: 1px solid var(--border-color);
}

.ef-wa-crm-sidebar-stat-number {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.ef-wa-crm-sidebar-stat-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ef-wa-crm-sidebar-contacts {
    flex: 1;
    overflow-y: auto;
    background: var(--surface-color);
}

/* Filter Button (ersetzt Add Contact Button) */
.ef-wa-crm-filter-btn {
    position: relative;
    width: 36px;
    height: 36px;
    background: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    flex-shrink: 0;
    color: white;
}

.ef-wa-crm-filter-icon,
.ef-wa-crm-filter-icon .emoji,
.ef-wa-crm-filter-icon img.emoji {
    font-size: 18px !important;
    line-height: 1 !important;
    width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
    vertical-align: middle !important;
}

.ef-wa-crm-filter-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary-light);
}

.ef-wa-crm-filter-btn.active {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.ef-wa-crm-filter-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--danger-color, #e74c3c);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    color: white;
    display: none;
    align-items: center;
    justify-content: center;
}

.ef-wa-crm-filter-badge.visible {
    display: flex;
}

/* Export Button */
.ef-wa-crm-sidebar-actions {
    padding: 10px 20px;
    border-top: 1px solid var(--border-color);
}

.ef-wa-crm-export-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    background: var(--surface-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.ef-wa-crm-export-btn:hover {
    background: var(--surface-light);
    color: var(--text-primary);
    border-color: var(--primary-color);
}

.ef-wa-crm-export-btn:active {
    transform: scale(0.98);
}

.ef-wa-crm-export-btn svg {
    flex-shrink: 0;
}

/* Filter Sidebar */
.ef-wa-crm-filter-sidebar {
    position: absolute;
    top: 0;
    right: 0;
    width: 320px;
    max-width: 50%;
    height: 100%;
    background: var(--surface-color);
    border-left: 1px solid var(--border-color);
    z-index: 100;
    transform: translateX(100%);
    transition: transform var(--transition-slow, 0.3s ease);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.ef-wa-crm-filter-sidebar.open {
    transform: translateX(0);
}

.ef-wa-crm-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--surface-dark);
}

.ef-wa-crm-filter-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.ef-wa-crm-filter-close {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.ef-wa-crm-filter-close:hover {
    background: var(--surface-light);
    color: var(--text-primary);
}

.ef-wa-crm-filter-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.ef-wa-crm-filter-section {
    margin-bottom: 24px;
}

.ef-wa-crm-filter-section:last-child {
    margin-bottom: 0;
}

.ef-wa-crm-filter-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.ef-wa-crm-filter-section h4 {
    margin: 0 0 12px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ef-wa-crm-filter-section-header h4 {
    margin-bottom: 0;
}

/* Quick Actions */
.ef-wa-crm-filter-quick-actions {
    display: flex;
    gap: 8px;
}

.ef-wa-crm-filter-quick-actions button {
    padding: 4px 8px;
    background: transparent;
    border: none;
    font-size: 12px;
    color: var(--primary-color);
    cursor: pointer;
    text-decoration: underline;
    transition: opacity var(--transition-fast);
}

.ef-wa-crm-filter-quick-actions button:hover {
    opacity: 0.8;
}

/* Filter Chips */
.ef-wa-crm-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ef-wa-crm-filter-chip {
    padding: 8px 12px;
    background: var(--surface-dark);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.ef-wa-crm-filter-chip:hover {
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.ef-wa-crm-filter-chip.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Status Checkboxes */
.ef-wa-crm-filter-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
}

.ef-wa-crm-filter-checkbox:last-child {
    border-bottom: none;
}

.ef-wa-crm-filter-checkbox:hover {
    background: var(--surface-dark);
    margin: 0 -20px;
    padding-left: 20px;
    padding-right: 20px;
}

.ef-wa-crm-filter-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.ef-wa-crm-filter-checkbox span {
    color: var(--text-primary);
    font-size: 14px;
}

/* Filter Footer */
.ef-wa-crm-filter-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--surface-dark);
}

.ef-wa-crm-filter-reset,
.ef-wa-crm-filter-apply {
    flex: 1;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.ef-wa-crm-filter-reset {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.ef-wa-crm-filter-reset:hover {
    background: var(--surface-light);
    color: var(--text-primary);
}

.ef-wa-crm-filter-apply {
    background: var(--primary-color);
    border: none;
    color: white;
}

.ef-wa-crm-filter-apply:hover {
    background: var(--primary-dark);
}

/* Filter Overlay */
.ef-wa-crm-filter-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-slow, 0.3s ease);
}

.ef-wa-crm-filter-overlay.visible {
    opacity: 1;
    visibility: visible;
}