/*
 * Shared dense admin data-table chrome (Text Export Library, My Library, …).
 *
 * Pattern every new table on the site should follow:
 *   1. Sort row  — .te-lib-sort-row + .te-lib-sort-btn (click toggles asc/desc)
 *   2. Filter row — .te-lib-filter-row + .te-lib-col-filter (per-column search)
 *   3. Body rows
 *
 * Class names are shared with Text Export so look-and-feel stays one system.
 */

.te-lib-table-wrap {
    border: 1px solid var(--ddr-border, #334155);
    border-radius: 0.5rem;
    overflow: auto;
    background: rgba(15, 23, 42, 0.55);
}

.te-lib-table {
    margin-bottom: 0;
    --bs-table-bg: transparent;
    --bs-table-color: var(--ddr-text, #e8eef7);
    --bs-table-hover-bg: rgba(45, 212, 191, 0.06);
    --bs-table-border-color: var(--ddr-border, #334155);
}

.te-lib-table .te-lib-sort-row th {
    vertical-align: middle;
    white-space: nowrap;
    padding: 0 !important;
    background: #1e3a5f !important;
    border-bottom: 2px solid #38bdf8;
}

.te-lib-table .te-lib-sort-row th:not(:first-child) {
    border-left: 1px solid rgba(148, 163, 184, 0.28);
}

.te-lib-sort-btn {
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    gap: 0.3rem;
    width: 100% !important;
    min-height: 2.4rem;
    margin: 0 !important;
    padding: 0.55rem 0.65rem !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #f1f5f9 !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.2;
    cursor: pointer;
}

.te-lib-table .te-lib-sort-row th.text-end .te-lib-sort-btn,
.te-lib-table .te-lib-sort-row th.te-lib-actions-col .te-lib-sort-btn {
    justify-content: flex-end;
}

.te-lib-sort-btn:hover,
.te-lib-sort-btn.is-active {
    color: #ffffff !important;
    background: rgba(56, 189, 248, 0.22) !important;
}

.te-lib-sort-ind {
    font-size: 0.65rem;
    min-width: 0.7rem;
    color: #7dd3fc !important;
    margin-left: auto;
}

.te-lib-table .te-lib-sort-row th.te-lib-actions-col {
    background: #1e3a5f !important;
    color: #f1f5f9 !important;
    border-bottom: 2px solid #38bdf8 !important;
    text-align: end;
    padding: 0.55rem 0.65rem !important;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.te-lib-filter-row th {
    padding-top: 0.25rem;
    padding-bottom: 0.45rem;
    padding-left: 0.4rem;
    padding-right: 0.4rem;
    background: var(--ddr-surface-2, #182338);
    border-bottom: 1px solid var(--ddr-border, #334155);
    vertical-align: middle;
}

.te-lib-col-filter {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    font-size: 0.72rem;
    padding: 0.2rem 0.4rem;
}

.te-lib-filter-row th.te-lib-actions-col {
    background: var(--ddr-surface-2, #182338) !important;
    padding: 0.25rem 0.4rem !important;
}

.te-empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--ddr-muted, #94a3b8);
}
