/* ============================================================================
   SideMenu.css  -  Side menu and page frame, same behaviour and look as the Foundry module
   ----------------------------------------------------------------------------
   Part of App_Themes/Default. web.config sets theme="Default", so ASP.NET links this
   file automatically on every page (after Default.css). Nothing in any .aspx or
   code-behind needs to change. Used by AdminMaster and ProductionMaster.
   Works together with initMenuClickOpen() in assets/js/app.js.

   - Top bar, side menu and footer stay where they are at any screen size; only
     the page content scrolls. The template made every page at least 1400px tall
     with the closed menu, so even a short page scrolled.
   - Closed menu (icons only, data-sidebar-size="sm"): nothing opens when the
     mouse passes over an icon. A click opens the section as a card (app.js places
     it inside the screen); the icon column scrolls by itself when the screen is
     too short for all icons.
   Selectors start with "html ... body" so they win over Default.css and app.css
   regardless of the order in which the files are linked.
   ========================================================================== */

html[data-sidebar-size], html[data-sidebar-size] body #layout-wrapper { min-height: 0 !important; }   /* template: 1400px with the closed menu */
html body .main-content { min-height: 100vh !important; }
html body .footer {
    position: fixed !important; bottom: 0; z-index: 1001;
    background: #fff !important; border-top: 1px solid #e3e8f0 !important; box-shadow: 0 -2px 10px rgba(15,32,64,.05);
}

/* closed menu: pinned to the screen like the open menu (Default.css lets it scroll with the page) */
@media (min-width: 768px) {
    html:root[data-sidebar=gradient-4]:is([data-layout=vertical], [data-layout=semibox])[data-sidebar-size=sm] body .app-menu.navbar-menu {
        position: fixed !important; top: 0 !important; bottom: 0 !important; min-height: 0 !important;
    }
}

/* icon column: scrolls on short screens, scrollbar hidden (the open cards are fixed, so nothing is clipped) */
html:root[data-sidebar][data-layout][data-sidebar-size=sm] body .app-menu.navbar-menu #scrollbar {
    overflow-x: hidden !important; overflow-y: auto !important; scrollbar-width: none;
}
html:root[data-sidebar][data-layout][data-sidebar-size=sm] body .app-menu.navbar-menu #scrollbar::-webkit-scrollbar { display: none; }

/* no mouse-over pop-outs */
html[data-sidebar-size=sm] body .navbar-menu .navbar-nav .nav-item:not(.fth-open):hover > .menu-dropdown { display: none !important; }
html[data-sidebar-size=sm] body .navbar-menu .navbar-nav .nav-item:has(> a.menu-link):hover > a.menu-link,
html[data-sidebar-size=sm] body .navbar-menu .navbar-nav .nav-item:has(> a.menu-link).fth-open > a.menu-link {
    width: auto !important; background-image: none !important; background-color: rgba(255,255,255,.16) !important;
}
html[data-sidebar-size=sm] body .navbar-menu .navbar-nav .nav-item:has(> a.menu-link) > a.menu-link span,
html[data-sidebar-size=sm] body .navbar-menu .navbar-nav .nav-item:has(> a.menu-link):not(.fth-open):hover .nav-link span { display: none !important; }
html[data-sidebar-size=sm] body .navbar-menu .navbar-nav .nav-item:has(> a.menu-link) > a.menu-link:after { display: none !important; }
html[data-sidebar-size=sm] body .navbar-menu .navbar-nav .nav-item > a.menu-link { cursor: pointer; }

/* opened section: white card, blue header, blue highlight */
html[data-sidebar-size=sm] body .navbar-menu .navbar-nav .nav-item.fth-open > .menu-dropdown {
    display: block !important; position: fixed !important; width: 250px !important; height: auto !important;
    overflow-x: hidden; overflow-y: auto; margin: 0 !important; padding: 6px 0 !important; z-index: 1005;
    background: #fff !important; border: 1px solid #e3e8f0; border-radius: 10px !important;
    box-shadow: 0 18px 40px rgba(15,32,64,.20), 0 2px 6px rgba(15,32,64,.08) !important;
    scrollbar-width: thin;
}
html[data-sidebar-size=sm] body .navbar-menu .navbar-nav .nav-item:has(> a.menu-link).fth-open > .menu-dropdown { padding-top: 0 !important; }
html[data-sidebar-size=sm] body .navbar-menu .navbar-nav .nav-item:has(> a.menu-link).fth-open > .menu-dropdown::before {
    content: attr(data-fth-title); display: block; position: sticky; top: 0; z-index: 1;
    padding: 10px 16px; margin-bottom: 6px; color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    background: linear-gradient(90deg, #0F4C81 0%, #1565C0 55%, #1E88E5 100%);
}
html[data-sidebar-size=sm] body .navbar-menu .navbar-nav .fth-open > .menu-dropdown .nav-sm { padding: 0 !important; }
html[data-sidebar-size=sm] body .navbar-menu .navbar-nav .fth-open > .menu-dropdown .nav-link {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 8px 16px !important; font-size: 13px !important; line-height: 1.35; white-space: normal;
    color: #1f2440 !important; background: transparent !important; border-radius: 0 !important;
}
html[data-sidebar-size=sm] body .navbar-menu .navbar-nav .fth-open > .menu-dropdown .nav-link span { display: inline !important; padding: 0 !important; }
html[data-sidebar-size=sm] body .navbar-menu .navbar-nav .fth-open > .menu-dropdown .nav-link:before { display: none !important; }
html[data-sidebar-size=sm] body .navbar-menu .navbar-nav .fth-open > .menu-dropdown .nav-link:after { color: #9aa5b8 !important; }
html[data-sidebar-size=sm] body .navbar-menu .navbar-nav .fth-open > .menu-dropdown .nav-link:hover,
html[data-sidebar-size=sm] body .navbar-menu .navbar-nav .fth-open > .menu-dropdown .nav-item.fth-open > .nav-link {
    color: #1565C0 !important; background: #eef4fd !important;
}
html[data-sidebar-size=sm] body .navbar-menu .navbar-nav .fth-open > .menu-dropdown .nav-link:hover:after,
html[data-sidebar-size=sm] body .navbar-menu .navbar-nav .fth-open > .menu-dropdown .nav-item.fth-open > .nav-link:after { color: #1565C0 !important; }
html[data-sidebar-size=sm] body .navbar-menu .navbar-nav .fth-open > .menu-dropdown .nav-link.active { color: #1565C0 !important; font-weight: 600; }
