/* =========================================================
 * sonsion-table v2.9.4 · 前端样式
 * 开发者：sonsion.com
 *
 * 特点：
 * - 全端统一行高 38px
 * - 表头与第一列样式完全统一
 * - 行列联动高亮（表头也参与）
 * - 首列紧凑间距 + 左对齐（含移动端）
 * - 所有单元格不换行 + 省略号
 * - 表格无圆角
 * - 筛选生效后：首列自适应宽度 + 数据列左对齐
 * - 强制覆盖 WordPress 主题表格样式
 * ========================================================= */

/* ============================================================
 * 设计 Token
 * ============================================================ */
:root {
    --st-red:            #dc2626;
    --st-red-dark:       #b91c1c;
    --st-red-soft:       #fef2f2;
    --st-red-soft-2:     #fee2e2;

    --st-gray-50:        #f9fafb;
    --st-gray-100:       #f3f4f6;
    --st-gray-200:       #e5e7eb;
    --st-gray-300:       #d1d5db;
    --st-gray-400:       #9ca3af;
    --st-gray-500:       #6b7280;
    --st-gray-700:       #374151;
    --st-gray-900:       #111827;

    --st-bg:             #ffffff;
    --st-bg-stripe:      #fafafa;
    --st-radius-sm:      6px;
    --st-transition:     0.12s ease;

    --st-row-height:     38px;

    --st-first-col-min:  100px;
    --st-first-col-max:  140px;

    --st-label-font-size:   13.5px;
    --st-label-font-weight: 600;
    --st-label-color:       #111827;

    --st-first-col-pad-left:  8px;
    --st-first-col-pad-right: 8px;

    --st-cell-pad-x:     14px;
}

/* ============================================================
 * 1. 容器
 * ============================================================ */
.sonsion-table-container {
    width: 100%;
    overflow: auto;
    max-height: 640px;
    position: relative;
    border-radius: 0;
    border: 1px solid var(--st-gray-300);
    background: var(--st-bg);
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
    box-sizing: border-box;
}

.sonsion-table-container * {
    box-sizing: border-box;
}

/* ============================================================
 * 2. 表格基础
 * ============================================================ */
.sonsion-table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    width: 100%;
    min-width: 720px;
    background: var(--st-bg);
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI",
        Roboto, "Helvetica Neue", Arial, sans-serif;
    font-feature-settings: "tnum" 1;
    color: var(--st-gray-900);
    font-size: 13.5px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    border: none !important;
    margin: 0 !important;
}

.sonsion-table thead,
.sonsion-table tbody,
.sonsion-table tfoot {
    border: none !important;
}

.sonsion-table thead tr,
.sonsion-table tbody tr {
    border: none !important;
}

.sonsion-table,
.sonsion-table th,
.sonsion-table td,
.sonsion-table tr,
.sonsion-table thead,
.sonsion-table tbody {
    border-radius: 0 !important;
}

/* ============================================================
 * 3. 所有单元格（统一高度 38px + 不换行）
 * ============================================================ */
.sonsion-table th,
.sonsion-table td,
.sonsion-table > tbody > tr > td,
.sonsion-table > tbody > tr > th {
    height: var(--st-row-height) !important;
    line-height: var(--st-row-height) !important;
    padding: 0 var(--st-cell-pad-x) !important;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap !important;
    font-size: 13.5px;
    font-weight: 400;
    color: var(--st-gray-900);
    background-clip: padding-box;
    position: relative;
    transition: background-color var(--st-transition), color var(--st-transition);
    text-shadow: none !important;
    outline: none !important;

    border-top: none;
    border-bottom: 1px solid var(--st-gray-200) !important;
    border-right: 1px solid var(--st-gray-200) !important;
    border-left: none !important;

    box-shadow: none !important;
    background-image: none !important;
}

.sonsion-table tr > *:first-child {
    border-left: 1px solid var(--st-gray-200) !important;
}

.sonsion-table tbody tr:first-child > * {
    border-top: 1px solid var(--st-gray-200) !important;
}

.sonsion-table tbody tr:last-child > * {
    border-bottom: 1px solid var(--st-gray-200) !important;
}

/* ============================================================
 * 4. 表头 & 第一列样式统一
 * ============================================================ */
.sonsion-table thead th,
.sonsion-table thead tr > th,
.sonsion-table thead tr > td,
.sonsion-table > thead > tr > th,
.sonsion-table tbody td:first-child,
.sonsion-table tbody th:first-child {
    background: var(--st-gray-50);
    background-image: none !important;
    font-weight: var(--st-label-font-weight) !important;
    font-size: var(--st-label-font-size) !important;
    color: var(--st-label-color) !important;
    text-align: center;
    vertical-align: middle;
    height: var(--st-row-height) !important;
    line-height: var(--st-row-height) !important;
    text-shadow: none !important;
    outline: none !important;
    box-shadow: none !important;
    white-space: nowrap !important;
}

