/* === СИСТЕМА ФИЛЬТРАЦИИ ОТЧЕТОВ === */

.filters-panel {
    position: fixed;
    top: 175px;
    right: 12px;
    width: 320px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
}

.filters-header {
    padding: 16px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.filters-title {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filters-close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

.filters-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.filters-body {
    padding: 16px;
}

.filter-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
}

.filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.filter-title {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    cursor: pointer;
    transition: color 0.2s ease;
}

.filter-option:hover {
    color: #3b82f6;
}

.filter-option input[type="checkbox"],
.filter-option input[type="radio"] {
    margin: 0;
}

.filter-option label {
    cursor: pointer;
    font-size: 13px;
    color: #6b7280;
    flex: 1;
}

.filter-option:hover label {
    color: #374151;
}

/* Быстрые фильтры дат */
.date-quick-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.date-quick-btn {
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.date-quick-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.date-quick-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

/* Кастомные селекты */
.custom-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    background: white;
    cursor: pointer;
}

.custom-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Чекбоксы и радио */
.checkbox-group, .radio-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.checkbox-item, .radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.checkbox-item input, .radio-item input {
    margin: 0;
}

.checkbox-item label, .radio-item label {
    font-size: 13px;
    color: #6b7280;
    cursor: pointer;
}

/* Кнопки действий */
.filter-actions {
    padding: 16px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 8px;
}

.btn-filter {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-apply {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.btn-apply:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-reset {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.btn-reset:hover {
    background: #e5e7eb;
    color: #374151;
}

/* Счетчик результатов */
.filter-results {
    padding: 12px 16px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    font-size: 12px;
    color: #6b7280;
    text-align: center;
}

/* Кнопка открытия фильтров */
.filters-toggle-btn {
    position: fixed;
    top: 130px;
    right: 12px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    transition: all 0.2s ease;
}

.filters-toggle-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* Чипы активных фильтров */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.filter-chip {
    background: #3b82f6;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.filter-chip-remove {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    font-size: 12px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .filters-panel {
        width: 300px;
        right: 10px;
    }
    
    .date-quick-filters {
        grid-template-columns: 1fr;
    }
}

/* Анимации */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.filters-panel {
    animation: slideInRight 0.3s ease-out;
}

/* Стили для скроллируемых групп чекбоксов */
.checkbox-group {
    max-height: 150px;
    overflow-y: auto;
    padding-right: 5px;
}

.checkbox-group::-webkit-scrollbar {
    width: 4px;
}

.checkbox-group::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.checkbox-group::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

.checkbox-group::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Чистый вид для чекбоксов без иконок */
.checkbox-item label {
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Убираем эмодзи и оставляем только текст */
.checkbox-item label::before {
    display: none;
}

/* Стили для скроллируемых контейнеров */
.checkbox-group {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 8px;
    background: #fafafa;
}

.checkbox-group::-webkit-scrollbar {
    width: 6px;
}

.checkbox-group::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.checkbox-group::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.checkbox-group::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Стили для чекбоксов */
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.checkbox-item:hover {
    background: #f3f4f6;
}

.checkbox-item input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Стили для активных фильтров */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
    min-height: 20px;
}

.filter-chip {
    background: #3b82f6;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: slideInRight 0.2s ease-out;
}

.filter-chip-remove {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    font-size: 14px;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.filter-chip-remove:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Анимация появления */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Стили для поисковых полей */
.filter-search {
    position: relative;
    margin-bottom: 10px;
}

.search-input {
    width: 100%;
    padding: 8px 32px 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    background: white;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 12px;
}

.search-results {
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: white;
    margin-top: 5px;
}

.search-result-item {
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s ease;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: #f3f4f6;
}

.search-result-item.selected {
    background: #3b82f6;
    color: white;
}

/* Счетчик найденных вариантов */
.search-count {
    font-size: 11px;
    color: #6b7280;
    margin-top: 4px;
    text-align: right;
}

/* Стили для скрытия/показа при поиске */
.checkbox-group.hidden {
    display: none;
}

.search-results.visible {
    display: block;
}