/* Resized Column Styles */
/* Reserve a right gutter on every resizable header so the sort icon/label
   never collides with the resize handle bar sitting at the right edge. */
.group\/column-resize {
    padding-inline-end: 1rem !important;
}

.column-resize-handle-bar {
    position: absolute;
    top: 50%;
    height: 66.666667%;
    transform: translateY(-50%);
    width: 1rem;
    cursor: col-resize;
    user-select: none;
    touch-action: none;
    right: -0.5rem;
    z-index: 10;
    display: flex;
    justify-content: center;
}

.column-resize-handle-bar::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: rgb(209 213 219);
    transform: translateX(1px);
    transition-property: all;
    transition-duration: 300ms;
}

.dark .column-resize-handle-bar::before {
    background-color: rgba(255, 255, 255, 0.05);
}

.column-resize-handle-bar:hover::before,
.column-resize-handle-bar.active::before {
    width: 2px;
    background-color: rgb(from var(--primary-500) r g b);
}

/* Active resize handle */
.column-resize-handle-bar.active::before {
    width: 4px !important;
}
/* Table header cell styles */
.fi-ta-header-cell {
    position: relative;
}

/* Reserve space on the left of a reorderable header so the grip sits in a
   gutter instead of overlapping the label. */
.resized-reorderable-col {
    padding-inline-start: 1.75rem !important;
}

.resized-col-drag {
    position: absolute;
    top: 50%;
    left: 0.5rem;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 1rem;
    cursor: grab;
    opacity: 0.35;
    line-height: 1;
    letter-spacing: -0.15em;
    color: rgb(148 163 184);
    transition: opacity 0.15s ease;
}

.group\/column-resize:hover .resized-col-drag {
    opacity: 1;
}

.resized-col-drag:active {
    cursor: grabbing;
}

.sortable-ghost {
    opacity: 0.4;
}

/* Pin icon / toggle marking a sticky (pinned) column header */
.resized-sticky-pin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 0.85rem;
    height: 0.85rem;
    margin-inline-end: 0.35rem;
    padding: 0;
    background: transparent;
    border: 0;
    color: rgb(var(--primary-500, 234 179 8));
    flex-shrink: 0;
    pointer-events: none;
}

.resized-sticky-pin svg {
    width: 100%;
    height: 100%;
}

/* Clickable toggle variant (stickable tables): faint when unpinned, solid
   when pinned, brighter on hover. */
.resized-sticky-pin.is-toggle {
    pointer-events: auto;
    cursor: pointer;
    color: rgb(148 163 184);
    opacity: 0.55;
    transition: opacity 0.15s ease, color 0.15s ease;
}

.resized-sticky-pin.is-toggle:hover {
    opacity: 1;
}

.resized-sticky-pin.is-toggle.is-pinned {
    color: rgb(var(--primary-500, 234 179 8));
    opacity: 1;
}

/* Sticky columns need opaque backgrounds so horizontally scrolled cells pass
   underneath instead of bleeding through. Colours match Filament's table. */
.fi-ta-header-cell.resized-sticky {
    background-color: rgb(249 250 251);
}

.dark .fi-ta-header-cell.resized-sticky {
    background-color: color-mix(in srgb, white 5%, rgb(17 24 39));
}

td.resized-sticky {
    background-color: rgb(255 255 255);
}

.fi-ta-row:hover td.resized-sticky,
.fi-ta-row.fi-striped td.resized-sticky,
.fi-ta-row.fi-selected td.resized-sticky {
    background-color: rgb(249 250 251);
}

.dark td.resized-sticky {
    background-color: rgb(17 24 39);
}

.dark .fi-ta-row:hover td.resized-sticky,
.dark .fi-ta-row.fi-striped td.resized-sticky,
.dark .fi-ta-row.fi-selected td.resized-sticky {
    background-color: color-mix(in srgb, white 5%, rgb(17 24 39));
}

/* "Pin columns" toolbar dropdown panel */
.resized-sticky-panel {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* Container + trigger styled here (Filament's fi-dropdown-panel sets
   width:100vw and expects its floating-ui parent, so it can't be reused
   standalone). Only the checkbox reuses Filament's fi-checkbox-input. */
.resized-sticky-panel-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    color: rgb(113 113 122);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.resized-sticky-panel-trigger svg {
    width: 1.25rem;
    height: 1.25rem;
}

.resized-sticky-panel-trigger:hover {
    background-color: rgb(244 244 245);
    color: rgb(63 63 70);
}

.dark .resized-sticky-panel-trigger {
    color: rgb(161 161 170);
}

.dark .resized-sticky-panel-trigger:hover {
    background-color: rgb(39 39 42);
    color: rgb(228 228 231);
}

.resized-sticky-panel-menu {
    position: absolute;
    top: calc(100% + 0.25rem);
    inset-inline-end: 0;
    z-index: 40;
    min-width: 14rem;
    max-height: 20rem;
    overflow-y: auto;
    padding: 0.375rem;
    border-radius: 0.75rem;
    background-color: rgb(255 255 255);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    border: 1px solid rgb(228 228 231);
}

.dark .resized-sticky-panel-menu {
    background-color: rgb(24 24 27);
    border-color: rgb(39 39 42);
}

.resized-sticky-panel-heading {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgb(113 113 122);
}

.dark .resized-sticky-panel-heading {
    color: rgb(161 161 170);
}

.resized-sticky-panel-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: rgb(39 39 42);
    cursor: pointer;
}

.resized-sticky-panel-item:hover {
    background-color: rgb(244 244 245);
}

.dark .resized-sticky-panel-item {
    color: rgb(228 228 231);
}

.dark .resized-sticky-panel-item:hover {
    background-color: rgb(39 39 42);
}

.resized-sticky-panel-empty {
    padding: 0.5rem;
    font-size: 0.875rem;
    color: rgb(161 161 170);
}

.resized-sticky-panel-bulk {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.5rem;
    padding: 0.125rem 0.5rem 0.375rem;
}

.resized-sticky-panel-bulk-btn {
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
}

.resized-sticky-panel-bulk-btn--select {
    color: rgb(var(--primary-500, 234 179 8));
}

.resized-sticky-panel-bulk-btn--select:hover {
    color: rgb(var(--primary-600, 202 138 4));
}

.resized-sticky-panel-bulk-btn--deselect {
    color: rgb(220 38 38);
}

.resized-sticky-panel-bulk-btn--deselect:hover {
    color: rgb(185 28 28);
}

.dark .resized-sticky-panel-bulk-btn--deselect {
    color: rgb(248 113 113);
}

.dark .resized-sticky-panel-bulk-btn--deselect:hover {
    color: rgb(252 165 165);
}

.resized-sticky-panel-footer {
    display: flex;
    justify-content: flex-start;
    padding: 0.375rem 0.5rem 0.25rem;
    margin-top: 0.25rem;
    border-top: 1px solid rgb(228 228 231);
}

.dark .resized-sticky-panel-footer {
    border-top-color: rgb(39 39 42);
}

[x-cloak] {
    display: none !important;
}
