/* Amplify Side Nav — styles for Controls/MainNavigation.ascx (Figma: Amplify Navigation, node 7:18248) */

:root {
    /* SideNav design tokens — change widths/paddings here only, nothing else needs editing */
    --sidenav-width-expanded: 250px;
    --sidenav-width-collapsed: 72px;
    --sidenav-padding-expanded: 8px 16px 56px 16px;
    --sidenav-padding-collapsed: 8px 12px 56px 12px;
    --sidenav-item-max-width: 218px; /* expanded width minus left/right padding */
}

#main-navigation-container {
    position: relative; /* anchors the module-switcher dropdown */
    transition: width 200ms ease;
    background: var(--Surface-Sheet, #FFFFFF);
    display: flex;
    flex-direction: column;
    padding: var(--sidenav-padding-expanded);
    height: 100%;
    overflow-y: scroll;
    width: 100%;
    box-sizing: border-box;
}

div#main-navigation-container::-webkit-scrollbar {
    display: none;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

#main-navigation-container.collapsed {
    flex-direction: column;
    max-height: 902px;
    padding: var(--sidenav-padding-collapsed);
    flex-direction: column;
    align-items: center;
}


/* toggle button */
.nav-toggle {
    width: 20px;
    height: 20px;
    display: block;
}

.icon-regular {
    display: block !important;
}

.mainMenu:hover .icon-regular,
.mainMenu.hover .icon-regular {
    display: none !important;
}

.mainMenu:hover .icon-hover,
.mainMenu.hover .icon-hover {
    display: block !important;
}

/*  #main-navigation-container.collapsed #main-navigation {
    padding: 0 12px;
}*/

.mainMenu, .secondary-nav {
    border-radius: var(--Component-NavItem-Large-Radius-Radius, 8px);
}

.secondary-nav {
    margin-top: 4px;
    padding: 4px 0;
}

.HeaderLink, .NoLink {
    color: var(--Foreground-Action-Secondary-Rest, #3D3D3D);
    /* ❇️ Label/Menu/Base/Medium */
    font-family: "Red Hat Text", sans-serif;
    font-size: 14px;
    font-style: normal;
    font-weight: 500;
    line-height: 20px; /* 142.9% */
    letter-spacing: 0.3px;
    /* Positioning context for the accent-bar ::before — without this, it sizes against the parent li (which grows to include an expanded submenu) instead of this 44px row */
    position: relative;
    display: flex !important;
    align-items: center;       
    gap: 6px; /* Figma Padding/XTight: icon-to-label gap (Icon.Leading ends x=24, Nav Label starts x=30) */
    border-radius: var(--Component-NavItem-Large-Radius-Radius, 8px);
    transition: color 0.15s, background-color 0.15s;
    max-width: var(--sidenav-item-max-width);
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding-right: 8px; /* Figma Padding/Tight: Container.RowEnd centers the 14px chevron 8px from the item's right edge */
    box-sizing: border-box;
}

/* Collapsed rail is narrower than the Figma Level 0 width — shrink to the icon-only touch target */
#main-navigation-container.collapsed .HeaderLink,
#main-navigation-container.collapsed .NoLink {
    width: 44px;
}

    .HeaderLink .icon, .NoLink .icon {
        display: flex;
        padding: var(--Padding-XXTight, 4px);
        justify-content: center;
        align-items: center;
        aspect-ratio: 1/1;
    }

    .HeaderLink .icon img, .NoLink .icon img {
        width: 16px;
        height: 16px;
        display: block;
    }

/* Base state icon color - using CSS filter to colorize icons */
/*.HeaderLink .icon img, .NoLink .icon img {
    filter: brightness(0) saturate(100%) invert(27%) sepia(0%) saturate(0%) hue-rotate(161deg) brightness(99%) contrast(87%);
    transition: filter 0.15s;
}*/

/* Hover state icon color */
/*#main-navigation a:not(.leftnavactive):hover .icon img,
#main-navigation li.hover > a:not(.leftnavactive) .icon img {
    filter: brightness(0) saturate(100%) invert(13%) sepia(23%) saturate(1449%) hue-rotate(185deg) brightness(96%) contrast(95%);
}*/

