/* Timey Modern Dashboard Theme — Matches Mobile App & Landing Page Visual Identity */

:root {
    --brand-primary: #2F5CF0;
    --brand-primary-hover: #1D43D6;
    --brand-bg-subtle: #EEF4FF;
    --brand-border: #E2E8F0;
}

/* 1. Global Typography & Smooth Rendering */
body, .fi-body, .fi-main, .fi-sidebar, .fi-topbar {
    font-family: 'Cairo', 'Instrument Sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 2. Topbar & Header Enhancements
   Note: backdrop-filter is applied to a ::before pseudo-element rather than
   .fi-topbar itself. Putting it directly on .fi-topbar creates a new CSS
   containing block, which traps any position:fixed descendant (e.g. the
   Alpine/Floating-UI user-menu dropdown) and makes it render off-screen. */
.fi-topbar {
    position: relative !important;
    background-color: transparent !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8) !important;
}

.fi-topbar::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background-color: rgba(255, 255, 255, 0.85);
}

.dark .fi-topbar {
    border-bottom: 1px solid rgba(51, 65, 85, 0.6) !important;
}

.dark .fi-topbar::before {
    background-color: rgba(15, 23, 42, 0.85);
}

/* 3. Sidebar Styling & Navigation Items */
.fi-sidebar-nav-group-label {
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
    color: #64748B !important;
    padding-top: 0.75rem !important;
}

.dark .fi-sidebar-nav-group-label {
    color: #94A3B8 !important;
}

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

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

.fi-sidebar-item-button:hover .fi-sidebar-item-label,
.fi-sidebar-item-button:hover .fi-sidebar-item-icon {
    color: #1D43D6 !important;
}

.dark .fi-sidebar-item-button:hover {
    background-color: rgba(47, 92, 240, 0.15) !important;
}

.dark .fi-sidebar-item-button:hover .fi-sidebar-item-label,
.dark .fi-sidebar-item-button:hover .fi-sidebar-item-icon {
    color: #8BACFF !important;
}

.fi-sidebar-item-active .fi-sidebar-item-button {
    background-color: #2F5CF0 !important;
    box-shadow: 0 4px 14px 0 rgba(47, 92, 240, 0.35) !important;
}

/* The label/icon spans set their own text-primary-* color directly (see
   vendor/filament/filament/resources/views/components/sidebar/item.blade.php),
   which wins over an inherited color from the parent button — so the active
   state needs to override those elements explicitly, not just the button. */
.fi-sidebar-item-active .fi-sidebar-item-label,
.fi-sidebar-item-active .fi-sidebar-item-icon {
    color: #FFFFFF !important;
}

/* 4. Modern Cards & Stat Widgets */
.fi-wi-stats-overview-stat,
.fi-section,
.fi-ta-ctn {
    border-radius: 1rem !important;
    border: 1px solid #E2E8F0 !important;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.04) !important;
    transition: all 0.2s ease-in-out !important;
}

.dark .fi-wi-stats-overview-stat,
.dark .fi-section,
.dark .fi-ta-ctn {
    border: 1px solid rgba(51, 65, 85, 0.6) !important;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.25) !important;
}

.fi-wi-stats-overview-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px -4px rgba(47, 92, 240, 0.12) !important;
}

/* 5. Modern Pill Badges */
.fi-badge {
    border-radius: 9999px !important;
    font-weight: 600 !important;
    font-size: 0.75rem !important;
    padding: 0.25rem 0.625rem !important;
}

/* 6. Buttons & Interactive Elements */
.fi-btn {
    border-radius: 0.625rem !important;
    font-weight: 600 !important;
    transition: all 0.15s ease-in-out !important;
}

.fi-btn-primary {
    background-color: #2F5CF0 !important;
    box-shadow: 0 2px 8px 0 rgba(47, 92, 240, 0.3) !important;
}

.fi-btn-primary:hover {
    background-color: #1D43D6 !important;
    box-shadow: 0 4px 12px 0 rgba(47, 92, 240, 0.45) !important;
}

/* 7. Tables & Headers */
.fi-ta-header-cell {
    font-size: 0.8125rem !important;
    font-weight: 700 !important;
    color: #475569 !important;
    background-color: #F8FAFC !important;
}

.dark .fi-ta-header-cell {
    background-color: #0F172A !important;
    color: #94A3B8 !important;
}

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

.dark .fi-ta-row:hover {
    background-color: rgba(30, 41, 59, 0.5) !important;
}

/* 8. Refined Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 9999px;
}
.dark ::-webkit-scrollbar-thumb {
    background: #475569;
}
::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}
