/* ───────────────────────────────────────────────
   tableTools — controls bar + sort indicators
   ─────────────────────────────────────────────── */

.tt-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    margin-top: 4px;
}

.tt-search {
    display: flex;
    align-items: center;
    position: relative;
}

.tt-search::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    background-image: 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='rgba(156,163,175,0.7)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 1;
}

.tt-search-input {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.92);
    padding: 6px 12px 6px 32px;
    border-radius: 999px;
    min-width: 220px;
    font-size: 0.82rem;
    outline: none;
    transition: border-color .15s ease, background .15s ease;
}



.tt-search-input:focus {
    border-color: rgba(67, 233, 89, 0.6);
    background: rgba(255, 255, 255, 0.06);
}

.tt-search-input::placeholder {
    color: rgba(156, 163, 175, 0.7);
}

.tt-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    align-items: center;
    flex: 1 1 auto;
}

.tt-chip-group {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.tt-chip-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgb(156, 163, 175);
    margin-right: 4px;
}

.tt-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.85);
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 0.72rem;
    line-height: 1.4;
    cursor: pointer;
    transition: background .12s ease, color .12s ease, border-color .12s ease;
}

.tt-chip:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.tt-chip.active {
    background: #43E959;
    color: #0a0a0a;
    border-color: #43E959;
    font-weight: 600;
}

.tt-status {
    font-size: 0.7rem;
    color: rgb(156, 163, 175);
    margin-left: auto;
    white-space: nowrap;
}

.tt-clear {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.75);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    cursor: pointer;
}
.tt-clear:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }

/* ─── Header-mounted mode (search inline in card header,
       chips in a popover anchored to a filter button) ─── */

.card-s-header-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.tt-header-search {
    display: flex;
    align-items: center;
    position: relative;
}

.tt-header-search::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    background-image: 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='rgba(156,163,175,0.7)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 1;
}

.card-s-header-tools .tt-search-input {
    min-width: 180px;
    padding: 5px 12px 5px 32px;
    font-size: 0.78rem;
}

.tt-filter-anchor {
    position: relative;
    display: inline-block;
}

.tt-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(107, 114, 128, 0.18);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.tt-filter-btn:hover,
.tt-filter-btn.open {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(67, 233, 89, 0.35);
    color: #fff;
}
.tt-filter-btn.pinned {
    background: rgba(67, 233, 89, 0.18);
    border-color: rgba(67, 233, 89, 0.6);
    color: #fff;
}

.tt-popover {
    position: fixed;
    top: 0;
    right: 0;
    min-width: 320px;
    max-width: 520px;
    background: rgba(18, 20, 24, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    padding: 12px;
    z-index: 1000;
    display: none;
    flex-direction: column;
    gap: 10px;
}
.tt-popover.open { display: flex; }

.tt-popover .tt-extras { display: flex; flex-direction: column; gap: 6px; }
.tt-popover .tt-extras:empty { display: none; }

.tt-popover .tt-chips {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}
.tt-popover .tt-chips:empty { display: none; }

.tt-popover .tt-chip-group { gap: 6px; }
.tt-popover .tt-chip { padding: 4px 12px; font-size: 0.74rem; }

.tt-popover-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.tt-popover-footer .tt-status { margin-left: 0; }

/* Sort indicators */
th.tt-sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: color .12s ease;
}

th.tt-sortable:hover { color: #fff; }

.tt-arrow {
    display: inline-block;
    margin-left: 6px;
    font-size: 0.85em;
    line-height: 1;
    color: rgba(156, 163, 175, 0.65);
    vertical-align: middle;
}

.tt-arrow::before { content: "\25B4\25BE"; letter-spacing: -0.05em; }

th.tt-sort-asc .tt-arrow,
th.tt-sort-desc .tt-arrow {
    color: #43E959;
}

th.tt-sort-asc .tt-arrow::before { content: "\25B4"; }
th.tt-sort-desc .tt-arrow::before { content: "\25BE"; }

@media (max-width: 720px) {
    .tt-search-input { min-width: 0; width: 100%; }
    .tt-status { margin-left: 0; }
}