/* Active state icon color */
/* #main-navigation a.leftnavactive .icon img,
#main-navigation li:has(.leftnavactive) > a .icon img,
#main-navigation li.hover:has(ul.secondary-nav li > a.leftnavactive) > a .icon img {
    filter: brightness(0) saturate(100%) invert(13%) sepia(23%) saturate(1449%) hue-rotate(185deg) brightness(96%) contrast(95%);
}*/

    .HeaderLink .text, .NoLink .text {
        flex: 1 1 0%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: var(--Foreground-Action-Secondary-Rest, #3D3D3D);
        transition: color 0.15s;
    }

.collapsed .HeaderLink, .collapsed .NoLink {
    text-align: center;
}

ul.secondary-nav li {
    margin-bottom: 6px;
}

    ul.secondary-nav li:last-child {
        margin-bottom: 0;
    }

.subMenu, .leftnavactive {
    overflow: hidden;
    color: var(--Foreground-Action-Secondary-Rest, #3D3D3D);
    text-overflow: ellipsis;
    white-space: nowrap;

    /* ❇️ Label/Menu/Base/Medium */
    font-family: var(--Family-Brand, "Red Hat Text");
    font-size: var(--Font-Size-S, 14px);
    font-style: normal;
    font-weight: var(--Weight-Medium, 500);
    line-height: var(--Line-Height-S-Single, 20px); /* 142.857% */
    letter-spacing: var(--Letter-Spacing-Spacious, 0.3px);

    border-radius: var(--CornerRadius-Medium, 8px);

    /* ❇️ Label/Menu/Base/Medium */
    /*
    display: block;
    font-family: "Red Hat Text", sans-serif;
    font-size: 14px;
    font-style: normal;
    font-weight: 500;
    line-height: 20px;
    letter-spacing: 0.3px;
    border-radius: 8px;
    transition: background-color 0.15s, color 0.15s;
    padding: 6px 12px; */
}

/* Hover — same token as Level 0 (.HeaderLink/.NoLink) hover */
.subMenu:hover {
    background: var(--Fill-Action-Selection-Hover, rgba(216, 211, 205, 0.24));
    color: var(--Foreground-Action-Secondary-Hover, #202020);
}

.leftnavactive {
    color: var(--Foreground-Action-Secondary-Pressed, #070707) !important;
    margin: 0;
}

/* Level 0 — Selected/Active (also applies to secondary submenu links so both levels share the same active background) */
.HeaderLink.leftnavactive, .NoLink.leftnavactive, .subMenu.leftnavactive {
    background-color: var(--Fill-Action-Selection-Selected, rgba(182, 198, 236, 0.24));
    border-radius: var(--Component-NavItem-Large-Radius-Radius, 8px);
}

.subMenu .text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    float: none !important;
    padding: 0 !important;
}

.leftnavactive .text {
        color: var(--Foreground-Action-Secondary-Pressed, #070707) !important;
}

.left-col {
    display: flex;
    width: var(--sidenav-width-expanded);
    transition: width 200ms ease;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    flex-shrink: 0;
    border-right: 1px solid var(--Stroke-Static-Info-Subtle, #EBF0FB);
    border-right: 1px solid var(--Stroke-Static-Info-Subtle, color(display-p3 0.9294 0.9412 0.9765));
    background: var(--Surface-Sheet, #FFFFFF);
}

/* .amplify-container is the positioned anchor for .nav-toggle-edge (see Financials.master) */
.amplify-container {
    position: relative;
}

/* Collapsed rail width — toggled via JS (see MainNavigation.js) instead of inline styles */
.left-col.nav-collapsed {
    width: var(--sidenav-width-collapsed);
}

.divToggle {
    display: flex;
    padding: 14px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

#main-navigation {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  line-height: 100%;
  font-size: 16px;
}

#main-navigation li {
  /*float: left;*/
  margin-top: 2px;
  margin-bottom: 2px;
  position: relative;
  list-style: none;
  cursor: pointer;
}

/* main level link */
#main-navigation a {
  text-decoration: none;
  display: block;
  padding: 12px 12px;
  cursor: pointer !important;
}

#main-navigation a:focus {
    outline: none !important;
}

ul.secondary-nav {
	border-radius: var(--Component-NavItem-Large-Radius-Radius, 8px);
    background: var(--Surface-Sheet, #FFFFFF);
}

ul.secondary-nav li a {
    padding-left: 36px !important;
    margin-bottom: 2px;
    margin-top: 2px;
}
/* Selector must match markup: <ul id="main-navigation" class="primary-nav"> — overrides legacy navigation.css #main-navigation rule (padding:0, no gap) */
#main-navigation-container.expanded #main-navigation,
#main-navigation-container.collapsed #main-navigation {
    display: flex;
    padding-bottom: 24px;
    flex-direction: column;
    gap: 6px;
    align-self: stretch;
}

/* ============================================================
   Grouper (mainMenu with a submenu) state matrix — derived purely
   from markup, no JS-added state class needed:
     li.hover                      -> submenu is currently expanded
     li:has(... a.leftnavactive)   -> submenu contains the active page
   The 3 combinations below are mutually exclusive by selector, so
   rule order between them doesn't matter.
   ============================================================ */

/* Active — Figma "L0 Active": submenu collapsed but contains the active page. Renders exactly like a leaf .leftnavactive item (background + text + accent bar). */
li:not(.hover):has(ul.secondary-nav li > a.leftnavactive) > a.NoLink {
    background-color: var(--Fill-Action-Selection-Selected, rgba(182, 198, 236, 0.24));
    color: var(--Foreground-Action-Secondary-Pressed, #070707);
}

    li:not(.hover):has(ul.secondary-nav li > a.leftnavactive) > a.NoLink .text {
        color: var(--Foreground-Action-Secondary-Pressed, #070707);
    }

    li:not(.hover):has(ul.secondary-nav li > a.leftnavactive) > a.NoLink::before {
        content: "";
        position: absolute;
        left: 0px;
        top: 6px;
        bottom: 6px;
        width: 4px;
        transition: background-color 0.15s;
        flex: 1 0 0px;
        border-radius: 0 var(--Border-Radius-S, 8px) var(--Border-Radius-S, 8px) 0;
        background: var(--Fill-Action-Primary-Strong-Pressed, #2D4889);
    }

/* Trail — Figma "L0 Trail": submenu expanded AND contains the active page (the accent bar stays on that child item, not here) */
#main-navigation li.hover:has(ul.secondary-nav li > a.leftnavactive) > a:not(.leftnavactive) {
    border-radius: var(--Component-NavItem-Large-Radius-Radius, 8px);
    background-color: var(--Fill-Action-Selection-Trail, rgba(87, 83, 78, 0.08));
    color: var(--Foreground-Action-Secondary-Pressed, #070707);
}

    #main-navigation li.hover:has(ul.secondary-nav li > a.leftnavactive) > a:not(.leftnavactive) .text {
        color: var(--Foreground-Action-Secondary-Pressed, #070707);
    }

/* Expanded, no active descendant — keeps the Hover look persistently while open (not just on mouse :hover) */
#main-navigation li.hover:not(:has(ul.secondary-nav li > a.leftnavactive)) > a:not(.leftnavactive) {
    border-radius: var(--Component-NavItem-Large-Radius-Radius, 8px);
    background-color: var(--Fill-Action-Selection-Hover, rgba(216, 211, 205, 0.24));
    color: var(--Foreground-Action-Secondary-Hover, #202020);
}

    #main-navigation li.hover:not(:has(ul.secondary-nav li > a.leftnavactive)) > a:not(.leftnavactive) .text {
        color: var(--Foreground-Action-Secondary-Hover, #202020);
    }

/* Level 0 — real mouse :hover (transient, independent of expand state) */
#main-navigation a:not(.subMenu):not(.leftnavactive):hover {
    border-radius: var(--Component-NavItem-Large-Radius-Radius, 8px);
    background-color: var(--Fill-Action-Selection-Hover, rgba(216, 211, 205, 0.24));
    color: var(--Foreground-Action-Secondary-Hover, #202020);
}

    #main-navigation a:not(.subMenu):not(.leftnavactive):hover .text {
        color: var(--Foreground-Action-Secondary-Hover, #202020);
    }

/* Base state chevron color */
.chevron {
    color: #484848;
}

/* Hover state chevron color */
#main-navigation a:not(.leftnavactive):hover .chevron,
#main-navigation li.hover > a:not(.leftnavactive) .chevron {
    color: #2D4889;
}

/* Active state chevron color */
#main-navigation a.leftnavactive .chevron,
#main-navigation li:has(.leftnavactive) > a .chevron,
#main-navigation li.hover:has(ul.secondary-nav li > a.leftnavactive) > a .chevron {
    color: #2D4889;
}

/* Figma: expand_more — down (∨) = closed, up (∧) = open via rotate(180deg) */
.chevron-wrapper {
    height: 24px;
    display: flex;
    align-items: center;
    /*justify-content: center;*/
    flex-shrink: 0;
    transition: background-color 0.15s;
}

.chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    transition: transform 340ms cubic-bezier(0.22, 1, 0.36, 1), color 0.15s;
    color: #484848;
    transform: rotate(0deg);
}

.chevron.chevron-open {
    transform: rotate(180deg);
}

#main-navigation-container.collapsed .chevron-wrapper {
    display: none;
}

/* SideNav.Control.Edge — circular expand/collapse control straddling the rail's right edge, ~64px below rail top.
   Anchored to .amplify-container (shared ancestor of .left-col/.right-col, see Financials.master) rather than
   nested inside .left-col, so it is never subject to .left-col/.right-col paint-order or stacking-context rules. */
.nav-toggle-edge {
    box-sizing: border-box;
    position: absolute;
    top: 64px;
    left: calc(var(--sidenav-width-collapsed) - 18px); /* collapsed rail: half the 36px circle sits outside the rail, half inside */
    z-index: 5;
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #FFFFFF;
    border: 1px solid #D9DBE0;
    border-radius: 18px;
    box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    transition: left 200ms ease;
}

.nav-toggle-edge.expanded {
    left: calc(var(--sidenav-width-expanded) - 18px); /* expanded rail: straddle its right edge instead */
}

#navToggleEdge:hover {
    background-color: #F5F5F5;
}

.nav-toggle-edge-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 16px;
    height: 16px;
    transition: transform 200ms ease;
    transform: rotate(0deg); /* collapsed: chevron points right (Expand) */
}

