.fi-tenant-menu {
    .fi-dropdown-panel {
        min-width: fit-content;
        margin-top: 2px;
        min-height: fit-content !important;
        max-height: fit-content !important;
    }

    margin: 14px;
}

.fi-sidebar-nav {
    .fi-tenant-menu {
        margin: -10px;
        margin-right: -6px;
        margin-bottom: -12px;
    }

    .fi-dropdown-list-item>.fi-icon {
        color: var(--gray-700);
    }
}

.fi-user-menu,
.fi-tenant-menu {
    .fi-dropdown-list-item>.fi-icon {
        color: var(--gray-700);
    }
}

.fi-sidebar-header,
.fi-topbar {
    height: 3.5rem !important;
}

.fi-topbar-end {
    margin-top: -6px;
}

.fi-simple-main {
    form {
        margin-top: 12px;
    }
}

[data-filepond-item-state="processing-complete"] .filepond--item-panel {
    background-color: #4f39f6;
}

.fi-auth-layout main>div:first-child {
    max-width: 525px !important;
    padding: 0px !important;
    margin: auto;
}

.fi-panel-app main .fi-page>section:first-child {
    min-height: 800px;
}

.fi-panel-app .fi-topbar-ctn nav>div:first-child {
    display: flex !important;
}

.app-menu ul li {
    width: 100% !important;

    button.fi-topbar-item-button {
        width: 100% !important;
        justify-content: start !important;

        svg:last-child {
            display: none;
        }
    }

    a {
        justify-content: start !important;
    }
}

.fi-breadcrumbs {
    margin-bottom: 1.5rem !important;
}

.fi-simple-main {
    --tw-ring-color: none;
}

.fi-sidebar-nav {
    border-top: 1px solid var(--sidebar-border);
}

.fi-sc-form .fi-sc-component .fi-sc-actions,
.fi-ta-col-manager-actions-ctn,
.fi-modal-footer .fi-modal-footer-actions:not(.flex-col-reverse) {
    display: flex;
    flex-direction: row-reverse;
    margin-top: 8px;
}

.app-col-manager-modal {
    .fi-ta-col-manager-heading {
        display: none;
    }

    .fi-ta-col-manager {
        border: 1px solid var(--border-subtle);
        padding: 2em;
        border-radius: var(--radius-md);
    }
}

.fi-sc-form .fi-sc-component .fi-fieldset .fi-sc-actions {
    display: flex;
    flex-direction: row;
}

.fi-auth-layout .fi-sc-form .fi-sc-actions {
    display: flex;
    flex-direction: column;
}

.fi-align-center .fi-modal-footer-actions {
    flex-direction: row !important;
    display: grid !important;
}

.fi-dropdown-panel {
    label {
        cursor: pointer;
    }
}

input[type="checkbox"] {
    cursor: pointer;
}

.fi-main.max-w-7xl {
    max-width: 85rem !important;
}

.fi-account-widget {
    .fi-avatar {
        height: 4rem !important;
        width: 4rem !important;
        margin-right: 0.3rem !important;
    }
}

.fi-wi-stats-overview-stat-content {
    row-gap: 1.5rem !important;
    margin-bottom: 1.5rem !important;
}

.fi-wi-stats-overview-stat-description {
    width: 100% !important;

    span {
        width: 100% !important;
    }
}

#livewire-error {
    padding: 0 !important;

    iframe {
        background-color: #fff !important;
    }
}

.fi-badge {
    padding: 2px 8px !important;
    border-radius: var(--radius-sm) !important;
    font-weight: var(--font-weight-medium);
}

.fi-topbar-ctn {
    background: var(--surface-base);
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: none;
    overflow-x: unset;
}

.fi-sidebar-header-ctn {
    border-bottom: 1px solid var(--sidebar-border);
}

.fi-sidebar-nav {
    border-top: none;
}

.fi-ta-col-manager-items {
    padding-top: 16px;
    padding-bottom: 16px;
}

.fi-ta-col-manager-apply-action-ctn {
    display: flex;
    flex-direction: row-reverse;
}

.fi-dropdown-panel {
    min-width: fit-content;
}

.fi-layout {
    margin-bottom: -1px;
}

.fi-wi-chart-canvas-ctn {
    min-height: 300px !important;
    width: 100% !important;
}

