/* MAHIN_UNIFIED_MODULE_LAYOUT_V4
 * MAHIN MODULE NAVIGATION V3
 * Shared navigation appearance + header layout for Dashboard, Settings and Sales.
 * Each future module uses .mi-module-parent-row/.mi-module-home/.mi-module-chevron,
 * .mi-submenu with .nav-item, and .mi-settings-header-tabs.
 * All appearance comes from the existing semantic palette / corner tokens.
 */
html #appScreen #sidebar {
  --mi-module-nav-idle: var(--mi-nav-state-idle,var(--mi-nav-row,rgba(255,255,255,.07)));
  --mi-module-nav-hover: color-mix(in srgb,var(--mi-module-nav-idle) 87%,var(--mi-module-nav-text) 13%);
  --mi-module-nav-active: color-mix(in srgb,var(--mi-module-nav-idle) 76%,var(--mi-module-nav-text) 24%);
  --mi-module-nav-line: var(--mi-nav-state-border,color-mix(in srgb,var(--mi-palette-accent,#3576de) 22%,transparent));
  --mi-module-nav-text: var(--mi-ds-sidebar-ink,var(--mi-nav-ink,#f4f8ff));
  --mi-module-radius: var(--mi-global-control-radius,10px);
}
/* Exactly one visual surface for each parent row. Settings contains two real
 * controls: keep their clicks separate but never paint two rectangles. */
html body #appScreen#appScreen #sidebar :is(.mi-settings-parent-row,.mi-module-parent-row) {
  display:flex !important;
  align-items:stretch !important;
  width:100%;min-width:0;min-height:42px;
  gap:0 !important;
  border:1px solid var(--mi-module-nav-line) !important;
  border-radius:var(--mi-module-radius) !important;
  background:var(--mi-module-nav-idle) !important;
  background-image:none !important;
  box-shadow:none !important;
  color:var(--mi-module-nav-text) !important;
  opacity:1 !important;
  overflow:hidden;
  transition:background-color .18s ease,border-color .18s ease !important;
}
html body #appScreen#appScreen #sidebar :is(.mi-settings-parent-row,.mi-module-parent-row) > :is(#settingsHomeNav,#settingsGroupToggle,.mi-module-home,.mi-module-chevron) {
  position:relative;
  display:flex !important;align-items:center !important;
  min-height:40px !important;margin:0 !important;padding:9px 10px !important;
  border:0 !important;border-radius:0 !important;
  background:transparent !important;background-image:none !important;
  box-shadow:none !important;color:inherit !important;
  opacity:1 !important;text-shadow:none !important;
  font:inherit;font-size:13px;cursor:pointer;
}
html body #appScreen#appScreen #sidebar :is(.mi-settings-parent-row,.mi-module-parent-row) > :is(#settingsHomeNav,.mi-module-home) {
  flex:1 1 auto !important;min-width:0;gap:11px;text-align:left;justify-content:flex-start;
}
html body #appScreen#appScreen #sidebar :is(.mi-settings-parent-row,.mi-module-parent-row) > :is(#settingsGroupToggle,.mi-module-chevron) {
  flex:0 0 37px !important;width:37px !important;max-width:37px !important;
  justify-content:center !important;padding:0 !important;
}
html body #appScreen#appScreen #sidebar .mi-module-parent-row :is(.mi-parent-label,.mi-polished-icon,#miSalesToggle),
html body #appScreen#appScreen #sidebar .mi-settings-parent-row :is(.mi-settings-home-label,.mi-polished-icon,#settingsGroupToggle) {
  color:inherit !important;
  opacity:1 !important;
  text-shadow:none !important;
}
/* One uniform chevron (same direction, animation and accessibility). */
html body #appScreen#appScreen #sidebar #miSalesToggle > *,
html body #appScreen#appScreen #sidebar #settingsGroupToggle > * {display:none !important;}
html body #appScreen#appScreen #sidebar :is(#miSalesToggle,#settingsGroupToggle)::before {content:none !important;display:none !important;}
html body #appScreen#appScreen #sidebar :is(#miSalesToggle,#settingsGroupToggle)::after {
  content:"" !important;display:block !important;
  width:7px !important;height:7px !important;
  border:0 !important;border-right:1.7px solid currentColor !important;border-bottom:1.7px solid currentColor !important;
  border-radius:0 !important;transform:rotate(-45deg) !important;
  transition:transform .2s ease !important;pointer-events:none;
}
html body #appScreen#appScreen #sidebar :is(#miSalesToggle,#settingsGroupToggle)[aria-expanded="true"]::after {
  transform:rotate(45deg) !important;
}
/* Parent + leaf + submenu links — all the same visual contract. */
html body #appScreen#appScreen #sidebar :is(#dashboardNav,.mi-submenu .nav-item,.mi-submenu .mi-v2-sidebar-link) {
  border:1px solid var(--mi-module-nav-line) !important;
  border-left-width:1px !important;
  border-radius:var(--mi-module-radius) !important;
  background:var(--mi-module-nav-idle) !important;
  background-image:none !important;
  color:var(--mi-module-nav-text) !important;
  box-shadow:none !important;opacity:1 !important;
  text-shadow:none !important;
  transition:background-color .18s ease,border-color .18s ease !important;
}
html body #appScreen#appScreen #sidebar .mi-submenu :is(.mi-nav-text,.mi-v2-nav-label) {
  color:inherit !important;opacity:1 !important;
}
/* MAHIN_ROUTE_EXCLUSIVE_ACTIVE_V5
 * Page selection must never be inferred from mere DOM presence.
 * A collapsed/expanded submenu is not evidence of the current page.
 * Existing .mi-sales-route-active is set by the Sales router.
 */