.sonsion-table thead th,
.sonsion-table thead tr > th {
    position: sticky;
    top: 0;
    z-index: 20;
    user-select: none;
}

.sonsion-table thead th::before,
.sonsion-table thead th::after {
    display: none !important;
    content: none !important;
}

.sonsion-table thead th:first-child {
    z-index: 30;
    background: var(--st-gray-50) !important;
}

.sonsion-table thead th:hover {
    background: var(--st-gray-100) !important;
}

/* ============================================================
 * 5. 第一列
 * ============================================================ */
.sonsion-table th:first-child,
.sonsion-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 10;
    border-right: 1px solid var(--st-gray-200) !important;
    min-width: var(--st-first-col-min);
    max-width: var(--st-first-col-max);
    text-align: left !important;
    padding-left:  var(--st-first-col-pad-left) !important;
    padding-right: var(--st-first-col-pad-right) !important;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sonsion-table thead th:first-child {
    z-index: 30;
}

/* ============================================================
 * 6. 斑马纹
 * ============================================================ */
.sonsion-table tbody tr:nth-child(even) td {
    background: var(--st-bg-stripe);
}
.sonsion-table tbody tr:nth-child(even) td:first-child {
    background: var(--st-gray-100);
}

/* ============================================================
 * 7. 行列联动高亮
 * ============================================================ */
.sonsion-table tbody tr:hover td,
.sonsion-table .row-highlight {
    background: var(--st-red-soft) !important;
}

.sonsion-table tbody tr:hover td:first-child,
.sonsion-table .row-highlight:first-child {
    background: var(--st-red-soft-2) !important;
    color: var(--st-red-dark);
}

.sonsion-table .col-highlight {
    background: var(--st-red-soft) !important;
}

.sonsion-table thead th.col-highlight {
    background: var(--st-red-soft) !important;
    color: var(--st-red-dark) !important;
}

.sonsion-table tbody td.col-highlight:first-child,
.sonsion-table tbody th.col-highlight:first-child {
    background: var(--st-red-soft-2) !important;
    color: var(--st-red-dark);
}

.sonsion-table .current-cell {
    background: var(--st-red-soft-2) !important;
    color: var(--st-red-dark) !important;
    font-weight: 600 !important;
    box-shadow: inset 0 0 0 1px var(--st-red) !important;
    z-index: 5;
}

.sonsion-table tbody td.current-cell:first-child,
.sonsion-table tbody th.current-cell:first-child {
    box-shadow: none !important;
    font-weight: var(--st-label-font-weight) !important;
    color: var(--st-red-dark) !important;
}

.sonsion-table thead th.current-cell,
.sonsion-table thead th.current-cell:first-child {
    box-shadow: none !important;
}

/* ============================================================
 * 8. 空状态
 * ============================================================ */
.sonsion-table .empty-row td {
    height: auto !important;
    line-height: 1.5 !important;
    padding: 40px 20px !important;
    color: var(--st-gray-400);
    font-style: italic;
    border: 1px solid var(--st-gray-200);
}

/* ============================================================
 * 9. 隐藏列
 * ============================================================ */
.sonsion-table .col-hidden { display: none !important; }

/* ============================================================
 * 10. 行标签单元格
 * ============================================================ */
.sonsion-table th.has-row-filter,
.sonsion-table td.has-row-filter,
.sonsion-table thead th.has-filter {
    padding: 0 !important;
    min-width: var(--st-first-col-min);
    max-width: var(--st-first-col-max);
    box-sizing: border-box;
    text-align: left !important;
    height: var(--st-row-height) !important;
    line-height: var(--st-row-height) !important;
}

.sonsion-row-filter-content {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    height: var(--st-row-height);
    padding: 0 var(--st-first-col-pad-right) 0 var(--st-first-col-pad-left);
    box-sizing: border-box;
    justify-content: flex-start;
}

.sonsion-row-filter-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap !important;
    text-align: left !important;
    font-weight: var(--st-label-font-weight);
    font-size: var(--st-label-font-size);
    color: var(--st-label-color);
    line-height: 1.4;
    word-break: keep-all;
}

/* ============================================================
 * 11. 筛选按钮
 * ============================================================ */
.sonsion-row-filter-btn {
    position: relative;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    padding: 0;
    box-sizing: border-box;
    border: none;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--st-gray-400);
    opacity: 0.35;
    transition: all 0.15s;
    outline: none;
    line-height: 0;
    font-size: 0;
    margin-left: auto;
}

