/* Reduce padding for collapsed sidebar icons */
.fi-sidebar-nav-collapsed .fi-sidebar-item-button {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
}

.fi-sidebar-nav-collapsed .fi-sidebar-item {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.fi-sidebar-nav-collapsed .fi-sidebar-nav {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
}

/* Center the icons when collapsed */
.fi-sidebar-nav-collapsed .fi-sidebar-item-icon {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Adjust the collapsed sidebar width if needed */
.fi-sidebar-nav-collapsed {
    width: 4rem !important;
}

/* Custom dropdown height overrides - double the default */
.choices__list--dropdown {
    max-height: 32rem !important;
}

.choices__list--dropdown .choices__list,
.choices__list[aria-expanded] .choices__list {
    max-height: 31rem !important; /* Override default 15rem */
}

.fi-ta-filters .choices__list--dropdown {
    max-height: 32rem !important;
}

.fi-ta-filters .choices__list[role="listbox"] {
    max-height: 31rem !important;
}

/* Hide active filters bar completely */
.fi-ta-filter-indicators {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Also hide any active filter summary */
.fi-ta-filters-summary {
    display: none !important;
}

/* Eliminate spacing between fields in order_search filter */
.fi-ta-filters > div:nth-child(4) .fi-fo-field-wrp {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.fi-ta-filters > div:nth-child(4) .fi-fo-field-wrp + .fi-fo-field-wrp {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.fi-ta-filters > div:nth-child(4) form > div {
    gap: 0 !important;
}

.fi-ta-filters > div:nth-child(4) .space-y-4 {
    gap: 0 !important;
}

.fi-ta-filters > div:nth-child(4) .space-y-4 > * + * {
    margin-top: 0 !important;
}

/* Style the order_search filter as a visually grouped unit */
.fi-ta-filters > div:nth-child(4) {
    background: #f9fafb !important;
    padding: 1rem !important;
    border-radius: 0.5rem !important;
    border: 2px solid #e5e7eb !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}

/* Dark mode styling */
.dark .fi-ta-filters > div:nth-child(4) {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Add a visual separator between the two fields */
.fi-ta-filters > div:nth-child(4) .fi-fo-field-wrp:first-child {
    position: relative;
    padding-bottom: 0.75rem !important;
    margin-bottom: 0.75rem !important;
    border-bottom: 1px solid #e5e7eb !important;
}

.dark .fi-ta-filters > div:nth-child(4) .fi-fo-field-wrp:first-child {
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

/* Adjust spacing for the visual grouping */
.fi-ta-filters > div:nth-child(4) .fi-fo-field-wrp + .fi-fo-field-wrp {
    margin-top: 0 !important;
}

/* Hide all search bars at the top of the page */
.fi-global-search,
.fi-global-search-field,
.fi-global-search-input,
[class*="global-search"],
[class*="globalSearch"] {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
}

/* Hide the search container in the topbar */
.fi-topbar nav > div:has(.fi-global-search),
.fi-topbar nav > div:has([class*="search"]) {
    display: none !important;
}

/* Hide any search input in the header/topbar */
.fi-topbar input[type="search"],
.fi-topbar input[placeholder*="Search"],
.fi-topbar input[placeholder*="search"],
.fi-header input[type="search"],
.fi-header input[placeholder*="Search"],
.fi-header input[placeholder*="search"] {
    display: none !important;
}

/* Hide parent containers of search inputs */
.fi-topbar form:has(input[type="search"]),
.fi-topbar div:has(input[type="search"]),
.fi-header form:has(input[type="search"]),
.fi-header div:has(input[type="search"]) {
    display: none !important;
}

/* Make date filter more compact */
.fi-ta-filters > div:nth-child(3) .fi-fo-field-wrp {
    margin-bottom: 0.5rem !important;
}

/* Reduce spacing in the date filter grid */
.fi-ta-filters > div:nth-child(3) .grid {
    gap: 0.5rem !important;
}

/* Keep the default 4-column layout */
.fi-ta-filters {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 1rem !important;
}

/* All filters take 25% width by default */
.fi-ta-filters > div {
    flex: 0 0 calc(25% - 0.75rem) !important;
    width: calc(25% - 0.75rem) !important;
}

/* Make order_search filter (4th child) span 2 columns */
.fi-ta-filters > div:nth-child(4) {
    flex: 0 0 calc(50% - 0.5rem) !important;
    width: calc(50% - 0.5rem) !important;
}

/* Style the Search Orders section */
.fi-ta-filters > div:nth-child(4) .fi-section {
    background: #f9fafb !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 0.5rem !important;
    padding: 1rem !important;
}

/* Dark mode styling */
.dark .fi-ta-filters > div:nth-child(4) .fi-section {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}