html body #appScreen#appScreen:not(.mi-sales-route-active) #sidebar#sidebar #dashboardNav:is(.active,[aria-current="page"]),
html body #appScreen#appScreen:not(.mi-sales-route-active):not(:has(#dashboardNav:is(.active,[aria-current="page"]))) #sidebar#sidebar .mi-settings-parent-row.mi-parent-active,
html body #appScreen#appScreen:not(.mi-sales-route-active):not(:has(#dashboardNav:is(.active,[aria-current="page"]))) #sidebar#sidebar .mi-settings-parent-row:has(> #settingsHomeNav:is(.active,.mi-settings-section-active,[aria-current="page"])),
html body #appScreen#appScreen:not(.mi-sales-route-active):not(:has(#dashboardNav:is(.active,[aria-current="page"]))) #sidebar#sidebar #settingsSubmenu :is(.nav-item,.mi-v2-sidebar-link):is(.active,.mi-v2-current,[aria-current="page"]),
html body #appScreen#appScreen.mi-sales-route-active #sidebar#sidebar .mi-sales-group .mi-module-parent-row.mi-parent-active,
html body #appScreen#appScreen.mi-sales-route-active #sidebar#sidebar .mi-sales-group .mi-submenu .nav-item:is(.active,[aria-current="page"]) {
    background: var(--mi-module-nav-active) !important;
    background-image: none !important;
    border-color: color-mix(in srgb, var(--mi-module-nav-text) 35%, transparent) !important;
    color: var(--mi-module-nav-text) !important;
    box-shadow: inset 0 -2px 0 var(--mi-ds-accent,var(--mi-palette-accent,#3b86ec)) !important;
    font-weight: 700 !important;
}

/* Stale Settings classes must not appear selected on a Sales page.
 * This also defeats older Settings-specific rules loaded earlier. */
html body #appScreen#appScreen.mi-sales-route-active #sidebar#sidebar .mi-settings-parent-row,
html body #appScreen#appScreen:has(#dashboardNav:is(.active,[aria-current="page"])) #sidebar#sidebar .mi-settings-parent-row,
html body #appScreen#appScreen:not(.mi-sales-route-active) #sidebar#sidebar .mi-sales-group .mi-module-parent-row {
    background: var(--mi-module-nav-idle) !important;
    background-image: none !important;
    border-color: var(--mi-module-nav-line) !important;
    color: var(--mi-module-nav-text) !important;
    box-shadow: none !important;
    font-weight: 550 !important;
}