.sonsion-table tr:hover .sonsion-row-filter-btn {
    opacity: 0.9;
    color: var(--st-gray-500);
}

.sonsion-row-filter-btn:hover {
    opacity: 1;
    color: var(--st-red);
    background: var(--st-red-soft);
}

.sonsion-row-filter-btn:focus {
    box-shadow: 0 0 0 2px var(--st-red-soft-2);
    opacity: 1;
}

.sonsion-row-filter-btn.active {
    background: var(--st-red);
    color: #fff;
    opacity: 1;
}

.sonsion-row-filter-btn.active:hover {
    background: var(--st-red-dark);
    color: #fff;
}

.sonsion-row-filter-btn svg {
    width: 10px;
    height: 10px;
    display: block;
    flex-shrink: 0;
}

/* ============================================================
 * 12. 列筛选按钮
 * ============================================================ */
.sonsion-filter-btn {
    position: relative;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    padding: 0;
    box-sizing: border-box;
    border: none;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--st-gray-400);
    opacity: 0.6;
    transition: all 0.15s;
    outline: none;
    line-height: 0;
    font-size: 0;
    margin-left: auto;
}

.sonsion-table thead tr:hover .sonsion-filter-btn {
    opacity: 0.9;
}

.sonsion-filter-btn:hover {
    opacity: 1;
    color: var(--st-red);
    background: var(--st-red-soft);
}

.sonsion-filter-btn:focus {
    box-shadow: 0 0 0 2px var(--st-red-soft-2);
}

.sonsion-filter-btn.active {
    background: var(--st-red);
    color: #fff;
    opacity: 1;
}

.sonsion-filter-btn.active:hover {
    background: var(--st-red-dark);
    color: #fff;
}

.sonsion-filter-btn svg {
    width: 10px;
    height: 10px;
    display: block;
    flex-shrink: 0;
}

/* ============================================================
 * 13. 徽标
 * ============================================================ */
.sonsion-filter-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 13px;
    height: 13px;
    padding: 0 3px;
    background: var(--st-red);
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    line-height: 13px;
    text-align: center;
    border-radius: 7px;
    box-shadow: 0 0 0 2px #fff;
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    box-sizing: border-box;
}

/* ============================================================
 * 14. 筛选弹窗
 * ============================================================ */
.sonsion-filter-dropdown {
    position: fixed;
    top: -9999px;
    left: -9999px;
    min-width: 260px;
    max-width: 320px;
    background: #fff;
    border: 1px solid var(--st-gray-300);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
    padding: 0;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI",
        Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 13px;
    color: var(--st-gray-900);
    text-align: left;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.sonsion-filter-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sonsion-filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--st-gray-700);
    flex-shrink: 0;
}

.sonsion-filter-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}

.sonsion-filter-count {
    font-weight: 400;
    color: var(--st-gray-400);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.sonsion-filter-search {
    position: relative;
    padding: 0 12px 8px;
    flex-shrink: 0;
}

.sonsion-filter-search-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    height: 32px;
    padding: 0 28px 0 30px;
    font-size: 13px;
    font-family: inherit;
    color: var(--st-gray-900);
    background: var(--st-gray-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat 10px center;
    border: 1px solid var(--st-gray-200);
    border-radius: 6px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    margin: 0;
    line-height: 32px;
}

.sonsion-filter-search-input::placeholder { color: var(--st-gray-400); }

.sonsion-filter-search-input:focus {
    background-color: #fff;
    border-color: var(--st-red);
    box-shadow: 0 0 0 3px var(--st-red-soft);
}

.sonsion-filter-search-clear {
    position: absolute;
    right: 18px;
    top: 16px;
    margin-top: -10px;
    width: 18px;
    height: 18px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--st-gray-400);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.15s, color 0.15s;
    box-sizing: border-box;
}

.sonsion-filter-search-clear:hover {
    background: var(--st-gray-200);
    color: var(--st-gray-700);
}

.sonsion-filter-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 14px;
    border-top: 1px solid var(--st-gray-200);
    border-bottom: 1px solid var(--st-gray-200);
    background: var(--st-gray-50);
    flex-shrink: 0;
}

.sonsion-filter-all-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--st-gray-700);
    user-select: none;
    margin: 0;
}

.sonsion-filter-all-label input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
    accent-color: var(--st-red);
    width: 14px;
    height: 14px;
}

.sonsion-filter-select-none {
    display: inline-block;
    padding: 3px 10px;
    font-size: 12px;
    color: var(--st-red);
    text-decoration: none;
    background: var(--st-red-soft);
    border-radius: 5px;
    transition: background 0.15s;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
}

