/* WHIMS Custom Theme - Amazon Seller Central Inspired */

/* Compact header */
.fi-topbar {
    height: 3.5rem !important;
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

/* Desktop: Reduce padding for collapsed sidebar */
@media (min-width: 1024px) {
    .fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-nav {
        padding-left: 0.25rem !important;
        padding-right: 0.25rem !important;
    }

    .fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-item-button {
        padding-left: 0.25rem !important;
        padding-right: 0.25rem !important;
        justify-content: center !important;
    }

    .fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-item {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* Center icons in collapsed state */
    .fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-item-icon {
        margin: 0 auto !important;
    }

    /* Adjust collapsed sidebar width - make it narrower */
    .fi-sidebar:not(.fi-sidebar-open) {
        width: 3.5rem !important;
    }

    /* Remove extra padding from navigation */
    .fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-nav > ul {
        padding: 0 !important;
    }
    
    /* Add padding to expanded sidebar icons */
    .fi-sidebar.fi-sidebar-open .fi-sidebar-item-icon {
        margin-left: 0.625rem !important;
    }
}

/* Reduce horizontal padding/margins for main content area */
.fi-main {
    padding: 0.5rem 1rem !important;
    margin: 0 !important;
    max-width: none !important;
    width: 100% !important;
}

/* Override Tailwind utility classes on fi-main */
.fi-main.mx-auto {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.fi-main.max-w-7xl,
.fi-main.max-w-screen-2xl {
    max-width: none !important;
}

/* Page layout optimization */
.fi-page {
    padding: 0.5rem !important;
}

.fi-page-header {
    margin-bottom: 0.75rem !important;
    padding-bottom: 0.5rem !important;
}

.fi-page-heading {
    font-size: 1.25rem !important;
    font-weight: 600 !important;
}

/* Modern Compact Table Design - Amazon Style */
.fi-ta-table {
    font-size: 0.75rem !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

.fi-ta-table thead {
    background: linear-gradient(to bottom, #f8f9fa, #f3f4f6) !important;
}

.fi-ta-header-cell {
    padding: 0.25rem 0.5rem !important;
    font-weight: 600 !important;
    font-size: 0.6875rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.025em !important;
    color: #4b5563 !important;
    background-color: transparent !important;
    border-bottom: 2px solid #e5e7eb !important;
    white-space: nowrap !important;
}

.fi-ta-cell {
    padding: 0.25rem 0.5rem !important;
    border-bottom: 1px solid #f3f4f6 !important;
    vertical-align: middle !important;
    line-height: 1.2 !important;
}

.fi-ta-row {
    transition: background-color 0.1s ease !important;
}

.fi-ta-row:hover {
    background-color: #f9fafb !important;
}

/* Zebra striping for better readability */
.fi-ta-table tbody tr:nth-child(even) {
    background-color: #fafafa !important;
}

/* Selected row highlight */
.fi-ta-row.fi-ta-row-selected {
    background-color: #eff6ff !important;
}

/* Make action buttons more compact */
.fi-ta-actions {
    gap: 0.0625rem !important;
}

.fi-ta-actions .fi-btn {
    padding: 0.125rem 0.25rem !important;
    font-size: 0.625rem !important;
}

/* Icon buttons in tables */
.fi-ta-actions .fi-icon-btn {
    width: 1.5rem !important;
    height: 1.5rem !important;
}

.fi-ta-actions .fi-icon-btn svg {
    width: 0.875rem !important;
    height: 0.875rem !important;
}

/* Compact pagination */
.fi-ta-pagination {
    padding: 0.5rem !important;
    background-color: #f9fafb !important;
    border-top: 1px solid #e5e7eb !important;
}

/* Remove extra padding from table container */
.fi-ta-content {
    padding: 0 !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 0.375rem !important;
    overflow: hidden !important;
}

/* Table wrapper adjustments */
.fi-ta-ctn {
    padding: 0 !important;
    background-color: white !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}

/* Filters section - more compact */
.fi-ta-filters {
    padding: 0.375rem 0.5rem !important;
    background: linear-gradient(to bottom, #ffffff, #f9fafb) !important;
    border-bottom: 1px solid #e5e7eb !important;
    border-radius: 0.375rem 0.375rem 0 0 !important;
}

.fi-ta-filters-ctn {
    gap: 0.375rem !important;
    align-items: flex-end !important;
}

/* Compact filter inputs */
.fi-ta-filters .fi-input {
    padding: 0.375rem 0.5rem !important;
    font-size: 0.8125rem !important;
    min-height: 2.125rem !important;
    height: 2.125rem !important;
}

.fi-ta-filters .fi-select-input {
    padding: 0.375rem 0.5rem !important;
    font-size: 0.8125rem !important;
    min-height: 2.125rem !important;
    height: 2.125rem !important;
}

.fi-ta-filters label {
    font-size: 0.6875rem !important;
    font-weight: 600 !important;
    margin-bottom: 0.25rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.025em !important;
    color: #6b7280 !important;
}

/* Filter form spacing */
.fi-ta-filters .fi-fo-field-wrp {
    margin-bottom: 0 !important;
}

/* Make all filter containers same height */
.fi-ta-filters > div > div {
    display: flex !important;
    align-items: flex-end !important;
    min-height: 3.5rem !important;
}

/* Make filter toggle switch aligned */
.fi-ta-filters .fi-toggle {
    height: 2.125rem !important;
    display: flex !important;
    align-items: center !important;
    margin-top: 1.5rem !important; /* Align with other inputs that have labels */
}

.fi-ta-filters .fi-toggle-button {
    width: 2.5rem !important;
    height: 1.25rem !important;
}

.fi-ta-filters .fi-toggle-button span {
    width: 1rem !important;
    height: 1rem !important;
}

/* Fix for double toggle display - hide the gray/inactive one */
.fi-ta-filters button[role="switch"]:not([class*="bg-primary"]):not([class*="bg-blue"]) {
    display: none !important;
}

/* Alternative: if there are multiple switches in the same container, hide all but last */
.fi-ta-filters .fi-fo-field-wrp button[role="switch"] ~ button[role="switch"] {
    display: flex !important;
}

.fi-ta-filters .fi-fo-field-wrp button[role="switch"]:not(:last-of-type) {
    display: none !important;
}

/* Ensure toggle container aligns properly */
.fi-ta-filters .fi-fo-field-wrp:has(.fi-toggle) {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
}

/* Fix specific alignment for the Has Stock toggle */
.fi-ta-filters .fi-fo-field-wrp label:has(+ .fi-toggle) {
    margin-bottom: 0.375rem !important;
}

/* Ensure all filter fields have consistent height */
.fi-ta-filters .fi-fo-field-wrp {
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    min-height: 3.5rem !important;
}

/* Price range inputs side by side - fix overflow */
.fi-ta-filters .grid-cols-2 {
    gap: 0.375rem !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
}

.fi-ta-filters .grid-cols-2 input {
    width: 100% !important;
    min-width: 0 !important;
}

/* Search icon size and alignment */
.fi-ta-filters .fi-input-wrp {
    display: flex !important;
    align-items: center !important;
}

.fi-ta-filters .fi-input-wrp-icon {
    display: flex !important;
    align-items: center !important;
    padding: 0 0.375rem !important;
}

.fi-ta-filters .fi-input-wrp-icon svg {
    width: 1rem !important;
    height: 1rem !important;
}

/* Search input in tables */
.fi-ta-search-field input {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.75rem !important;
    min-height: 1.75rem !important;
}

/* Table header actions bar */
.fi-ta-header {
    padding: 0.75rem 1rem !important;
    background-color: white !important;
    border-bottom: 1px solid #e5e7eb !important;
}

.fi-ta-header-heading {
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: #111827 !important;
}

/* Bulk actions bar */
.fi-ta-bulk-actions {
    padding: 0.5rem !important;
    background-color: #fef3c7 !important;
    border-bottom: 1px solid #fbbf24 !important;
}

/* Empty state */
.fi-ta-empty-state {
    padding: 2rem !important;
}

/* Column toggles */
.fi-ta-col-toggle {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.75rem !important;
}

/* Status badges in tables */
.fi-ta-cell .fi-badge {
    padding: 0.0625rem 0.25rem !important;
    font-size: 0.625rem !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
}

/* Make text columns more readable */
.fi-ta-text {
    line-height: 1.2 !important;
}

.fi-ta-text-item {
    font-size: 0.75rem !important;
}

/* Compact text in sm size columns */
.fi-ta-text-item-label {
    font-size: 0.6875rem !important;
}

/* Column widths optimization */
.fi-ta-cell:first-child {
    padding-left: 1rem !important;
}

.fi-ta-cell:last-child {
    padding-right: 1rem !important;
}

/* Checkbox column */
.fi-ta-record-checkbox {
    padding: 0.375rem 0.5rem !important;
}

/* Make sure tables are full width */
.fi-ta-table {
    width: 100% !important;
}

/* Compact form fields */
.fi-fo-field-wrp {
    margin-bottom: 0.75rem !important;
}

.fi-input {
    padding-top: 0.375rem !important;
    padding-bottom: 0.375rem !important;
    font-size: 0.875rem !important;
}

/* Compact cards and sections */
.fi-section {
    padding: 0.75rem !important;
}

.fi-card {
    padding: 1rem !important;
}

/* Compact buttons */
.fi-btn {
    padding-top: 0.375rem !important;
    padding-bottom: 0.375rem !important;
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
    font-size: 0.875rem !important;
}

/* Dense navigation items */
.fi-sidebar-item {
    margin-bottom: 0.125rem !important;
}

.fi-sidebar-item-button {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
    font-size: 0.875rem !important;
}

/* Professional color scheme - Better contrast */
.fi-sidebar {
    background-color: #f8f9fa !important;
}

.fi-sidebar-header {
    border-bottom: 1px solid #e5e7eb !important;
}

.fi-sidebar-item-button {
    color: #374151 !important;
    font-weight: 500 !important;
}

.fi-sidebar-item-button:hover {
    background-color: #e5e7eb !important;
    color: #111827 !important;
}

.fi-sidebar-item-active .fi-sidebar-item-button {
    background-color: #3b82f6 !important;
    color: #ffffff !important;
}

.fi-sidebar-item-icon {
    color: #6b7280 !important;
}

.fi-sidebar-item-active .fi-sidebar-item-icon {
    color: #ffffff !important;
}

.fi-sidebar-group-button {
    color: #374151 !important;
    font-weight: 600 !important;
}

.fi-sidebar-group-button:hover {
    background-color: #f3f4f6 !important;
}

/* Compact modal */
.fi-modal {
    padding: 1rem !important;
}

.fi-modal-header {
    padding-bottom: 0.75rem !important;
}

/* Improve data density in tables */
.fi-ta-content {
    padding: 0 !important;
}

.fi-ta-ctn {
    padding: 0.5rem !important;
}

/* Breadcrumb styling */
.fi-breadcrumbs {
    font-size: 0.875rem !important;
    padding: 0.5rem 0 !important;
}

/* Action buttons in tables */
.fi-ta-actions {
    gap: 0.25rem !important;
}

/* Filters panel */
.fi-filters {
    padding: 0.75rem !important;
    background-color: #f9fafb !important;
    border-radius: 0.5rem !important;
}

/* Stats widgets */
.fi-stats-card {
    padding: 0.75rem !important;
}

.fi-stats-value {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
}

/* Global search */
.fi-global-search {
    max-width: 24rem !important;
}

.fi-global-search-input {
    font-size: 0.875rem !important;
    padding: 0.375rem 0.75rem !important;
}

/* Notification panel */
.fi-notifications {
    width: 20rem !important;
}

/* Tabs */
.fi-tabs-tab {
    padding: 0.5rem 1rem !important;
    font-size: 0.875rem !important;
}

/* Remove rounded corners for cleaner look */
.fi-card,
.fi-modal-window,
.fi-section {
    border-radius: 0.25rem !important;
}

/* Better focus states */
.fi-input:focus,
.fi-select-input:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 1px #3b82f6 !important;
}

/* Loading states */
.fi-loading-indicator {
    color: #3b82f6 !important;
}

/* Success/Error messages */
.fi-notification-success {
    background-color: #10b981 !important;
}

.fi-notification-danger {
    background-color: #ef4444 !important;
}

/* Make dropdowns more compact */
.fi-dropdown-list-item {
    padding: 0.375rem 0.75rem !important;
    font-size: 0.875rem !important;
}

/* Pagination */
.fi-pagination {
    font-size: 0.875rem !important;
}

.fi-pagination-item {
    padding: 0.25rem 0.5rem !important;
}

/* Badge styling */
.fi-badge {
    padding: 0.125rem 0.5rem !important;
    font-size: 0.75rem !important;
}

/* Info lists */
.fi-in-item {
    padding: 0.5rem 0 !important;
}

/* Mobile and small screen responsive improvements */
@media (max-width: 640px) {
    .fi-main {
        padding-left: 0.25rem !important;
        padding-right: 0.25rem !important;
    }
    
    .fi-card {
        padding: 0.75rem !important;
    }
    
    .fi-ta-cell {
        padding: 0.375rem !important;
    }
    
    /* Make filters stack vertically on mobile */
    .fi-ta-filters-ctn {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    
    .fi-ta-filters > div > div {
        min-height: auto !important;
        margin-bottom: 0.5rem !important;
    }
}

/* MacBook 13" and similar small laptops (1280px width) */
@media (min-width: 1024px) and (max-width: 1536px) {
    /* Optimize filter layout for MacBook 13" - use 2 rows */
    .fi-ta-filters {
        padding: 0.75rem !important;
    }
    
    .fi-ta-filters-ctn {
        gap: 0.75rem !important;
        row-gap: 1rem !important;
    }
    
    /* Better spacing between filter rows */
    .fi-ta-filters > div {
        margin-bottom: 0.5rem !important;
    }
    
    /* Make all filter containers same height but allow wrapping */
    .fi-ta-filters > div > div {
        min-height: auto !important;
        align-items: stretch !important;
    }
    
    /* Ensure filters wrap properly */
    .fi-ta-filters .grid {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.75rem !important;
        row-gap: 1rem !important;
    }
    
    /* Full width search field on first row */
    .fi-ta-filters .grid > div:first-child {
        grid-column: span 1 !important;
    }
    
    /* Normal sized inputs for better readability */
    .fi-ta-filters .fi-input {
        font-size: 0.8125rem !important;
        padding: 0.375rem 0.5rem !important;
        min-height: 2rem !important;
        height: 2rem !important;
    }
    
    .fi-ta-filters .fi-select-input {
        font-size: 0.8125rem !important;
        padding: 0.375rem 0.5rem !important;
        min-height: 2rem !important;
        height: 2rem !important;
    }
    
    /* Readable labels */
    .fi-ta-filters label {
        font-size: 0.6875rem !important;
        margin-bottom: 0.25rem !important;
    }
    
    /* Price inputs side by side within their container */
    .fi-ta-filters .grid-cols-2 {
        gap: 0.375rem !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
    }
    
    /* Toggle switch proper size and alignment */
    .fi-ta-filters .fi-toggle {
        height: 2rem !important;
        margin-top: 1.5rem !important; /* Match other inputs with labels */
    }
    
    .fi-ta-filters .fi-toggle-button {
        width: 2.25rem !important;
        height: 1.125rem !important;
    }
    
    /* Align toggle field wrapper */
    .fi-ta-filters .fi-fo-field-wrp:has(.fi-toggle) {
        display: flex !important;
        align-items: flex-end !important;
        min-height: 3.5rem !important;
    }
}

/* Responsive filter grid adjustments */
@media (max-width: 1024px) {
    /* Stack filters in 2 columns on tablets */
    .fi-ta-filters .grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    /* Full width search on smaller screens */
    .fi-ta-filters > div:first-child {
        grid-column: span 2 !important;
    }
}

/* Price range specific responsive fixes */
.fi-ta-filters .fi-fo-component-ctn.grid-cols-2 {
    display: grid !important;
    gap: 0.25rem !important;
}

.fi-ta-filters .fi-fo-component-ctn.grid-cols-2 > div {
    min-width: 0 !important;
}

/* Ensure price inputs don't overflow */
.fi-ta-filters input[type="number"] {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
}

/* Force two-row layout on MacBook 13" screens */
@media (min-width: 1024px) and (max-width: 1536px) {
    .fi-ta-filters .fi-fo-grid {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 1rem !important;
        width: 100% !important;
    }
    
    /* Ensure each filter takes appropriate space */
    .fi-ta-filters .fi-fo-field-wrp {
        width: 100% !important;
        min-width: 0 !important;
    }
    
    /* Apply button spans full width or takes last position */
    .fi-ta-filters button[type="button"] {
        margin-top: 0rem !important;
    }
}