/* ==========================================================================
   СТИЛИ ДЛЯ ТАБЛИЦ С ФИЛЬТРАМИ
   ========================================================================== */

/* Обертка */
.tablepress-filter-wrapper {
    margin: 0;
    padding: 0;
    width: 100%;
}

/* Перезаписываем стиль заголовков TablePress только для таблиц с фильтрами */
.tablepress-filter-wrapper .tablepress thead th {
    padding: 0.3em 0.3em 0.3em !important;
}

/* Заголовки таблицы */
.tablepress-filter-wrapper .table-filter thead th {
    background: #122D79;
    color: white;
    padding: 12px 8px;
    font-size: 13px;
    font-weight: normal;
    text-align: center;
    vertical-align: middle;
    border-top-width: 0 !important;
    border-right-width: 1px !important;
    border-bottom-width: 0px !important;
    border-left-width: 1px !important;
    border-top-style: solid !important;
    border-right-style: solid !important;
    border-bottom-style: solid !important;
    border-left-style: solid !important;
    border-top-color: rgb(196, 196, 196) !important;
    border-right-color: rgb(196, 196, 196) !important;
    border-bottom-color: rgb(196, 196, 196) !important;
    border-left-color: rgb(196, 196, 196) !important;
}

/* === УПРАВЛЕНИЕ ТАБЛИЦЕЙ === */
.tablepress-filter-wrapper .table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 15px;
}

.tablepress-filter-wrapper .controls-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Поле поиска */
.tablepress-filter-wrapper .search-box-wrapper {
    border: 1px solid #C4C4C4;
    padding: 4px 8px;
    width: 50%;
    background: white;
    border-radius: 4px;
}

.tablepress-filter-wrapper .search-box-wrapper input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 14px;
    background: transparent;
}

/* Цвет плейсхолдера в поле поиска */
.tablepress-filter-wrapper .search-box-wrapper input::placeholder {
    color: #666 !important;
}

.tablepress-filter-wrapper .search-box-wrapper input::-webkit-input-placeholder {
    color: #666 !important;
}

.tablepress-filter-wrapper .search-box-wrapper input::-moz-placeholder {
    color: #666 !important;
}

.tablepress-filter-wrapper .search-box-wrapper input:-ms-input-placeholder {
    color: #666 !important;
}

.tablepress-filter-wrapper .search-box-wrapper input:-moz-placeholder {
    color: #666 !important;
}

/* Текст "Всего результатов" */
.tablepress-filter-wrapper .table-text {
    font-family: var(--e-global-typography-f3687bb-font-family), Sans-serif;
    font-size: var(--e-global-typography-f3687bb-font-size);
    font-weight: var(--e-global-typography-f3687bb-font-weight);
    text-transform: var(--e-global-typography-f3687bb-text-transform);
    line-height: var(--e-global-typography-f3687bb-line-height);
    color: var(--e-global-color-42c2a64);
}

.tablepress-filter-wrapper .total-count {
    font-weight: bold;
    color: #122D79;
}

/* Кнопка сброса */
.tablepress-filter-wrapper .reset-btn {
    background-color: var(--e-global-color-secondary);
    border: none;
    padding: 0.5rem 1.4rem;
    cursor: pointer;
    font-family: "pt_sans", Sans-serif;
    font-size: 0.85vw;
    color: var(--e-global-color-5330dee);
    font-weight: var(--e-global-typography-text-font-weight);
    text-transform: var(--e-global-typography-text-text-transform);
    transition: all 0.2s;
}

.tablepress-filter-wrapper .reset-btn:hover,
.tablepress-filter-wrapper .reset-btn:focus {
    background-color: var(--e-global-color-primary);
    color: var(--e-global-color-5330dee);
}

/* === ТАБЛИЦА === */
.tablepress-filter-wrapper .table-filter {
    overflow-x: auto;
    width: 100%;
}

.tablepress-filter-wrapper .table-filter table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

/* Заголовки таблицы */
.tablepress-filter-wrapper .table-filter thead th {
    background: #122D79;
    color: white;
    padding: 12px 8px;
    font-size: 13px;
    font-weight: normal;
    text-align: center;
    border: 1px solid #2a4a9e;
    vertical-align: middle;
}

/* Строка с фильтрами - без видимых границ */
.tablepress-filter-wrapper .tablepress-filter-row {
    background: #f5f5f5;
}

.tablepress-filter-wrapper .tablepress-filter-cell {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    text-align: center !important;
    background: #f5f5f5;
    border: none;
}

/* Выпадающие фильтры */
.tablepress-filter-wrapper .filter-select {
    width: 100%;
    min-width: 50px;
    padding: 6px 4px;
    font-size: 12px;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: white;
    cursor: pointer;
}

.tablepress-filter-wrapper .filter-select:hover {
    border-color: #122D79;
}

.tablepress-filter-wrapper .filter-select:focus {
    outline: none;
    border-color: #122D79;
    box-shadow: 0 0 3px rgba(18, 45, 121, 0.3);
}

/* Ячейки таблицы */
.tablepress-filter-wrapper .table-filter tbody td {
    padding: 10px 8px;
    font-size: 13px;
    color: #333;
    text-align: center;
    border: 1px solid #ddd;
    vertical-align: middle;
}

/* Четные строки */
.tablepress-filter-wrapper .table-filter tbody tr:nth-child(even) td {
    background-color: #fafafa;
}

/* Нечетные строки */
.tablepress-filter-wrapper .table-filter tbody tr:nth-child(odd) td {
    background-color: white;
}

/* Строки при наведении */
.tablepress-filter-wrapper .table-filter tbody tr:hover td {
    background-color: #f0f4fa;
}

/* Сообщение об отсутствии результатов */
.tablepress-filter-wrapper .no-results-message {
    display: none;
    padding: 30px;
    text-align: center;
    background: #f9f9f9;
    border: 1px solid #eee;
    color: #666;
    margin-top: 20px;
    font-size: 14px;
}

/* Фиксация шапки при прокрутке */
.tablepress-filter-wrapper .table-filter.has-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Для строки с фильтрами */
.tablepress-filter-wrapper .table-filter.has-scroll .tablepress-filter-row th {
    position: sticky;
    top: 42px;
    z-index: 9;
    background: #f5f5f5;
}

/* === АДАПТИВ === */
@media (max-width: 1024px) {
    .tablepress-filter-wrapper .search-box-wrapper {
        width: 250px;
    }
    
    .tablepress-filter-wrapper .filter-select {
        min-width: 80px;
        font-size: 11px;
        padding: 4px;
    }
    
    .tablepress-filter-wrapper .table-filter thead th,
    .tablepress-filter-wrapper .table-filter tbody td {
        font-size: 12px;
        padding: 8px 4px;
    }
    
    .tablepress-filter-wrapper .reset-btn {
        font-size: 1.5vw;
    }
}

@media (max-width: 768px) {
    .tablepress-filter-wrapper .table-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tablepress-filter-wrapper .controls-left {
        justify-content: space-between;
    }
    
    .tablepress-filter-wrapper .search-box-wrapper {
        width: 100%;
        box-sizing: border-box;
    }
    
    .tablepress-filter-wrapper .reset-btn {
        padding: 6px 15px;
        font-size: 3vw;
    }
    
    .tablepress-filter-wrapper .table-text {
        font-size: 12px;
    }
    
    .tablepress-filter-wrapper .table-filter {
        overflow-x: auto;
    }
    
    .tablepress-filter-wrapper .table-filter table {
        min-width: 800px;
    }
}