.sonsion-filter-select-none:hover {
    background: var(--st-red-soft-2);
    text-decoration: none;
}

.sonsion-filter-list {
    max-height: 240px;
    overflow-y: auto;
    padding: 4px 0;
    border-bottom: 1px solid var(--st-gray-200);
    flex: 1 1 auto;
    min-height: 0;
}

.sonsion-filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    cursor: pointer;
    font-size: 13px;
    color: var(--st-gray-900);
    transition: background 0.1s;
    white-space: nowrap;
    overflow: hidden;
    user-select: none;
}

.sonsion-filter-item:hover {
    background: var(--st-gray-50);
}

.sonsion-filter-item input[type="checkbox"] {
    margin: 0;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: var(--st-red);
    width: 14px;
    height: 14px;
}

.sonsion-filter-item span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.sonsion-filter-list::-webkit-scrollbar { width: 6px; }
.sonsion-filter-list::-webkit-scrollbar-thumb {
    background: var(--st-gray-200);
    border-radius: 3px;
}

.sonsion-filter-empty {
    display: none;
    padding: 20px 14px;
    text-align: center;
    color: var(--st-gray-400);
    font-size: 12px;
    font-style: italic;
    flex-shrink: 0;
}

.sonsion-filter-footer {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    background: var(--st-gray-50);
    flex-shrink: 0;
}

.sonsion-filter-btn-cancel,
.sonsion-filter-btn-apply {
    flex: 1;
    text-align: center;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    box-sizing: border-box;
    outline: none;
    line-height: 1.4;
}

.sonsion-filter-btn-cancel {
    border: 1px solid var(--st-gray-300);
    background: #fff;
    color: var(--st-gray-700);
}

.sonsion-filter-btn-cancel:hover {
    background: var(--st-gray-50);
    border-color: var(--st-gray-400);
}

.sonsion-filter-btn-apply {
    border: 1px solid var(--st-red);
    background: var(--st-red);
    color: #fff;
    font-weight: 600;
}

.sonsion-filter-btn-apply:hover {
    background: var(--st-red-dark);
    border-color: var(--st-red-dark);
}

/* ============================================================
 * 15. 滚动条
 * ============================================================ */
.sonsion-table-container::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
.sonsion-table-container::-webkit-scrollbar-track {
    background: var(--st-gray-50);
}
.sonsion-table-container::-webkit-scrollbar-thumb {
    background: var(--st-gray-300);
    border-radius: 5px;
    border: 2px solid var(--st-gray-50);
}
.sonsion-table-container::-webkit-scrollbar-thumb:hover {
    background: var(--st-gray-400);
}

/* ============================================================
 * 16. 响应式
 * ============================================================ */
@media (max-width: 768px) {
    :root {
        --st-row-height:     38px;
        --st-cell-pad-x:     8px;
        --st-first-col-min:  85px;
        --st-first-col-max:  110px;
        --st-label-font-size: 12.5px;
        --st-first-col-pad-left:  6px;
        --st-first-col-pad-right: 4px;
    }

    .sonsion-table th,
    .sonsion-table td {
        font-size: 12.5px;
    }

    .sonsion-table th:first-child,
    .sonsion-table td:first-child,
    .sonsion-table th.has-row-filter,
    .sonsion-table td.has-row-filter,
    .sonsion-table thead th.has-filter {
        text-align: left !important;
    }

    .sonsion-row-filter-content {
        justify-content: flex-start !important;
    }

    .sonsion-row-filter-label {
        font-size: 12.5px;
        text-align: left !important;
    }

    .sonsion-table thead th .sonsion-row-filter-label {
        font-size: 12.5px;
        text-align: left !important;
    }

    .sonsion-table-container { max-height: 65vh; }

    .sonsion-filter-dropdown { min-width: 220px; max-width: 85vw; max-height: 70vh; }
    .sonsion-filter-list { max-height: 180px; }
    .sonsion-filter-btn-cancel,
    .sonsion-filter-btn-apply { padding: 7px 10px; font-size: 12.5px; }
}

