.fi-modal.fi-modal-open { visibility: visible !important; }

/* Filament ships no sticky-column support, so on wide tables the row actions
   (Edit/Delete) are the last cell in the horizontally-scrolling table and get
   pushed off-screen when the sidebar is open, requiring a manual scroll to
   reach them. Pin the actions cell/header to the right edge instead. */
.fi-ta-cell:has(.fi-ta-actions),
.fi-ta-actions-header-cell {
    position: sticky;
    right: 0;
    z-index: 1;
    background-color: var(--color-white);
    box-shadow: -4px 0 4px -4px rgb(0 0 0 / 0.15);
}
:where(.dark) .fi-ta-cell:has(.fi-ta-actions),
:where(.dark) .fi-ta-actions-header-cell {
    background-color: var(--gray-900);
}
.fi-ta-row.fi-striped .fi-ta-cell:has(.fi-ta-actions) {
    background-color: var(--gray-50);
}
:where(.dark) .fi-ta-row.fi-striped .fi-ta-cell:has(.fi-ta-actions) {
    background-color: color-mix(in oklab, var(--color-white) 5%, transparent);
}
.fi-ta-row.fi-clickable:hover .fi-ta-cell:has(.fi-ta-actions),
.fi-ta-row.fi-selected:not(.fi-striped) .fi-ta-cell:has(.fi-ta-actions) {
    background-color: var(--gray-50);
}
:where(.dark) .fi-ta-row.fi-clickable:hover .fi-ta-cell:has(.fi-ta-actions),
:where(.dark) .fi-ta-row.fi-selected:not(.fi-striped) .fi-ta-cell:has(.fi-ta-actions) {
    background-color: color-mix(in oklab, var(--color-white) 5%, transparent);
}
.fi-ta-row-ai-import-new .fi-ta-cell {
    background-color: rgb(239 246 255 / 0.38);
    box-shadow: inset 3px 0 0 rgb(96 165 250 / 0.48);
}
.fi-ta-row-ai-import-new.fi-ta-row.fi-clickable:hover .fi-ta-cell,
.fi-ta-row-ai-import-new.fi-ta-row.fi-striped .fi-ta-cell,
.fi-ta-row-ai-import-new .fi-ta-cell:has(.fi-ta-actions) {
    background-color: rgb(219 234 254 / 0.46);
}
:where(.dark) .fi-ta-row-ai-import-new .fi-ta-cell {
    background-color: color-mix(in oklab, #60a5fa 9%, transparent);
    box-shadow: inset 3px 0 0 rgb(59 130 246 / 0.5);
}
:where(.dark) .fi-ta-row-ai-import-new.fi-ta-row.fi-clickable:hover .fi-ta-cell,
:where(.dark) .fi-ta-row-ai-import-new.fi-ta-row.fi-striped .fi-ta-cell,
:where(.dark) .fi-ta-row-ai-import-new .fi-ta-cell:has(.fi-ta-actions) {
    background-color: color-mix(in oklab, #60a5fa 13%, transparent);
}

/* The invoice line VAT selector contains the value, clear button, dropdown
   trigger, and inline create action. Filament only applies repeater table
   widths to headers, so force the body cell/control to keep enough room. */
.facture-lines-repeater.fi-fo-table-repeater > table > tbody > tr > td:has(.facture-line-vat-rate),
.facture-lines-repeater.fi-fo-table-repeater .facture-line-vat-rate {
    min-width: 8rem;
}

/* Keep invoice identity, payment state, and accounting context visible while
   long line-item tables scroll on laptop-sized two-column layouts. Filament's
   top bar is 4rem tall, so the extra 1rem keeps the rail comfortably below it. */
@media (min-width: 80rem) {
    .facture-sticky-rail {
        position: sticky;
        top: 5rem;
        z-index: 5;
        align-self: start;
        height: fit-content;
    }
}
