.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 1rem;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.search-container {
    flex: 1;
    max-width: 25rem;
    min-width: 12.5rem;
}

.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    border: 1px solid var(--border-dim);
}

.styled-table {
    border-collapse: collapse;
    width: 100%;
    text-align: left;
    font-size: 0.95rem;
}

.styled-table th,
.styled-table td {
    padding: 0.3rem 0.5rem;
}

.styled-table th {
    background-color: var(--primary-light);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-dim);
}

.styled-table th.checkbox-col {
    text-align: center;
    width: 3rem;
}

.styled-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 1.2rem;
    transition: background-color 0.2s, color 0.2s;
}

.styled-table th.sortable:hover {
    color: var(--primary-dark);
    background-color: var(--bg-surface);
}

.styled-table th.sortable::after {
    content: '';
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    border: 4px solid transparent;
    border-top-color: var(--neutral-strong);
    opacity: 0.3;
}

.styled-table th.sorted-asc::after {
    border: 4px solid transparent;
    border-bottom-color: var(--primary);
    transform: translateY(-75%);
    opacity: 1;
}

.styled-table th.sorted-desc::after {
    border: 4px solid transparent;
    border-top-color: var(--primary);
    transform: translateY(-25%);
    opacity: 1;
}

.styled-table th.col-wide,
.styled-table td.col-wide {
    width: auto;
    min-width: 9rem;
    max-width: 18rem;
    white-space: normal;
    line-height: 1.2;
}

.styled-table td {
    border-bottom: 1px solid var(--border-dim);
    vertical-align: middle;
    color: var(--text-main);
    white-space: nowrap;
}

.styled-table tr:hover td {
    background-color: var(--bg-app);
}

.styled-table th.action-col,
.styled-table td.action-cell {
    text-align: center;
    width: 3.5rem;
    min-width: 3.5rem;
    box-sizing: border-box;
}

.styled-table td.action-cell a {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    color: inherit;
    text-decoration: none;
}

.styled-table td.action-cell a::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2.75rem;
    height: 2.75rem;
    cursor: pointer;
    z-index: 1;
}


.user-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.user-main-text {
    font-weight: 600;
    color: var(--text-strong);
}

.email-cell {
    max-width: 12rem;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.checkbox-cell {
    text-align: center;
}

.text-primary {
    color: var(--success);
    font-weight: 700;
}

@media (max-width: 600px) {
    .table-header {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 1rem;
    }

    .search-container {
        max-width: 100%;
    }

    .hide-mobile {
        display: none;
    }
}