/* 
    Roy Gadget - Premium "Floating Card" Sidebar Styles
    Senior Engineer Recommendation: Floating sidebar pattern for modern SaaS feel.
*/

:root {
    --primary-orange: #F97316;
    --sidebar-bg: #FFFFFF;
    --layout-bg: #F8F9FB; /* Softer, off-white background for the whole layout */
}

/* 1. Global Layout Background */
body.fi-body {
    background-color: var(--layout-bg) !important;
}

/* 2. Floating Sidebar "Card" Style */
.fi-sidebar {
    background-color: var(--sidebar-bg) !important;
    border-right: none !important;
    margin: 1rem !important; /* The magic for the floating look */
    height: calc(100vh - 2rem) !important;
    border-radius: 1.25rem !important;
    box-shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.05), 0 8px 16px -8px rgba(0, 0, 0, 0.05) !important;
    overflow-y: auto !important;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* 2.1 Collapsed Sidebar Adjustments */
.fi-sidebar-collapsed {
    width: 80px !important;
}

.fi-sidebar-collapsed .fi-sidebar-header {
    justify-content: center !important;
    padding-left: 0 !important;
}

.fi-sidebar-collapsed .fi-sidebar-nav-group-label {
    display: none !important;
}

/* Adjusting the sidebar content padding to match the card feel */
.fi-sidebar-nav {
    padding: 0.5rem !important;
}

/* 3. Refined Navigation Item Styling */
.fi-sidebar-nav-group-label {
    letter-spacing: 0.06em;
    font-weight: 800 !important;
    text-transform: uppercase;
    font-size: 0.65rem !important;
    color: #64748b !important;
    margin-top: 1.75rem;
    padding-left: 1rem !important;
}

.fi-sidebar-item-button {
    border-radius: 0.75rem !important;
    margin: 0.25rem 0.5rem !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Active State: Soft Orange Glow */
.fi-sidebar-item-active .fi-sidebar-item-button {
    background: rgba(249, 115, 22, 0.06) !important;
    color: var(--primary-orange) !important;
    font-weight: 600 !important;
    box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.1) !important;
}

.fi-sidebar-item-active .fi-sidebar-item-button .fi-sidebar-item-icon {
    color: var(--primary-orange) !important;
}

/* Hover Interaction */
.fi-sidebar-item-button:hover {
    background: rgba(0, 0, 0, 0.03) !important;
    transform: translateX(2px);
}

/* 4. Topbar Floating Card Polish */
.fi-topbar {
    backdrop-filter: blur(12px) !important;
    background: rgba(255, 255, 255, 0.7) !important;
    border-radius: 1.25rem !important; /* Matches Sidebar */
    margin: 1rem 1rem 0 0 !important; /* Top, Right, Bottom, Left */
    border: 1px solid rgba(0, 0, 0, 0.04) !important;
    box-shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.03) !important;
}

/* Ensure the main content also respects the new top margin */
.fi-main {
    padding-top: 0.5rem !important;
}

/* Center the Brand Logo and constrain it properly */
.fi-logo {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    flex: 1 1 0% !important;
    margin-right: 1.5rem !important; /* Visual offset to center it relative to the collapse button */
}

.fi-logo img {
    display: block;
    object-fit: contain;
    max-width: 165px;
    max-height: 44px;
    width: auto;
    height: auto;
}

/* Dark Mode Overrides */
.dark .fi-sidebar {
    background-color: #121214 !important;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5) !important;
}

.dark body.fi-body {
    background-color: #09090b !important;
}

.dark .fi-topbar {
    background: rgba(18, 18, 20, 0.7) !important;
}

/* 5. Uniform Widget Heights & Table Polish (Filament v3) */
.fi-wi-chart, .fi-wi-table {
    display: flex !important;
    flex-direction: column !important;
}

.fi-wi-chart .fi-section,
.fi-wi-table .fi-section {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 420px !important;
}

/* Clean Search Bar Styling */
.fi-ta-search-field input {
    border-radius: 0.75rem !important;
    background-color: rgba(0,0,0,0.02) !important;
    border: 1px solid rgba(0,0,0,0.05) !important;
}

.dark .fi-ta-search-field input {
    background-color: rgba(255,255,255,0.05) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
}

/* Fix table header spacing in widgets */
.fi-wi-table .fi-ta-header {
    padding: 0.75rem 1rem !important;
}
