body {
    font-family: "Segoe UI", Arial, sans-serif;
    background: #f5f6fa;
    margin: 0;
    padding: 20px;
    color: #222;
}
.container {
    width: 80%;
    margin: 0 auto;
}
.header {
    background: #dbf0f2;
    padding: 10px;
    border-radius: 6px;
}
.header-row {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
h1 {
    margin: 0 0 10px 0;
    color: #333;
    cursor: pointer;
}
.controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}
.table-selector {
    font-size: 15px;
    padding: 5px 10px;
    border-radius: 6px;
}
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #ddd;
    margin-top: 0;
}
thead th {
    position: sticky;
    top: 0;
    background: #beecbf;
    z-index: 10;
    border-bottom: 2px solid #ccc;
    padding: 10px;
    text-align: left;
}
thead th[onclick] {
    cursor: pointer;
}
.source-type-cell {
    width: 19px;
    max-width: 19px;
}
td {
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}
tr:hover { background: #fafafa; }
a.news-link { color: inherit; text-decoration: none; cursor: pointer; }
a.news-link:visited { color: #aaa; }
select { padding: 4px 8px; font-size: 14px; border-radius: 4px; }
.no-wrap {
    white-space: nowrap;
}
.description-cell {
    width: 50px;
    max-width: 50px;
}
.desc-btn {
    padding: 2px 8px;
    font-size: 14px;
    border: 1px solid #ccc;
    background: #f5f5f5;
    cursor: pointer;
    border-radius: 3px;
}
.desc-btn:hover {
    background: #e0e0e0;
}
.description-popup {
    position: fixed;
    background: #ffe5cc;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 10px;
    width: 80%;
    max-width: 600px;
    min-width: 300px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    word-wrap: break-word;
}
.hidden {
    display: none;
}
.search-container {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.search-input {
    display: none;
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    width: 150px;
}
.search-input.active {
    display: inline-block;
}
.search-btn, .clear-btn {
    padding: 5px 10px;
    border: 1px solid #ccc;
    background: white;
    cursor: pointer;
    border-radius: 5px;
    font-size: 15px;
}
.search-btn:hover, .clear-btn:hover {
    background: #f0f0f0;
}
.clear-btn {
    display: none;
}
.clear-btn.active {
    display: inline-block;
}
.loading {
    text-align: center;
    padding: 20px;
    display: none;
}
.loading.active {
    display: block;
}
.source-type-icon {
    width: 24px;
    height: 24px;
    vertical-align: middle;
}
@media (max-width: 768px) {
    .container {
        width: 100%;
    }
    .controls {
        flex-direction: column;
        align-items: flex-start;
    }
    .search-container {
        order: -1;
        width: 100%;
        justify-content: flex-end;
    }
    .search-input.active {
        flex-grow: 1;
    }
}

/* Стили для фильтра и инструментов */
.filters-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.filter-panel, .tools-panel {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    background: white;
    border: 1px solid #ccc;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 20;
    width: 200px;
}
.filter-panel.active, .tools-panel.active {
    display: block;
}
.filter-group {
    margin-bottom: 10px;
}
.filter-group label {
    font-weight: 600;
    display: block;
    margin-bottom: 5px;
}
.filter-options {
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid #eee;
    padding: 5px;
}
.filter-options label {
    display: block;
    margin: 5px 0;
}
.filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.filter-btn {
    padding: 5px 10px;
    border: 1px solid #ccc;
    background: white;
    cursor: pointer;
    border-radius: 5px;
    font-size: 15px;
}
.filter-btn:hover {
    background: #f0f0f0;
}

/* Стили для тегов фильтров */
.filter-tags {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.filter-tag {
    background: #f0f0f0;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.filter-tag .remove-tag {
    color: red;
    cursor: pointer;
    font-weight: bold;
}
.filter-tag .remove-tag:hover {
    color: darkred;
}