/* Prevent prior Settings-only active backgrounds on the inner buttons. */
html body #appScreen#appScreen #sidebar .mi-settings-parent-row > :is(#settingsHomeNav,#settingsGroupToggle):is(.active,.mi-settings-section-active,:hover,:focus),
html body #appScreen#appScreen #sidebar .mi-module-parent-row > :is(.mi-module-home,.mi-module-chevron):is(.active,:hover,:focus) {
  background:transparent !important;background-image:none !important;
  box-shadow:none !important;color:inherit !important;
}
html body #appScreen#appScreen #sidebar :is(.mi-settings-parent-row,.mi-module-parent-row,#dashboardNav,.mi-submenu .nav-item,.mi-submenu .mi-v2-sidebar-link)::before,
html body #appScreen#appScreen #sidebar :is(.mi-settings-parent-row,.mi-module-parent-row,#dashboardNav,.mi-submenu .nav-item,.mi-submenu .mi-v2-sidebar-link)::after {
  box-shadow:none !important;
}
@media(hover:hover) and (pointer:fine){
  html body #appScreen#appScreen #sidebar :is(.mi-settings-parent-row,.mi-module-parent-row,#dashboardNav,.mi-submenu .nav-item,.mi-submenu .mi-v2-sidebar-link):hover{
    background:var(--mi-module-nav-hover) !important;border-color:var(--mi-palette-accent,#3576de) !important;
  }
  html body #appScreen#appScreen #sidebar :is(.mi-settings-parent-row,.mi-module-parent-row,#dashboardNav,.mi-submenu .nav-item,.mi-submenu .mi-v2-sidebar-link):is(.mi-parent-active,.active,.mi-v2-current,[aria-current="page"]):hover{
    background:var(--mi-module-nav-active) !important;
  }
}
html body #appScreen#appScreen #sidebar :is(#settingsHomeNav,#settingsGroupToggle,.mi-module-home,.mi-module-chevron,#dashboardNav,.mi-submenu .nav-item,.mi-submenu .mi-v2-sidebar-link):focus-visible {
  outline:2px solid var(--mi-palette-accent,#3576de) !important;outline-offset:-3px !important;
}
/* GLOBAL-FIRST: one row rhythm for existing and future top-level modules.
 * The Sales group must not apply its own extra top margin. */
#appScreen #sidebar > :is(#dashboardNav, .mi-navigation-group) {
  margin-block-start: 0 !important;
  margin-block-end: var(--mi-nav-primary-gap, 6px) !important;
}
#appScreen #sidebar { --mi-nav-primary-gap: 6px; }
#appScreen #sidebar .mi-sales-group .mi-submenu .nav-item {display:flex;width:100%;align-items:center;gap:10px;text-align:left;cursor:pointer;}
/* Reuse Settings' two-row header structure and exact tab geometry in Sales. */
#appScreen .main > #topbar.mi-module-tabs-visible {
  display:flex !important;flex-wrap:wrap !important;align-content:flex-start !important;
  row-gap:0 !important;padding-bottom:4px !important;
}
#appScreen #topbar > #miSalesHeaderTabs {
  display:flex;align-items:center;flex-wrap:nowrap;gap:5px !important;
  flex:0 0 100% !important;width:100% !important;min-width:0 !important;
  margin:0 !important;padding:2px 0 0 !important;
  border:0 !important;background:transparent !important;
  overflow-x:auto;overflow-y:hidden;scrollbar-width:none;overscroll-behavior-x:contain;
}
#appScreen #miSalesHeaderTabs::-webkit-scrollbar {display:none;}
#appScreen #miSalesHeaderTabs[hidden] {display:none !important;}
#appScreen.mi-sales-route-active #miSettingsHeaderTabs {display:none !important;}
#appScreen :is(#miSettingsHeaderTabs,#miSalesHeaderTabs) > .mi-v2-header-link {
  display:inline-flex;align-items:center;justify-content:center;gap:5px;
  flex:0 0 auto;min-height:30px !important;
  padding:5px 9px !important;border-radius:var(--mi-global-control-radius,7px) !important;
  font-size:11.5px !important;white-space:nowrap;
}
#appScreen #miSalesHeaderTabs .mi-v2-nav-icon {flex:0 0 auto;}
/* ONE Header tab contract: both Settings and Sales now share normal,
 * hover and selected states. No palette-specific styles required. */
