/* Table Sorting Styles */

/* Sortable table headers */
.table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background-color 0.2s ease;
    padding-right: 24px !important;
}

.table th.sortable:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Sort indicators */
.sort-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    text-align: center;
    line-height: 12px;
    font-size: 10px;
    color: #6c757d;
    opacity: 0.6;
    transition: opacity 0.2s ease, color 0.2s ease;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
}

/* Active sort indicator */
.table th.sorted .sort-indicator {
    opacity: 1;
    color: #000000;
}

/* Hover effect for inactive headers */
.table th.sortable:not(.sorted):hover .sort-indicator {
    opacity: 0.8;
}

/* Ensure proper spacing for text-end headers */
.table th.text-end.sortable {
    white-space: nowrap;
    position: relative;
}

/* Dashboard and overview table specific styles */
.dashboard-table th.sortable,
.overview-table th.sortable {
    font-weight: 600;
}

.dashboard-table th:first-child.sortable .sort-indicator,
.overview-table th:first-child.sortable .sort-indicator,
.sortable th:first-child.sortable .sort-indicator {
    position: relative !important;
    right: auto !important;
    top: auto !important;
    transform: none !important;
    display: inline-block !important;
    margin-left: 8px !important;
    vertical-align: middle !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sort-indicator {
        width: 10px;
        height: 10px;
        line-height: 10px;
        font-size: 8px;
    }
}

/* Print styles - hide sort indicators */
@media print {
    .sort-indicator {
        display: none !important;
    }

    .table th.sortable {
        cursor: default;
    }
}
