hasChildren && !sidebarPinned ? openFlyout(key) : undefined}
+ onMouseLeave={() => hasChildren && !sidebarPinned ? closeFlyout() : undefined}
+ >
+
prefetchForRoute(item.href)}
+ onFocus={() => hasChildren && !sidebarPinned ? openFlyout(key) : undefined}
+ onBlur={() => hasChildren && !sidebarPinned ? closeFlyout() : undefined}
+ className={cn(
+ 'group relative flex flex-col items-center justify-center rounded-lg px-1 py-2 transition-all duration-150',
+ active
+ ? 'bg-[rgba(34,211,238,0.10)] text-[#67e8f9]'
+ : 'text-[#6b7280] hover:text-[#848b9b]'
+ )}
+ title={item.label}
+ >
+
+
+ {item.badge !== undefined && item.badge > 0 && (
+
+ {item.badge > 99 ? '99+' : item.badge}
+
+ )}
+
+
+ {item.shortLabel}
+
+
+
+ {/* Flyout panel (icon rail only) */}
+ {hasChildren && !sidebarPinned && flyoutIndex === key && (
+
{
+ const itemEl = sidebarRef.current.querySelector(`[data-flyout-key="${key}"]`)
+ if (itemEl) {
+ const rect = itemEl.getBoundingClientRect()
+ return `${rect.top}px`
+ }
+ return '0px'
+ })()
+ : '0px',
+ maxHeight: '70vh',
+ overflowY: 'auto',
+ }}
+ onMouseEnter={keepFlyout}
+ onMouseLeave={closeFlyout}
+ >
+
+ {item.children!.map(child => (
+
+ {child.label}
+ {child.count !== undefined && (
+ {child.count}
+ )}
+
+ ))}
+
+
+ )}
+
+ )
+ }
+
+ const renderPinnedItem = (item: NavEntry, key: string) => {
+ const active = isActive(item)
+ const Icon = item.icon
+ const fullPath = location.pathname + location.search
+ const activeChild = item.children?.find(c => fullPath === c.href || fullPath.startsWith(c.href + '&'))
+ const isParentDimmed = !!activeChild && active
+
+ return (
+
+
prefetchForRoute(item.href)}
+ className={cn(
+ 'group relative flex items-center gap-3 rounded-lg px-3 py-2 text-[0.8125rem] font-medium transition-all duration-150',
+ active
+ ? isParentDimmed
+ ? 'bg-[rgba(34,211,238,0.05)] text-[#e2e5eb]/70'
+ : 'bg-[rgba(34,211,238,0.10)] text-[#e2e5eb]'
+ : 'text-[#848b9b] hover:bg-[#191c25] hover:text-[#e2e5eb]'
+ )}
+ >
+ {active && !isParentDimmed && (
+
+ )}
+
+
{item.label}
+ {item.badge !== undefined && item.badge > 0 && (
+
+ {item.badge}
+
+ )}
+
+
+ {/* Sub-items for pinned mode */}
+ {item.children && item.children.length > 0 && (
+
+ {item.children.map(child => {
+ const childActive = isChildActive(child)
+ return (
+
+ {child.label}
+ {child.count !== undefined && (
+
+ {child.count}
+
+ )}
+
+ )
+ })}
+
+ )}
+
+ )
+ }
+
+ /* ── Flyout positioning: use data attribute for lookup ── */
+
+ const renderRailItemWithRef = (item: NavEntry, key: string) => {
+ return (
+