/**
 * Barras de rolagem perceptíveis nas tabelas Filament.
 * A barra horizontal custom aparece sempre que houver overflow (não só por media query),
 * para funcionar ao redimensionar o browser manualmente.
 */

.fi-ta-content-ctn {
    overflow: auto !important;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgb(113 113 122) rgb(39 39 42);
}

.fi-ta-content-ctn::-webkit-scrollbar {
    width: 12px;
    height: 0; /* horizontal nativa some; usamos .bj-hscroll */
}

.fi-ta-content-ctn::-webkit-scrollbar-thumb {
    background: rgb(113 113 122);
    border-radius: 9999px;
    border: 2px solid rgb(39 39 42);
}

.fi-ta-content-ctn::-webkit-scrollbar-track {
    background: rgb(39 39 42);
}

html:not(.dark) .fi-ta-content-ctn {
    scrollbar-color: rgb(113 113 122) rgb(228 228 231);
}

html:not(.dark) .fi-ta-content-ctn::-webkit-scrollbar-thumb {
    border-color: rgb(228 228 231);
}

html:not(.dark) .fi-ta-content-ctn::-webkit-scrollbar-track {
    background: rgb(228 228 231);
}

/* Em viewport estreita/baixa, limita a altura para a barra horizontal ficar na tela */
@media (max-width: 1280px), (max-height: 900px) {
    .fi-ta-content-ctn {
        max-height: min(28rem, calc(100dvh - 16rem));
    }
}

.bj-hscroll {
    display: none;
    height: 14px;
    margin-top: 0.5rem;
    padding: 0 0.25rem;
    touch-action: none;
    user-select: none;
}

.bj-hscroll.is-visible {
    display: block;
}

.bj-hscroll__track {
    position: relative;
    height: 100%;
    border-radius: 9999px;
    background: rgb(39 39 42);
    cursor: pointer;
}

.bj-hscroll__thumb {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    min-width: 32px;
    border-radius: 9999px;
    background: rgb(113 113 122);
    cursor: grab;
}

.bj-hscroll__thumb:active {
    cursor: grabbing;
}

html:not(.dark) .bj-hscroll__track {
    background: rgb(228 228 231);
}

html:not(.dark) .bj-hscroll__thumb {
    background: rgb(113 113 122);
}
