/* Compact navigation shares the existing device mode and permission-rendered menus. */
.sidebar-fold-toggle { width:34px; height:34px; padding:6px; border:1px solid #dce2ed; border-radius:8px; background:#fff; color:#244785; cursor:pointer; display:grid; place-items:center; flex-shrink:0; }
.sidebar-fold-toggle svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.7; }
.sidebar-fold-toggle:hover { background:#eef2fa; }
.sidebar-fold-toggle:focus-visible,.sidebar-menu button:focus-visible { outline:3px solid #5579ba; outline-offset:2px; }
body.is-desktop .sidebar-header { position:relative; padding-right:52px !important; }
body.is-desktop .sidebar-brand-text span { white-space:normal !important; overflow-wrap:anywhere; font-size:10px !important; }
body.is-desktop .sidebar-header #sidebarLogoImg { max-width:100% !important; }
body.is-desktop .sidebar-fold-toggle { position:absolute; right:12px; top:16px; }
body.is-desktop .sidebar { height:100dvh; min-height:0; }
body.is-desktop .sidebar-menu { min-height:0; }
body.is-desktop .sidebar-footer { padding-bottom:28px !important; }
body.is-mobile .sidebar-fold-toggle { display:none; }
body.is-desktop.sidebar-compact { --sidebar-width:76px; }
body.is-desktop.sidebar-compact .sidebar-header { padding:16px 12px !important; align-items:center !important; min-height:68px !important; }
body.is-desktop.sidebar-compact .sidebar-header #sidebarLogoImg,
body.is-desktop.sidebar-compact .sidebar-brand-text { display:none !important; }
body.is-desktop.sidebar-compact .sidebar-fold-toggle { position:static; }
body.is-desktop.sidebar-compact .sidebar-menu { padding:10px !important; }
body.is-desktop.sidebar-compact .menu-item { justify-content:center; min-height:44px !important; padding:10px !important; }
body.is-desktop.sidebar-compact .menu-item > span:not(.menu-icon),
body.is-desktop.sidebar-compact .submenu { display:none !important; }
body.is-desktop.sidebar-compact .menu-icon { font-size:18px !important; width:22px !important; min-width:22px !important; opacity:1; }
body.is-desktop.sidebar-compact .sidebar-footer { padding:10px 10px 28px !important; }
body.is-desktop.sidebar-compact .user-chip { justify-content:center; padding:8px 0 !important; }
body.is-desktop.sidebar-compact .user-chip > div:not(.user-avatar) { display:none; }
body.is-desktop.sidebar-compact #logoutBtn { font-size:0; padding:10px !important; }
.sidebar-logout-icon { display:none; }
body.is-desktop.sidebar-compact #logoutBtn { display:flex; align-items:center; justify-content:center; }
body.is-desktop.sidebar-compact .sidebar-logout-icon { display:block; width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.5; stroke-linecap:round; stroke-linejoin:round; }
.sidebar-flyout,.sidebar-tooltip { position:fixed; z-index:60; font-family:Inter,Arial,sans-serif; }
.sidebar-flyout[hidden],.sidebar-tooltip[hidden] { display:none !important; }
.sidebar-flyout { width:232px; max-height:calc(100dvh - 24px); overflow:auto; padding:8px; border:1px solid #dce4f0; border-radius:12px; background:#fff; box-shadow:0 8px 28px #18386b24; }
.sidebar-flyout-heading { padding:9px 11px 12px; margin-bottom:4px; border-bottom:1px solid #edf0f5; color:#244785; font-size:12px; font-weight:700; }
.sidebar-flyout-item { display:block; width:100%; border:0; border-radius:8px; padding:11px; background:transparent; color:#38465c; font:500 13px Inter,Arial,sans-serif; text-align:left; cursor:pointer; }
.sidebar-flyout-item:hover,.sidebar-flyout-item:focus-visible { background:#edf2fc; color:#244785; outline:2px solid #d1ddef; outline-offset:-2px; }
.sidebar-flyout-item.active { color:#244785; background:#e8eef9; box-shadow:inset 3px 0 #f5aa18; }
.sidebar-tooltip { max-width:230px; padding:9px 13px; border-radius:8px; background:#244785; color:#fff; box-shadow:0 4px 14px #18386b26; font-size:12px; font-weight:500; line-height:1.4; pointer-events:none; border-left:3px solid #f5aa18; }
body.is-mobile .sidebar-flyout,body.is-mobile .sidebar-tooltip { display:none !important; }
@media print { .sidebar-flyout,.sidebar-tooltip { display:none !important; } }
@media print { .sidebar-fold-toggle { display:none !important; } }

/* Navigation uses one 18px outline family in both expanded and compact modes. */
.sidebar .sidebar-nav-icon,.sidebar-flyout .sidebar-nav-icon,.topbar .sidebar-nav-icon {
  display:block; width:18px; height:18px; flex:0 0 18px;
  fill:none; stroke:currentColor; stroke-width:1.5; stroke-linecap:round; stroke-linejoin:round;
}
.sidebar .menu-icon,.sidebar .submenu-icon { width:18px !important; min-width:18px !important; height:18px; opacity:1 !important; color:inherit !important; }
body.is-desktop.sidebar-compact .menu-icon { width:18px !important; min-width:18px !important; }
.sidebar .menu-chevron::before,.sidebar .menu-chevron::after { content:none !important; }
.sidebar .menu-chevron { background:transparent !important; }
.sidebar-flyout-item { display:flex; align-items:center; gap:10px; }
.sidebar #logoutBtn { display:flex; align-items:center; justify-content:center; gap:8px; }
body.is-desktop.sidebar-compact #logoutBtn { gap:0; }

/* Expanded menus use their native accordion; compact menus use a flyout. */
.sidebar-fold-toggle { width:30px;height:30px;padding:6px;border:0;background:transparent;border-radius:6px;box-shadow:none; }
.sidebar .sidebar-fold-toggle svg { width:17px;height:17px;flex-basis:17px;stroke-width:1.6; }
body.is-desktop.sidebar-compact .sidebar-fold-toggle svg { transform:rotate(180deg); }
#openSidebarBtn,#closeSidebarBtn { border:0!important;box-shadow:none!important;background:transparent!important;width:30px;height:30px;padding:6px; }

body.is-desktop .sidebar .sidebar-header { height:auto!important;min-height:0!important;padding:14px 16px 6px!important;align-items:flex-start!important;gap:8px!important; }
body.is-desktop .sidebar .sidebar-brand-text { flex:0 0 auto!important;justify-content:flex-start!important;text-align:left!important; }
body.is-desktop .sidebar .sidebar-fold-toggle { position:static!important;flex:0 0 24px;width:28px;height:24px;padding:3px 5px;color:#7a818a; }
body.is-desktop.sidebar-compact .sidebar .sidebar-fold-toggle svg { transform:none; }
body.is-desktop.sidebar-compact .sidebar .sidebar-header { height:64px!important;min-height:64px!important;padding:16px 10px!important; }

/* Larger brand and a smaller, right-aligned fold control below its subtitle. */
body.is-desktop .sidebar .sidebar-header #sidebarLogoImg { width:100%!important;max-width:100%!important; }
body.is-desktop .sidebar .sidebar-fold-toggle { align-self:flex-end;flex-basis:22px;width:24px;height:22px;padding:3px 4px; }
.sidebar .sidebar-fold-toggle svg { width:15px;height:15px;flex-basis:15px; }
body.is-desktop.sidebar-compact .sidebar .sidebar-fold-toggle { align-self:center; }

/* Reduce only subtitle-to-toggle spacing from 8px to 2px. */
body.is-desktop:not(.sidebar-compact) .sidebar .sidebar-fold-toggle { margin-top:-6px; }
