/* Active table bar */
.active-table-bar {
    position: sticky !important;
    width: 100% !important;
    top: 0px !important;
    z-index: 999 !important;
    border-bottom-left-radius: 5px !important;
    border-bottom-right-radius: 5px !important;
    --active-table-bar-height: 38.8px;
    height: var(--active-table-bar-height) !important;
}

.active-table-bar .table-generation {
    /* position: fixed; */
    top: 55px !important;
}

#tableDropdown {
    font-size: 0.85rem !important;
}

/* Table name truncation for small screens */
.table-name-wrapper {
    min-width: 0;
    flex: 1;
}

.table-name-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.table-name-container.min-w-0 {
    min-width: 0;
}

.table-name-label.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}


/* Dropdown menu */
/* Dropdown menu - match sidebar hover/active styles */
#tableDropdownMenu {
    min-width: 220px;
    background: var(--sp-sidebar-bg);
    border: 1px solid var(--sp-sidebar-border);
    box-shadow: var(--sp-sidebar-shadow);
    color: var(--sp-sidebar-color);
    padding: .35rem;
    border-radius: .5rem;
}

/* header / divider */
#tableDropdownMenu .dropdown-header { color: var(--sp-sidebar-color-muted); font-size: .85rem; padding: .4rem .6rem; }
#tableDropdownMenu .dropdown-divider { margin: .4rem 0; border-top-color: var(--sp-sidebar-border); opacity: .9; }

/* items */
#tableDropdownMenu .dropdown-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: .45rem .6rem;
    margin: .12rem 0;
    border-radius: .5rem;
    color: var(--sp-sidebar-color);
    background: transparent;
    transition: color var(--sp-transition), transform var(--sp-scale-spring);
    overflow: hidden;
    font-size: 0.99rem !important;
}

/* subtle gradient overlay like sidebar links */
#tableDropdownMenu .dropdown-item::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--sp-hover-gradient);
    opacity: 0;
    transition: opacity var(--sp-transition);
}
#tableDropdownMenu .dropdown-item:hover::before { opacity: 1; }

/* hover / focus */
#tableDropdownMenu .dropdown-item:hover { color: var(--sp-sidebar-accent); transform: translateY(-1px); }
#tableDropdownMenu .dropdown-item:focus-visible { outline: none; box-shadow: var(--sp-active-ring); }

/* active state */
#tableDropdownMenu .dropdown-item.active,
#tableDropdownMenu .dropdown-item:active {
    color: var(--sp-sidebar-accent);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px var(--sp-sidebar-active-outline);
}
#tableDropdownMenu .dropdown-item.active::before { opacity: 1; background: var(--sp-sidebar-active-bg); }

/* ensure content (text/icons) sits above overlay */
#tableDropdownMenu .dropdown-item > * { position: relative; z-index: 1; }

/* icons inherit color */
#tableDropdownMenu .dropdown-item i,
#tableDropdownMenu .dropdown-item .fa { color: inherit; }