/* ============================================================================
   MenuIcons.css  -  menu icons (assets/js/menu-icons.js), same look as Foundry ERP - GUI only
   ----------------------------------------------------------------------------
   Part of App_Themes/Default: web.config sets theme="Default", so ASP.NET links this
   file automatically on every page. A coloured icon tile in front of every page name
   in the side menu, the header Search Menu list and My Favourite. The JS picks the
   icon (mdi-*) and one of 8 colour tones (fmi-t0..fmi-t7) from the page name.
   Selectors start with "html body" so they win over Default.css / app.css.
   ========================================================================== */
.fmi-t0 { --fmi-bg: #e3eefc; --fmi-fg: #1565C0; }
.fmi-t1 { --fmi-bg: #dcf4ea; --fmi-fg: #0a8f6c; }
.fmi-t2 { --fmi-bg: #fff0d3; --fmi-fg: #b06a00; }
.fmi-t3 { --fmi-bg: #ece6fd; --fmi-fg: #6741d9; }
.fmi-t4 { --fmi-bg: #d9f2f4; --fmi-fg: #0c8599; }
.fmi-t5 { --fmi-bg: #fde3ed; --fmi-fg: #c2255c; }
.fmi-t6 { --fmi-bg: #ffe7d8; --fmi-fg: #d9480f; }
.fmi-t7 { --fmi-bg: #e4e8fd; --fmi-fg: #3b5bdb; }

html body i.fmi {
    flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 6px; font-size: 14px; line-height: 1; font-style: normal;
    background: var(--fmi-bg, #e3eefc); color: var(--fmi-fg, #1565C0);
}
html body i.fmi::before { line-height: 1; }
/* the template styles every side-menu icon as inline-block, min-width 1.75rem, line-height inherit
   (and bigger in the closed menu), which pushed the glyph into the top-left corner of the box */
html body .app-menu.navbar-menu .navbar-nav .nav-link > i.fmi {
    display: inline-flex !important; align-items: center !important; justify-content: center !important;
    min-width: 0 !important; margin: 0 !important; padding: 0 !important; text-align: center !important;
    width: 22px !important; height: 22px !important; font-size: 14px !important; line-height: 1 !important; vertical-align: middle;
}
html body .app-menu.navbar-menu .navbar-nav .nav-link > i.fmi::before { display: block; line-height: 1 !important; margin: 0 !important; }

/* ---- side menu: full (open) menu on the blue gradient ---- */
html body .app-menu.navbar-menu .menu-dropdown a.nav-link.fmi-link {
    display: flex !important; align-items: center; justify-content: flex-start !important; gap: 9px;
}
html body .app-menu.navbar-menu .menu-dropdown a.nav-link.fmi-link::before { display: none !important; }   /* template dash/bullet */
html body .app-menu.navbar-menu .menu-dropdown a.nav-link.fmi-link > .fmi-text { flex: 1 1 auto; min-width: 0; }
html body .app-menu.navbar-menu .menu-dropdown a.nav-link.fmi-link > i.fmi { opacity: .95; }

/* ---- side menu: closed menu, a section opened as a white card (SideMenu.css) ---- */
html[data-sidebar-size=sm] body .navbar-menu .navbar-nav .fth-open > .menu-dropdown a.nav-link.fmi-link {
    justify-content: flex-start !important; gap: 10px; padding: 7px 14px !important;
}
html[data-sidebar-size=sm] body .navbar-menu .navbar-nav .fth-open > .menu-dropdown a.nav-link.fmi-link > i.fmi {
    width: 26px !important; height: 26px !important; border-radius: 7px; font-size: 15px !important; opacity: 1;
}
html[data-sidebar-size=sm] body .navbar-menu .navbar-nav .fth-open > .menu-dropdown a.nav-link.fmi-link > .fmi-text { display: block !important; }
html[data-sidebar-size=sm] body .navbar-menu .navbar-nav .fth-open > .menu-dropdown a.nav-link.fmi-link:hover > i.fmi {
    background: var(--fmi-fg); color: #fff;
}

/* ---- header Search Menu box (as in Foundry): search icon, Ctrl K hint and a theme-blue arrow ---- */
html body #page-topbar .menu-search-wrapper .select2-selection--single { position: relative; transition: box-shadow .15s; }
html body #page-topbar .menu-search-wrapper .select2-selection--single::before {
    content: "\F0349"; font-family: "Material Design Icons"; position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
    font-size: 17px; line-height: 1; color: #1565C0; pointer-events: none;
}
html body #page-topbar .menu-search-wrapper .select2-selection--single .select2-selection__rendered {
    padding-left: 38px !important; padding-right: 92px !important; font-weight: 600; letter-spacing: .02em; color: #3a4258;
}
html body #page-topbar .menu-search-wrapper .select2-selection--single .select2-selection__arrow {
    top: 50% !important; right: 6px !important; width: 24px !important; height: 24px !important; margin-top: -12px; border-radius: 50%;
    background: #e3eefc; transition: background .15s, transform .2s;
}
html body #page-topbar .menu-search-wrapper .select2-selection--single .select2-selection__arrow b { display: none !important; }
html body #page-topbar .menu-search-wrapper .select2-selection--single .select2-selection__arrow::before {
    content: "\F0140"; font-family: "Material Design Icons"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-size: 18px; line-height: 1; color: #1565C0;
}
html body #page-topbar .menu-search-wrapper .select2-selection--single:hover .select2-selection__arrow { background: #1565C0; }
html body #page-topbar .menu-search-wrapper .select2-selection--single:hover .select2-selection__arrow::before { color: #fff; }
html body #page-topbar .menu-search-wrapper .select2-container--open .select2-selection--single .select2-selection__arrow { background: #1565C0; transform: rotate(180deg); }
html body #page-topbar .menu-search-wrapper .select2-container--open .select2-selection--single .select2-selection__arrow::before { color: #fff; }
html body #page-topbar .menu-search-wrapper .select2-container--open .select2-selection--single,
html body #page-topbar .menu-search-wrapper .select2-container--focus .select2-selection--single { box-shadow: 0 0 0 3px rgba(255,255,255,.35); }
html body #page-topbar .fmi-kbd {
    position: absolute; right: 38px; top: 50%; transform: translateY(-50%); padding: 1px 6px; border-radius: 5px; pointer-events: none;
    font: 600 10.5px/16px "Segoe UI", Arial, sans-serif; letter-spacing: .03em; color: #6b7280; background: #f1f4f9; border: 1px solid #dde3ee;
}
/* before select2 starts, the plain select already looks like the box (no flash on page load) */
html body #page-topbar .menu-search-wrapper select.topbar-menu-select:not(.select2-hidden-accessible) {
    display: block; width: 100%; height: 34px; padding: 0 40px 0 38px; border: 1px solid #fff; border-radius: 17px; outline: none;
    font-size: 13px; font-weight: 600; letter-spacing: .02em; color: #3a4258; -webkit-appearance: none; appearance: none;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Ccircle cx='12' cy='12' r='12' fill='%23e3eefc'/%3E%3Cpath d='M7.4 9.6 12 14.2l4.6-4.6' fill='none' stroke='%231565C0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 6px center;
}

/* ---- header Search Menu list ---- */
html body .select2-container--open .select2-dropdown.fmi-search-drop {
    border: 1px solid #d6e4f7 !important; border-radius: 12px; overflow: hidden;
    box-shadow: 0 18px 40px rgba(15,32,64,.20), 0 2px 6px rgba(15,32,64,.08);
}
/* search box inside the open list */
html body .select2-dropdown.fmi-search-drop .select2-search--dropdown { padding: 8px; background: #f8f9fc; border-bottom: 1px solid #eef1f6; }
html body .select2-dropdown.fmi-search-drop .select2-search--dropdown .select2-search__field {
    height: 34px; padding: 0 10px; border: 1px solid #d6dce8 !important; border-radius: 8px; outline: none; font-size: 13px; background: #fff;
}
html body .select2-dropdown.fmi-search-drop .select2-search--dropdown .select2-search__field:focus { border-color: #1565C0 !important; box-shadow: 0 0 0 3px rgba(21,101,192,.12); }
html body .select2-dropdown.fmi-search-drop .select2-results > .select2-results__options { max-height: 360px; padding: 4px; scrollbar-width: thin; }
html body .select2-dropdown.fmi-search-drop .select2-results__option.fmi-opt {
    display: flex; align-items: center; gap: 10px; margin: 1px 0; padding: 6px 10px; border-radius: 8px; font-size: 13px; color: #1f2440;
}
html body .select2-dropdown.fmi-search-drop .select2-results__option.fmi-opt > i.fmi { width: 24px; height: 24px; border-radius: 7px; font-size: 15px; }
html body .select2-dropdown.fmi-search-drop .select2-results__option--highlighted.fmi-opt,
html body .select2-dropdown.fmi-search-drop .select2-results__option--highlighted[aria-selected].fmi-opt { background: #1565C0 !important; color: #fff !important; }
html body .select2-dropdown.fmi-search-drop .select2-results__option--highlighted.fmi-opt > i.fmi { background: #fff; color: var(--fmi-fg); }
html body .select2-dropdown.fmi-search-drop .select2-results__message { padding: 14px 10px; text-align: center; font-size: 12.5px; color: #8a94a8; }

/* ---- closed side menu: module name beside the icon under the mouse (menu-icons.js) ---- */
html body .fmi-tip {
    position: fixed; z-index: 1006; left: 0; top: 0; transform: translate(-6px, -50%); opacity: 0; pointer-events: none;
    padding: 6px 12px; border-radius: 7px; white-space: nowrap; font-size: 12.5px; font-weight: 600; letter-spacing: .02em; line-height: 1.3;
    color: #fff; background: linear-gradient(90deg, #0F4C81 0%, #1565C0 100%); box-shadow: 0 6px 16px rgba(15,32,64,.25);
    transition: opacity .12s ease, transform .12s ease;
}
html body .fmi-tip::before {
    content: ""; position: absolute; left: -5px; top: 50%; transform: translateY(-50%);
    border-style: solid; border-width: 5px 5px 5px 0; border-color: transparent #0F4C81 transparent transparent;
}
html body .fmi-tip.on { opacity: 1; transform: translate(0, -50%); }

/* ---- smooth page change (Chrome / Edge 126+), as in Foundry: the old page fades into the
        next one instead of a blank flash; the top bar and side menu are the same on both,
        so they do not move. Other browsers open pages as before. ---- */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .16s; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