/* expanded: chevron points left (Collapse) */
.nav-toggle-edge.expanded .nav-toggle-edge-icon {
    transform: rotate(-180deg);
}

/* Mobile drawer takes over below this width — edge control is not present */
@media (max-width: 392px) {
    .nav-toggle-edge {
        display: none;
    }
}

/* Figma: SideNavItem.Collapsed — Hover, Destination, No (label pill next to the icon, scoped off the shared .ui-tooltip so other app tooltips are unaffected) */
.ui-tooltip.sidenav-collapsed-tooltip {
    padding: 6px 8px;
    background: var(--Surface-Sheet, #FFFFFF);
    border: 1px solid var(--Stroke-Static-Neutral-Faint, #F3F0EC);
    border-radius: var(--Component-NavItem-Large-Radius-Radius, 8px);
    box-shadow: 2px 2px 8px 4px rgba(0, 0, 0, 0.03);
    color: var(--Foreground-Action-Secondary-Rest, #3D3D3D);
    font-family: var(--Family-Brand, "Red Hat Text");
    font-size: var(--Font-Size-S, 14px);
    font-weight: 400;
    line-height: var(--Line-Height-S-Single, 20px);
    letter-spacing: var(--Letter-Spacing-Spacious, 0.3px);
    max-width: none;
    white-space: nowrap;
}

/* Hover Side Menu Styles — Figma node I7:19188;40005607:25199 "PopoverMenu" (top/left set in JS, anchored to the hovered item) */
.hover-side-menu {
    position: fixed;
    top: 0;
    min-width: 220px;
    background: var(--Fill-Surface-Elevated, #FFFFFF);
    border-radius: var(--CornerRadius-Medium, 8px);
    box-shadow: 2px 2px 8px 4px rgba(0, 0, 0, 0.03);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    transition: all 0.2s ease;
    border: var(--Border-Width-XS, 0.5px) solid var(--Stroke-Static-Neutral-Base, #D8D3CD);
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

    .hover-side-menu.show {
        opacity: 1;
        visibility: visible;
        transform: translateX(0);
    }

.hover-side-menu-header {
    /* Figma insets the divider by the card's own padding (6px) + menu wrapper padding (4px) = 10px, not edge-to-edge */
    margin: 0 10px;
    padding: 14px 4px;
    border-bottom: var(--Border-Width-XS, 0.5px) solid var(--Stroke-Static-Neutral-Base, #D8D3CD);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.leftnavactive::before {
    /* Figma I7:19101;40005607:25843 indicator.stripe: 2px inset, not 6px */
    content: "";
    position: absolute;
    left: 0px;
    top: 6px;
    bottom: 6px;
    width: 4px;
    flex: 1 0 0;
    border-radius: 0 var(--Border-Radius-S, 8px) var(--Border-Radius-S, 8px) 0;
    background: var(--Fill-Action-Primary-Strong-Pressed, #2D4889);
}


.hover-side-menu-header .icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .hover-side-menu-header .icon img {
        width: 16px;
        height: 16px;
    }

.hover-side-menu-title {
    padding-left: 6px;
    font-family: var(--Family-Brand, "Red Hat Text");
    font-weight: var(--Weight-Regular, 400);
    font-size: var(--Font-Size-S, 14px);
    line-height: var(--Line-Height-S-Single, 20px);
    letter-spacing: var(--Letter-Spacing-Spacious, 0.3px);
    color: var(--Foreground-Action-Secondary-Hover, #202020);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.hover-side-menu-items {
    padding: 8px 6px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto;
    min-height: 0;
}

    /* Scrollbar — Pathway Design System spec */
    .hover-side-menu-items {
        scrollbar-width: thin;
        scrollbar-color: rgba(17,17,17,0.16) transparent;
    }

    .hover-side-menu-items::-webkit-scrollbar {
        width: 6px;
    }

    .hover-side-menu-items::-webkit-scrollbar-track {
        background: transparent;
    }

    .hover-side-menu-items::-webkit-scrollbar-thumb {
        background: rgba(17, 17, 17, 0.16);
        border-radius: 100px;
        -webkit-backdrop-filter: blur(8px) saturate(180%);
        backdrop-filter: blur(8px) saturate(180%);
        -webkit-box-shadow: inset 0 0 0 0.5px rgba(255,255,255,0.35);
        box-shadow: inset 0 0 0 0.5px rgba(255,255,255,0.35);
    }

        .hover-side-menu-items::-webkit-scrollbar-thumb:hover {
            background: rgba(17, 17, 17, 0.30);
        }

.hover-side-menu-item {
    display: block;
    padding: 10px 16px;
    margin-bottom: 8px;
    text-decoration: none;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    /* ❇️ Text/Body/Small/Regular — Figma PopoverMenu.Item label color is Secondary/Hover, not Rest */
    font-family: var(--Family-Brand, "Red Hat Text");
    font-weight: 400;
    font-size: var(--Font-Size-S, 14px);
    line-height: var(--Line-Height-S-Single, 20px);
    letter-spacing: var(--Letter-Spacing-Spacious, 0.3px);
    color: var(--Foreground-Action-Secondary-Hover, #202020);
    background: var(--Fill-Surface-Sheet, #FFFFFF);
    border-radius: var(--Border-Radius-S, 8px);
    transition: color 0.15s, background-color 0.15s, margin 0.15s;
    flex: 1 1 0%;
}

    .hover-side-menu-item:last-child {
        margin-bottom: 0;
    }

    .hover-side-menu-item:hover {
        background-color: var(--Fill-Action-Selection-Hover, rgba(216, 211, 205, 0.24));
        color: var(--Foreground-Action-Secondary-Hover, #202020);
        text-decoration: none;
        border-radius: var(--Component-NavItem-Large-Radius-Radius, 8px);
    }

    .hover-side-menu-item:hover + .hover-side-menu-item {
        margin-top: 1px;
    }

    .hover-side-menu-item:first-child:hover {
        margin-top: 0;
    }

    .hover-side-menu-item.active {
        /* Matches .leftnavactive (expanded active submenu) color/background tokens */
        color: var(--Foreground-Action-Secondary-Pressed, #070707) !important;
        background-color: var(--Fill-Action-Selection-Selected, rgba(182, 198, 236, 0.24));
        font-weight: 500;
        position: relative;
        border-radius: var(--Component-NavItem-Large-Radius-Radius, 8px);
    }

        .hover-side-menu-item.active::before {
            /* Same accent-bar geometry as .leftnavactive::before (Figma I7:19101;40005607:25843) */
            content: "";
            position: absolute;
            left: 0px;
            top: 6px;
            bottom: 6px;
            width: 4px;
            background-color: var(--Fill-Action-Primary-Strong-Pressed, #2D4889);
            transition: background-color 0.15s;
            flex: 1 0 0px;
            border-radius: 0 var(--Border-Radius-S, 8px) var(--Border-Radius-S, 8px) 0;
        }

#main-navigation-container.collapsed #main-navigation li.mainMenu.hover {
    border-radius: var(--Border-Radius-S, 8px) var(--Contextual-NavItem-Large-Radius-Radius, 8px) var(--Contextual-NavItem-Large-Radius-Radius, 8px) var(--Border-Radius-S, 8px);
    background: var(--Fill-Contextual-NavItem-Active, rgba(148, 183, 239, 0.16));
    background: var(--Fill-Contextual-NavItem-Active, color(display-p3 0.6275 0.7098 0.902 / 0.16));
}

#main-navigation-container.collapsed #main-navigation li.mainMenu {
    width: 44px;
    align-items: center;
    align-self: stretch;
}

#main-navigation-container.collapsed .mainMenu.hover::before {
    /* Figma I7:19101;40005607:25843 indicator.stripe: fixed 2px inset, --Border-Radius-S radius, not 75%/10px */
    content: "";
    position: absolute;
    left: 0px;
    top: 6px;
    bottom: 6px;
    width: 4px;
    background-color: var(--Fill-Action-Primary-Strong-Pressed, #2D4889);
    transition: background-color 0.15s;
    flex: 1 0 0px;
    border-radius: 0 var(--Border-Radius-S, 8px) var(--Border-Radius-S, 8px) 0;
}

/* Hide regular submenu when collapsed */
#main-navigation-container.collapsed .secondary-nav {
    display: none !important;
}

/* Collapsed state icon switching on hover */
#main-navigation-container.collapsed .mainMenu:hover .icon-regular,
#main-navigation-container.collapsed .mainMenu.hover .icon-regular {
    display: none !important;
}

#main-navigation-container.collapsed .mainMenu:hover .icon-hover,
#main-navigation-container.collapsed .mainMenu.hover .icon-hover {
    display: block !important;
}

/* Position the hover menu trigger */
#main-navigation-container.collapsed .mainMenu {
    position: relative;
}

/* SideNav.Control (restored old toggle) — top-of-sidebar collapse/expand button */
.nav-toggle-header {
    flex-shrink: 0;
}

#navToggle:hover {
    background-color: rgba(17, 17, 17, 0.02) !important;
}

.nav-toggle-divider {
    height: 1px;
    background-color: rgb(237, 240, 249);
    margin: 0 0 4px 0;
}

/* =============================================
   Module Switcher
   ============================================= */
.module-switcher-container {
    position: relative;
    margin-bottom: 4px;
}

.module-switcher-trigger {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-align: center;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
    -webkit-transition: background 0.15s;
    transition: background 0.15s;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    border: none;
    width: 100%;
    text-align: left;
    box-sizing: border-box;
}

.module-switcher-trigger:hover,
.module-switcher-trigger:focus {
    background: rgba(17,17,17,0.04);
    outline: none;
}

.module-switcher-trigger:hover .module-switcher-chevron,
.module-switcher-container.open .module-switcher-chevron {
    -webkit-transform: rotate(-180deg);
    -ms-transform: rotate(-180deg);
    transform: rotate(-180deg);
}

.module-switcher-text {
    -ms-flex: 1;
    flex: 1;
    font-family: "Red Hat Text", sans-serif;
    font-size: 12px;
    font-weight: 500;
    line-height: 18px;
    letter-spacing: 0.6px;
    color: var(--Text-Static-Secondary-Subtle, #606060);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.module-switcher-chevron {
    font-size: 11px;
    color: var(--Icon-Static-Neutral-Light, #7B7B7B);
    -webkit-transition: -webkit-transform 0.2s ease;
    transition: transform 0.2s ease;
    -ms-flex-negative: 0;
    flex-shrink: 0;
}

/* Dropdown: hidden by default, shown by .open class (JS toggle) */
.module-switcher-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 220px;
    background: #fff;
    border: 0.5px solid var(--stroke-static-neutral-subtle, #ededed);
    border-radius: 8px;
    -webkit-box-shadow: 2px 2px 8px 4px rgba(0,0,0,0.03);
    box-shadow: 2px 2px 8px 4px rgba(0,0,0,0.03);
    z-index: 1001;
    padding: 6px;
    max-height: 576px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Show dropdown when .open class is applied by JavaScript */
.module-switcher-container.open .module-switcher-dropdown {
    display: flex;
    flex-direction: column;
}

.module-switcher-item {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-align: center;
    align-items: center;
    min-height: 44px;
    padding: 8px 12px;
    font-family: "Red Hat Text", sans-serif;
    font-size: 14px;
    line-height: 20px;
    letter-spacing: 0.3px;
    color: var(--text-contextual-navitem-base, #313131);
    text-decoration: none;
    border-radius: 8px;
    -webkit-transition: background 0.15s;
    transition: background 0.15s;
    position: relative;
}

.module-switcher-item:hover {
    background: rgba(17,17,17,0.04);
    text-decoration: none;
    color: var(--text-contextual-navitem-base, #313131);
}

.module-switcher-item.active {
    color: #003979 !important;
    background: rgba(0,57,121,0.08);
    font-weight: 500;
}

.module-switcher-item.active::before {
    /* Figma I7:19101;40005607:25843 indicator.stripe geometry/token, normalized to match all other accent bars */
    content: "";
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 4px;
    background: var(--Fill-Action-Primary-Strong-Pressed, #2D4889);
    border-radius: 0 var(--Border-Radius-S, 8px) var(--Border-Radius-S, 8px) 0;
}

.module-switcher-item--divider {
    border-bottom: 0.5px solid var(--stroke-static-neutral-subtle, #ededed);
    margin-bottom: 4px;
    padding-bottom: 8px;
    border-radius: 8px 8px 0 0;
}

   /* Financial Home nav item */
.financial-home-nav-item .financial-home-link {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-align: center;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    font-family: "Red Hat Text", sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 22px;
    color: #252525;
    text-decoration: none;
    -webkit-transition: background 0.15s;
    transition: background 0.15s;
    min-height: 48px;
}

.financial-home-nav-item .financial-home-link:hover {
    background: rgba(17,17,17,0.04);
    color: #252525;
    text-decoration: none;
}

.financial-home-nav-item .financial-home-link.active {
    color: #003979 !important;
    background: rgba(0,57,121,0.08);
    position: relative;
}

.financial-home-nav-item .financial-home-link.active::before {
    /* Figma I7:19101;40005607:25843 indicator.stripe geometry/token, normalized to match all other accent bars */
    content: "";
    position: absolute;
    left: 0px;
    top: 6px;
    bottom: 6px;
    width: 4px;
    background: var(--Fill-Action-Primary-Strong-Pressed, #2D4889);
    border-radius: 0 var(--Border-Radius-S, 8px) var(--Border-Radius-S, 8px) 0;
}

/* Collapsed nav: icon-only mode */
#main-navigation-container.collapsed .module-switcher-text,
#main-navigation-container.collapsed .module-switcher-chevron {
    display: none;
}

#main-navigation-container.collapsed .module-switcher-trigger {
    padding: 10px;
    -ms-flex-pack: center;
    justify-content: center;
}

#main-navigation-container.collapsed .module-switcher-dropdown {
    left: calc(100% + 8px);
    top: 0;
    min-width: 220px;
}

/* Mobile responsive */
@media (max-width: 1023px) {
    .module-switcher-dropdown {
        position: fixed;
        left: 0;
        right: 0;
        top: auto;
        bottom: 0;
        border-radius: 12px 12px 0 0;
        max-height: 70vh;
        min-width: unset;
        padding: 12px 8px;
    }
}