@media (max-width: 480px) {
    :root {
        --st-row-height:     38px;
        --st-cell-pad-x:     7px;
        --st-first-col-min:  72px;
        --st-first-col-max:  95px;
        --st-label-font-size: 12px;
        --st-first-col-pad-left:  5px;
        --st-first-col-pad-right: 3px;
    }

    .sonsion-table th,
    .sonsion-table td {
        font-size: 12px;
    }

    .sonsion-table th:first-child,
    .sonsion-table td:first-child,
    .sonsion-table th.has-row-filter,
    .sonsion-table td.has-row-filter,
    .sonsion-table thead th.has-filter {
        text-align: left !important;
    }

    .sonsion-row-filter-content {
        justify-content: flex-start !important;
    }

    .sonsion-row-filter-label {
        font-size: 12px;
        text-align: left !important;
    }

    .sonsion-table thead th .sonsion-row-filter-label {
        font-size: 12px;
        text-align: left !important;
    }

    .sonsion-row-filter-btn,
    .sonsion-filter-btn {
        width: 15px;
        height: 15px;
        flex-shrink: 0;
    }
    .sonsion-row-filter-btn svg,
    .sonsion-filter-btn svg {
        width: 9px;
        height: 9px;
    }

    .sonsion-filter-dropdown { min-width: 200px; max-width: 92vw; max-height: 65vh; }
    .sonsion-filter-list { max-height: 150px; }
}

/* ============================================================
 * 17. 暗色模式
 * ============================================================ */
@media (prefers-color-scheme: dark) {
    :root {
        --st-gray-50:        #1e293b;
        --st-gray-100:       #1a2438;
        --st-gray-200:       #334155;
        --st-gray-300:       #475569;
        --st-gray-400:       #94a3b8;
        --st-gray-500:       #cbd5e1;
        --st-gray-700:       #e2e8f0;
        --st-gray-900:       #f1f5f9;
        --st-bg:             #0f172a;
        --st-bg-stripe:      #131c2e;
        --st-red:            #ef4444;
        --st-red-dark:       #dc2626;
        --st-red-soft:       #3b1e24;
        --st-red-soft-2:     #4c232b;
        --st-label-color:    #f1f5f9;
    }

    .sonsion-filter-dropdown { background: #1e293b; border-color: #334155; }
    .sonsion-filter-search-input { background-color: #0f172a; border-color: #334155; color: #f1f5f9; }
    .sonsion-filter-toolbar { background: #0f172a; border-color: #334155; }
    .sonsion-filter-footer { background: #0f172a; }
    .sonsion-filter-btn-cancel { background: #1e293b; border-color: #334155; color: #e2e8f0; }
    .sonsion-filter-btn-cancel:hover { background: #334155; }
    .sonsion-filter-item:hover { background: #1e293b; }
    .sonsion-filter-badge { box-shadow: 0 0 0 2px #0f172a; }
}

/* ============================================================
 * 18. 打印
 * ============================================================ */
@media print {
    .sonsion-filter-btn,
    .sonsion-row-filter-btn,
    .sonsion-filter-dropdown { display: none !important; }
    .sonsion-table-container { border: 1px solid #999; max-height: none; }
    .sonsion-table th,
    .sonsion-table td { border: 1px solid #999 !important; }
}

/* ============================================================
 * ★ 19. 筛选生效后：首列自适应 + 数据列左对齐
 * ============================================================ */

.sonsion-table.has-filter-active {
    width: auto !important;
    min-width: 0 !important;
    table-layout: auto !important;
}

.sonsion-table.has-filter-active th:first-child,
.sonsion-table.has-filter-active td:first-child,
.sonsion-table.has-filter-active th.has-row-filter,
.sonsion-table.has-filter-active td.has-row-filter,
.sonsion-table.has-filter-active thead th.has-filter {
    width: 1px !important;
    min-width: 0 !important;
    max-width: none !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

.sonsion-table.has-filter-active .sonsion-row-filter-content {
    display: inline-flex !important;
    width: auto !important;
    gap: 6px !important;
    justify-content: flex-start !important;
    padding-left: var(--st-first-col-pad-left) !important;
    padding-right: var(--st-first-col-pad-right) !important;
}

.sonsion-table.has-filter-active .sonsion-row-filter-label {
    flex: 0 0 auto !important;
    min-width: 0 !important;
    max-width: none !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
    text-align: left !important;
}

.sonsion-table.has-filter-active .sonsion-row-filter-btn,
.sonsion-table.has-filter-active .sonsion-filter-btn {
    flex: 0 0 auto !important;
    margin-left: 0 !important;
}

.sonsion-table.has-filter-active th:not(:first-child),
.sonsion-table.has-filter-active td:not(:first-child) {
    text-align: left !important;
    padding-left: 16px !important;
}

@media (max-width: 768px) {
    .sonsion-table.has-filter-active th:not(:first-child),
    .sonsion-table.has-filter-active td:not(:first-child) {
        padding-left: 10px !important;
    }
    .sonsion-table.has-filter-active .sonsion-row-filter-content {
        gap: 4px !important;
    }
}