html[data-mi-ds-ready] body #appScreen#appScreen #topbar :is(#miSettingsHeaderTabs,#miSalesHeaderTabs) > .mi-v2-header-link {
  background-color:color-mix(in srgb,var(--mi-ds-header-ink,#122b41) 6%,transparent) !important;
  background-image:none !important;
  border:1px solid color-mix(in srgb,var(--mi-ds-header-ink,#122b41) 20%,transparent) !important;
  color:var(--mi-ds-header-ink,#122b41) !important;
  font-weight:550;
  min-height:31px !important;
  transition:background-color .18s ease,border-color .18s ease,box-shadow .18s ease;
}
@media(hover:hover) and (pointer:fine){
  html[data-mi-ds-ready] body #appScreen#appScreen #topbar :is(#miSettingsHeaderTabs,#miSalesHeaderTabs) > .mi-v2-header-link:not(.active,.mi-v2-current,[aria-current="page"]):hover {
    background-color:color-mix(in srgb,var(--mi-ds-accent,#2876ce) 17%,var(--mi-ds-header-fill,transparent)) !important;
    border-color:color-mix(in srgb,var(--mi-ds-accent,#2876ce) 45%,transparent) !important;
  }
}
html[data-mi-ds-ready] body #appScreen#appScreen #topbar :is(#miSettingsHeaderTabs,#miSalesHeaderTabs) > .mi-v2-header-link:is(.active,.mi-v2-current,[aria-current="page"]) {
  background-color:color-mix(in srgb,var(--mi-ds-accent,#2876ce) 26%,var(--mi-ds-header-fill,#f7f8fc)) !important;
  background-image:none !important;
  border-color:color-mix(in srgb,var(--mi-ds-accent,#2876ce) 72%,transparent) !important;
  color:var(--mi-ds-header-ink,#122b41) !important;
  box-shadow:inset 0 -2px 0 var(--mi-ds-accent,#2876ce) !important;
  font-weight:750 !important;
}
/* Standard page-title back action: reuses .mi-ui-settings-back shared paint. */
#appScreen .mi-module-page .mi-module-titlebar > .mi-ui-settings-back {flex:0 0 auto;margin:0 !important;}
#appScreen .mi-ui-settings-back[hidden]{display:none !important;}
/* Settings banner and Sales banner share the same DOM structure and tokens. */
#appScreen .mi-module-page{width:100%;max-width:none;margin:0;padding:0 0 32px;}
/* Banner geometry belongs to components.css: .mi-ui-settings-banner */
#appScreen .mi-module-page-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:0 0 14px;}
#appScreen .mi-module-page-grid[hidden]{display:none !important;}
#appScreen .mi-sales-overview-card{width:100%;min-width:0;display:flex;align-items:center;gap:12px;min-height:90px;padding:16px;cursor:pointer;text-align:left;}
#appScreen .mi-sales-overview-card .mi-v2-card-text{display:flex;flex:1;flex-direction:column;gap:4px;min-width:0;}
#appScreen .mi-sales-overview-card small{font-size:12px;color:var(--mi-ds-muted,var(--muted,#71839b));}
#appScreen .mi-sales-message{padding:20px;min-height:110px;background:var(--mi-global-card,var(--card,#fff));border:1px solid var(--mi-global-line,#b5c9e5);border-radius:var(--mi-global-radius,12px);}
#appScreen .mi-sales-message strong{display:block;margin-bottom:8px;}
#appScreen .mi-sales-message p{font-size:13px;line-height:1.6;margin:0;color:var(--mi-ds-muted,var(--muted,#71839b));}
#appScreen .mi-sales-status{padding:7px 10px;border:1px solid var(--mi-global-line,#b5c9e5);border-radius:var(--mi-global-control-radius,8px);font-size:11px;white-space:nowrap;}
@media(max-width:650px){
  
  #appScreen .mi-module-page-grid{grid-template-columns:1fr;}
}
@media(prefers-reduced-motion:reduce){
  html body #appScreen#appScreen #sidebar :is(.mi-settings-parent-row,.mi-module-parent-row,#dashboardNav,.mi-submenu .nav-item,.mi-submenu .mi-v2-sidebar-link){transition:none !important;}
  html body #appScreen#appScreen #sidebar :is(#miSalesToggle,#settingsGroupToggle)::after{transition:none !important;}
}


/* MAHIN_COMPACT_PARENT_ICON_CONTRACT_V1
 * One compact-rail geometry for every existing/future split parent-row.
 * Sidebar modules use .mi-module-parent-row > .mi-module-home/.mi-module-chevron.
 * Settings uses the same visual contract via its existing IDs.
 * Normal expanded and mobile drawer layouts are untouched.
 */
@media (min-width: 751px) {
  /* The router applies this state only while the measured sidebar is a narrow rail. */
  html body #appScreen#appScreen.mi-settings-compact-mode:not(.mi-nav-expanded) #sidebar#sidebar
  :is(.mi-settings-parent-row,.mi-module-parent-row) {
    position:relative !important;
    display:grid !important;
    grid-template-columns:minmax(0,1fr) !important;
    align-items:center !important;
    justify-items:stretch !important;
    box-sizing:border-box !important;
    width:100% !important;
    min-width:0 !important;
    min-height:44px !important;
    padding:0 !important;
    gap:0 !important;
    overflow:visible !important;
  }
  /* Split parents have one actual navigation action and one secondary toggle.
     The action fills the rail; the secondary toggle does not consume its width. */
  html body #appScreen#appScreen.mi-settings-compact-mode:not(.mi-nav-expanded) #sidebar#sidebar
  :is(.mi-settings-parent-row,.mi-module-parent-row) > :is(#settingsHomeNav,.mi-module-home) {
    position:relative !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    box-sizing:border-box !important;
    grid-area:1/1 !important;
    flex:none !important;
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    min-height:42px !important;
    margin:0 !important;
    padding:0 !important;
    gap:0 !important;
    text-align:center !important;
  }
  html body #appScreen#appScreen.mi-settings-compact-mode:not(.mi-nav-expanded) #sidebar#sidebar
  :is(.mi-settings-parent-row,.mi-module-parent-row) > :is(#settingsHomeNav,.mi-module-home) >
  :is(.mi-polished-icon,.mi-sidebar-icon,svg) {
    position:static !important;
    display:block !important;
    visibility:visible !important;
    opacity:1 !important;
    flex:0 0 19px !important;
    width:19px !important;
    min-width:19px !important;
    height:19px !important;
    margin:0 !important;
    transform:none !important;
  }
  html body #appScreen#appScreen.mi-settings-compact-mode:not(.mi-nav-expanded) #sidebar#sidebar
  :is(.mi-settings-parent-row,.mi-module-parent-row) :is(.mi-settings-home-label,.mi-parent-label) {
    display:none !important;
  }
  /* Inactive parent indicators are hidden in the compact rail. */
  html body #appScreen#appScreen.mi-settings-compact-mode:not(.mi-nav-expanded) #sidebar#sidebar
  :is(.mi-settings-parent-row,.mi-module-parent-row) > :is(#settingsGroupToggle,.mi-module-chevron) {
    display:none !important;
    flex:none !important;
    grid-area:1/1 !important;
    box-sizing:border-box !important;
    min-width:0 !important;
    margin:0 !important;
  }
  /* Active Settings and Sales get a SMALL functional indicator in the corner.
     This is not a duplicated icon and never moves the primary icon. */
  html body #appScreen#appScreen.mi-settings-compact-mode:not(.mi-sales-route-active):not(.mi-nav-expanded) #sidebar#sidebar
  .mi-settings-parent-row > #settingsGroupToggle[data-mi-context-active="1"],
  html body #appScreen#appScreen.mi-settings-compact-mode.mi-sales-route-active:not(.mi-nav-expanded) #sidebar#sidebar
  .mi-module-parent-row.mi-parent-active > :is(#miSalesToggle,.mi-module-chevron) {
    position:absolute !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    top:auto !important;
    right:1px !important;
    bottom:1px !important;
    left:auto !important;
    transform:none !important;
    flex:0 0 14px !important;
    width:14px !important;
    max-width:14px !important;
    min-width:14px !important;
    height:14px !important;
    min-height:14px !important;
    padding:0 !important;
    border:1px solid currentColor !important;
    border-radius:50% !important;
    background:var(--mi-module-nav-idle,rgba(12,30,46,.92)) !important;
    color:var(--mi-module-nav-text,currentColor) !important;
    box-shadow:none !important;
    z-index:3 !important;
  }
  html body #appScreen#appScreen.mi-settings-compact-mode:not(.mi-nav-expanded) #sidebar#sidebar
  :is(#settingsGroupToggle,.mi-module-chevron)::after {
    width:5px !important;
    height:5px !important;
    margin:0 !important;
    border-right-width:1.25px !important;
    border-bottom-width:1.25px !important;
  }
  /* When CSS toggles from rail to overlay-expanded, restore the existing
     normal two-control row without waiting for a page navigation. */
  html body #appScreen#appScreen.mi-nav-expanded #sidebar#sidebar
  :is(.mi-settings-parent-row,.mi-module-parent-row) {
    display:flex !important;
    align-items:stretch !important;
  }
  /* Source of truth: active route, never the previous expanded group. */
  html body #appScreen#appScreen.mi-settings-compact-mode.mi-sales-route-active:not(.mi-nav-expanded) #sidebar#sidebar
  .mi-settings-parent-row > #settingsGroupToggle {
    display:none !important;
    visibility:hidden !important;
    pointer-events:none !important;
  }
  html body #appScreen#appScreen.mi-settings-compact-mode:not(.mi-sales-route-active):not(.mi-nav-expanded) #sidebar#sidebar
  .mi-module-parent-row > #miSalesToggle {
    display:none !important;
    visibility:hidden !important;
    pointer-events:none !important;
  }
}
/* MAHIN_COMPACT_PARENT_ICON_CONTRACT_V1_END */

/* MAHIN_SHARED_CHILD_NAV_ICON_CONTRACT_V1
 * Any future module can use the same .mi-module-child-icon markup.
 * The parent's icon, active selection, text and click target are untouched.
 */
html body #appScreen#appScreen #sidebar#sidebar .mi-submenu .nav-item > .mi-module-child-icon {
  display:block !important;
  width:19px !important;
  min-width:19px !important;
  height:19px !important;
  flex:0 0 19px !important;
  margin:0 !important;
  color:inherit !important;
  opacity:1 !important;
  visibility:visible !important;
  stroke:currentColor !important;
  pointer-events:none !important;
}
html body #appScreen#appScreen #sidebar#sidebar .mi-submenu .nav-item > .mi-nav-text {
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
}
/* Child rows exist only when their true submenu is open. Compact rails
 * expand via the shared responsive controller before revealing labels. */
html body #appScreen#appScreen #sidebar#sidebar .mi-submenu[hidden] {
  display:none !important;
}
/* MAHIN_SHARED_CHILD_NAV_ICON_CONTRACT_V1_END */

/* MAHIN_UNIFIED_COMPACT_CHILDREN_V2
 * Compact sidebar: parent (Settings/Sales/future .mi-navigation-group)
 * opens children IN THE RAIL, never by expanding the entire sidebar.
 * This overrides the retired navigation.css rule that hides all submenus.
 * The hidden attribute remains authoritative; aria-expanded is owned by
 * the existing route controllers. No theme-specific or page-specific hacks.
 */
@media (min-width:751px) {
  html body #appScreen#appScreen.mi-settings-compact-mode:not(.mi-nav-expanded)
  #sidebar#sidebar .mi-navigation-group > .mi-submenu:not([hidden]) {
    display:flex !important;
    flex-direction:column !important;
    align-items:stretch !important;
    width:100% !important;
    min-width:0 !important;
    margin:4px 0 7px !important;
    padding:0 3px !important;
    gap:4px !important;
    overflow:visible !important;
    visibility:visible !important;
  }
  html body #appScreen#appScreen.mi-settings-compact-mode:not(.mi-nav-expanded)
  #sidebar#sidebar .mi-navigation-group > .mi-submenu:not([hidden]) > :is(button.nav-item,a.nav-item) {
    display:flex !important;
    flex-direction:row !important;
    justify-content:center !important;
    align-items:center !important;
    box-sizing:border-box !important;
    width:100% !important;
    min-width:0 !important;
    min-height:36px !important;
    margin:0 !important;
    padding:7px 2px !important;
    gap:0 !important;
    text-align:center !important;
    overflow:hidden !important;
  }
  html body #appScreen#appScreen.mi-settings-compact-mode:not(.mi-nav-expanded)
  #sidebar#sidebar .mi-navigation-group > .mi-submenu:not([hidden]) > .nav-item
  :is(.mi-nav-text,.mi-v2-nav-label) {
    display:none !important;
  }
  html body #appScreen#appScreen.mi-settings-compact-mode:not(.mi-nav-expanded)
  #sidebar#sidebar .mi-navigation-group > .mi-submenu:not([hidden]) > .nav-item
  :is(svg.mi-module-child-icon,svg.mi-polished-icon,svg.mi-sidebar-icon,svg.mi-nav-icon) {
    display:block !important;
    position:static !important;
    visibility:visible !important;
    opacity:1 !important;
    flex:0 0 19px !important;
    width:19px !important;
    min-width:19px !important;
    height:19px !important;
    margin:0 !important;
    transform:none !important;
    pointer-events:none !important;
  }
  /* Do not allow older CSS to unhide a genuinely collapsed submenu. */
  html body #appScreen#appScreen.mi-settings-compact-mode:not(.mi-nav-expanded)
  #sidebar#sidebar .mi-navigation-group > .mi-submenu[hidden] {
    display:none !important;
  }
}
/* MAHIN_UNIFIED_COMPACT_CHILDREN_V2_END */

/* MAHIN_GLOBAL_SUBMENU_MOTION_V1
 * Shared parent-to-child motion. Settings, Sales and future modules use the
 * same .mi-navigation-group > .mi-submenu contract (no page-specific JS).
 * Browsers without discrete display/auto-size transitions keep the existing
 * immediate hidden behavior rather than running an unreliable animation.
 */
@supports (transition-behavior: allow-discrete) and (interpolate-size: allow-keywords) {
  html body #appScreen#appScreen #sidebar#sidebar .mi-navigation-group > .mi-submenu {
    interpolate-size:allow-keywords;
    height:auto;
    min-height:0;
    opacity:1;
    transform:translateY(0) scaleY(1);
    transform-origin:center top;
    clip-path:inset(0 0 0 0);
    transition:
      height 340ms cubic-bezier(.22,1,.36,1),
      opacity 250ms ease,
      transform 340ms cubic-bezier(.22,1,.36,1),
      clip-path 340ms cubic-bezier(.22,1,.36,1),
      display 340ms allow-discrete !important;
  }
  html body #appScreen#appScreen #sidebar#sidebar .mi-navigation-group > .mi-submenu[hidden] {
    display:none !important;
    height:0 !important;
    opacity:0;
    transform:translateY(-11px) scaleY(.96);
    clip-path:inset(0 0 100% 0);
    pointer-events:none;
  }
  /* Height shrinks and expands physically; icons emerge downward from parent. */
  html body #appScreen#appScreen #sidebar#sidebar .mi-navigation-group > .mi-submenu {
    overflow:clip !important;
  }
  @starting-style {
    html body #appScreen#appScreen #sidebar#sidebar .mi-navigation-group > .mi-submenu:not([hidden]) {
      height:0;
      opacity:0;
      transform:translateY(-11px) scaleY(.96);
      clip-path:inset(0 0 100% 0);
    }
  }
  @media (prefers-reduced-motion:reduce) {
    html body #appScreen#appScreen #sidebar#sidebar .mi-navigation-group > .mi-submenu {
      transition:none !important;
      transform:none !important;
      clip-path:none !important;
    }
  }
  html[data-mi-reduced-motion="true"] body #appScreen#appScreen #sidebar#sidebar .mi-navigation-group > .mi-submenu {
    transition:none !important;
    transform:none !important;
    clip-path:none !important;
  }
}
/* MAHIN_GLOBAL_SUBMENU_MOTION_V1_END */
