/* Shared list-table sort controls (static/js/table-sort.js). Scoped to .mf-sortable. */
.mf-sortable th .mf-sort-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    max-width: 100%;
}
.mf-sortable th .mf-sort-btn {
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
    text-align: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.mf-sortable th .mf-sort-btn:hover { color: var(--gray-900, #111827); }
.mf-sortable th .mf-sort-arrow { font-size: 0.65em; min-width: 0.7em; }
.mf-sortable th .mf-sort-caret {
    background: none;
    border: 1px solid transparent;
    border-radius: 4px;
    width: 18px;
    height: 18px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400, #9CA3AF);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.mf-sortable th .mf-sort-caret:hover,
.mf-sortable th .mf-sort-caret[aria-expanded="true"] {
    background: var(--gray-100, #F3F4F6);
    border-color: var(--gray-200, #E5E7EB);
    color: var(--gray-700, #374151);
}
.mf-sortable th .mf-sort-btn:focus-visible,
.mf-sortable th .mf-sort-caret:focus-visible,
.mf-sortable th .mf-sort-item:focus-visible {
    outline: 2px solid var(--accent, #2563EB);
    outline-offset: 2px;
}
.mf-sortable th.mf-sort-active .mf-sort-btn { color: var(--gray-900, #111827); }
.mf-sortable th .mf-sort-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 50;
    min-width: 140px;
    background: #fff;
    border: 1px solid var(--gray-200, #E5E7EB);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 4px;
    text-align: left;
}
.mf-sortable th .mf-sort-menu[hidden] { display: none; }
.mf-sortable th .mf-sort-item {
    display: block;
    width: 100%;
    background: none;
    border: 0;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.8125rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
    color: var(--gray-700, #374151);
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
}
.mf-sortable th .mf-sort-item:hover { background: var(--gray-100, #F3F4F6); }
.mf-sortable th .mf-sort-item[aria-checked="true"] {
    color: var(--accent, #2563EB);
    font-weight: 600;
}
.mf-sortable th .mf-sort-item[aria-checked="true"]::before { content: "\2713  "; }