.fi-modal-content {

    .fi-fo-builder-block-picker,
    .fi-fo-repeater-add {
        justify-content: center !important;
    }

    .fi-fo-builder-item-content {
        padding: 20px !important;
        border: 1px solid var(--border-subtle) !important;
        border-radius: var(--radius-md) !important;
    }

    .fi-fo-builder-label-between-items-ctn {
        border: 0 !important;
        margin-top: 8px !important;
        margin-bottom: 8px !important;

        .fi-fo-builder-label-between-items-divider-before,
        .fi-fo-builder-label-between-items-divider-after {
            display: none !important;
        }
    }

    .fi-fo-repeater-label-between-items-ctn {
        border: 0 !important;
        margin-top: 8px !important;
        margin-bottom: 8px !important;

        .fi-fo-repeater-label-between-items-divider-before,
        .fi-fo-repeater-label-between-items-divider-after {
            display: none !important;
        }
    }
}

.fi-wi-chart-canvas-ctn {
    min-height: 300px !important;
    width: 100% !important;
}

:root,
:host {
    --spacing: 0.225rem;

    --text-base: 0.85rem;
    --text-sm: 0.85rem;
    --text-md: 0.9rem;
    --text-lg: 1rem;
    --text-xl: 1.1rem;
    --text-2xl: 1.2rem;
    --text-3xl: 1.4rem;

    --app-max-wd: 100%;

    /* --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700; */

    /* radius scale */
    --radius-xs: 0.25rem;
    --radius-sm: 0.375rem;
    --radius-md: 0.4rem;
    --radius-lg: 0.5rem;
    --radius-full: 9999px;

    /* neutral surfaces & borders */
    --surface-base: #ffffff;
    --surface-sunken: #fafafa;
    --surface-raised: #ffffff;
    --border-subtle: oklch(0.929 0.003 264 / 1);
    --border-default: oklch(0.87 0.004 264 / 1);

    /* sidebar tokens, derived from the accent so tenant color overrides cascade */
    --sidebar-bg: var(--surface-sunken);
    --sidebar-border: var(--border-subtle);
    --sidebar-active-bg: color-mix(in oklab, var(--primary-500) 10%, transparent);
    --sidebar-active-fg: var(--primary-700);
    --sidebar-hover-bg: color-mix(in oklab, var(--primary-500) 6%, transparent);

    /* motion */
    --anim-fast: 100ms;
    --anim-base: 150ms;
    --anim-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

.fi-toggle {
    --spacing: 0.25rem;
}

.fi-modal>.fi-modal-window-ctn>.fi-modal-window .fi-modal-heading {
    font-size: var(--text-lg);
}

.fi-select-input-ctn {
    .fi-scrollable {
        max-height: 375px !important;
    }
}

footer>* {
    max-width: var(--app-max-wd) !important;
    margin: auto;
}

.fi-topbar {
    max-width: var(--app-max-wd) !important;
    margin: 0 auto;
    --tw-ring-shadow: none;
}

.fi-topbar:nth-child(2) {
    height: 16px !important;
    padding: 0px 12px !important;
}

.fi-topbar-item.fi-active .fi-topbar-item-btn,
.fi-tabs-item.fi-active {
    background-color: var(--primary-100) !important;
}

.fi-topbar-ctn>.fi-topbar .fi-topbar-start {
    display: flex !important;
}

@media (max-width: 1023px) {
    .fi-topbar:nth-child(2) {
        display: none !important;
    }
}

.fi-auth-layout {
    .fi-logo {
        height: 70px !important;
        margin-bottom: 64px !important;
    }
}

.fi-auth-login {
    .fi-simple-header-subheading {
        display: none !important;
    }
}

.fi-wi-widget,
.fi-ta-ctn,
.fi-sc-component {
    animation: fadeIn var(--anim-base) var(--anim-ease);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.fi-sc-section {
    transition: all var(--anim-base) var(--anim-ease);
}

.fi-section-header-heading {
    font-size: var(--text-sm);
    line-height: var(--tw-leading, var(--text-sm--line-height));
    --tw-font-weight: var(--font-weight-medium);
    font-weight: var(--font-weight-medium);
    color: var(--gray-950);
}

.fi-topbar-item-label {
    font-size: 0.85rem !important;
}

.fi-wi-chart {
    .fi-wi-chart-canvas-ctn {
        min-height: 220px !important;
        max-height: 320px !important;
        width: 100% !important;
    }

    .fi-section-content-ctn {
        display: grid;
        grid-template-rows: 1fr;
        transition: all var(--anim-base) var(--anim-ease);
    }

    .fi-section-content-ctn[aria-expanded="false"] {
        grid-template-rows: 0fr;
    }

    .fi-section-content {
        overflow: hidden;
    }
}

.app-capitalq-formula {
    display: flex;
    flex-direction: column;
    gap: 8px;

    hr {
        color: #a0a0a0;
    }

    span {
        text-align: center;
    }
}

.fi-panel-app,
.fi-panel-admin {
    .fi-main {
        margin-top: 1em;
        margin-bottom: 1em;
    }
}

.fi-fo-date-time-picker-calendar {
    gap: 12px !important;
    margin: 12px !important;
}

.fi-fo-date-time-picker .fi-fo-date-time-picker-calendar .fi-fo-date-time-picker-calendar-day.fi-selected {
    background-color: var(--primary-500) !important;
    color: white !important;
}

.ftv-root {
    .ftv-item {
        margin-top: 4rem;
    }

    .ftv-item:nth-child(1) {
        margin-top: 2rem;
    }

    .ftv-card-meta {
        margin-top: 3rem;
    }


    .ftv-card-clickable {
        cursor: pointer;
    }


    .ftv-card-clickable {
        cursor: pointer;
    }

    .ftv-card-current {
        background-color: color-mix(in oklab, var(--primary-500) 6%, var(--ftv-card-surface));
        --tw-ring-color: var(--primary-500);
        --tw-ring-shadow: var(--tw-ring-inset, ) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
    }

    .ftv-card-with-badge {
        padding-right: calc(var(--spacing) * 5);
    }

    .ftv-card-badge {
        position: absolute;
        top: calc(var(--spacing) * 3);
        right: calc(var(--spacing) * 3);
    }
}

.fi-fo-date-time-picker-time-inputs {
    margin-top: 36px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 8px;
}

.fi-fo-date-time-picker-panel-header {
    margin-bottom: 36px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 8px;
}

.fi-topbar-nav-groups {
    column-gap: 6px;
}

.shadow-lg {
    --tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
}

@media (min-width: 650px) {

    html:has(.capitalq-auth) {
        background-color: #261d66;
    }

    body:has(.capitalq-auth) {

        background: linear-gradient(180deg, #1e00ff, #2a12e0, #2a12e0, #61618c);

        .fi-simple-main-ctn {
            content: '';
            position: absolute;
            inset: 0;
            background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.4'/%3E%3C/svg%3E");
        }
    }

    .capitalq-auth {
        main {
            padding: 5em;
            border-radius: 3em;
            box-shadow: 6px 6px 6px rgb(0 0 0 / 0.1);
        }

        .capitalq-auth-form {
            animation: loginAnimation .3s ease-out;
            max-width: 650px;
        }
    }
}

.capitalq-email-verification {
    margin-top: 16px;

    .fi-sc-text {
        width: 100%;
        text-align: center !important;
    }
}


.driver-popover {
    min-width: 560px !important;
    padding: 2em !important;
    border-radius: var(--radius-md) !important;

    @media (max-width: 560px) {
        min-width: 100% !important;
    }

    .driver-popover-close-btn {
        font-size: 26px !important;
        color: #535353;
        top: 2px !important;
        right: 4px !important;
    }

    .driver-popover-title {
        margin-bottom: 32px !important;
        font-size: 1.5em !important;
    }

    .driver-popover-description {
        font-size: 0.875em !important;
    }

    footer {
        margin-top: 64px !important;

        justify-content: end !important;

        button {
            color: black !important;
            font-size: 0.875em;
            border: 1px solid rgb(221, 221, 221);
        }
    }
}

.driver-popover * {
    font-family: var(--font-family) !important;
}

.fi-sidebar {
    max-width: 260px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    box-shadow: none;
}

.fi-layout-sidebar-toggle-btn-ctn,
.fi-main-ctn {
    background-color: var(--surface-base);
}

html:has(.fi-simple-layout) {

    .fi-no-database,
    .fi-sidebar-item-btn,
    .fi-user-menu,
    .fi-topbar {
        display: none;
    }

    @media (min-width: 1023px) {
        .fi-simple-main {
            padding: 3em;
            box-shadow: 0px 0px 6px rgb(0 0 0 / 0.1);
            border-radius: 2em;
        }

        .fi-simple-layout {
            .fi-simple-main-ctn {
                max-width: 1280px;
            }
        }
    }

}


.fi-sidebar-item.fi-active>.fi-sidebar-item-btn {
    background-color: var(--sidebar-active-bg);
    color: var(--sidebar-active-fg);
}

.fi-sidebar-database-notifications-btn:hover,
.fi-tenant-menu-trigger:hover,
.fi-user-menu-trigger:hover,
.fi-sidebar-item>.fi-sidebar-item-btn:hover {
    background-color: var(--sidebar-hover-bg);
}

.fi-sidebar-footer {
    border-top: 1px solid var(--sidebar-border);
    margin: 0;
    padding: 0.5em;
}

/* Default bell trigger is replaced by the "open-notifications" user menu action; kept mounted (not removed) so its modal/Livewire component still exists for that action to dispatch open-modal against. */
.fi-sidebar-database-notifications-btn {
    display: none;
}

.capitalq-sidebar-collapse {
    border-bottom: 1px solid var(--sidebar-border);

    .fi-topbar-open-collapse-sidebar-btn {
        margin: o auto;
        margin-top: 16px;
        margin-bottom: 16px;
        width: 100%;
    }

    .capitalq-sidebar-img-collapse {
        display: flex;
        align-items: center;
        margin: o auto;
        margin-top: 8px;
        margin-bottom: 8px;
        width: 100%;

        img {
            height: 100% !important;
            width: 140px;
            margin: 8px;
            margin-left: 16px;
        }
    }

    .fi-topbar-close-collapse-sidebar-btn {
        margin: o auto;
        margin-top: 12px;
        margin-bottom: 12px;
        width: 100%;
        justify-content: end;
        padding-right: 20px;
    }
}

.fi-sidebar-header-ctn {
    display: none;
}

@media (max-width: 1023px) {
    .capitalq-sidebar-collapse {
        & .capitalq-sidebar-img-collapse {
            img {
                width: 160px;
                margin-top: 16px;
                margin-bottom: 16px;
            }
        }
    }
}

html:has(.capitalq-report-stack) {
    .fi-ta-record:hover {
        background-color: var(--gray-50);
        transition: background-color var(--anim-fast) var(--anim-ease);
    }
}

.fi-topbar-end {
    li {
        list-style: none;
    }
}

.fi-sidebar-item-grouped-border-part,
.fi-sidebar-item-grouped-border,
.fi-sidebar-item-grouped-border-part-not-first {
    opacity: 0 !important;
}

.fi-sidebar-nav-groups {
    row-gap: 6px !important;
    margin-top: -12px !important;
}

.fi-sidebar-group-items {
    row-gap: 6px !important;

    .fi-sidebar-item:nth-child(1) {
        margin-top: 2px !important;
    }
}

.fi-sidebar-group-btn {
    button {
        svg {
            opacity: 0 !important;
        }
    }
}

.fi-sidebar-group-btn:hover {
    button {
        svg {
            opacity: 1 !important;
        }
    }
}

.fi-sidebar-database-notifications-btn .fi-icon,
.fi-sidebar-footer .fi-sidebar-item-btn .fi-icon,
.fi-sidebar .fi-dropdown-trigger .fi-icon,
.fi-sidebar-item-icon,
.fi-sidebar-group-btn .fi-icon,
.fi-user-menu-trigger-text,
.fi-tenant-menu-trigger-tenant-name,
.fi-sidebar-group-label {
    color: var(--gray-700);
}

.fi-sidebar-group.fi-active .fi-sidebar-group-dropdown-trigger-btn .fi-icon,
.fi-sidebar-item.fi-active>.fi-sidebar-item-btn>.fi-icon {
    color: var(--primary-700);
}

.fi-sidebar-group-btn {
    border-radius: var(--radius-md);
}

.fi-sidebar-item:has(.fi-sidebar-item-grouped-border) {
    .fi-sidebar-item-label {
        font-weight: 500 !important;
    }
}

.fi-sidebar-group-btn:hover {
    background-color: var(--sidebar-hover-bg);
}

.fi-sidebar-open {

    .fi-user-menu-trigger .fi-avatar,
    .fi-tenant-menu-trigger .fi-avatar {
        margin-left: -3px;
    }

    .fi-sidebar-item-label,
    .fi-sidebar-group-label {
        margin-left: 3px;
    }

    .fi-sidebar-group[data-group-label]:not([data-group-label=""]) {
        .fi-sidebar-item:last-child {
            margin-bottom: 8px;
        }
    }
}

.capitalq-diff-modal-second-level {
    .fi-modal-window {
        max-height: fit-content;
        transition-duration: 0ms;
        animation-duration: 0ms;
    }
}

html:has(.capitalq-diff-modal-second-level) {
    .fi-modal-content:has(> .capitalq-diff-modal-first-level) {
        overflow: hidden;
    }
}

html:has(.capitalq-diff-modal-second-level .fi-modal-content) {
    .fi-modal-content:has(> .capitalq-diff-modal-second-level) {
        overflow: hidden;
    }
}


html:has(.capitalq-diff-modal-second-level) {
    .fi-modal-window:has(> * > .capitalq-diff-modal-first-level) {
        transition-duration: 0ms;
        animation-duration: 0ms;
    }

    .fi-modal-window:has(> * > .capitalq-diff-modal-second-level) {
        transition-duration: 100ms;
        animation-duration: 100ms;
    }
}

.fi-wi-stats-overview-stat {
    /* box-shadow: 0px 2px 2cqmax rgb(0 0 0 / 0.1);
    border: 1px solid var(--border-subtle); */
    transition: transform var(--anim-base) var(--anim-ease);
}

.fi-wi-stats-overview-stat:hover {
    transform: scale(1.02);
}

.fi-resource-reporting-reports {
    .fi-wi-stats-overview {
        .fi-section-header-heading {
            display: none;
        }
    }
}

.app-simple-layout {
    .fi-sidebar-database-notifications-btn {
        display: none;
    }

    .fi-header {
        div:has(.fi-header-heading) {
            display: none;
        }
    }

    .fi-sc-form {
        min-height: 65vh;
    }
}

.capitalq-workspace-switcher {
    .fi-dropdown-list-item {
        align-items: center;
        gap: calc(var(--spacing) * 3);
        width: 100%;
        padding: calc(var(--spacing) * 3);
        padding-left: 2px;
        font-weight: var(--font-weight-medium);
        font-size: var(--text-md);
        line-height: var(--tw-leading, var(--text-md--line-height));

        .fi-dropdown-list-item-image {
            width: 1.75em;
            height: 1.75em;
        }
    }
}

.fi-sidebar-footer {
    /* border-top: none; */
    /* padding: 0.5em; */

    .fi-user-menu {
        .fi-user-menu-trigger {
            padding: 0.8em;
            border-radius: var(--radius-md) !important;
            margin-top: -12px;
        }

        .fi-user-menu-trigger:hover {
            background-color: var(--sidebar-active-bg);
        }
    }
}

/*
 * Sticky table headers: the header row pins to the top of the viewport once it
 * scrolls out of view, so long tables stay readable without shrinking the table
 * into a fixed-height scroll box.
 *
 * `position: sticky` only tracks real page scroll if NO ancestor between the
 * `<th>` and the page has a non-`visible` overflow (auto/hidden/clip all count,
 * confirmed by testing) — any such ancestor becomes sticky's reference frame
 * instead of the page, and since these table wrappers never scroll internally
 * (no max-height), the header would just sit static rather than sticking. Two
 * such ancestors exist here and both need to be neutralized:
 *
 * 1. `.fi-ta-ctn` — this project's committed resources/css/tailwind.css snapshot
 *    carries an outdated, unconditional `.fi-ta-ctn{overflow:hidden}` (current
 *    Filament only hides overflow when the table has no header toolbar). Restore
 *    the conditional behavior for tables that do have a header.
 * 2. `.fi-ta-content-ctn` — Filament sets `overflow-x: auto` unconditionally so
 *    wide tables get a contained horizontal scrollbar. Sticky and that scrollbar
 *    can't coexist on the same element, so this is only enabled when a table
 *    actually overflows (`.app-table-x-scroll`, toggled by
 *    resources/js/sticky-tables.js via ResizeObserver) — most tables fit their
 *    container and get a working sticky header; a genuinely wide table keeps its
 *    scrollbar but loses stickiness for itself.
 *
 * `.fi-ta-header-ctn` (heading/description/header actions plus the search,
 * filters, grouping and column manager toolbar) sticks above the column header
 * row. Its height varies per table and can change at runtime (filters wrapping
 * to a second line, the bulk-selection toolbar appearing), so the column header
 * row's `top` offset is read from `--app-ta-header-h`, a custom property that
 * resources/js/sticky-tables.js keeps in sync per table via ResizeObserver
 * (scoped to each `.fi-ta-ctn` since a page can have more than one table, e.g.
 * relation managers).
 *
 * The column header row's `position: sticky` rule below is scoped to
 * `:not(.app-table-x-scroll)`. On an x-scrolling table, `top: var(--app-ta-
 * header-h)` doesn't just fail to stick — since that table's nearest "scrolling
 * ancestor" is itself (never actually scrolling), the header renders pinned
 * `--app-ta-header-h` pixels below the *top of that container's own box*,
 * permanently, regardless of page scroll, shoving it down into the body rows
 * instead of sitting above them. resources/js/sticky-tables.js's cloned header
 * (`.app-ta-sticky-clone`) is what actually provides stickiness for these
 * tables; the real header row just needs to stay in normal flow.
 */
.fi-ta-ctn.fi-ta-ctn-with-header {
    overflow: visible !important;
}

.fi-ta-content-ctn {
    overflow-x: visible !important;
}

.fi-ta-content-ctn.app-table-x-scroll {
    overflow-x: auto !important;
}

/*
 * Filament rounds `.fi-ta-content-ctn`'s bottom corners to match the card when
 * there's no pagination footer below it, relying on its own `overflow` to clip
 * the table's square background/rows to that curve. `overflow-x: visible`
 * above (needed for sticky, see the comment further down) leaves nothing to do
 * that clipping any more, so the last row's square corners show past the
 * curve. `clip-path` reproduces the same visual clip without setting
 * `overflow`, so it doesn't create a scroll container and doesn't break
 * sticky the way `overflow: hidden`/`auto`/`clip` all do here.
 */
.fi-ta-content-ctn:not(.fi-ta-ctn-with-footer .fi-ta-content-ctn) {
    clip-path: inset(0 round 0 0 var(--radius-xl) var(--radius-xl));
}

.fi-ta-header-ctn {
    position: sticky;
    top: 0;
    z-index: 20;
}

/*
 * An opaque background is only wanted once this is actually pinned to the top
 * of the viewport (to stay readable over rows scrolling underneath); applied
 * unconditionally it also covers the card's own rounded top corners while the
 * header is still in its normal, non-stuck position. `.app-ta-header-stuck` is
 * toggled by resources/js/sticky-tables.js via an IntersectionObserver on a
 * sentinel placed right before this element.
 */
.fi-ta-header-ctn.app-ta-header-stuck {
    background-color: var(--color-white, #fff);
}

.fi-ta-header-ctn.app-ta-header-stuck:where(.dark, .dark *) {
    background-color: var(--gray-900, #101828);
}

:where(.fi-ta-content-ctn:not(.app-table-x-scroll)) .fi-ta-table>thead>tr:where(:not(.fi-ta-table-head-groups-row)):where(:not(.fi-ta-table-stacked-header-row))>th {
    position: sticky;
    top: var(--app-ta-header-h, 0px);
    z-index: 10;
    background-color: var(--gray-50, #f9fafb);
}

.fi-ta-table>thead>tr>th:where(.dark, .dark *) {
    background-color: color-mix(in oklab, white 5%, var(--gray-900, #101828));
}

/*
 * `.app-ta-sticky-clone` is the JS-managed fallback header (see
 * resources/js/sticky-tables.js) shown in place of the native sticky column
 * header row on tables where `.app-table-x-scroll` is active — `position`,
 * `top`, `left`, `width` and `height` are all set inline per-frame by that
 * script; this just adds the same divider the real thead/tbody boundary gets
 * (`.fi-ta-table` divide-y) since the clone has no tbody sibling to draw it.
 */
.app-ta-sticky-clone {
    box-shadow: 0 1px 0 0 var(--border-subtle);
}

.app-ta-sticky-clone:where(.dark, .dark *) {
    box-shadow: 0 1px 0 0 color-mix(in oklab, white 10%, transparent);
}

.fi-ta-header-toolbar {
    border-top: none;
}